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 * Errors that may occur when converting a [`RawBolt11Invoice`] to a [`Bolt11Invoice`]. They relate to
15 * the requirements sections in BOLT #11
17 typedef enum LDKBolt11SemanticError {
19 * The invoice is missing the mandatory payment hash
21 LDKBolt11SemanticError_NoPaymentHash,
23 * The invoice has multiple payment hashes which isn't allowed
25 LDKBolt11SemanticError_MultiplePaymentHashes,
27 * No description or description hash are part of the invoice
29 LDKBolt11SemanticError_NoDescription,
31 * The invoice contains multiple descriptions and/or description hashes which isn't allowed
33 LDKBolt11SemanticError_MultipleDescriptions,
35 * The invoice is missing the mandatory payment secret, which all modern lightning nodes
38 LDKBolt11SemanticError_NoPaymentSecret,
40 * The invoice contains multiple payment secrets
42 LDKBolt11SemanticError_MultiplePaymentSecrets,
44 * The invoice's features are invalid
46 LDKBolt11SemanticError_InvalidFeatures,
48 * The recovery id doesn't fit the signature/pub key
50 LDKBolt11SemanticError_InvalidRecoveryId,
52 * The invoice's signature is invalid
54 LDKBolt11SemanticError_InvalidSignature,
56 * The invoice's amount was not a whole number of millisatoshis
58 LDKBolt11SemanticError_ImpreciseAmount,
60 * Must be last for serialization purposes
62 LDKBolt11SemanticError_Sentinel,
63 } LDKBolt11SemanticError;
66 * Error when interpreting a TLV stream as a specific type.
68 typedef enum LDKBolt12SemanticError {
70 * The current [`std::time::SystemTime`] is past the offer or invoice's expiration.
72 LDKBolt12SemanticError_AlreadyExpired,
74 * The provided chain hash does not correspond to a supported chain.
76 LDKBolt12SemanticError_UnsupportedChain,
78 * A chain was provided but was not expected.
80 LDKBolt12SemanticError_UnexpectedChain,
82 * An amount was expected but was missing.
84 LDKBolt12SemanticError_MissingAmount,
86 * The amount exceeded the total bitcoin supply.
88 LDKBolt12SemanticError_InvalidAmount,
90 * An amount was provided but was not sufficient in value.
92 LDKBolt12SemanticError_InsufficientAmount,
94 * An amount was provided but was not expected.
96 LDKBolt12SemanticError_UnexpectedAmount,
98 * A currency was provided that is not supported.
100 LDKBolt12SemanticError_UnsupportedCurrency,
102 * A feature was required but is unknown.
104 LDKBolt12SemanticError_UnknownRequiredFeatures,
106 * Features were provided but were not expected.
108 LDKBolt12SemanticError_UnexpectedFeatures,
110 * A required description was not provided.
112 LDKBolt12SemanticError_MissingDescription,
114 * A signing pubkey was not provided.
116 LDKBolt12SemanticError_MissingSigningPubkey,
118 * A signing pubkey was provided but a different one was expected.
120 LDKBolt12SemanticError_InvalidSigningPubkey,
122 * A signing pubkey was provided but was not expected.
124 LDKBolt12SemanticError_UnexpectedSigningPubkey,
126 * A quantity was expected but was missing.
128 LDKBolt12SemanticError_MissingQuantity,
130 * An unsupported quantity was provided.
132 LDKBolt12SemanticError_InvalidQuantity,
134 * A quantity or quantity bounds was provided but was not expected.
136 LDKBolt12SemanticError_UnexpectedQuantity,
138 * Metadata could not be used to verify the offers message.
140 LDKBolt12SemanticError_InvalidMetadata,
142 * Metadata was provided but was not expected.
144 LDKBolt12SemanticError_UnexpectedMetadata,
146 * Payer metadata was expected but was missing.
148 LDKBolt12SemanticError_MissingPayerMetadata,
150 * A payer id was expected but was missing.
152 LDKBolt12SemanticError_MissingPayerId,
154 * The payment id for a refund or request is already in use.
156 LDKBolt12SemanticError_DuplicatePaymentId,
158 * Blinded paths were expected but were missing.
160 LDKBolt12SemanticError_MissingPaths,
162 * The blinded payinfo given does not match the number of blinded path hops.
164 LDKBolt12SemanticError_InvalidPayInfo,
166 * An invoice creation time was expected but was missing.
168 LDKBolt12SemanticError_MissingCreationTime,
170 * An invoice payment hash was expected but was missing.
172 LDKBolt12SemanticError_MissingPaymentHash,
174 * A signature was expected but was missing.
176 LDKBolt12SemanticError_MissingSignature,
178 * Must be last for serialization purposes
180 LDKBolt12SemanticError_Sentinel,
181 } LDKBolt12SemanticError;
184 * An enum which can either contain a or not
186 typedef enum LDKCOption_NoneZ {
188 * When we're in this state, this COption_NoneZ contains a
190 LDKCOption_NoneZ_Some,
192 * When we're in this state, this COption_NoneZ contains nothing
194 LDKCOption_NoneZ_None,
196 * Must be last for serialization purposes
198 LDKCOption_NoneZ_Sentinel,
202 * An enum representing the status of a channel monitor update persistence.
204 * These are generally used as the return value for an implementation of [`Persist`] which is used
205 * as the storage layer for a [`ChainMonitor`]. See the docs on [`Persist`] for a high-level
206 * explanation of how to handle different cases.
208 * While `UnrecoverableError` is provided as a failure variant, it is not truly \"handled\" on the
209 * calling side, and generally results in an immediate panic. For those who prefer to avoid
210 * panics, `InProgress` can be used and you can retry the update operation in the background or
213 * Note that channels should generally *not* be force-closed after a persistence failure.
214 * Force-closing with the latest [`ChannelMonitorUpdate`] applied may result in a transaction
215 * being broadcast which can only be spent by the latest [`ChannelMonitor`]! Thus, if the
216 * latest [`ChannelMonitor`] is not durably persisted anywhere and exists only in memory, naively
217 * calling [`ChannelManager::force_close_broadcasting_latest_txn`] *may result in loss of funds*!
219 * [`Persist`]: chainmonitor::Persist
220 * [`ChainMonitor`]: chainmonitor::ChainMonitor
221 * [`ChannelManager::force_close_broadcasting_latest_txn`]: crate::ln::channelmanager::ChannelManager::force_close_broadcasting_latest_txn
223 typedef enum LDKChannelMonitorUpdateStatus {
225 * The update has been durably persisted and all copies of the relevant [`ChannelMonitor`]
228 * This includes performing any `fsync()` calls required to ensure the update is guaranteed to
229 * be available on restart even if the application crashes.
231 LDKChannelMonitorUpdateStatus_Completed,
233 * Indicates that the update will happen asynchronously in the background or that a transient
234 * failure occurred which is being retried in the background and will eventually complete.
236 * This will \"freeze\" a channel, preventing us from revoking old states or submitting a new
237 * commitment transaction to the counterparty. Once the update(s) which are `InProgress` have
238 * been completed, a [`MonitorEvent::Completed`] can be used to restore the channel to an
241 * Even when a channel has been \"frozen\", updates to the [`ChannelMonitor`] can continue to
242 * occur (e.g. if an inbound HTLC which we forwarded was claimed upstream, resulting in us
243 * attempting to claim it on this channel) and those updates must still be persisted.
245 * No updates to the channel will be made which could invalidate other [`ChannelMonitor`]s
246 * until a [`MonitorEvent::Completed`] is provided, even if you return no error on a later
247 * monitor update for the same channel.
249 * For deployments where a copy of [`ChannelMonitor`]s and other local state are backed up in
250 * a remote location (with local copies persisted immediately), it is anticipated that all
251 * updates will return [`InProgress`] until the remote copies could be updated.
253 * Note that while fully asynchronous persistence of [`ChannelMonitor`] data is generally
254 * reliable, this feature is considered beta, and a handful of edge-cases remain. Until the
255 * remaining cases are fixed, in rare cases, *using this feature may lead to funds loss*.
257 * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
259 LDKChannelMonitorUpdateStatus_InProgress,
261 * Indicates that an update has failed and will not complete at any point in the future.
263 * Currently returning this variant will cause LDK to immediately panic to encourage immediate
264 * shutdown. In the future this may be updated to disconnect peers and refuse to continue
265 * normal operation without a panic.
267 * Applications which wish to perform an orderly shutdown after failure should consider
268 * returning [`InProgress`] instead and simply shut down without ever marking the update
271 * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
273 LDKChannelMonitorUpdateStatus_UnrecoverableError,
275 * Must be last for serialization purposes
277 LDKChannelMonitorUpdateStatus_Sentinel,
278 } LDKChannelMonitorUpdateStatus;
281 * Further information on the details of the channel shutdown.
282 * Upon channels being forced closed (i.e. commitment transaction confirmation detected
283 * by `ChainMonitor`), ChannelShutdownState will be set to `ShutdownComplete` or
284 * the channel will be removed shortly.
285 * Also note, that in normal operation, peers could disconnect at any of these states
286 * and require peer re-connection before making progress onto other states
288 typedef enum LDKChannelShutdownState {
290 * Channel has not sent or received a shutdown message.
292 LDKChannelShutdownState_NotShuttingDown,
294 * Local node has sent a shutdown message for this channel.
296 LDKChannelShutdownState_ShutdownInitiated,
298 * Shutdown message exchanges have concluded and the channels are in the midst of
299 * resolving all existing open HTLCs before closing can continue.
301 LDKChannelShutdownState_ResolvingHTLCs,
303 * All HTLCs have been resolved, nodes are currently negotiating channel close onchain fee rates.
305 LDKChannelShutdownState_NegotiatingClosingFee,
307 * We've successfully negotiated a closing_signed dance. At this point `ChannelManager` is about
308 * to drop the channel.
310 LDKChannelShutdownState_ShutdownComplete,
312 * Must be last for serialization purposes
314 LDKChannelShutdownState_Sentinel,
315 } LDKChannelShutdownState;
318 * An enum that represents the priority at which we want a transaction to confirm used for feerate
321 typedef enum LDKConfirmationTarget {
323 * We have some funds available on chain which we need to spend prior to some expiry time at
324 * which point our counterparty may be able to steal them. Generally we have in the high tens
325 * to low hundreds of blocks to get our transaction on-chain, but we shouldn't risk too low a
326 * fee - this should be a relatively high priority feerate.
328 LDKConfirmationTarget_OnChainSweep,
330 * The highest feerate we will allow our channel counterparty to have in a non-anchor channel.
332 * This is the feerate on the transaction which we (or our counterparty) will broadcast in
333 * order to close the channel unilaterally. Because our counterparty must ensure they can
334 * always broadcast the latest state, this value being too low will cause immediate
337 * Allowing this value to be too high can allow our counterparty to burn our HTLC outputs to
338 * dust, which can result in HTLCs failing or force-closures (when the dust HTLCs exceed
339 * [`ChannelConfig::max_dust_htlc_exposure`]).
341 * Because most nodes use a feerate estimate which is based on a relatively high priority
342 * transaction entering the current mempool, setting this to a small multiple of your current
343 * high priority feerate estimate should suffice.
345 * [`ChannelConfig::max_dust_htlc_exposure`]: crate::util::config::ChannelConfig::max_dust_htlc_exposure
347 LDKConfirmationTarget_MaxAllowedNonAnchorChannelRemoteFee,
349 * This is the lowest feerate we will allow our channel counterparty to have in an anchor
350 * channel in order to close the channel if a channel party goes away.
352 * This needs to be sufficient to get into the mempool when the channel needs to
353 * be force-closed. Setting too high may result in force-closures if our counterparty attempts
354 * to use a lower feerate. Because this is for anchor channels, we can always bump the feerate
355 * later; the feerate here only needs to be sufficient to enter the mempool.
357 * A good estimate is the expected mempool minimum at the time of force-closure. Obviously this
358 * is not an estimate which is very easy to calculate because we do not know the future. Using
359 * a simple long-term fee estimate or tracking of the mempool minimum is a good approach to
360 * ensure you can always close the channel. A future change to Bitcoin's P2P network
361 * (package relay) may obviate the need for this entirely.
363 LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee,
365 * The lowest feerate we will allow our channel counterparty to have in a non-anchor channel.
367 * This is the feerate on the transaction which we (or our counterparty) will broadcast in
368 * order to close the channel if a channel party goes away. Setting this value too high will
369 * cause immediate force-closures in order to avoid having an unbroadcastable state.
371 * This feerate represents the fee we pick now, which must be sufficient to enter a block at an
372 * arbitrary time in the future. Obviously this is not an estimate which is very easy to
373 * calculate. This can leave channels subject to being unable to close if feerates rise, and in
374 * general you should prefer anchor channels to ensure you can increase the feerate when the
375 * transactions need broadcasting.
377 * Do note some fee estimators round up to the next full sat/vbyte (ie 250 sats per kw),
378 * causing occasional issues with feerate disagreements between an initiator that wants a
379 * feerate of 1.1 sat/vbyte and a receiver that wants 1.1 rounded up to 2. If your fee
380 * estimator rounds subtracting 250 to your desired feerate here can help avoid this issue.
382 * [`ChannelConfig::max_dust_htlc_exposure`]: crate::util::config::ChannelConfig::max_dust_htlc_exposure
384 LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee,
386 * This is the feerate on the transaction which we (or our counterparty) will broadcast in
387 * order to close the channel if a channel party goes away.
389 * This needs to be sufficient to get into the mempool when the channel needs to
390 * be force-closed. Setting too low may result in force-closures. Because this is for anchor
391 * channels, it can be a low value as we can always bump the feerate later.
393 * A good estimate is the expected mempool minimum at the time of force-closure. Obviously this
394 * is not an estimate which is very easy to calculate because we do not know the future. Using
395 * a simple long-term fee estimate or tracking of the mempool minimum is a good approach to
396 * ensure you can always close the channel. A future change to Bitcoin's P2P network
397 * (package relay) may obviate the need for this entirely.
399 LDKConfirmationTarget_AnchorChannelFee,
401 * Lightning is built around the ability to broadcast a transaction in the future to close our
402 * channel and claim all pending funds. In order to do so, non-anchor channels are built with
403 * transactions which we need to be able to broadcast at some point in the future.
405 * This feerate represents the fee we pick now, which must be sufficient to enter a block at an
406 * arbitrary time in the future. Obviously this is not an estimate which is very easy to
407 * calculate, so most lightning nodes use some relatively high-priority feerate using the
408 * current mempool. This leaves channels subject to being unable to close if feerates rise, and
409 * in general you should prefer anchor channels to ensure you can increase the feerate when the
410 * transactions need broadcasting.
412 * Since this should represent the feerate of a channel close that does not need fee
413 * bumping, this is also used as an upper bound for our attempted feerate when doing cooperative
414 * closure of any channel.
416 LDKConfirmationTarget_NonAnchorChannelFee,
418 * When cooperatively closing a channel, this is the minimum feerate we will accept.
419 * Recommended at least within a day or so worth of blocks.
421 * This will also be used when initiating a cooperative close of a channel. When closing a
422 * channel you can override this fee by using
423 * [`ChannelManager::close_channel_with_feerate_and_script`].
425 * [`ChannelManager::close_channel_with_feerate_and_script`]: crate::ln::channelmanager::ChannelManager::close_channel_with_feerate_and_script
427 LDKConfirmationTarget_ChannelCloseMinimum,
429 * Must be last for serialization purposes
431 LDKConfirmationTarget_Sentinel,
432 } LDKConfirmationTarget;
435 * Errors that may occur when constructing a new [`RawBolt11Invoice`] or [`Bolt11Invoice`]
437 typedef enum LDKCreationError {
439 * The supplied description string was longer than 639 __bytes__ (see [`Description::new`])
441 LDKCreationError_DescriptionTooLong,
443 * The specified route has too many hops and can't be encoded
445 LDKCreationError_RouteTooLong,
447 * The Unix timestamp of the supplied date is less than zero or greater than 35-bits
449 LDKCreationError_TimestampOutOfBounds,
451 * The supplied millisatoshi amount was greater than the total bitcoin supply.
453 LDKCreationError_InvalidAmount,
455 * Route hints were required for this invoice and were missing. Applies to
456 * [phantom invoices].
458 * [phantom invoices]: crate::utils::create_phantom_invoice
460 LDKCreationError_MissingRouteHints,
462 * The provided `min_final_cltv_expiry_delta` was less than [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
464 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
466 LDKCreationError_MinFinalCltvExpiryDeltaTooShort,
468 * Must be last for serialization purposes
470 LDKCreationError_Sentinel,
474 * Enum representing the crypto currencies (or networks) supported by this library
476 typedef enum LDKCurrency {
484 LDKCurrency_BitcoinTestnet,
498 * Must be last for serialization purposes
500 LDKCurrency_Sentinel,
504 * Describes the type of HTLC claim as determined by analyzing the witness.
506 typedef enum LDKHTLCClaim {
508 * Claims an offered output on a commitment transaction through the timeout path.
510 LDKHTLCClaim_OfferedTimeout,
512 * Claims an offered output on a commitment transaction through the success path.
514 LDKHTLCClaim_OfferedPreimage,
516 * Claims an accepted output on a commitment transaction through the timeout path.
518 LDKHTLCClaim_AcceptedTimeout,
520 * Claims an accepted output on a commitment transaction through the success path.
522 LDKHTLCClaim_AcceptedPreimage,
524 * Claims an offered/accepted output on a commitment transaction through the revocation path.
526 LDKHTLCClaim_Revocation,
528 * Must be last for serialization purposes
530 LDKHTLCClaim_Sentinel,
534 * Represents an IO Error. Note that some information is lost in the conversion from Rust.
536 typedef enum LDKIOError {
538 LDKIOError_PermissionDenied,
539 LDKIOError_ConnectionRefused,
540 LDKIOError_ConnectionReset,
541 LDKIOError_ConnectionAborted,
542 LDKIOError_NotConnected,
543 LDKIOError_AddrInUse,
544 LDKIOError_AddrNotAvailable,
545 LDKIOError_BrokenPipe,
546 LDKIOError_AlreadyExists,
547 LDKIOError_WouldBlock,
548 LDKIOError_InvalidInput,
549 LDKIOError_InvalidData,
551 LDKIOError_WriteZero,
552 LDKIOError_Interrupted,
554 LDKIOError_UnexpectedEof,
556 * Must be last for serialization purposes
562 * An enum representing the available verbosity levels of the logger.
564 typedef enum LDKLevel {
566 * Designates extremely verbose information, including gossip-induced messages
570 * Designates very low priority, often extremely verbose, information
574 * Designates lower priority information
578 * Designates useful information
582 * Designates hazardous situations
586 * Designates very serious errors
590 * Must be last for serialization purposes
596 * An enum representing the possible Bitcoin or test networks which we can run on
598 typedef enum LDKNetwork {
600 * The main Bitcoin blockchain.
604 * The testnet3 blockchain.
608 * A local test blockchain.
612 * A blockchain on which blocks are signed instead of mined.
616 * Must be last for serialization purposes
622 * The reason the payment failed. Used in [`Event::PaymentFailed`].
624 typedef enum LDKPaymentFailureReason {
626 * The intended recipient rejected our payment.
628 LDKPaymentFailureReason_RecipientRejected,
630 * The user chose to abandon this payment by calling [`ChannelManager::abandon_payment`].
632 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
634 LDKPaymentFailureReason_UserAbandoned,
636 * We exhausted all of our retry attempts while trying to send the payment, or we
637 * exhausted the [`Retry::Timeout`] if the user set one. If at any point a retry
638 * attempt failed while being forwarded along the path, an [`Event::PaymentPathFailed`] will
639 * have come before this.
641 * [`Retry::Timeout`]: crate::ln::channelmanager::Retry::Timeout
643 LDKPaymentFailureReason_RetriesExhausted,
645 * The payment expired while retrying, based on the provided
646 * [`PaymentParameters::expiry_time`].
648 * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
650 LDKPaymentFailureReason_PaymentExpired,
652 * We failed to find a route while retrying the payment.
654 LDKPaymentFailureReason_RouteNotFound,
656 * This error should generally never happen. This likely means that there is a problem with
659 LDKPaymentFailureReason_UnexpectedError,
661 * Must be last for serialization purposes
663 LDKPaymentFailureReason_Sentinel,
664 } LDKPaymentFailureReason;
667 * Specifies the recipient of an invoice.
669 * This indicates to [`NodeSigner::sign_invoice`] what node secret key should be used to sign
672 typedef enum LDKRecipient {
674 * The invoice should be signed with the local node secret key.
678 * The invoice should be signed with the phantom node secret key. This secret key must be the
679 * same for all nodes participating in the [phantom node payment].
681 * [phantom node payment]: PhantomKeysManager
683 LDKRecipient_PhantomNode,
685 * Must be last for serialization purposes
687 LDKRecipient_Sentinel,
691 * Indicates an immediate error on [`ChannelManager::send_payment`]. Further errors may be
692 * surfaced later via [`Event::PaymentPathFailed`] and [`Event::PaymentFailed`].
694 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
695 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
696 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
698 typedef enum LDKRetryableSendFailure {
700 * The provided [`PaymentParameters::expiry_time`] indicated that the payment has expired. Note
701 * that this error is *not* caused by [`Retry::Timeout`].
703 * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
705 LDKRetryableSendFailure_PaymentExpired,
707 * We were unable to find a route to the destination.
709 LDKRetryableSendFailure_RouteNotFound,
711 * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
712 * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
714 * [`PaymentId`]: crate::ln::channelmanager::PaymentId
715 * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
716 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
718 LDKRetryableSendFailure_DuplicatePayment,
720 * Must be last for serialization purposes
722 LDKRetryableSendFailure_Sentinel,
723 } LDKRetryableSendFailure;
726 * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
728 typedef enum LDKSecp256k1Error {
730 * Signature failed verification
732 LDKSecp256k1Error_IncorrectSignature,
734 * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
736 LDKSecp256k1Error_InvalidMessage,
740 LDKSecp256k1Error_InvalidPublicKey,
744 LDKSecp256k1Error_InvalidSignature,
748 LDKSecp256k1Error_InvalidSecretKey,
752 LDKSecp256k1Error_InvalidSharedSecret,
756 LDKSecp256k1Error_InvalidRecoveryId,
758 * Invalid tweak for add_assign or mul_assign
760 LDKSecp256k1Error_InvalidTweak,
762 * Didn't pass enough memory to context creation with preallocated memory
764 LDKSecp256k1Error_NotEnoughMemory,
766 * Bad set of public keys.
768 LDKSecp256k1Error_InvalidPublicKeySum,
770 * The only valid parity values are 0 or 1.
772 LDKSecp256k1Error_InvalidParityValue,
774 * Must be last for serialization purposes
776 LDKSecp256k1Error_Sentinel,
780 * SI prefixes for the human readable part
782 typedef enum LDKSiPrefix {
800 * Must be last for serialization purposes
802 LDKSiPrefix_Sentinel,
806 * [`SocketAddress`] error variants
808 typedef enum LDKSocketAddressParseError {
810 * Socket address (IPv4/IPv6) parsing error
812 LDKSocketAddressParseError_SocketAddrParse,
814 * Invalid input format
816 LDKSocketAddressParseError_InvalidInput,
820 LDKSocketAddressParseError_InvalidPort,
822 * Invalid onion v3 address
824 LDKSocketAddressParseError_InvalidOnionV3,
826 * Must be last for serialization purposes
828 LDKSocketAddressParseError_Sentinel,
829 } LDKSocketAddressParseError;
832 * An error when accessing the chain via [`UtxoLookup`].
834 typedef enum LDKUtxoLookupError {
836 * The requested chain is unknown.
838 LDKUtxoLookupError_UnknownChain,
840 * The requested transaction doesn't exist or hasn't confirmed.
842 LDKUtxoLookupError_UnknownTx,
844 * Must be last for serialization purposes
846 LDKUtxoLookupError_Sentinel,
847 } LDKUtxoLookupError;
850 * A Rust str object, ie a reference to a UTF8-valid string.
851 * This is *not* null-terminated so cannot be used directly as a C string!
853 typedef struct LDKStr {
855 * A pointer to the string's bytes, in UTF8 encoding
857 const uint8_t *chars;
859 * The number of bytes (not characters!) pointed to by `chars`
863 * Whether the data pointed to by `chars` should be freed or not.
869 * A 16-byte byte array.
871 typedef struct LDKSixteenBytes {
879 * Unsigned, 128-bit integer.
881 * Because LLVM implements an incorrect ABI for 128-bit integers, a wrapper type is defined here.
882 * See https://github.com/rust-lang/rust/issues/54341 for more details.
884 typedef struct LDKU128 {
886 * The 128-bit integer, as 16 little-endian bytes
888 uint8_t le_bytes[16];
892 * Represents a scalar value between zero and the secp256k1 curve order, in big endian.
894 typedef struct LDKBigEndianScalar {
896 * The bytes of the scalar value.
898 uint8_t big_endian_bytes[32];
899 } LDKBigEndianScalar;
902 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
903 * look up the corresponding function in rust-lightning's docs.
905 typedef struct LDKThirtyTwoBytes {
907 * The thirty-two bytes
913 * Represents an error returned from the bech32 library during validation of some bech32 data
915 typedef enum LDKBech32Error_Tag {
917 * String does not contain the separator character
919 LDKBech32Error_MissingSeparator,
921 * The checksum does not match the rest of the data
923 LDKBech32Error_InvalidChecksum,
925 * The data or human-readable part is too long or too short
927 LDKBech32Error_InvalidLength,
929 * Some part of the string contains an invalid character
931 LDKBech32Error_InvalidChar,
933 * Some part of the data has an invalid value
935 LDKBech32Error_InvalidData,
937 * The bit conversion failed due to a padding issue
939 LDKBech32Error_InvalidPadding,
941 * The whole string must be of one case
943 LDKBech32Error_MixedCase,
945 * Must be last for serialization purposes
947 LDKBech32Error_Sentinel,
948 } LDKBech32Error_Tag;
950 typedef struct LDKBech32Error {
951 LDKBech32Error_Tag tag;
954 uint32_t invalid_char;
957 uint8_t invalid_data;
963 * A serialized transaction, in (pointer, length) form.
965 * This type optionally owns its own memory, and thus the semantics around access change based on
966 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
967 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
968 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
969 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
970 * you would be invalid.
972 * Note that, while it may change in the future, because transactions on the Rust side are stored
973 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
974 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
975 * `data_is_owned` either set or unset at your discretion.
977 typedef struct LDKTransaction {
979 * The serialized transaction data.
981 * This is non-const for your convenience, an object passed to Rust is never written to.
985 * The length of the serialized transaction
989 * Whether the data pointed to by `data` should be freed or not.
995 * A serialized witness.
997 typedef struct LDKWitness {
999 * The serialized transaction data.
1001 * This is non-const for your convenience, an object passed to Rust is never written to.
1005 * The length of the serialized transaction
1009 * Whether the data pointed to by `data` should be freed or not.
1015 * A dynamically-allocated array of u8s of arbitrary size.
1016 * This corresponds to std::vector in C++
1018 typedef struct LDKCVec_u8Z {
1020 * The elements in the array.
1021 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1025 * The number of elements pointed to by `data`.
1031 * An input to a transaction.
1033 * This contains the witness, the scriptSig and the previous outpoint and represents a single
1034 * input to a transaction
1036 typedef struct LDKTxIn {
1038 * The witness which includes any signatures required to spend a segwit output.
1040 struct LDKWitness witness;
1042 * The script_sig which includes signatures requires to spend a pre-segwit output (or a
1043 * P2SH-wrapped segwit output).
1045 struct LDKCVec_u8Z script_sig;
1047 * The sequence number of the transaction input
1051 * The txid of the transaction being spent.
1053 struct LDKThirtyTwoBytes previous_txid;
1055 * The output index of the transaction being spent.
1057 uint32_t previous_vout;
1061 * A transaction output including a scriptPubKey and value.
1062 * This type *does* own its own memory, so must be free'd appropriately.
1064 typedef struct LDKTxOut {
1066 * The script_pubkey in this output
1068 struct LDKCVec_u8Z script_pubkey;
1070 * The value, in satoshis, of this output
1076 * An enum which can either contain a u64 or not
1078 typedef enum LDKCOption_u64Z_Tag {
1080 * When we're in this state, this COption_u64Z contains a u64
1082 LDKCOption_u64Z_Some,
1084 * When we're in this state, this COption_u64Z contains nothing
1086 LDKCOption_u64Z_None,
1088 * Must be last for serialization purposes
1090 LDKCOption_u64Z_Sentinel,
1091 } LDKCOption_u64Z_Tag;
1093 typedef struct LDKCOption_u64Z {
1094 LDKCOption_u64Z_Tag tag;
1105 * Onion messages and payments can be sent and received to blinded paths, which serve to hide the
1106 * identity of the recipient.
1108 typedef struct MUST_USE_STRUCT LDKBlindedPath {
1110 * A pointer to the opaque Rust object.
1111 * Nearly everywhere, inner must be non-null, however in places where
1112 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1114 LDKnativeBlindedPath *inner;
1116 * Indicates that this is the only struct which contains the same pointer.
1117 * Rust functions which take ownership of an object provided via an argument require
1118 * this to be true and invalidate the object pointed to by inner.
1124 * A dynamically-allocated array of crate::lightning::blinded_path::BlindedPaths of arbitrary size.
1125 * This corresponds to std::vector in C++
1127 typedef struct LDKCVec_BlindedPathZ {
1129 * The elements in the array.
1130 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1132 struct LDKBlindedPath *data;
1134 * The number of elements pointed to by `data`.
1137 } LDKCVec_BlindedPathZ;
1142 * A `Refund` is a request to send an [`Bolt12Invoice`] without a preceding [`Offer`].
1144 * Typically, after an invoice is paid, the recipient may publish a refund allowing the sender to
1145 * recoup their funds. A refund may be used more generally as an \"offer for money\", such as with a
1148 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
1149 * [`Offer`]: crate::offers::offer::Offer
1151 typedef struct MUST_USE_STRUCT LDKRefund {
1153 * A pointer to the opaque Rust object.
1154 * Nearly everywhere, inner must be non-null, however in places where
1155 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1157 LDKnativeRefund *inner;
1159 * Indicates that this is the only struct which contains the same pointer.
1160 * Rust functions which take ownership of an object provided via an argument require
1161 * this to be true and invalidate the object pointed to by inner.
1169 * Error when parsing a bech32 encoded message using [`str::parse`].
1171 typedef struct MUST_USE_STRUCT LDKBolt12ParseError {
1173 * A pointer to the opaque Rust object.
1174 * Nearly everywhere, inner must be non-null, however in places where
1175 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1177 LDKnativeBolt12ParseError *inner;
1179 * Indicates that this is the only struct which contains the same pointer.
1180 * Rust functions which take ownership of an object provided via an argument require
1181 * this to be true and invalidate the object pointed to by inner.
1184 } LDKBolt12ParseError;
1187 * The contents of CResult_RefundBolt12ParseErrorZ
1189 typedef union LDKCResult_RefundBolt12ParseErrorZPtr {
1191 * A pointer to the contents in the success state.
1192 * Reading from this pointer when `result_ok` is not set is undefined.
1194 struct LDKRefund *result;
1196 * A pointer to the contents in the error state.
1197 * Reading from this pointer when `result_ok` is set is undefined.
1199 struct LDKBolt12ParseError *err;
1200 } LDKCResult_RefundBolt12ParseErrorZPtr;
1203 * A CResult_RefundBolt12ParseErrorZ represents the result of a fallible operation,
1204 * containing a crate::lightning::offers::refund::Refund on success and a crate::lightning::offers::parse::Bolt12ParseError on failure.
1205 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1207 typedef struct LDKCResult_RefundBolt12ParseErrorZ {
1209 * The contents of this CResult_RefundBolt12ParseErrorZ, accessible via either
1210 * `err` or `result` depending on the state of `result_ok`.
1212 union LDKCResult_RefundBolt12ParseErrorZPtr contents;
1214 * Whether this CResult_RefundBolt12ParseErrorZ represents a success state.
1217 } LDKCResult_RefundBolt12ParseErrorZ;
1220 * Strategies available to retry payment path failures.
1222 typedef enum LDKRetry_Tag {
1224 * Max number of attempts to retry payment.
1226 * Each attempt may be multiple HTLCs along multiple paths if the router decides to split up a
1227 * retry, and may retry multiple failed HTLCs at once if they failed around the same time and
1228 * were retried along a route from a single call to [`Router::find_route_with_id`].
1232 * Time elapsed before abandoning retries for a payment. At least one attempt at payment is made;
1233 * see [`PaymentParameters::expiry_time`] to avoid any attempt at payment after a specific time.
1235 * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
1239 * Must be last for serialization purposes
1244 typedef struct MUST_USE_STRUCT LDKRetry {
1257 * An error in decoding a message or struct.
1259 typedef enum LDKDecodeError_Tag {
1261 * A version byte specified something we don't know how to handle.
1263 * Includes unknown realm byte in an onion hop data packet.
1265 LDKDecodeError_UnknownVersion,
1267 * Unknown feature mandating we fail to parse message (e.g., TLV with an even, unknown type)
1269 LDKDecodeError_UnknownRequiredFeature,
1271 * Value was invalid.
1273 * For example, a byte which was supposed to be a bool was something other than a 0
1274 * or 1, a public key/private key/signature was invalid, text wasn't UTF-8, TLV was
1275 * syntactically incorrect, etc.
1277 LDKDecodeError_InvalidValue,
1279 * The buffer to be read was too short.
1281 LDKDecodeError_ShortRead,
1283 * A length descriptor in the packet didn't describe the later data correctly.
1285 LDKDecodeError_BadLengthDescriptor,
1287 * Error from [`std::io`].
1291 * The message included zlib-compressed values, which we don't support.
1293 LDKDecodeError_UnsupportedCompression,
1295 * Must be last for serialization purposes
1297 LDKDecodeError_Sentinel,
1298 } LDKDecodeError_Tag;
1300 typedef struct MUST_USE_STRUCT LDKDecodeError {
1301 LDKDecodeError_Tag tag;
1310 * The contents of CResult_RetryDecodeErrorZ
1312 typedef union LDKCResult_RetryDecodeErrorZPtr {
1314 * A pointer to the contents in the success state.
1315 * Reading from this pointer when `result_ok` is not set is undefined.
1317 struct LDKRetry *result;
1319 * A pointer to the contents in the error state.
1320 * Reading from this pointer when `result_ok` is set is undefined.
1322 struct LDKDecodeError *err;
1323 } LDKCResult_RetryDecodeErrorZPtr;
1326 * A CResult_RetryDecodeErrorZ represents the result of a fallible operation,
1327 * containing a crate::lightning::ln::outbound_payment::Retry on success and a crate::lightning::ln::msgs::DecodeError on failure.
1328 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1330 typedef struct LDKCResult_RetryDecodeErrorZ {
1332 * The contents of this CResult_RetryDecodeErrorZ, accessible via either
1333 * `err` or `result` depending on the state of `result_ok`.
1335 union LDKCResult_RetryDecodeErrorZPtr contents;
1337 * Whether this CResult_RetryDecodeErrorZ represents a success state.
1340 } LDKCResult_RetryDecodeErrorZ;
1345 * A script pubkey for shutting down a channel as defined by [BOLT #2].
1347 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
1349 typedef struct MUST_USE_STRUCT LDKShutdownScript {
1351 * A pointer to the opaque Rust object.
1352 * Nearly everywhere, inner must be non-null, however in places where
1353 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1355 LDKnativeShutdownScript *inner;
1357 * Indicates that this is the only struct which contains the same pointer.
1358 * Rust functions which take ownership of an object provided via an argument require
1359 * this to be true and invalidate the object pointed to by inner.
1362 } LDKShutdownScript;
1365 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
1368 typedef enum LDKAPIError_Tag {
1370 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
1371 * are documented, but generally indicates some precondition of a function was violated.
1373 LDKAPIError_APIMisuseError,
1375 * Due to a high feerate, we were unable to complete the request.
1376 * For example, this may be returned if the feerate implies we cannot open a channel at the
1377 * requested value, but opening a larger channel would succeed.
1379 LDKAPIError_FeeRateTooHigh,
1381 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
1382 * too-many-hops, etc).
1384 LDKAPIError_InvalidRoute,
1386 * We were unable to complete the request as the Channel required to do so is unable to
1387 * complete the request (or was not found). This can take many forms, including disconnected
1388 * peer, channel at capacity, channel shutting down, etc.
1390 LDKAPIError_ChannelUnavailable,
1392 * An attempt to call [`chain::Watch::watch_channel`]/[`chain::Watch::update_channel`]
1393 * returned a [`ChannelMonitorUpdateStatus::InProgress`] indicating the persistence of a
1394 * monitor update is awaiting async resolution. Once it resolves the attempted action should
1395 * complete automatically.
1397 * [`chain::Watch::watch_channel`]: crate::chain::Watch::watch_channel
1398 * [`chain::Watch::update_channel`]: crate::chain::Watch::update_channel
1399 * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
1401 LDKAPIError_MonitorUpdateInProgress,
1403 * [`SignerProvider::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
1404 * with the channel counterparty as negotiated in [`InitFeatures`].
1406 * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
1407 * a channel or cooperatively close one with this peer (and will have to force-close instead).
1409 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
1410 * [`InitFeatures`]: crate::ln::features::InitFeatures
1412 LDKAPIError_IncompatibleShutdownScript,
1414 * Must be last for serialization purposes
1416 LDKAPIError_Sentinel,
1419 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
1421 * A human-readable error message
1424 } LDKAPIError_LDKAPIMisuseError_Body;
1426 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
1428 * A human-readable error message
1432 * The feerate which was too high.
1435 } LDKAPIError_LDKFeeRateTooHigh_Body;
1437 typedef struct LDKAPIError_LDKInvalidRoute_Body {
1439 * A human-readable error message
1442 } LDKAPIError_LDKInvalidRoute_Body;
1444 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
1446 * A human-readable error message
1449 } LDKAPIError_LDKChannelUnavailable_Body;
1451 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
1453 * The incompatible shutdown script.
1455 struct LDKShutdownScript script;
1456 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
1458 typedef struct MUST_USE_STRUCT LDKAPIError {
1459 LDKAPIError_Tag tag;
1461 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
1462 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
1463 LDKAPIError_LDKInvalidRoute_Body invalid_route;
1464 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
1465 LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
1470 * The contents of CResult_NoneAPIErrorZ
1472 typedef union LDKCResult_NoneAPIErrorZPtr {
1474 * Note that this value is always NULL, as there are no contents in the OK variant
1478 * A pointer to the contents in the error state.
1479 * Reading from this pointer when `result_ok` is set is undefined.
1481 struct LDKAPIError *err;
1482 } LDKCResult_NoneAPIErrorZPtr;
1485 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
1486 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
1487 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1489 typedef struct LDKCResult_NoneAPIErrorZ {
1491 * The contents of this CResult_NoneAPIErrorZ, accessible via either
1492 * `err` or `result` depending on the state of `result_ok`.
1494 union LDKCResult_NoneAPIErrorZPtr contents;
1496 * Whether this CResult_NoneAPIErrorZ represents a success state.
1499 } LDKCResult_NoneAPIErrorZ;
1502 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
1503 * This corresponds to std::vector in C++
1505 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
1507 * The elements in the array.
1508 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1510 struct LDKCResult_NoneAPIErrorZ *data;
1512 * The number of elements pointed to by `data`.
1515 } LDKCVec_CResult_NoneAPIErrorZZ;
1518 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
1519 * This corresponds to std::vector in C++
1521 typedef struct LDKCVec_APIErrorZ {
1523 * The elements in the array.
1524 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1526 struct LDKAPIError *data;
1528 * The number of elements pointed to by `data`.
1531 } LDKCVec_APIErrorZ;
1534 * An enum which can either contain a crate::c_types::ThirtyTwoBytes or not
1536 typedef enum LDKCOption_ThirtyTwoBytesZ_Tag {
1538 * When we're in this state, this COption_ThirtyTwoBytesZ contains a crate::c_types::ThirtyTwoBytes
1540 LDKCOption_ThirtyTwoBytesZ_Some,
1542 * When we're in this state, this COption_ThirtyTwoBytesZ contains nothing
1544 LDKCOption_ThirtyTwoBytesZ_None,
1546 * Must be last for serialization purposes
1548 LDKCOption_ThirtyTwoBytesZ_Sentinel,
1549 } LDKCOption_ThirtyTwoBytesZ_Tag;
1551 typedef struct LDKCOption_ThirtyTwoBytesZ {
1552 LDKCOption_ThirtyTwoBytesZ_Tag tag;
1555 struct LDKThirtyTwoBytes some;
1558 } LDKCOption_ThirtyTwoBytesZ;
1561 * An enum which can either contain a crate::c_types::derived::CVec_u8Z or not
1563 typedef enum LDKCOption_CVec_u8ZZ_Tag {
1565 * When we're in this state, this COption_CVec_u8ZZ contains a crate::c_types::derived::CVec_u8Z
1567 LDKCOption_CVec_u8ZZ_Some,
1569 * When we're in this state, this COption_CVec_u8ZZ contains nothing
1571 LDKCOption_CVec_u8ZZ_None,
1573 * Must be last for serialization purposes
1575 LDKCOption_CVec_u8ZZ_Sentinel,
1576 } LDKCOption_CVec_u8ZZ_Tag;
1578 typedef struct LDKCOption_CVec_u8ZZ {
1579 LDKCOption_CVec_u8ZZ_Tag tag;
1582 struct LDKCVec_u8Z some;
1585 } LDKCOption_CVec_u8ZZ;
1590 * Information which is provided, encrypted, to the payment recipient when sending HTLCs.
1592 * This should generally be constructed with data communicated to us from the recipient (via a
1593 * BOLT11 or BOLT12 invoice).
1595 typedef struct MUST_USE_STRUCT LDKRecipientOnionFields {
1597 * A pointer to the opaque Rust object.
1598 * Nearly everywhere, inner must be non-null, however in places where
1599 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1601 LDKnativeRecipientOnionFields *inner;
1603 * Indicates that this is the only struct which contains the same pointer.
1604 * Rust functions which take ownership of an object provided via an argument require
1605 * this to be true and invalidate the object pointed to by inner.
1608 } LDKRecipientOnionFields;
1611 * The contents of CResult_RecipientOnionFieldsDecodeErrorZ
1613 typedef union LDKCResult_RecipientOnionFieldsDecodeErrorZPtr {
1615 * A pointer to the contents in the success state.
1616 * Reading from this pointer when `result_ok` is not set is undefined.
1618 struct LDKRecipientOnionFields *result;
1620 * A pointer to the contents in the error state.
1621 * Reading from this pointer when `result_ok` is set is undefined.
1623 struct LDKDecodeError *err;
1624 } LDKCResult_RecipientOnionFieldsDecodeErrorZPtr;
1627 * A CResult_RecipientOnionFieldsDecodeErrorZ represents the result of a fallible operation,
1628 * containing a crate::lightning::ln::outbound_payment::RecipientOnionFields on success and a crate::lightning::ln::msgs::DecodeError on failure.
1629 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1631 typedef struct LDKCResult_RecipientOnionFieldsDecodeErrorZ {
1633 * The contents of this CResult_RecipientOnionFieldsDecodeErrorZ, accessible via either
1634 * `err` or `result` depending on the state of `result_ok`.
1636 union LDKCResult_RecipientOnionFieldsDecodeErrorZPtr contents;
1638 * Whether this CResult_RecipientOnionFieldsDecodeErrorZ represents a success state.
1641 } LDKCResult_RecipientOnionFieldsDecodeErrorZ;
1644 * A tuple of 2 elements. See the individual fields for the types contained.
1646 typedef struct LDKC2Tuple_u64CVec_u8ZZ {
1648 * The element at position 0
1652 * The element at position 1
1654 struct LDKCVec_u8Z b;
1655 } LDKC2Tuple_u64CVec_u8ZZ;
1658 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u64CVec_u8ZZs of arbitrary size.
1659 * This corresponds to std::vector in C++
1661 typedef struct LDKCVec_C2Tuple_u64CVec_u8ZZZ {
1663 * The elements in the array.
1664 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1666 struct LDKC2Tuple_u64CVec_u8ZZ *data;
1668 * The number of elements pointed to by `data`.
1671 } LDKCVec_C2Tuple_u64CVec_u8ZZZ;
1674 * The contents of CResult_RecipientOnionFieldsNoneZ
1676 typedef union LDKCResult_RecipientOnionFieldsNoneZPtr {
1678 * A pointer to the contents in the success state.
1679 * Reading from this pointer when `result_ok` is not set is undefined.
1681 struct LDKRecipientOnionFields *result;
1683 * Note that this value is always NULL, as there are no contents in the Err variant
1686 } LDKCResult_RecipientOnionFieldsNoneZPtr;
1689 * A CResult_RecipientOnionFieldsNoneZ represents the result of a fallible operation,
1690 * containing a crate::lightning::ln::outbound_payment::RecipientOnionFields on success and a () on failure.
1691 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1693 typedef struct LDKCResult_RecipientOnionFieldsNoneZ {
1695 * The contents of this CResult_RecipientOnionFieldsNoneZ, accessible via either
1696 * `err` or `result` depending on the state of `result_ok`.
1698 union LDKCResult_RecipientOnionFieldsNoneZPtr contents;
1700 * Whether this CResult_RecipientOnionFieldsNoneZ represents a success state.
1703 } LDKCResult_RecipientOnionFieldsNoneZ;
1706 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
1707 * This corresponds to std::vector in C++
1709 typedef struct LDKCVec_ThirtyTwoBytesZ {
1711 * The elements in the array.
1712 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1714 struct LDKThirtyTwoBytes *data;
1716 * The number of elements pointed to by `data`.
1719 } LDKCVec_ThirtyTwoBytesZ;
1722 * An enum which can either contain a crate::c_types::derived::CVec_ThirtyTwoBytesZ or not
1724 typedef enum LDKCOption_CVec_ThirtyTwoBytesZZ_Tag {
1726 * When we're in this state, this COption_CVec_ThirtyTwoBytesZZ contains a crate::c_types::derived::CVec_ThirtyTwoBytesZ
1728 LDKCOption_CVec_ThirtyTwoBytesZZ_Some,
1730 * When we're in this state, this COption_CVec_ThirtyTwoBytesZZ contains nothing
1732 LDKCOption_CVec_ThirtyTwoBytesZZ_None,
1734 * Must be last for serialization purposes
1736 LDKCOption_CVec_ThirtyTwoBytesZZ_Sentinel,
1737 } LDKCOption_CVec_ThirtyTwoBytesZZ_Tag;
1739 typedef struct LDKCOption_CVec_ThirtyTwoBytesZZ {
1740 LDKCOption_CVec_ThirtyTwoBytesZZ_Tag tag;
1743 struct LDKCVec_ThirtyTwoBytesZ some;
1746 } LDKCOption_CVec_ThirtyTwoBytesZZ;
1749 * The contents of CResult_ThirtyTwoBytesNoneZ
1751 typedef union LDKCResult_ThirtyTwoBytesNoneZPtr {
1753 * A pointer to the contents in the success state.
1754 * Reading from this pointer when `result_ok` is not set is undefined.
1756 struct LDKThirtyTwoBytes *result;
1758 * Note that this value is always NULL, as there are no contents in the Err variant
1761 } LDKCResult_ThirtyTwoBytesNoneZPtr;
1764 * A CResult_ThirtyTwoBytesNoneZ represents the result of a fallible operation,
1765 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
1766 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1768 typedef struct LDKCResult_ThirtyTwoBytesNoneZ {
1770 * The contents of this CResult_ThirtyTwoBytesNoneZ, accessible via either
1771 * `err` or `result` depending on the state of `result_ok`.
1773 union LDKCResult_ThirtyTwoBytesNoneZPtr contents;
1775 * Whether this CResult_ThirtyTwoBytesNoneZ represents a success state.
1778 } LDKCResult_ThirtyTwoBytesNoneZ;
1783 * Information needed to route a payment across a [`BlindedPath`].
1785 typedef struct MUST_USE_STRUCT LDKBlindedPayInfo {
1787 * A pointer to the opaque Rust object.
1788 * Nearly everywhere, inner must be non-null, however in places where
1789 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1791 LDKnativeBlindedPayInfo *inner;
1793 * Indicates that this is the only struct which contains the same pointer.
1794 * Rust functions which take ownership of an object provided via an argument require
1795 * this to be true and invalidate the object pointed to by inner.
1798 } LDKBlindedPayInfo;
1801 * The contents of CResult_BlindedPayInfoDecodeErrorZ
1803 typedef union LDKCResult_BlindedPayInfoDecodeErrorZPtr {
1805 * A pointer to the contents in the success state.
1806 * Reading from this pointer when `result_ok` is not set is undefined.
1808 struct LDKBlindedPayInfo *result;
1810 * A pointer to the contents in the error state.
1811 * Reading from this pointer when `result_ok` is set is undefined.
1813 struct LDKDecodeError *err;
1814 } LDKCResult_BlindedPayInfoDecodeErrorZPtr;
1817 * A CResult_BlindedPayInfoDecodeErrorZ represents the result of a fallible operation,
1818 * containing a crate::lightning::offers::invoice::BlindedPayInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
1819 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1821 typedef struct LDKCResult_BlindedPayInfoDecodeErrorZ {
1823 * The contents of this CResult_BlindedPayInfoDecodeErrorZ, accessible via either
1824 * `err` or `result` depending on the state of `result_ok`.
1826 union LDKCResult_BlindedPayInfoDecodeErrorZPtr contents;
1828 * Whether this CResult_BlindedPayInfoDecodeErrorZ represents a success state.
1831 } LDKCResult_BlindedPayInfoDecodeErrorZ;
1836 * Information about a spendable output to a P2WSH script.
1838 * See [`SpendableOutputDescriptor::DelayedPaymentOutput`] for more details on how to spend this.
1840 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
1842 * A pointer to the opaque Rust object.
1843 * Nearly everywhere, inner must be non-null, however in places where
1844 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1846 LDKnativeDelayedPaymentOutputDescriptor *inner;
1848 * Indicates that this is the only struct which contains the same pointer.
1849 * Rust functions which take ownership of an object provided via an argument require
1850 * this to be true and invalidate the object pointed to by inner.
1853 } LDKDelayedPaymentOutputDescriptor;
1856 * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
1858 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
1860 * A pointer to the contents in the success state.
1861 * Reading from this pointer when `result_ok` is not set is undefined.
1863 struct LDKDelayedPaymentOutputDescriptor *result;
1865 * A pointer to the contents in the error state.
1866 * Reading from this pointer when `result_ok` is set is undefined.
1868 struct LDKDecodeError *err;
1869 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
1872 * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
1873 * containing a crate::lightning::sign::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
1874 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1876 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
1878 * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
1879 * `err` or `result` depending on the state of `result_ok`.
1881 union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
1883 * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
1886 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
1891 * Information about a spendable output to our \"payment key\".
1893 * See [`SpendableOutputDescriptor::StaticPaymentOutput`] for more details on how to spend this.
1895 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
1897 * A pointer to the opaque Rust object.
1898 * Nearly everywhere, inner must be non-null, however in places where
1899 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1901 LDKnativeStaticPaymentOutputDescriptor *inner;
1903 * Indicates that this is the only struct which contains the same pointer.
1904 * Rust functions which take ownership of an object provided via an argument require
1905 * this to be true and invalidate the object pointed to by inner.
1908 } LDKStaticPaymentOutputDescriptor;
1911 * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
1913 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
1915 * A pointer to the contents in the success state.
1916 * Reading from this pointer when `result_ok` is not set is undefined.
1918 struct LDKStaticPaymentOutputDescriptor *result;
1920 * A pointer to the contents in the error state.
1921 * Reading from this pointer when `result_ok` is set is undefined.
1923 struct LDKDecodeError *err;
1924 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
1927 * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
1928 * containing a crate::lightning::sign::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
1929 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1931 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
1933 * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
1934 * `err` or `result` depending on the state of `result_ok`.
1936 union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
1938 * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
1941 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
1946 * A reference to a transaction output.
1948 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
1949 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
1951 typedef struct MUST_USE_STRUCT LDKOutPoint {
1953 * A pointer to the opaque Rust object.
1954 * Nearly everywhere, inner must be non-null, however in places where
1955 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1957 LDKnativeOutPoint *inner;
1959 * Indicates that this is the only struct which contains the same pointer.
1960 * Rust functions which take ownership of an object provided via an argument require
1961 * this to be true and invalidate the object pointed to by inner.
1967 * Describes the necessary information to spend a spendable output.
1969 * When on-chain outputs are created by LDK (which our counterparty is not able to claim at any
1970 * point in the future) a [`SpendableOutputs`] event is generated which you must track and be able
1971 * to spend on-chain. The information needed to do this is provided in this enum, including the
1972 * outpoint describing which `txid` and output `index` is available, the full output which exists
1973 * at that `txid`/`index`, and any keys or other information required to sign.
1975 * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
1977 typedef enum LDKSpendableOutputDescriptor_Tag {
1979 * An output to a script which was provided via [`SignerProvider`] directly, either from
1980 * [`get_destination_script`] or [`get_shutdown_scriptpubkey`], thus you should already
1981 * know how to spend it. No secret keys are provided as LDK was never given any key.
1982 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
1983 * on-chain using the payment preimage or after it has timed out.
1985 * [`get_shutdown_scriptpubkey`]: SignerProvider::get_shutdown_scriptpubkey
1986 * [`get_destination_script`]: SignerProvider::get_shutdown_scriptpubkey
1988 LDKSpendableOutputDescriptor_StaticOutput,
1990 * An output to a P2WSH script which can be spent with a single signature after an `OP_CSV`
1993 * The witness in the spending input should be:
1995 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
1998 * Note that the `nSequence` field in the spending input must be set to
1999 * [`DelayedPaymentOutputDescriptor::to_self_delay`] (which means the transaction is not
2000 * broadcastable until at least [`DelayedPaymentOutputDescriptor::to_self_delay`] blocks after
2001 * the outpoint confirms, see [BIP
2002 * 68](https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki)). Also note that LDK
2003 * won't generate a [`SpendableOutputDescriptor`] until the corresponding block height
2006 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
2007 * it is an output from an old state which we broadcast (which should never happen).
2009 * To derive the delayed payment key which is used to sign this input, you must pass the
2010 * holder [`InMemorySigner::delayed_payment_base_key`] (i.e., the private key which corresponds to the
2011 * [`ChannelPublicKeys::delayed_payment_basepoint`] in [`ChannelSigner::pubkeys`]) and the provided
2012 * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to [`chan_utils::derive_private_key`]. The public key can be
2013 * generated without the secret key using [`chan_utils::derive_public_key`] and only the
2014 * [`ChannelPublicKeys::delayed_payment_basepoint`] which appears in [`ChannelSigner::pubkeys`].
2016 * To derive the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] provided here (which is
2017 * used in the witness script generation), you must pass the counterparty
2018 * [`ChannelPublicKeys::revocation_basepoint`] (which appears in the call to
2019 * [`ChannelSigner::provide_channel_parameters`]) and the provided
2020 * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to
2021 * [`chan_utils::derive_public_revocation_key`].
2023 * The witness script which is hashed and included in the output `script_pubkey` may be
2024 * regenerated by passing the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] (derived
2025 * as explained above), our delayed payment pubkey (derived as explained above), and the
2026 * [`DelayedPaymentOutputDescriptor::to_self_delay`] contained here to
2027 * [`chan_utils::get_revokeable_redeemscript`].
2029 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
2031 * An output spendable exclusively by our payment key (i.e., the private key that corresponds
2032 * to the `payment_point` in [`ChannelSigner::pubkeys`]). The output type depends on the
2033 * channel type negotiated.
2035 * On an anchor outputs channel, the witness in the spending input is:
2037 * <BIP 143 signature> <witness script>
2042 * <BIP 143 signature> <payment key>
2045 * These are generally the result of our counterparty having broadcast the current state,
2046 * allowing us to claim the non-HTLC-encumbered outputs immediately, or after one confirmation
2047 * in the case of anchor outputs channels.
2049 LDKSpendableOutputDescriptor_StaticPaymentOutput,
2051 * Must be last for serialization purposes
2053 LDKSpendableOutputDescriptor_Sentinel,
2054 } LDKSpendableOutputDescriptor_Tag;
2056 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
2058 * The outpoint which is spendable.
2060 struct LDKOutPoint outpoint;
2062 * The output which is referenced by the given outpoint.
2064 struct LDKTxOut output;
2065 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
2067 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
2068 LDKSpendableOutputDescriptor_Tag tag;
2070 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
2072 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
2075 struct LDKStaticPaymentOutputDescriptor static_payment_output;
2078 } LDKSpendableOutputDescriptor;
2081 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
2083 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
2085 * A pointer to the contents in the success state.
2086 * Reading from this pointer when `result_ok` is not set is undefined.
2088 struct LDKSpendableOutputDescriptor *result;
2090 * A pointer to the contents in the error state.
2091 * Reading from this pointer when `result_ok` is set is undefined.
2093 struct LDKDecodeError *err;
2094 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
2097 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
2098 * containing a crate::lightning::sign::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2099 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2101 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
2103 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
2104 * `err` or `result` depending on the state of `result_ok`.
2106 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
2108 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
2111 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
2114 * A dynamically-allocated array of crate::lightning::sign::SpendableOutputDescriptors of arbitrary size.
2115 * This corresponds to std::vector in C++
2117 typedef struct LDKCVec_SpendableOutputDescriptorZ {
2119 * The elements in the array.
2120 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2122 struct LDKSpendableOutputDescriptor *data;
2124 * The number of elements pointed to by `data`.
2127 } LDKCVec_SpendableOutputDescriptorZ;
2130 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
2131 * This corresponds to std::vector in C++
2133 typedef struct LDKCVec_TxOutZ {
2135 * The elements in the array.
2136 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2138 struct LDKTxOut *data;
2140 * The number of elements pointed to by `data`.
2146 * An enum which can either contain a u32 or not
2148 typedef enum LDKCOption_u32Z_Tag {
2150 * When we're in this state, this COption_u32Z contains a u32
2152 LDKCOption_u32Z_Some,
2154 * When we're in this state, this COption_u32Z contains nothing
2156 LDKCOption_u32Z_None,
2158 * Must be last for serialization purposes
2160 LDKCOption_u32Z_Sentinel,
2161 } LDKCOption_u32Z_Tag;
2163 typedef struct LDKCOption_u32Z {
2164 LDKCOption_u32Z_Tag tag;
2173 * A tuple of 2 elements. See the individual fields for the types contained.
2175 typedef struct LDKC2Tuple_CVec_u8ZusizeZ {
2177 * The element at position 0
2179 struct LDKCVec_u8Z a;
2181 * The element at position 1
2184 } LDKC2Tuple_CVec_u8ZusizeZ;
2187 * The contents of CResult_C2Tuple_CVec_u8ZusizeZNoneZ
2189 typedef union LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZPtr {
2191 * A pointer to the contents in the success state.
2192 * Reading from this pointer when `result_ok` is not set is undefined.
2194 struct LDKC2Tuple_CVec_u8ZusizeZ *result;
2196 * Note that this value is always NULL, as there are no contents in the Err variant
2199 } LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZPtr;
2202 * A CResult_C2Tuple_CVec_u8ZusizeZNoneZ represents the result of a fallible operation,
2203 * containing a crate::c_types::derived::C2Tuple_CVec_u8ZusizeZ on success and a () on failure.
2204 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2206 typedef struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ {
2208 * The contents of this CResult_C2Tuple_CVec_u8ZusizeZNoneZ, accessible via either
2209 * `err` or `result` depending on the state of `result_ok`.
2211 union LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZPtr contents;
2213 * Whether this CResult_C2Tuple_CVec_u8ZusizeZNoneZ represents a success state.
2216 } LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ;
2221 * The parameters required to derive a channel signer via [`SignerProvider`].
2223 typedef struct MUST_USE_STRUCT LDKChannelDerivationParameters {
2225 * A pointer to the opaque Rust object.
2226 * Nearly everywhere, inner must be non-null, however in places where
2227 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2229 LDKnativeChannelDerivationParameters *inner;
2231 * Indicates that this is the only struct which contains the same pointer.
2232 * Rust functions which take ownership of an object provided via an argument require
2233 * this to be true and invalidate the object pointed to by inner.
2236 } LDKChannelDerivationParameters;
2239 * The contents of CResult_ChannelDerivationParametersDecodeErrorZ
2241 typedef union LDKCResult_ChannelDerivationParametersDecodeErrorZPtr {
2243 * A pointer to the contents in the success state.
2244 * Reading from this pointer when `result_ok` is not set is undefined.
2246 struct LDKChannelDerivationParameters *result;
2248 * A pointer to the contents in the error state.
2249 * Reading from this pointer when `result_ok` is set is undefined.
2251 struct LDKDecodeError *err;
2252 } LDKCResult_ChannelDerivationParametersDecodeErrorZPtr;
2255 * A CResult_ChannelDerivationParametersDecodeErrorZ represents the result of a fallible operation,
2256 * containing a crate::lightning::sign::ChannelDerivationParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
2257 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2259 typedef struct LDKCResult_ChannelDerivationParametersDecodeErrorZ {
2261 * The contents of this CResult_ChannelDerivationParametersDecodeErrorZ, accessible via either
2262 * `err` or `result` depending on the state of `result_ok`.
2264 union LDKCResult_ChannelDerivationParametersDecodeErrorZPtr contents;
2266 * Whether this CResult_ChannelDerivationParametersDecodeErrorZ represents a success state.
2269 } LDKCResult_ChannelDerivationParametersDecodeErrorZ;
2274 * A descriptor used to sign for a commitment transaction's HTLC output.
2276 typedef struct MUST_USE_STRUCT LDKHTLCDescriptor {
2278 * A pointer to the opaque Rust object.
2279 * Nearly everywhere, inner must be non-null, however in places where
2280 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2282 LDKnativeHTLCDescriptor *inner;
2284 * Indicates that this is the only struct which contains the same pointer.
2285 * Rust functions which take ownership of an object provided via an argument require
2286 * this to be true and invalidate the object pointed to by inner.
2289 } LDKHTLCDescriptor;
2292 * The contents of CResult_HTLCDescriptorDecodeErrorZ
2294 typedef union LDKCResult_HTLCDescriptorDecodeErrorZPtr {
2296 * A pointer to the contents in the success state.
2297 * Reading from this pointer when `result_ok` is not set is undefined.
2299 struct LDKHTLCDescriptor *result;
2301 * A pointer to the contents in the error state.
2302 * Reading from this pointer when `result_ok` is set is undefined.
2304 struct LDKDecodeError *err;
2305 } LDKCResult_HTLCDescriptorDecodeErrorZPtr;
2308 * A CResult_HTLCDescriptorDecodeErrorZ represents the result of a fallible operation,
2309 * containing a crate::lightning::sign::HTLCDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2310 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2312 typedef struct LDKCResult_HTLCDescriptorDecodeErrorZ {
2314 * The contents of this CResult_HTLCDescriptorDecodeErrorZ, accessible via either
2315 * `err` or `result` depending on the state of `result_ok`.
2317 union LDKCResult_HTLCDescriptorDecodeErrorZPtr contents;
2319 * Whether this CResult_HTLCDescriptorDecodeErrorZ represents a success state.
2322 } LDKCResult_HTLCDescriptorDecodeErrorZ;
2325 * The contents of CResult_NoneNoneZ
2327 typedef union LDKCResult_NoneNoneZPtr {
2329 * Note that this value is always NULL, as there are no contents in the OK variant
2333 * Note that this value is always NULL, as there are no contents in the Err variant
2336 } LDKCResult_NoneNoneZPtr;
2339 * A CResult_NoneNoneZ represents the result of a fallible operation,
2340 * containing a () on success and a () on failure.
2341 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2343 typedef struct LDKCResult_NoneNoneZ {
2345 * The contents of this CResult_NoneNoneZ, accessible via either
2346 * `err` or `result` depending on the state of `result_ok`.
2348 union LDKCResult_NoneNoneZPtr contents;
2350 * Whether this CResult_NoneNoneZ represents a success state.
2353 } LDKCResult_NoneNoneZ;
2356 * Represents a secp256k1 ECDSA signature serialized as two 32-byte numbers
2358 typedef struct LDKECDSASignature {
2360 * The bytes of the signature in "compact" form
2362 uint8_t compact_form[64];
2363 } LDKECDSASignature;
2366 * A dynamically-allocated array of crate::c_types::ECDSASignatures of arbitrary size.
2367 * This corresponds to std::vector in C++
2369 typedef struct LDKCVec_ECDSASignatureZ {
2371 * The elements in the array.
2372 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2374 struct LDKECDSASignature *data;
2376 * The number of elements pointed to by `data`.
2379 } LDKCVec_ECDSASignatureZ;
2382 * A tuple of 2 elements. See the individual fields for the types contained.
2384 typedef struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ {
2386 * The element at position 0
2388 struct LDKECDSASignature a;
2390 * The element at position 1
2392 struct LDKCVec_ECDSASignatureZ b;
2393 } LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ;
2396 * The contents of CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ
2398 typedef union LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr {
2400 * A pointer to the contents in the success state.
2401 * Reading from this pointer when `result_ok` is not set is undefined.
2403 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *result;
2405 * Note that this value is always NULL, as there are no contents in the Err variant
2408 } LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr;
2411 * A CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ represents the result of a fallible operation,
2412 * containing a crate::c_types::derived::C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ on success and a () on failure.
2413 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2415 typedef struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ {
2417 * The contents of this CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ, accessible via either
2418 * `err` or `result` depending on the state of `result_ok`.
2420 union LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr contents;
2422 * Whether this CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ represents a success state.
2425 } LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ;
2428 * The contents of CResult_ECDSASignatureNoneZ
2430 typedef union LDKCResult_ECDSASignatureNoneZPtr {
2432 * A pointer to the contents in the success state.
2433 * Reading from this pointer when `result_ok` is not set is undefined.
2435 struct LDKECDSASignature *result;
2437 * Note that this value is always NULL, as there are no contents in the Err variant
2440 } LDKCResult_ECDSASignatureNoneZPtr;
2443 * A CResult_ECDSASignatureNoneZ represents the result of a fallible operation,
2444 * containing a crate::c_types::ECDSASignature on success and a () on failure.
2445 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2447 typedef struct LDKCResult_ECDSASignatureNoneZ {
2449 * The contents of this CResult_ECDSASignatureNoneZ, accessible via either
2450 * `err` or `result` depending on the state of `result_ok`.
2452 union LDKCResult_ECDSASignatureNoneZPtr contents;
2454 * Whether this CResult_ECDSASignatureNoneZ represents a success state.
2457 } LDKCResult_ECDSASignatureNoneZ;
2460 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
2462 typedef struct LDKPublicKey {
2464 * The bytes of the public key
2466 uint8_t compressed_form[33];
2470 * The contents of CResult_PublicKeyNoneZ
2472 typedef union LDKCResult_PublicKeyNoneZPtr {
2474 * A pointer to the contents in the success state.
2475 * Reading from this pointer when `result_ok` is not set is undefined.
2477 struct LDKPublicKey *result;
2479 * Note that this value is always NULL, as there are no contents in the Err variant
2482 } LDKCResult_PublicKeyNoneZPtr;
2485 * A CResult_PublicKeyNoneZ represents the result of a fallible operation,
2486 * containing a crate::c_types::PublicKey on success and a () on failure.
2487 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2489 typedef struct LDKCResult_PublicKeyNoneZ {
2491 * The contents of this CResult_PublicKeyNoneZ, accessible via either
2492 * `err` or `result` depending on the state of `result_ok`.
2494 union LDKCResult_PublicKeyNoneZPtr contents;
2496 * Whether this CResult_PublicKeyNoneZ represents a success state.
2499 } LDKCResult_PublicKeyNoneZ;
2502 * An enum which can either contain a crate::c_types::BigEndianScalar or not
2504 typedef enum LDKCOption_BigEndianScalarZ_Tag {
2506 * When we're in this state, this COption_BigEndianScalarZ contains a crate::c_types::BigEndianScalar
2508 LDKCOption_BigEndianScalarZ_Some,
2510 * When we're in this state, this COption_BigEndianScalarZ contains nothing
2512 LDKCOption_BigEndianScalarZ_None,
2514 * Must be last for serialization purposes
2516 LDKCOption_BigEndianScalarZ_Sentinel,
2517 } LDKCOption_BigEndianScalarZ_Tag;
2519 typedef struct LDKCOption_BigEndianScalarZ {
2520 LDKCOption_BigEndianScalarZ_Tag tag;
2523 struct LDKBigEndianScalar some;
2526 } LDKCOption_BigEndianScalarZ;
2529 * Integer in the range `0..32`
2531 typedef struct LDKU5 {
2536 * A dynamically-allocated array of crate::c_types::U5s of arbitrary size.
2537 * This corresponds to std::vector in C++
2539 typedef struct LDKCVec_U5Z {
2541 * The elements in the array.
2542 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2546 * The number of elements pointed to by `data`.
2552 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
2553 * allows recovering the exact public key which created the signature given the message.
2555 typedef struct LDKRecoverableSignature {
2557 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
2560 uint8_t serialized_form[68];
2561 } LDKRecoverableSignature;
2564 * The contents of CResult_RecoverableSignatureNoneZ
2566 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
2568 * A pointer to the contents in the success state.
2569 * Reading from this pointer when `result_ok` is not set is undefined.
2571 struct LDKRecoverableSignature *result;
2573 * Note that this value is always NULL, as there are no contents in the Err variant
2576 } LDKCResult_RecoverableSignatureNoneZPtr;
2579 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
2580 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
2581 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2583 typedef struct LDKCResult_RecoverableSignatureNoneZ {
2585 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
2586 * `err` or `result` depending on the state of `result_ok`.
2588 union LDKCResult_RecoverableSignatureNoneZPtr contents;
2590 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
2593 } LDKCResult_RecoverableSignatureNoneZ;
2596 * Represents a secp256k1 Schnorr signature serialized as two 32-byte numbers
2598 typedef struct LDKSchnorrSignature {
2600 * The bytes of the signature as two 32-byte numbers
2602 uint8_t compact_form[64];
2603 } LDKSchnorrSignature;
2606 * The contents of CResult_SchnorrSignatureNoneZ
2608 typedef union LDKCResult_SchnorrSignatureNoneZPtr {
2610 * A pointer to the contents in the success state.
2611 * Reading from this pointer when `result_ok` is not set is undefined.
2613 struct LDKSchnorrSignature *result;
2615 * Note that this value is always NULL, as there are no contents in the Err variant
2618 } LDKCResult_SchnorrSignatureNoneZPtr;
2621 * A CResult_SchnorrSignatureNoneZ represents the result of a fallible operation,
2622 * containing a crate::c_types::SchnorrSignature on success and a () on failure.
2623 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2625 typedef struct LDKCResult_SchnorrSignatureNoneZ {
2627 * The contents of this CResult_SchnorrSignatureNoneZ, accessible via either
2628 * `err` or `result` depending on the state of `result_ok`.
2630 union LDKCResult_SchnorrSignatureNoneZPtr contents;
2632 * Whether this CResult_SchnorrSignatureNoneZ represents a success state.
2635 } LDKCResult_SchnorrSignatureNoneZ;
2640 * This class tracks the per-transaction information needed to build a commitment transaction and will
2641 * actually build it and sign. It is used for holder transactions that we sign only when needed
2642 * and for transactions we sign for the counterparty.
2644 * This class can be used inside a signer implementation to generate a signature given the relevant
2647 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
2649 * A pointer to the opaque Rust object.
2650 * Nearly everywhere, inner must be non-null, however in places where
2651 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2653 LDKnativeCommitmentTransaction *inner;
2655 * Indicates that this is the only struct which contains the same pointer.
2656 * Rust functions which take ownership of an object provided via an argument require
2657 * this to be true and invalidate the object pointed to by inner.
2660 } LDKCommitmentTransaction;
2665 * Information needed to build and sign a holder's commitment transaction.
2667 * The transaction is only signed once we are ready to broadcast.
2669 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
2671 * A pointer to the opaque Rust object.
2672 * Nearly everywhere, inner must be non-null, however in places where
2673 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2675 LDKnativeHolderCommitmentTransaction *inner;
2677 * Indicates that this is the only struct which contains the same pointer.
2678 * Rust functions which take ownership of an object provided via an argument require
2679 * this to be true and invalidate the object pointed to by inner.
2682 } LDKHolderCommitmentTransaction;
2687 * Information about an HTLC as it appears in a commitment transaction
2689 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
2691 * A pointer to the opaque Rust object.
2692 * Nearly everywhere, inner must be non-null, however in places where
2693 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2695 LDKnativeHTLCOutputInCommitment *inner;
2697 * Indicates that this is the only struct which contains the same pointer.
2698 * Rust functions which take ownership of an object provided via an argument require
2699 * this to be true and invalidate the object pointed to by inner.
2702 } LDKHTLCOutputInCommitment;
2707 * This class tracks the per-transaction information needed to build a closing transaction and will
2708 * actually build it and sign.
2710 * This class can be used inside a signer implementation to generate a signature given the relevant
2713 typedef struct MUST_USE_STRUCT LDKClosingTransaction {
2715 * A pointer to the opaque Rust object.
2716 * Nearly everywhere, inner must be non-null, however in places where
2717 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2719 LDKnativeClosingTransaction *inner;
2721 * Indicates that this is the only struct which contains the same pointer.
2722 * Rust functions which take ownership of an object provided via an argument require
2723 * this to be true and invalidate the object pointed to by inner.
2726 } LDKClosingTransaction;
2731 * The unsigned part of a [`channel_announcement`] message.
2733 * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
2735 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
2737 * A pointer to the opaque Rust object.
2738 * Nearly everywhere, inner must be non-null, however in places where
2739 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2741 LDKnativeUnsignedChannelAnnouncement *inner;
2743 * Indicates that this is the only struct which contains the same pointer.
2744 * Rust functions which take ownership of an object provided via an argument require
2745 * this to be true and invalidate the object pointed to by inner.
2748 } LDKUnsignedChannelAnnouncement;
2753 * One counterparty's public keys which do not change over the life of a channel.
2755 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
2757 * A pointer to the opaque Rust object.
2758 * Nearly everywhere, inner must be non-null, however in places where
2759 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2761 LDKnativeChannelPublicKeys *inner;
2763 * Indicates that this is the only struct which contains the same pointer.
2764 * Rust functions which take ownership of an object provided via an argument require
2765 * this to be true and invalidate the object pointed to by inner.
2768 } LDKChannelPublicKeys;
2773 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
2774 * The fields are organized by holder/counterparty.
2776 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
2777 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
2779 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
2781 * A pointer to the opaque Rust object.
2782 * Nearly everywhere, inner must be non-null, however in places where
2783 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2785 LDKnativeChannelTransactionParameters *inner;
2787 * Indicates that this is the only struct which contains the same pointer.
2788 * Rust functions which take ownership of an object provided via an argument require
2789 * this to be true and invalidate the object pointed to by inner.
2792 } LDKChannelTransactionParameters;
2795 * A trait to handle Lightning channel key material without concretizing the channel type or
2796 * the signature mechanism.
2798 typedef struct LDKChannelSigner {
2800 * An opaque pointer which is passed to your function implementations as an argument.
2801 * This has no meaning in the LDK, and can be NULL or any other value.
2805 * Gets the per-commitment point for a specific commitment number
2807 * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
2809 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
2811 * Gets the commitment secret for a specific commitment number as part of the revocation process
2813 * An external signer implementation should error here if the commitment was already signed
2814 * and should refuse to sign it in the future.
2816 * May be called more than once for the same index.
2818 * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
2820 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
2822 * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
2824 * This is required in order for the signer to make sure that releasing a commitment
2825 * secret won't leave us without a broadcastable holder transaction.
2826 * Policy checks should be implemented in this function, including checking the amount
2827 * sent to us and checking the HTLCs.
2829 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
2830 * A validating signer should ensure that an HTLC output is removed only when the matching
2831 * preimage is provided, or when the value to holder is restored.
2833 * Note that all the relevant preimages will be provided, but there may also be additional
2834 * irrelevant or duplicate preimages.
2836 struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_ThirtyTwoBytesZ preimages);
2838 * Returns the holder's channel public keys and basepoints.
2840 struct LDKChannelPublicKeys pubkeys;
2842 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
2843 * Note that this takes a pointer to this object, not the this_ptr like other methods do
2844 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
2846 void (*set_pubkeys)(const struct LDKChannelSigner*NONNULL_PTR );
2848 * Returns an arbitrary identifier describing the set of keys which are provided back to you in
2849 * some [`SpendableOutputDescriptor`] types. This should be sufficient to identify this
2850 * [`EcdsaChannelSigner`] object uniquely and lookup or re-derive its keys.
2852 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
2854 * Set the counterparty static channel data, including basepoints,
2855 * `counterparty_selected`/`holder_selected_contest_delay` and funding outpoint.
2857 * This data is static, and will never change for a channel once set. For a given [`ChannelSigner`]
2858 * instance, LDK will call this method exactly once - either immediately after construction
2859 * (not including if done via [`SignerProvider::read_chan_signer`]) or when the funding
2860 * information has been generated.
2862 * channel_parameters.is_populated() MUST be true.
2864 void (*provide_channel_parameters)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
2866 * Frees any resources associated with this object given its this_arg pointer.
2867 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2869 void (*free)(void *this_arg);
2873 * A trait to sign Lightning channel transactions as described in
2874 * [BOLT 3](https://github.com/lightning/bolts/blob/master/03-transactions.md).
2876 * Signing services could be implemented on a hardware wallet and should implement signing
2877 * policies in order to be secure. Please refer to the [VLS Policy
2878 * Controls](https://gitlab.com/lightning-signer/validating-lightning-signer/-/blob/main/docs/policy-controls.md)
2879 * for an example of such policies.
2881 typedef struct LDKEcdsaChannelSigner {
2883 * An opaque pointer which is passed to your function implementations as an argument.
2884 * This has no meaning in the LDK, and can be NULL or any other value.
2888 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
2890 * Note that if signing fails or is rejected, the channel will be force-closed.
2892 * Policy checks should be implemented in this function, including checking the amount
2893 * sent to us and checking the HTLCs.
2895 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
2896 * A validating signer should ensure that an HTLC output is removed only when the matching
2897 * preimage is provided, or when the value to holder is restored.
2899 * Note that all the relevant preimages will be provided, but there may also be additional
2900 * irrelevant or duplicate preimages.
2902 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx, struct LDKCVec_ThirtyTwoBytesZ preimages);
2904 * Validate the counterparty's revocation.
2906 * This is required in order for the signer to make sure that the state has moved
2907 * forward and it is safe to sign the next counterparty commitment.
2909 struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
2911 * Creates a signature for a holder's commitment transaction.
2913 * This will be called
2914 * - with a non-revoked `commitment_tx`.
2915 * - with the latest `commitment_tx` when we initiate a force-close.
2917 * This may be called multiple times for the same transaction.
2919 * An external signer implementation should check that the commitment has not been revoked.
2921 struct LDKCResult_ECDSASignatureNoneZ (*sign_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
2923 * Create a signature for the given input in a transaction spending an HTLC transaction output
2924 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
2926 * A justice transaction may claim multiple outputs at the same time if timelocks are
2927 * similar, but only a signature for the input at index `input` should be signed for here.
2928 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
2929 * to an upcoming timelock expiration.
2931 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2933 * `per_commitment_key` is revocation secret which was provided by our counterparty when they
2934 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
2935 * not allow the spending of any funds by itself (you need our holder `revocation_secret` to do
2938 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]);
2940 * Create a signature for the given input in a transaction spending a commitment transaction
2941 * HTLC output when our counterparty broadcasts an old state.
2943 * A justice transaction may claim multiple outputs at the same time if timelocks are
2944 * similar, but only a signature for the input at index `input` should be signed for here.
2945 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
2946 * to an upcoming timelock expiration.
2948 * `amount` is the value of the output spent by this input, committed to in the BIP 143
2951 * `per_commitment_key` is revocation secret which was provided by our counterparty when they
2952 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
2953 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
2956 * `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script
2957 * (which is committed to in the BIP 143 signatures).
2959 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);
2961 * Computes the signature for a commitment transaction's HTLC output used as an input within
2962 * `htlc_tx`, which spends the commitment transaction at index `input`. The signature returned
2963 * must be be computed using [`EcdsaSighashType::All`].
2965 * Note that this may be called for HTLCs in the penultimate commitment transaction if a
2966 * [`ChannelMonitor`] [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
2967 * broadcasts it before receiving the update for the latest commitment transaction.
2969 * [`EcdsaSighashType::All`]: bitcoin::blockdata::transaction::EcdsaSighashType::All
2970 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
2972 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);
2974 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
2975 * transaction, either offered or received.
2977 * Such a transaction may claim multiples offered outputs at same time if we know the
2978 * preimage for each when we create it, but only the input at index `input` should be
2979 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
2980 * needed with regards to an upcoming timelock expiration.
2982 * `witness_script` is either an offered or received script as defined in BOLT3 for HTLC
2985 * `amount` is value of the output spent by this input, committed to in the BIP 143 signature.
2987 * `per_commitment_point` is the dynamic point corresponding to the channel state
2988 * detected onchain. It has been generated by our counterparty and is used to derive
2989 * channel state keys, which are then included in the witness script and committed to in the
2990 * BIP 143 signature.
2992 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);
2994 * Create a signature for a (proposed) closing transaction.
2996 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
2997 * chosen to forgo their output as dust.
2999 struct LDKCResult_ECDSASignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
3001 * Computes the signature for a commitment transaction's anchor output used as an
3002 * input within `anchor_tx`, which spends the commitment transaction, at index `input`.
3004 struct LDKCResult_ECDSASignatureNoneZ (*sign_holder_anchor_input)(const void *this_arg, struct LDKTransaction anchor_tx, uintptr_t input);
3006 * Signs a channel announcement message with our funding key proving it comes from one of the
3007 * channel participants.
3009 * Channel announcements also require a signature from each node's network key. Our node
3010 * signature is computed through [`NodeSigner::sign_gossip_message`].
3012 * Note that if this fails or is rejected, the channel will not be publicly announced and
3013 * our counterparty may (though likely will not) close the channel on us for violating the
3016 struct LDKCResult_ECDSASignatureNoneZ (*sign_channel_announcement_with_funding_key)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
3018 * Implementation of ChannelSigner for this object.
3020 struct LDKChannelSigner ChannelSigner;
3022 * Frees any resources associated with this object given its this_arg pointer.
3023 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3025 void (*free)(void *this_arg);
3026 } LDKEcdsaChannelSigner;
3029 * A writeable signer.
3031 * There will always be two instances of a signer per channel, one occupied by the
3032 * [`ChannelManager`] and another by the channel's [`ChannelMonitor`].
3034 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
3035 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
3037 typedef struct LDKWriteableEcdsaChannelSigner {
3039 * An opaque pointer which is passed to your function implementations as an argument.
3040 * This has no meaning in the LDK, and can be NULL or any other value.
3044 * Implementation of EcdsaChannelSigner for this object.
3046 struct LDKEcdsaChannelSigner EcdsaChannelSigner;
3048 * Serialize the object into a byte array
3050 struct LDKCVec_u8Z (*write)(const void *this_arg);
3052 * Called, if set, after this WriteableEcdsaChannelSigner has been cloned into a duplicate object.
3053 * The new WriteableEcdsaChannelSigner is provided, and should be mutated as needed to perform a
3054 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
3056 void (*cloned)(struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR new_WriteableEcdsaChannelSigner);
3058 * Frees any resources associated with this object given its this_arg pointer.
3059 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3061 void (*free)(void *this_arg);
3062 } LDKWriteableEcdsaChannelSigner;
3065 * The contents of CResult_WriteableEcdsaChannelSignerDecodeErrorZ
3067 typedef union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr {
3069 * A pointer to the contents in the success state.
3070 * Reading from this pointer when `result_ok` is not set is undefined.
3072 struct LDKWriteableEcdsaChannelSigner *result;
3074 * A pointer to the contents in the error state.
3075 * Reading from this pointer when `result_ok` is set is undefined.
3077 struct LDKDecodeError *err;
3078 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr;
3081 * A CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents the result of a fallible operation,
3082 * containing a crate::lightning::sign::WriteableEcdsaChannelSigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
3083 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3085 typedef struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ {
3087 * The contents of this CResult_WriteableEcdsaChannelSignerDecodeErrorZ, accessible via either
3088 * `err` or `result` depending on the state of `result_ok`.
3090 union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr contents;
3092 * Whether this CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents a success state.
3095 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ;
3098 * The contents of CResult_CVec_u8ZNoneZ
3100 typedef union LDKCResult_CVec_u8ZNoneZPtr {
3102 * A pointer to the contents in the success state.
3103 * Reading from this pointer when `result_ok` is not set is undefined.
3105 struct LDKCVec_u8Z *result;
3107 * Note that this value is always NULL, as there are no contents in the Err variant
3110 } LDKCResult_CVec_u8ZNoneZPtr;
3113 * A CResult_CVec_u8ZNoneZ represents the result of a fallible operation,
3114 * containing a crate::c_types::derived::CVec_u8Z on success and a () on failure.
3115 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3117 typedef struct LDKCResult_CVec_u8ZNoneZ {
3119 * The contents of this CResult_CVec_u8ZNoneZ, accessible via either
3120 * `err` or `result` depending on the state of `result_ok`.
3122 union LDKCResult_CVec_u8ZNoneZPtr contents;
3124 * Whether this CResult_CVec_u8ZNoneZ represents a success state.
3127 } LDKCResult_CVec_u8ZNoneZ;
3130 * The contents of CResult_ShutdownScriptNoneZ
3132 typedef union LDKCResult_ShutdownScriptNoneZPtr {
3134 * A pointer to the contents in the success state.
3135 * Reading from this pointer when `result_ok` is not set is undefined.
3137 struct LDKShutdownScript *result;
3139 * Note that this value is always NULL, as there are no contents in the Err variant
3142 } LDKCResult_ShutdownScriptNoneZPtr;
3145 * A CResult_ShutdownScriptNoneZ represents the result of a fallible operation,
3146 * containing a crate::lightning::ln::script::ShutdownScript on success and a () on failure.
3147 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3149 typedef struct LDKCResult_ShutdownScriptNoneZ {
3151 * The contents of this CResult_ShutdownScriptNoneZ, accessible via either
3152 * `err` or `result` depending on the state of `result_ok`.
3154 union LDKCResult_ShutdownScriptNoneZPtr contents;
3156 * Whether this CResult_ShutdownScriptNoneZ represents a success state.
3159 } LDKCResult_ShutdownScriptNoneZ;
3162 * An enum which can either contain a u16 or not
3164 typedef enum LDKCOption_u16Z_Tag {
3166 * When we're in this state, this COption_u16Z contains a u16
3168 LDKCOption_u16Z_Some,
3170 * When we're in this state, this COption_u16Z contains nothing
3172 LDKCOption_u16Z_None,
3174 * Must be last for serialization purposes
3176 LDKCOption_u16Z_Sentinel,
3177 } LDKCOption_u16Z_Tag;
3179 typedef struct LDKCOption_u16Z {
3180 LDKCOption_u16Z_Tag tag;
3189 * An enum which can either contain a bool or not
3191 typedef enum LDKCOption_boolZ_Tag {
3193 * When we're in this state, this COption_boolZ contains a bool
3195 LDKCOption_boolZ_Some,
3197 * When we're in this state, this COption_boolZ contains nothing
3199 LDKCOption_boolZ_None,
3201 * Must be last for serialization purposes
3203 LDKCOption_boolZ_Sentinel,
3204 } LDKCOption_boolZ_Tag;
3206 typedef struct LDKCOption_boolZ {
3207 LDKCOption_boolZ_Tag tag;
3216 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
3217 * This corresponds to std::vector in C++
3219 typedef struct LDKCVec_CVec_u8ZZ {
3221 * The elements in the array.
3222 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3224 struct LDKCVec_u8Z *data;
3226 * The number of elements pointed to by `data`.
3229 } LDKCVec_CVec_u8ZZ;
3232 * The contents of CResult_CVec_CVec_u8ZZNoneZ
3234 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
3236 * A pointer to the contents in the success state.
3237 * Reading from this pointer when `result_ok` is not set is undefined.
3239 struct LDKCVec_CVec_u8ZZ *result;
3241 * Note that this value is always NULL, as there are no contents in the Err variant
3244 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
3247 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
3248 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
3249 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3251 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
3253 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
3254 * `err` or `result` depending on the state of `result_ok`.
3256 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
3258 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
3261 } LDKCResult_CVec_CVec_u8ZZNoneZ;
3266 * A simple implementation of [`WriteableEcdsaChannelSigner`] that just keeps the private keys in memory.
3268 * This implementation performs no policy checks and is insufficient by itself as
3269 * a secure external signer.
3271 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
3273 * A pointer to the opaque Rust object.
3274 * Nearly everywhere, inner must be non-null, however in places where
3275 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3277 LDKnativeInMemorySigner *inner;
3279 * Indicates that this is the only struct which contains the same pointer.
3280 * Rust functions which take ownership of an object provided via an argument require
3281 * this to be true and invalidate the object pointed to by inner.
3284 } LDKInMemorySigner;
3287 * The contents of CResult_InMemorySignerDecodeErrorZ
3289 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
3291 * A pointer to the contents in the success state.
3292 * Reading from this pointer when `result_ok` is not set is undefined.
3294 struct LDKInMemorySigner *result;
3296 * A pointer to the contents in the error state.
3297 * Reading from this pointer when `result_ok` is set is undefined.
3299 struct LDKDecodeError *err;
3300 } LDKCResult_InMemorySignerDecodeErrorZPtr;
3303 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
3304 * containing a crate::lightning::sign::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
3305 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3307 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
3309 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
3310 * `err` or `result` depending on the state of `result_ok`.
3312 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
3314 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
3317 } LDKCResult_InMemorySignerDecodeErrorZ;
3320 * The contents of CResult_TransactionNoneZ
3322 typedef union LDKCResult_TransactionNoneZPtr {
3324 * A pointer to the contents in the success state.
3325 * Reading from this pointer when `result_ok` is not set is undefined.
3327 struct LDKTransaction *result;
3329 * Note that this value is always NULL, as there are no contents in the Err variant
3332 } LDKCResult_TransactionNoneZPtr;
3335 * A CResult_TransactionNoneZ represents the result of a fallible operation,
3336 * containing a crate::c_types::Transaction on success and a () on failure.
3337 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3339 typedef struct LDKCResult_TransactionNoneZ {
3341 * The contents of this CResult_TransactionNoneZ, accessible via either
3342 * `err` or `result` depending on the state of `result_ok`.
3344 union LDKCResult_TransactionNoneZPtr contents;
3346 * Whether this CResult_TransactionNoneZ represents a success state.
3349 } LDKCResult_TransactionNoneZ;
3354 * Represents the compressed public key of a node
3356 typedef struct MUST_USE_STRUCT LDKNodeId {
3358 * A pointer to the opaque Rust object.
3359 * Nearly everywhere, inner must be non-null, however in places where
3360 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3362 LDKnativeNodeId *inner;
3364 * Indicates that this is the only struct which contains the same pointer.
3365 * Rust functions which take ownership of an object provided via an argument require
3366 * this to be true and invalidate the object pointed to by inner.
3374 * Proposed use of a channel passed as a parameter to [`ScoreLookUp::channel_penalty_msat`].
3376 typedef struct MUST_USE_STRUCT LDKChannelUsage {
3378 * A pointer to the opaque Rust object.
3379 * Nearly everywhere, inner must be non-null, however in places where
3380 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3382 LDKnativeChannelUsage *inner;
3384 * Indicates that this is the only struct which contains the same pointer.
3385 * Rust functions which take ownership of an object provided via an argument require
3386 * this to be true and invalidate the object pointed to by inner.
3394 * Parameters for configuring [`ProbabilisticScorer`].
3396 * Used to configure base, liquidity, and amount penalties, the sum of which comprises the channel
3397 * penalty (i.e., the amount in msats willing to be paid to avoid routing through the channel).
3399 * The penalty applied to any channel by the [`ProbabilisticScorer`] is the sum of each of the
3402 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringFeeParameters {
3404 * A pointer to the opaque Rust object.
3405 * Nearly everywhere, inner must be non-null, however in places where
3406 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3408 LDKnativeProbabilisticScoringFeeParameters *inner;
3410 * Indicates that this is the only struct which contains the same pointer.
3411 * Rust functions which take ownership of an object provided via an argument require
3412 * this to be true and invalidate the object pointed to by inner.
3415 } LDKProbabilisticScoringFeeParameters;
3418 * An interface used to score payment channels for path finding.
3420 * `ScoreLookUp` is used to determine the penalty for a given channel.
3422 * Scoring is in terms of fees willing to be paid in order to avoid routing through a channel.
3424 typedef struct LDKScoreLookUp {
3426 * An opaque pointer which is passed to your function implementations as an argument.
3427 * This has no meaning in the LDK, and can be NULL or any other value.
3431 * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
3432 * given channel in the direction from `source` to `target`.
3434 * The channel's capacity (less any other MPP parts that are also being considered for use in
3435 * the same payment) is given by `capacity_msat`. It may be determined from various sources
3436 * such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near
3437 * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount.
3438 * Thus, implementations should be overflow-safe.
3440 uint64_t (*channel_penalty_msat)(const void *this_arg, uint64_t short_channel_id, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target, struct LDKChannelUsage usage, const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR score_params);
3442 * Frees any resources associated with this object given its this_arg pointer.
3443 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3445 void (*free)(void *this_arg);
3451 * A path in a [`Route`] to the payment recipient. Must always be at least length one.
3452 * If no [`Path::blinded_tail`] is present, then [`Path::hops`] length may be up to 19.
3454 typedef struct MUST_USE_STRUCT LDKPath {
3456 * A pointer to the opaque Rust object.
3457 * Nearly everywhere, inner must be non-null, however in places where
3458 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3460 LDKnativePath *inner;
3462 * Indicates that this is the only struct which contains the same pointer.
3463 * Rust functions which take ownership of an object provided via an argument require
3464 * this to be true and invalidate the object pointed to by inner.
3470 * `ScoreUpdate` is used to update the scorer's internal state after a payment attempt.
3472 typedef struct LDKScoreUpdate {
3474 * An opaque pointer which is passed to your function implementations as an argument.
3475 * This has no meaning in the LDK, and can be NULL or any other value.
3479 * Handles updating channel penalties after failing to route through a channel.
3481 void (*payment_path_failed)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id);
3483 * Handles updating channel penalties after successfully routing along a path.
3485 void (*payment_path_successful)(void *this_arg, const struct LDKPath *NONNULL_PTR path);
3487 * Handles updating channel penalties after a probe over the given path failed.
3489 void (*probe_failed)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id);
3491 * Handles updating channel penalties after a probe over the given path succeeded.
3493 void (*probe_successful)(void *this_arg, const struct LDKPath *NONNULL_PTR path);
3495 * Frees any resources associated with this object given its this_arg pointer.
3496 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3498 void (*free)(void *this_arg);
3502 * A scorer that is accessed under a lock.
3504 * Needed so that calls to [`ScoreLookUp::channel_penalty_msat`] in [`find_route`] can be made while
3505 * having shared ownership of a scorer but without requiring internal locking in [`ScoreUpdate`]
3506 * implementations. Internal locking would be detrimental to route finding performance and could
3507 * result in [`ScoreLookUp::channel_penalty_msat`] returning a different value for the same channel.
3509 * [`find_route`]: crate::routing::router::find_route
3511 typedef struct LDKLockableScore {
3513 * An opaque pointer which is passed to your function implementations as an argument.
3514 * This has no meaning in the LDK, and can be NULL or any other value.
3518 * Returns read locked scorer.
3520 struct LDKScoreLookUp (*read_lock)(const void *this_arg);
3522 * Returns write locked scorer.
3524 struct LDKScoreUpdate (*write_lock)(const void *this_arg);
3526 * Frees any resources associated with this object given its this_arg pointer.
3527 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3529 void (*free)(void *this_arg);
3533 * Refers to a scorer that is accessible under lock and also writeable to disk
3535 * We need this trait to be able to pass in a scorer to `lightning-background-processor` that will enable us to
3536 * use the Persister to persist it.
3538 typedef struct LDKWriteableScore {
3540 * An opaque pointer which is passed to your function implementations as an argument.
3541 * This has no meaning in the LDK, and can be NULL or any other value.
3545 * Implementation of LockableScore for this object.
3547 struct LDKLockableScore LockableScore;
3549 * Serialize the object into a byte array
3551 struct LDKCVec_u8Z (*write)(const void *this_arg);
3553 * Frees any resources associated with this object given its this_arg pointer.
3554 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3556 void (*free)(void *this_arg);
3557 } LDKWriteableScore;
3560 * An enum which can either contain a crate::lightning::routing::scoring::WriteableScore or not
3562 typedef enum LDKCOption_WriteableScoreZ_Tag {
3564 * When we're in this state, this COption_WriteableScoreZ contains a crate::lightning::routing::scoring::WriteableScore
3566 LDKCOption_WriteableScoreZ_Some,
3568 * When we're in this state, this COption_WriteableScoreZ contains nothing
3570 LDKCOption_WriteableScoreZ_None,
3572 * Must be last for serialization purposes
3574 LDKCOption_WriteableScoreZ_Sentinel,
3575 } LDKCOption_WriteableScoreZ_Tag;
3577 typedef struct LDKCOption_WriteableScoreZ {
3578 LDKCOption_WriteableScoreZ_Tag tag;
3581 struct LDKWriteableScore some;
3584 } LDKCOption_WriteableScoreZ;
3587 * The contents of CResult_NoneIOErrorZ
3589 typedef union LDKCResult_NoneIOErrorZPtr {
3591 * Note that this value is always NULL, as there are no contents in the OK variant
3595 * A pointer to the contents in the error state.
3596 * Reading from this pointer when `result_ok` is set is undefined.
3598 enum LDKIOError *err;
3599 } LDKCResult_NoneIOErrorZPtr;
3602 * A CResult_NoneIOErrorZ represents the result of a fallible operation,
3603 * containing a () on success and a crate::c_types::IOError on failure.
3604 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3606 typedef struct LDKCResult_NoneIOErrorZ {
3608 * The contents of this CResult_NoneIOErrorZ, accessible via either
3609 * `err` or `result` depending on the state of `result_ok`.
3611 union LDKCResult_NoneIOErrorZPtr contents;
3613 * Whether this CResult_NoneIOErrorZ represents a success state.
3616 } LDKCResult_NoneIOErrorZ;
3621 * Details of a channel, as returned by [`ChannelManager::list_channels`] and [`ChannelManager::list_usable_channels`]
3623 typedef struct MUST_USE_STRUCT LDKChannelDetails {
3625 * A pointer to the opaque Rust object.
3626 * Nearly everywhere, inner must be non-null, however in places where
3627 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3629 LDKnativeChannelDetails *inner;
3631 * Indicates that this is the only struct which contains the same pointer.
3632 * Rust functions which take ownership of an object provided via an argument require
3633 * this to be true and invalidate the object pointed to by inner.
3636 } LDKChannelDetails;
3639 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
3640 * This corresponds to std::vector in C++
3642 typedef struct LDKCVec_ChannelDetailsZ {
3644 * The elements in the array.
3645 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3647 struct LDKChannelDetails *data;
3649 * The number of elements pointed to by `data`.
3652 } LDKCVec_ChannelDetailsZ;
3657 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
3658 * it can take multiple paths. Each path is composed of one or more hops through the network.
3660 typedef struct MUST_USE_STRUCT LDKRoute {
3662 * A pointer to the opaque Rust object.
3663 * Nearly everywhere, inner must be non-null, however in places where
3664 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3666 LDKnativeRoute *inner;
3668 * Indicates that this is the only struct which contains the same pointer.
3669 * Rust functions which take ownership of an object provided via an argument require
3670 * this to be true and invalidate the object pointed to by inner.
3678 * An Err type for failure to process messages.
3680 typedef struct MUST_USE_STRUCT LDKLightningError {
3682 * A pointer to the opaque Rust object.
3683 * Nearly everywhere, inner must be non-null, however in places where
3684 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3686 LDKnativeLightningError *inner;
3688 * Indicates that this is the only struct which contains the same pointer.
3689 * Rust functions which take ownership of an object provided via an argument require
3690 * this to be true and invalidate the object pointed to by inner.
3693 } LDKLightningError;
3696 * The contents of CResult_RouteLightningErrorZ
3698 typedef union LDKCResult_RouteLightningErrorZPtr {
3700 * A pointer to the contents in the success state.
3701 * Reading from this pointer when `result_ok` is not set is undefined.
3703 struct LDKRoute *result;
3705 * A pointer to the contents in the error state.
3706 * Reading from this pointer when `result_ok` is set is undefined.
3708 struct LDKLightningError *err;
3709 } LDKCResult_RouteLightningErrorZPtr;
3712 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
3713 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
3714 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3716 typedef struct LDKCResult_RouteLightningErrorZ {
3718 * The contents of this CResult_RouteLightningErrorZ, accessible via either
3719 * `err` or `result` depending on the state of `result_ok`.
3721 union LDKCResult_RouteLightningErrorZPtr contents;
3723 * Whether this CResult_RouteLightningErrorZ represents a success state.
3726 } LDKCResult_RouteLightningErrorZ;
3731 * A data structure for tracking in-flight HTLCs. May be used during pathfinding to account for
3732 * in-use channel liquidity.
3734 typedef struct MUST_USE_STRUCT LDKInFlightHtlcs {
3736 * A pointer to the opaque Rust object.
3737 * Nearly everywhere, inner must be non-null, however in places where
3738 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3740 LDKnativeInFlightHtlcs *inner;
3742 * Indicates that this is the only struct which contains the same pointer.
3743 * Rust functions which take ownership of an object provided via an argument require
3744 * this to be true and invalidate the object pointed to by inner.
3750 * The contents of CResult_InFlightHtlcsDecodeErrorZ
3752 typedef union LDKCResult_InFlightHtlcsDecodeErrorZPtr {
3754 * A pointer to the contents in the success state.
3755 * Reading from this pointer when `result_ok` is not set is undefined.
3757 struct LDKInFlightHtlcs *result;
3759 * A pointer to the contents in the error state.
3760 * Reading from this pointer when `result_ok` is set is undefined.
3762 struct LDKDecodeError *err;
3763 } LDKCResult_InFlightHtlcsDecodeErrorZPtr;
3766 * A CResult_InFlightHtlcsDecodeErrorZ represents the result of a fallible operation,
3767 * containing a crate::lightning::routing::router::InFlightHtlcs on success and a crate::lightning::ln::msgs::DecodeError on failure.
3768 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3770 typedef struct LDKCResult_InFlightHtlcsDecodeErrorZ {
3772 * The contents of this CResult_InFlightHtlcsDecodeErrorZ, accessible via either
3773 * `err` or `result` depending on the state of `result_ok`.
3775 union LDKCResult_InFlightHtlcsDecodeErrorZPtr contents;
3777 * Whether this CResult_InFlightHtlcsDecodeErrorZ represents a success state.
3780 } LDKCResult_InFlightHtlcsDecodeErrorZ;
3785 * A hop in a route, and additional metadata about it. \"Hop\" is defined as a node and the channel
3788 typedef struct MUST_USE_STRUCT LDKRouteHop {
3790 * A pointer to the opaque Rust object.
3791 * Nearly everywhere, inner must be non-null, however in places where
3792 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3794 LDKnativeRouteHop *inner;
3796 * Indicates that this is the only struct which contains the same pointer.
3797 * Rust functions which take ownership of an object provided via an argument require
3798 * this to be true and invalidate the object pointed to by inner.
3804 * The contents of CResult_RouteHopDecodeErrorZ
3806 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
3808 * A pointer to the contents in the success state.
3809 * Reading from this pointer when `result_ok` is not set is undefined.
3811 struct LDKRouteHop *result;
3813 * A pointer to the contents in the error state.
3814 * Reading from this pointer when `result_ok` is set is undefined.
3816 struct LDKDecodeError *err;
3817 } LDKCResult_RouteHopDecodeErrorZPtr;
3820 * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
3821 * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
3822 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3824 typedef struct LDKCResult_RouteHopDecodeErrorZ {
3826 * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
3827 * `err` or `result` depending on the state of `result_ok`.
3829 union LDKCResult_RouteHopDecodeErrorZPtr contents;
3831 * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
3834 } LDKCResult_RouteHopDecodeErrorZ;
3839 * An encrypted payload and node id corresponding to a hop in a payment or onion message path, to
3840 * be encoded in the sender's onion packet. These hops cannot be identified by outside observers
3841 * and thus can be used to hide the identity of the recipient.
3843 typedef struct MUST_USE_STRUCT LDKBlindedHop {
3845 * A pointer to the opaque Rust object.
3846 * Nearly everywhere, inner must be non-null, however in places where
3847 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3849 LDKnativeBlindedHop *inner;
3851 * Indicates that this is the only struct which contains the same pointer.
3852 * Rust functions which take ownership of an object provided via an argument require
3853 * this to be true and invalidate the object pointed to by inner.
3859 * A dynamically-allocated array of crate::lightning::blinded_path::BlindedHops of arbitrary size.
3860 * This corresponds to std::vector in C++
3862 typedef struct LDKCVec_BlindedHopZ {
3864 * The elements in the array.
3865 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3867 struct LDKBlindedHop *data;
3869 * The number of elements pointed to by `data`.
3872 } LDKCVec_BlindedHopZ;
3877 * The blinded portion of a [`Path`], if we're routing to a recipient who provided blinded paths in
3878 * their [`Bolt12Invoice`].
3880 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
3882 typedef struct MUST_USE_STRUCT LDKBlindedTail {
3884 * A pointer to the opaque Rust object.
3885 * Nearly everywhere, inner must be non-null, however in places where
3886 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3888 LDKnativeBlindedTail *inner;
3890 * Indicates that this is the only struct which contains the same pointer.
3891 * Rust functions which take ownership of an object provided via an argument require
3892 * this to be true and invalidate the object pointed to by inner.
3898 * The contents of CResult_BlindedTailDecodeErrorZ
3900 typedef union LDKCResult_BlindedTailDecodeErrorZPtr {
3902 * A pointer to the contents in the success state.
3903 * Reading from this pointer when `result_ok` is not set is undefined.
3905 struct LDKBlindedTail *result;
3907 * A pointer to the contents in the error state.
3908 * Reading from this pointer when `result_ok` is set is undefined.
3910 struct LDKDecodeError *err;
3911 } LDKCResult_BlindedTailDecodeErrorZPtr;
3914 * A CResult_BlindedTailDecodeErrorZ represents the result of a fallible operation,
3915 * containing a crate::lightning::routing::router::BlindedTail on success and a crate::lightning::ln::msgs::DecodeError on failure.
3916 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3918 typedef struct LDKCResult_BlindedTailDecodeErrorZ {
3920 * The contents of this CResult_BlindedTailDecodeErrorZ, accessible via either
3921 * `err` or `result` depending on the state of `result_ok`.
3923 union LDKCResult_BlindedTailDecodeErrorZPtr contents;
3925 * Whether this CResult_BlindedTailDecodeErrorZ represents a success state.
3928 } LDKCResult_BlindedTailDecodeErrorZ;
3931 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
3932 * This corresponds to std::vector in C++
3934 typedef struct LDKCVec_RouteHopZ {
3936 * The elements in the array.
3937 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3939 struct LDKRouteHop *data;
3941 * The number of elements pointed to by `data`.
3944 } LDKCVec_RouteHopZ;
3947 * A dynamically-allocated array of crate::lightning::routing::router::Paths of arbitrary size.
3948 * This corresponds to std::vector in C++
3950 typedef struct LDKCVec_PathZ {
3952 * The elements in the array.
3953 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3955 struct LDKPath *data;
3957 * The number of elements pointed to by `data`.
3963 * The contents of CResult_RouteDecodeErrorZ
3965 typedef union LDKCResult_RouteDecodeErrorZPtr {
3967 * A pointer to the contents in the success state.
3968 * Reading from this pointer when `result_ok` is not set is undefined.
3970 struct LDKRoute *result;
3972 * A pointer to the contents in the error state.
3973 * Reading from this pointer when `result_ok` is set is undefined.
3975 struct LDKDecodeError *err;
3976 } LDKCResult_RouteDecodeErrorZPtr;
3979 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
3980 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
3981 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3983 typedef struct LDKCResult_RouteDecodeErrorZ {
3985 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
3986 * `err` or `result` depending on the state of `result_ok`.
3988 union LDKCResult_RouteDecodeErrorZPtr contents;
3990 * Whether this CResult_RouteDecodeErrorZ represents a success state.
3993 } LDKCResult_RouteDecodeErrorZ;
3998 * Parameters needed to find a [`Route`].
4000 * Passed to [`find_route`] and [`build_route_from_hops`].
4002 typedef struct MUST_USE_STRUCT LDKRouteParameters {
4004 * A pointer to the opaque Rust object.
4005 * Nearly everywhere, inner must be non-null, however in places where
4006 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4008 LDKnativeRouteParameters *inner;
4010 * Indicates that this is the only struct which contains the same pointer.
4011 * Rust functions which take ownership of an object provided via an argument require
4012 * this to be true and invalidate the object pointed to by inner.
4015 } LDKRouteParameters;
4018 * The contents of CResult_RouteParametersDecodeErrorZ
4020 typedef union LDKCResult_RouteParametersDecodeErrorZPtr {
4022 * A pointer to the contents in the success state.
4023 * Reading from this pointer when `result_ok` is not set is undefined.
4025 struct LDKRouteParameters *result;
4027 * A pointer to the contents in the error state.
4028 * Reading from this pointer when `result_ok` is set is undefined.
4030 struct LDKDecodeError *err;
4031 } LDKCResult_RouteParametersDecodeErrorZPtr;
4034 * A CResult_RouteParametersDecodeErrorZ represents the result of a fallible operation,
4035 * containing a crate::lightning::routing::router::RouteParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
4036 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4038 typedef struct LDKCResult_RouteParametersDecodeErrorZ {
4040 * The contents of this CResult_RouteParametersDecodeErrorZ, accessible via either
4041 * `err` or `result` depending on the state of `result_ok`.
4043 union LDKCResult_RouteParametersDecodeErrorZPtr contents;
4045 * Whether this CResult_RouteParametersDecodeErrorZ represents a success state.
4048 } LDKCResult_RouteParametersDecodeErrorZ;
4051 * A dynamically-allocated array of u64s of arbitrary size.
4052 * This corresponds to std::vector in C++
4054 typedef struct LDKCVec_u64Z {
4056 * The elements in the array.
4057 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4061 * The number of elements pointed to by `data`.
4069 * Information used to route a payment.
4071 typedef struct MUST_USE_STRUCT LDKPaymentParameters {
4073 * A pointer to the opaque Rust object.
4074 * Nearly everywhere, inner must be non-null, however in places where
4075 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4077 LDKnativePaymentParameters *inner;
4079 * Indicates that this is the only struct which contains the same pointer.
4080 * Rust functions which take ownership of an object provided via an argument require
4081 * this to be true and invalidate the object pointed to by inner.
4084 } LDKPaymentParameters;
4087 * The contents of CResult_PaymentParametersDecodeErrorZ
4089 typedef union LDKCResult_PaymentParametersDecodeErrorZPtr {
4091 * A pointer to the contents in the success state.
4092 * Reading from this pointer when `result_ok` is not set is undefined.
4094 struct LDKPaymentParameters *result;
4096 * A pointer to the contents in the error state.
4097 * Reading from this pointer when `result_ok` is set is undefined.
4099 struct LDKDecodeError *err;
4100 } LDKCResult_PaymentParametersDecodeErrorZPtr;
4103 * A CResult_PaymentParametersDecodeErrorZ represents the result of a fallible operation,
4104 * containing a crate::lightning::routing::router::PaymentParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
4105 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4107 typedef struct LDKCResult_PaymentParametersDecodeErrorZ {
4109 * The contents of this CResult_PaymentParametersDecodeErrorZ, accessible via either
4110 * `err` or `result` depending on the state of `result_ok`.
4112 union LDKCResult_PaymentParametersDecodeErrorZPtr contents;
4114 * Whether this CResult_PaymentParametersDecodeErrorZ represents a success state.
4117 } LDKCResult_PaymentParametersDecodeErrorZ;
4120 * A tuple of 2 elements. See the individual fields for the types contained.
4122 typedef struct LDKC2Tuple_BlindedPayInfoBlindedPathZ {
4124 * The element at position 0
4126 struct LDKBlindedPayInfo a;
4128 * The element at position 1
4130 struct LDKBlindedPath b;
4131 } LDKC2Tuple_BlindedPayInfoBlindedPathZ;
4134 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZs of arbitrary size.
4135 * This corresponds to std::vector in C++
4137 typedef struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ {
4139 * The elements in the array.
4140 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4142 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *data;
4144 * The number of elements pointed to by `data`.
4147 } LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ;
4152 * A list of hops along a payment path terminating with a channel to the recipient.
4154 typedef struct MUST_USE_STRUCT LDKRouteHint {
4156 * A pointer to the opaque Rust object.
4157 * Nearly everywhere, inner must be non-null, however in places where
4158 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4160 LDKnativeRouteHint *inner;
4162 * Indicates that this is the only struct which contains the same pointer.
4163 * Rust functions which take ownership of an object provided via an argument require
4164 * this to be true and invalidate the object pointed to by inner.
4170 * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
4171 * This corresponds to std::vector in C++
4173 typedef struct LDKCVec_RouteHintZ {
4175 * The elements in the array.
4176 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4178 struct LDKRouteHint *data;
4180 * The number of elements pointed to by `data`.
4183 } LDKCVec_RouteHintZ;
4188 * A channel descriptor for a hop along a payment path.
4190 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
4192 * A pointer to the opaque Rust object.
4193 * Nearly everywhere, inner must be non-null, however in places where
4194 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4196 LDKnativeRouteHintHop *inner;
4198 * Indicates that this is the only struct which contains the same pointer.
4199 * Rust functions which take ownership of an object provided via an argument require
4200 * this to be true and invalidate the object pointed to by inner.
4206 * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
4207 * This corresponds to std::vector in C++
4209 typedef struct LDKCVec_RouteHintHopZ {
4211 * The elements in the array.
4212 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4214 struct LDKRouteHintHop *data;
4216 * The number of elements pointed to by `data`.
4219 } LDKCVec_RouteHintHopZ;
4222 * The contents of CResult_RouteHintDecodeErrorZ
4224 typedef union LDKCResult_RouteHintDecodeErrorZPtr {
4226 * A pointer to the contents in the success state.
4227 * Reading from this pointer when `result_ok` is not set is undefined.
4229 struct LDKRouteHint *result;
4231 * A pointer to the contents in the error state.
4232 * Reading from this pointer when `result_ok` is set is undefined.
4234 struct LDKDecodeError *err;
4235 } LDKCResult_RouteHintDecodeErrorZPtr;
4238 * A CResult_RouteHintDecodeErrorZ represents the result of a fallible operation,
4239 * containing a crate::lightning::routing::router::RouteHint on success and a crate::lightning::ln::msgs::DecodeError on failure.
4240 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4242 typedef struct LDKCResult_RouteHintDecodeErrorZ {
4244 * The contents of this CResult_RouteHintDecodeErrorZ, accessible via either
4245 * `err` or `result` depending on the state of `result_ok`.
4247 union LDKCResult_RouteHintDecodeErrorZPtr contents;
4249 * Whether this CResult_RouteHintDecodeErrorZ represents a success state.
4252 } LDKCResult_RouteHintDecodeErrorZ;
4255 * The contents of CResult_RouteHintHopDecodeErrorZ
4257 typedef union LDKCResult_RouteHintHopDecodeErrorZPtr {
4259 * A pointer to the contents in the success state.
4260 * Reading from this pointer when `result_ok` is not set is undefined.
4262 struct LDKRouteHintHop *result;
4264 * A pointer to the contents in the error state.
4265 * Reading from this pointer when `result_ok` is set is undefined.
4267 struct LDKDecodeError *err;
4268 } LDKCResult_RouteHintHopDecodeErrorZPtr;
4271 * A CResult_RouteHintHopDecodeErrorZ represents the result of a fallible operation,
4272 * containing a crate::lightning::routing::router::RouteHintHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
4273 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4275 typedef struct LDKCResult_RouteHintHopDecodeErrorZ {
4277 * The contents of this CResult_RouteHintHopDecodeErrorZ, accessible via either
4278 * `err` or `result` depending on the state of `result_ok`.
4280 union LDKCResult_RouteHintHopDecodeErrorZPtr contents;
4282 * Whether this CResult_RouteHintHopDecodeErrorZ represents a success state.
4285 } LDKCResult_RouteHintHopDecodeErrorZ;
4288 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
4289 * This corresponds to std::vector in C++
4291 typedef struct LDKCVec_PublicKeyZ {
4293 * The elements in the array.
4294 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4296 struct LDKPublicKey *data;
4298 * The number of elements pointed to by `data`.
4301 } LDKCVec_PublicKeyZ;
4306 * [`ScoreLookUp`] implementation that uses a fixed penalty.
4308 typedef struct MUST_USE_STRUCT LDKFixedPenaltyScorer {
4310 * A pointer to the opaque Rust object.
4311 * Nearly everywhere, inner must be non-null, however in places where
4312 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4314 LDKnativeFixedPenaltyScorer *inner;
4316 * Indicates that this is the only struct which contains the same pointer.
4317 * Rust functions which take ownership of an object provided via an argument require
4318 * this to be true and invalidate the object pointed to by inner.
4321 } LDKFixedPenaltyScorer;
4324 * The contents of CResult_FixedPenaltyScorerDecodeErrorZ
4326 typedef union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr {
4328 * A pointer to the contents in the success state.
4329 * Reading from this pointer when `result_ok` is not set is undefined.
4331 struct LDKFixedPenaltyScorer *result;
4333 * A pointer to the contents in the error state.
4334 * Reading from this pointer when `result_ok` is set is undefined.
4336 struct LDKDecodeError *err;
4337 } LDKCResult_FixedPenaltyScorerDecodeErrorZPtr;
4340 * A CResult_FixedPenaltyScorerDecodeErrorZ represents the result of a fallible operation,
4341 * containing a crate::lightning::routing::scoring::FixedPenaltyScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4342 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4344 typedef struct LDKCResult_FixedPenaltyScorerDecodeErrorZ {
4346 * The contents of this CResult_FixedPenaltyScorerDecodeErrorZ, accessible via either
4347 * `err` or `result` depending on the state of `result_ok`.
4349 union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr contents;
4351 * Whether this CResult_FixedPenaltyScorerDecodeErrorZ represents a success state.
4354 } LDKCResult_FixedPenaltyScorerDecodeErrorZ;
4357 * A dynamically-allocated array of crate::lightning::routing::gossip::NodeIds of arbitrary size.
4358 * This corresponds to std::vector in C++
4360 typedef struct LDKCVec_NodeIdZ {
4362 * The elements in the array.
4363 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4365 struct LDKNodeId *data;
4367 * The number of elements pointed to by `data`.
4373 * A tuple of 2 elements. See the individual fields for the types contained.
4375 typedef struct LDKC2Tuple_u64u64Z {
4377 * The element at position 0
4381 * The element at position 1
4384 } LDKC2Tuple_u64u64Z;
4387 * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u64Z or not
4389 typedef enum LDKCOption_C2Tuple_u64u64ZZ_Tag {
4391 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains a crate::c_types::derived::C2Tuple_u64u64Z
4393 LDKCOption_C2Tuple_u64u64ZZ_Some,
4395 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains nothing
4397 LDKCOption_C2Tuple_u64u64ZZ_None,
4399 * Must be last for serialization purposes
4401 LDKCOption_C2Tuple_u64u64ZZ_Sentinel,
4402 } LDKCOption_C2Tuple_u64u64ZZ_Tag;
4404 typedef struct LDKCOption_C2Tuple_u64u64ZZ {
4405 LDKCOption_C2Tuple_u64u64ZZ_Tag tag;
4408 struct LDKC2Tuple_u64u64Z some;
4411 } LDKCOption_C2Tuple_u64u64ZZ;
4416 typedef struct LDKThirtyTwoU16s {
4418 * The thirty-two 16-bit integers
4424 * A tuple of 2 elements. See the individual fields for the types contained.
4426 typedef struct LDKC2Tuple_Z {
4428 * The element at position 0
4430 struct LDKThirtyTwoU16s a;
4432 * The element at position 1
4434 struct LDKThirtyTwoU16s b;
4438 * A tuple of 2 elements. See the individual fields for the types contained.
4440 typedef struct LDKC2Tuple__u1632_u1632Z {
4442 * The element at position 0
4444 struct LDKThirtyTwoU16s a;
4446 * The element at position 1
4448 struct LDKThirtyTwoU16s b;
4449 } LDKC2Tuple__u1632_u1632Z;
4452 * An enum which can either contain a crate::c_types::derived::C2Tuple__u1632_u1632Z or not
4454 typedef enum LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag {
4456 * When we're in this state, this COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ contains a crate::c_types::derived::C2Tuple__u1632_u1632Z
4458 LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Some,
4460 * When we're in this state, this COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ contains nothing
4462 LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_None,
4464 * Must be last for serialization purposes
4466 LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Sentinel,
4467 } LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag;
4469 typedef struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ {
4470 LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag tag;
4473 struct LDKC2Tuple__u1632_u1632Z some;
4476 } LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ;
4479 * An enum which can either contain a f64 or not
4481 typedef enum LDKCOption_f64Z_Tag {
4483 * When we're in this state, this COption_f64Z contains a f64
4485 LDKCOption_f64Z_Some,
4487 * When we're in this state, this COption_f64Z contains nothing
4489 LDKCOption_f64Z_None,
4491 * Must be last for serialization purposes
4493 LDKCOption_f64Z_Sentinel,
4494 } LDKCOption_f64Z_Tag;
4496 typedef struct LDKCOption_f64Z {
4497 LDKCOption_f64Z_Tag tag;
4508 * A Record, unit of logging output with Metadata to enable filtering
4509 * Module_path, file, line to inform on log's source
4511 typedef struct MUST_USE_STRUCT LDKRecord {
4513 * A pointer to the opaque Rust object.
4514 * Nearly everywhere, inner must be non-null, however in places where
4515 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4517 LDKnativeRecord *inner;
4519 * Indicates that this is the only struct which contains the same pointer.
4520 * Rust functions which take ownership of an object provided via an argument require
4521 * this to be true and invalidate the object pointed to by inner.
4527 * A trait encapsulating the operations required of a logger
4529 typedef struct LDKLogger {
4531 * An opaque pointer which is passed to your function implementations as an argument.
4532 * This has no meaning in the LDK, and can be NULL or any other value.
4538 void (*log)(const void *this_arg, const struct LDKRecord *NONNULL_PTR record);
4540 * Frees any resources associated with this object given its this_arg pointer.
4541 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4543 void (*free)(void *this_arg);
4549 * Represents the network as nodes and channels between them
4551 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
4553 * A pointer to the opaque Rust object.
4554 * Nearly everywhere, inner must be non-null, however in places where
4555 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4557 LDKnativeNetworkGraph *inner;
4559 * Indicates that this is the only struct which contains the same pointer.
4560 * Rust functions which take ownership of an object provided via an argument require
4561 * this to be true and invalidate the object pointed to by inner.
4569 * [`ScoreLookUp`] implementation using channel success probability distributions.
4571 * Channels are tracked with upper and lower liquidity bounds - when an HTLC fails at a channel,
4572 * we learn that the upper-bound on the available liquidity is lower than the amount of the HTLC.
4573 * When a payment is forwarded through a channel (but fails later in the route), we learn the
4574 * lower-bound on the channel's available liquidity must be at least the value of the HTLC.
4576 * These bounds are then used to determine a success probability using the formula from
4577 * *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
4578 * and Stefan Richter [[1]] (i.e. `(upper_bound - payment_amount) / (upper_bound - lower_bound)`).
4580 * This probability is combined with the [`liquidity_penalty_multiplier_msat`] and
4581 * [`liquidity_penalty_amount_multiplier_msat`] parameters to calculate a concrete penalty in
4582 * milli-satoshis. The penalties, when added across all hops, have the property of being linear in
4583 * terms of the entire path's success probability. This allows the router to directly compare
4584 * penalties for different paths. See the documentation of those parameters for the exact formulas.
4586 * The liquidity bounds are decayed by halving them every [`liquidity_offset_half_life`].
4588 * Further, we track the history of our upper and lower liquidity bounds for each channel,
4589 * allowing us to assign a second penalty (using [`historical_liquidity_penalty_multiplier_msat`]
4590 * and [`historical_liquidity_penalty_amount_multiplier_msat`]) based on the same probability
4591 * formula, but using the history of a channel rather than our latest estimates for the liquidity
4596 * Mixing the `no-std` feature between serialization and deserialization results in undefined
4599 * [1]: https://arxiv.org/abs/2107.05322
4600 * [`liquidity_penalty_multiplier_msat`]: ProbabilisticScoringFeeParameters::liquidity_penalty_multiplier_msat
4601 * [`liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringFeeParameters::liquidity_penalty_amount_multiplier_msat
4602 * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
4603 * [`historical_liquidity_penalty_multiplier_msat`]: ProbabilisticScoringFeeParameters::historical_liquidity_penalty_multiplier_msat
4604 * [`historical_liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringFeeParameters::historical_liquidity_penalty_amount_multiplier_msat
4606 typedef struct MUST_USE_STRUCT LDKProbabilisticScorer {
4608 * A pointer to the opaque Rust object.
4609 * Nearly everywhere, inner must be non-null, however in places where
4610 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4612 LDKnativeProbabilisticScorer *inner;
4614 * Indicates that this is the only struct which contains the same pointer.
4615 * Rust functions which take ownership of an object provided via an argument require
4616 * this to be true and invalidate the object pointed to by inner.
4619 } LDKProbabilisticScorer;
4622 * The contents of CResult_ProbabilisticScorerDecodeErrorZ
4624 typedef union LDKCResult_ProbabilisticScorerDecodeErrorZPtr {
4626 * A pointer to the contents in the success state.
4627 * Reading from this pointer when `result_ok` is not set is undefined.
4629 struct LDKProbabilisticScorer *result;
4631 * A pointer to the contents in the error state.
4632 * Reading from this pointer when `result_ok` is set is undefined.
4634 struct LDKDecodeError *err;
4635 } LDKCResult_ProbabilisticScorerDecodeErrorZPtr;
4638 * A CResult_ProbabilisticScorerDecodeErrorZ represents the result of a fallible operation,
4639 * containing a crate::lightning::routing::scoring::ProbabilisticScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4640 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4642 typedef struct LDKCResult_ProbabilisticScorerDecodeErrorZ {
4644 * The contents of this CResult_ProbabilisticScorerDecodeErrorZ, accessible via either
4645 * `err` or `result` depending on the state of `result_ok`.
4647 union LDKCResult_ProbabilisticScorerDecodeErrorZPtr contents;
4649 * Whether this CResult_ProbabilisticScorerDecodeErrorZ represents a success state.
4652 } LDKCResult_ProbabilisticScorerDecodeErrorZ;
4655 * A tuple of 2 elements. See the individual fields for the types contained.
4657 typedef struct LDKC2Tuple_usizeTransactionZ {
4659 * The element at position 0
4663 * The element at position 1
4665 struct LDKTransaction b;
4666 } LDKC2Tuple_usizeTransactionZ;
4669 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
4670 * This corresponds to std::vector in C++
4672 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
4674 * The elements in the array.
4675 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4677 struct LDKC2Tuple_usizeTransactionZ *data;
4679 * The number of elements pointed to by `data`.
4682 } LDKCVec_C2Tuple_usizeTransactionZZ;
4685 * A tuple of 2 elements. See the individual fields for the types contained.
4687 typedef struct LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ {
4689 * The element at position 0
4691 struct LDKThirtyTwoBytes a;
4693 * The element at position 1
4695 struct LDKCOption_ThirtyTwoBytesZ b;
4696 } LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ;
4699 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZs of arbitrary size.
4700 * This corresponds to std::vector in C++
4702 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ {
4704 * The elements in the array.
4705 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4707 struct LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ *data;
4709 * The number of elements pointed to by `data`.
4712 } LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ;
4715 * The contents of CResult_ChannelMonitorUpdateStatusNoneZ
4717 typedef union LDKCResult_ChannelMonitorUpdateStatusNoneZPtr {
4719 * A pointer to the contents in the success state.
4720 * Reading from this pointer when `result_ok` is not set is undefined.
4722 enum LDKChannelMonitorUpdateStatus *result;
4724 * Note that this value is always NULL, as there are no contents in the Err variant
4727 } LDKCResult_ChannelMonitorUpdateStatusNoneZPtr;
4730 * A CResult_ChannelMonitorUpdateStatusNoneZ represents the result of a fallible operation,
4731 * containing a crate::lightning::chain::ChannelMonitorUpdateStatus on success and a () on failure.
4732 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4734 typedef struct LDKCResult_ChannelMonitorUpdateStatusNoneZ {
4736 * The contents of this CResult_ChannelMonitorUpdateStatusNoneZ, accessible via either
4737 * `err` or `result` depending on the state of `result_ok`.
4739 union LDKCResult_ChannelMonitorUpdateStatusNoneZPtr contents;
4741 * Whether this CResult_ChannelMonitorUpdateStatusNoneZ represents a success state.
4744 } LDKCResult_ChannelMonitorUpdateStatusNoneZ;
4749 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
4750 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
4751 * preimage claim backward will lead to loss of funds.
4753 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
4755 * A pointer to the opaque Rust object.
4756 * Nearly everywhere, inner must be non-null, however in places where
4757 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4759 LDKnativeHTLCUpdate *inner;
4761 * Indicates that this is the only struct which contains the same pointer.
4762 * Rust functions which take ownership of an object provided via an argument require
4763 * this to be true and invalidate the object pointed to by inner.
4769 * An event to be processed by the ChannelManager.
4771 typedef enum LDKMonitorEvent_Tag {
4773 * A monitor event containing an HTLCUpdate.
4775 LDKMonitorEvent_HTLCEvent,
4777 * A monitor event that the Channel's commitment transaction was confirmed.
4779 LDKMonitorEvent_HolderForceClosed,
4781 * Indicates a [`ChannelMonitor`] update has completed. See
4782 * [`ChannelMonitorUpdateStatus::InProgress`] for more information on how this is used.
4784 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
4786 LDKMonitorEvent_Completed,
4788 * Must be last for serialization purposes
4790 LDKMonitorEvent_Sentinel,
4791 } LDKMonitorEvent_Tag;
4793 typedef struct LDKMonitorEvent_LDKCompleted_Body {
4795 * The funding outpoint of the [`ChannelMonitor`] that was updated
4797 struct LDKOutPoint funding_txo;
4799 * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
4800 * [`ChannelMonitor::get_latest_update_id`].
4802 * Note that this should only be set to a given update's ID if all previous updates for the
4803 * same [`ChannelMonitor`] have been applied and persisted.
4805 uint64_t monitor_update_id;
4806 } LDKMonitorEvent_LDKCompleted_Body;
4808 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
4809 LDKMonitorEvent_Tag tag;
4812 struct LDKHTLCUpdate htlc_event;
4815 struct LDKOutPoint holder_force_closed;
4817 LDKMonitorEvent_LDKCompleted_Body completed;
4822 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
4823 * This corresponds to std::vector in C++
4825 typedef struct LDKCVec_MonitorEventZ {
4827 * The elements in the array.
4828 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4830 struct LDKMonitorEvent *data;
4832 * The number of elements pointed to by `data`.
4835 } LDKCVec_MonitorEventZ;
4838 * A tuple of 3 elements. See the individual fields for the types contained.
4840 typedef struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ {
4842 * The element at position 0
4844 struct LDKOutPoint a;
4846 * The element at position 1
4848 struct LDKCVec_MonitorEventZ b;
4850 * The element at position 2
4852 struct LDKPublicKey c;
4853 } LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ;
4856 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OutPointCVec_MonitorEventZPublicKeyZs of arbitrary size.
4857 * This corresponds to std::vector in C++
4859 typedef struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ {
4861 * The elements in the array.
4862 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4864 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *data;
4866 * The number of elements pointed to by `data`.
4869 } LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ;
4874 * Features used within an `init` message.
4876 typedef struct MUST_USE_STRUCT LDKInitFeatures {
4878 * A pointer to the opaque Rust object.
4879 * Nearly everywhere, inner must be non-null, however in places where
4880 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4882 LDKnativeInitFeatures *inner;
4884 * Indicates that this is the only struct which contains the same pointer.
4885 * Rust functions which take ownership of an object provided via an argument require
4886 * this to be true and invalidate the object pointed to by inner.
4892 * The contents of CResult_InitFeaturesDecodeErrorZ
4894 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
4896 * A pointer to the contents in the success state.
4897 * Reading from this pointer when `result_ok` is not set is undefined.
4899 struct LDKInitFeatures *result;
4901 * A pointer to the contents in the error state.
4902 * Reading from this pointer when `result_ok` is set is undefined.
4904 struct LDKDecodeError *err;
4905 } LDKCResult_InitFeaturesDecodeErrorZPtr;
4908 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
4909 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4910 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4912 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
4914 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
4915 * `err` or `result` depending on the state of `result_ok`.
4917 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
4919 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
4922 } LDKCResult_InitFeaturesDecodeErrorZ;
4927 * Features used within a `channel_announcement` message.
4929 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
4931 * A pointer to the opaque Rust object.
4932 * Nearly everywhere, inner must be non-null, however in places where
4933 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4935 LDKnativeChannelFeatures *inner;
4937 * Indicates that this is the only struct which contains the same pointer.
4938 * Rust functions which take ownership of an object provided via an argument require
4939 * this to be true and invalidate the object pointed to by inner.
4942 } LDKChannelFeatures;
4945 * The contents of CResult_ChannelFeaturesDecodeErrorZ
4947 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
4949 * A pointer to the contents in the success state.
4950 * Reading from this pointer when `result_ok` is not set is undefined.
4952 struct LDKChannelFeatures *result;
4954 * A pointer to the contents in the error state.
4955 * Reading from this pointer when `result_ok` is set is undefined.
4957 struct LDKDecodeError *err;
4958 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
4961 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
4962 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4963 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4965 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
4967 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
4968 * `err` or `result` depending on the state of `result_ok`.
4970 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
4972 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
4975 } LDKCResult_ChannelFeaturesDecodeErrorZ;
4980 * Features used within a `node_announcement` message.
4982 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
4984 * A pointer to the opaque Rust object.
4985 * Nearly everywhere, inner must be non-null, however in places where
4986 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4988 LDKnativeNodeFeatures *inner;
4990 * Indicates that this is the only struct which contains the same pointer.
4991 * Rust functions which take ownership of an object provided via an argument require
4992 * this to be true and invalidate the object pointed to by inner.
4998 * The contents of CResult_NodeFeaturesDecodeErrorZ
5000 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
5002 * A pointer to the contents in the success state.
5003 * Reading from this pointer when `result_ok` is not set is undefined.
5005 struct LDKNodeFeatures *result;
5007 * A pointer to the contents in the error state.
5008 * Reading from this pointer when `result_ok` is set is undefined.
5010 struct LDKDecodeError *err;
5011 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
5014 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
5015 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5016 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5018 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
5020 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
5021 * `err` or `result` depending on the state of `result_ok`.
5023 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
5025 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
5028 } LDKCResult_NodeFeaturesDecodeErrorZ;
5033 * Features used within an invoice.
5035 typedef struct MUST_USE_STRUCT LDKBolt11InvoiceFeatures {
5037 * A pointer to the opaque Rust object.
5038 * Nearly everywhere, inner must be non-null, however in places where
5039 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5041 LDKnativeBolt11InvoiceFeatures *inner;
5043 * Indicates that this is the only struct which contains the same pointer.
5044 * Rust functions which take ownership of an object provided via an argument require
5045 * this to be true and invalidate the object pointed to by inner.
5048 } LDKBolt11InvoiceFeatures;
5051 * The contents of CResult_Bolt11InvoiceFeaturesDecodeErrorZ
5053 typedef union LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr {
5055 * A pointer to the contents in the success state.
5056 * Reading from this pointer when `result_ok` is not set is undefined.
5058 struct LDKBolt11InvoiceFeatures *result;
5060 * A pointer to the contents in the error state.
5061 * Reading from this pointer when `result_ok` is set is undefined.
5063 struct LDKDecodeError *err;
5064 } LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr;
5067 * A CResult_Bolt11InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
5068 * containing a crate::lightning::ln::features::Bolt11InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5069 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5071 typedef struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ {
5073 * The contents of this CResult_Bolt11InvoiceFeaturesDecodeErrorZ, accessible via either
5074 * `err` or `result` depending on the state of `result_ok`.
5076 union LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr contents;
5078 * Whether this CResult_Bolt11InvoiceFeaturesDecodeErrorZ represents a success state.
5081 } LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ;
5086 * Features used within an `invoice`.
5088 typedef struct MUST_USE_STRUCT LDKBolt12InvoiceFeatures {
5090 * A pointer to the opaque Rust object.
5091 * Nearly everywhere, inner must be non-null, however in places where
5092 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5094 LDKnativeBolt12InvoiceFeatures *inner;
5096 * Indicates that this is the only struct which contains the same pointer.
5097 * Rust functions which take ownership of an object provided via an argument require
5098 * this to be true and invalidate the object pointed to by inner.
5101 } LDKBolt12InvoiceFeatures;
5104 * The contents of CResult_Bolt12InvoiceFeaturesDecodeErrorZ
5106 typedef union LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr {
5108 * A pointer to the contents in the success state.
5109 * Reading from this pointer when `result_ok` is not set is undefined.
5111 struct LDKBolt12InvoiceFeatures *result;
5113 * A pointer to the contents in the error state.
5114 * Reading from this pointer when `result_ok` is set is undefined.
5116 struct LDKDecodeError *err;
5117 } LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr;
5120 * A CResult_Bolt12InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
5121 * containing a crate::lightning::ln::features::Bolt12InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5122 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5124 typedef struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ {
5126 * The contents of this CResult_Bolt12InvoiceFeaturesDecodeErrorZ, accessible via either
5127 * `err` or `result` depending on the state of `result_ok`.
5129 union LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr contents;
5131 * Whether this CResult_Bolt12InvoiceFeaturesDecodeErrorZ represents a success state.
5134 } LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ;
5139 * Features used within BOLT 4 encrypted_data_tlv and BOLT 12 blinded_payinfo
5141 typedef struct MUST_USE_STRUCT LDKBlindedHopFeatures {
5143 * A pointer to the opaque Rust object.
5144 * Nearly everywhere, inner must be non-null, however in places where
5145 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5147 LDKnativeBlindedHopFeatures *inner;
5149 * Indicates that this is the only struct which contains the same pointer.
5150 * Rust functions which take ownership of an object provided via an argument require
5151 * this to be true and invalidate the object pointed to by inner.
5154 } LDKBlindedHopFeatures;
5157 * The contents of CResult_BlindedHopFeaturesDecodeErrorZ
5159 typedef union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr {
5161 * A pointer to the contents in the success state.
5162 * Reading from this pointer when `result_ok` is not set is undefined.
5164 struct LDKBlindedHopFeatures *result;
5166 * A pointer to the contents in the error state.
5167 * Reading from this pointer when `result_ok` is set is undefined.
5169 struct LDKDecodeError *err;
5170 } LDKCResult_BlindedHopFeaturesDecodeErrorZPtr;
5173 * A CResult_BlindedHopFeaturesDecodeErrorZ represents the result of a fallible operation,
5174 * containing a crate::lightning::ln::features::BlindedHopFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5175 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5177 typedef struct LDKCResult_BlindedHopFeaturesDecodeErrorZ {
5179 * The contents of this CResult_BlindedHopFeaturesDecodeErrorZ, accessible via either
5180 * `err` or `result` depending on the state of `result_ok`.
5182 union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr contents;
5184 * Whether this CResult_BlindedHopFeaturesDecodeErrorZ represents a success state.
5187 } LDKCResult_BlindedHopFeaturesDecodeErrorZ;
5192 * Features used within the channel_type field in an OpenChannel message.
5194 * A channel is always of some known \"type\", describing the transaction formats used and the exact
5195 * semantics of our interaction with our peer.
5197 * Note that because a channel is a specific type which is proposed by the opener and accepted by
5198 * the counterparty, only required features are allowed here.
5200 * This is serialized differently from other feature types - it is not prefixed by a length, and
5201 * thus must only appear inside a TLV where its length is known in advance.
5203 typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
5205 * A pointer to the opaque Rust object.
5206 * Nearly everywhere, inner must be non-null, however in places where
5207 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5209 LDKnativeChannelTypeFeatures *inner;
5211 * Indicates that this is the only struct which contains the same pointer.
5212 * Rust functions which take ownership of an object provided via an argument require
5213 * this to be true and invalidate the object pointed to by inner.
5216 } LDKChannelTypeFeatures;
5219 * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
5221 typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
5223 * A pointer to the contents in the success state.
5224 * Reading from this pointer when `result_ok` is not set is undefined.
5226 struct LDKChannelTypeFeatures *result;
5228 * A pointer to the contents in the error state.
5229 * Reading from this pointer when `result_ok` is set is undefined.
5231 struct LDKDecodeError *err;
5232 } LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr;
5235 * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
5236 * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5237 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5239 typedef struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ {
5241 * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
5242 * `err` or `result` depending on the state of `result_ok`.
5244 union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
5246 * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
5249 } LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
5254 * An `Offer` is a potentially long-lived proposal for payment of a good or service.
5256 * An offer is a precursor to an [`InvoiceRequest`]. A merchant publishes an offer from which a
5257 * customer may request an [`Bolt12Invoice`] for a specific quantity and using an amount sufficient
5258 * to cover that quantity (i.e., at least `quantity * amount`). See [`Offer::amount`].
5260 * Offers may be denominated in currency other than bitcoin but are ultimately paid using the
5263 * Through the use of [`BlindedPath`]s, offers provide recipient privacy.
5265 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
5266 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
5268 typedef struct MUST_USE_STRUCT LDKOffer {
5270 * A pointer to the opaque Rust object.
5271 * Nearly everywhere, inner must be non-null, however in places where
5272 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5274 LDKnativeOffer *inner;
5276 * Indicates that this is the only struct which contains the same pointer.
5277 * Rust functions which take ownership of an object provided via an argument require
5278 * this to be true and invalidate the object pointed to by inner.
5284 * The contents of CResult_OfferBolt12ParseErrorZ
5286 typedef union LDKCResult_OfferBolt12ParseErrorZPtr {
5288 * A pointer to the contents in the success state.
5289 * Reading from this pointer when `result_ok` is not set is undefined.
5291 struct LDKOffer *result;
5293 * A pointer to the contents in the error state.
5294 * Reading from this pointer when `result_ok` is set is undefined.
5296 struct LDKBolt12ParseError *err;
5297 } LDKCResult_OfferBolt12ParseErrorZPtr;
5300 * A CResult_OfferBolt12ParseErrorZ represents the result of a fallible operation,
5301 * containing a crate::lightning::offers::offer::Offer on success and a crate::lightning::offers::parse::Bolt12ParseError on failure.
5302 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5304 typedef struct LDKCResult_OfferBolt12ParseErrorZ {
5306 * The contents of this CResult_OfferBolt12ParseErrorZ, accessible via either
5307 * `err` or `result` depending on the state of `result_ok`.
5309 union LDKCResult_OfferBolt12ParseErrorZPtr contents;
5311 * Whether this CResult_OfferBolt12ParseErrorZ represents a success state.
5314 } LDKCResult_OfferBolt12ParseErrorZ;
5317 * The contents of CResult_PublicKeySecp256k1ErrorZ
5319 typedef union LDKCResult_PublicKeySecp256k1ErrorZPtr {
5321 * A pointer to the contents in the success state.
5322 * Reading from this pointer when `result_ok` is not set is undefined.
5324 struct LDKPublicKey *result;
5326 * A pointer to the contents in the error state.
5327 * Reading from this pointer when `result_ok` is set is undefined.
5329 enum LDKSecp256k1Error *err;
5330 } LDKCResult_PublicKeySecp256k1ErrorZPtr;
5333 * A CResult_PublicKeySecp256k1ErrorZ represents the result of a fallible operation,
5334 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
5335 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5337 typedef struct LDKCResult_PublicKeySecp256k1ErrorZ {
5339 * The contents of this CResult_PublicKeySecp256k1ErrorZ, accessible via either
5340 * `err` or `result` depending on the state of `result_ok`.
5342 union LDKCResult_PublicKeySecp256k1ErrorZPtr contents;
5344 * Whether this CResult_PublicKeySecp256k1ErrorZ represents a success state.
5347 } LDKCResult_PublicKeySecp256k1ErrorZ;
5350 * The contents of CResult_NodeIdDecodeErrorZ
5352 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
5354 * A pointer to the contents in the success state.
5355 * Reading from this pointer when `result_ok` is not set is undefined.
5357 struct LDKNodeId *result;
5359 * A pointer to the contents in the error state.
5360 * Reading from this pointer when `result_ok` is set is undefined.
5362 struct LDKDecodeError *err;
5363 } LDKCResult_NodeIdDecodeErrorZPtr;
5366 * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
5367 * containing a crate::lightning::routing::gossip::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
5368 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5370 typedef struct LDKCResult_NodeIdDecodeErrorZ {
5372 * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
5373 * `err` or `result` depending on the state of `result_ok`.
5375 union LDKCResult_NodeIdDecodeErrorZPtr contents;
5377 * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
5380 } LDKCResult_NodeIdDecodeErrorZ;
5385 * A [`channel_update`] message to be sent to or received from a peer.
5387 * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
5389 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
5391 * A pointer to the opaque Rust object.
5392 * Nearly everywhere, inner must be non-null, however in places where
5393 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5395 LDKnativeChannelUpdate *inner;
5397 * Indicates that this is the only struct which contains the same pointer.
5398 * Rust functions which take ownership of an object provided via an argument require
5399 * this to be true and invalidate the object pointed to by inner.
5405 * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
5406 * return packet by a node along the route. See [BOLT #4] for details.
5408 * [BOLT #4]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md
5410 typedef enum LDKNetworkUpdate_Tag {
5412 * An error indicating a `channel_update` messages should be applied via
5413 * [`NetworkGraph::update_channel`].
5415 LDKNetworkUpdate_ChannelUpdateMessage,
5417 * An error indicating that a channel failed to route a payment, which should be applied via
5418 * [`NetworkGraph::channel_failed_permanent`] if permanent.
5420 LDKNetworkUpdate_ChannelFailure,
5422 * An error indicating that a node failed to route a payment, which should be applied via
5423 * [`NetworkGraph::node_failed_permanent`] if permanent.
5425 LDKNetworkUpdate_NodeFailure,
5427 * Must be last for serialization purposes
5429 LDKNetworkUpdate_Sentinel,
5430 } LDKNetworkUpdate_Tag;
5432 typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
5434 * The update to apply via [`NetworkGraph::update_channel`].
5436 struct LDKChannelUpdate msg;
5437 } LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
5439 typedef struct LDKNetworkUpdate_LDKChannelFailure_Body {
5441 * The short channel id of the closed channel.
5443 uint64_t short_channel_id;
5445 * Whether the channel should be permanently removed or temporarily disabled until a new
5446 * `channel_update` message is received.
5449 } LDKNetworkUpdate_LDKChannelFailure_Body;
5451 typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
5453 * The node id of the failed node.
5455 struct LDKPublicKey node_id;
5457 * Whether the node should be permanently removed from consideration or can be restored
5458 * when a new `channel_update` message is received.
5461 } LDKNetworkUpdate_LDKNodeFailure_Body;
5463 typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
5464 LDKNetworkUpdate_Tag tag;
5466 LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
5467 LDKNetworkUpdate_LDKChannelFailure_Body channel_failure;
5468 LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
5473 * An enum which can either contain a crate::lightning::routing::gossip::NetworkUpdate or not
5475 typedef enum LDKCOption_NetworkUpdateZ_Tag {
5477 * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::gossip::NetworkUpdate
5479 LDKCOption_NetworkUpdateZ_Some,
5481 * When we're in this state, this COption_NetworkUpdateZ contains nothing
5483 LDKCOption_NetworkUpdateZ_None,
5485 * Must be last for serialization purposes
5487 LDKCOption_NetworkUpdateZ_Sentinel,
5488 } LDKCOption_NetworkUpdateZ_Tag;
5490 typedef struct LDKCOption_NetworkUpdateZ {
5491 LDKCOption_NetworkUpdateZ_Tag tag;
5494 struct LDKNetworkUpdate some;
5497 } LDKCOption_NetworkUpdateZ;
5500 * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
5502 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
5504 * A pointer to the contents in the success state.
5505 * Reading from this pointer when `result_ok` is not set is undefined.
5507 struct LDKCOption_NetworkUpdateZ *result;
5509 * A pointer to the contents in the error state.
5510 * Reading from this pointer when `result_ok` is set is undefined.
5512 struct LDKDecodeError *err;
5513 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
5516 * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
5517 * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
5518 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5520 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
5522 * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
5523 * `err` or `result` depending on the state of `result_ok`.
5525 union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
5527 * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
5530 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
5533 * The contents of CResult_TxOutUtxoLookupErrorZ
5535 typedef union LDKCResult_TxOutUtxoLookupErrorZPtr {
5537 * A pointer to the contents in the success state.
5538 * Reading from this pointer when `result_ok` is not set is undefined.
5540 struct LDKTxOut *result;
5542 * A pointer to the contents in the error state.
5543 * Reading from this pointer when `result_ok` is set is undefined.
5545 enum LDKUtxoLookupError *err;
5546 } LDKCResult_TxOutUtxoLookupErrorZPtr;
5549 * A CResult_TxOutUtxoLookupErrorZ represents the result of a fallible operation,
5550 * containing a crate::c_types::TxOut on success and a crate::lightning::routing::utxo::UtxoLookupError on failure.
5551 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5553 typedef struct LDKCResult_TxOutUtxoLookupErrorZ {
5555 * The contents of this CResult_TxOutUtxoLookupErrorZ, accessible via either
5556 * `err` or `result` depending on the state of `result_ok`.
5558 union LDKCResult_TxOutUtxoLookupErrorZPtr contents;
5560 * Whether this CResult_TxOutUtxoLookupErrorZ represents a success state.
5563 } LDKCResult_TxOutUtxoLookupErrorZ;
5568 * Represents a future resolution of a [`UtxoLookup::get_utxo`] query resolving async.
5570 * See [`UtxoResult::Async`] and [`UtxoFuture::resolve`] for more info.
5572 typedef struct MUST_USE_STRUCT LDKUtxoFuture {
5574 * A pointer to the opaque Rust object.
5575 * Nearly everywhere, inner must be non-null, however in places where
5576 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5578 LDKnativeUtxoFuture *inner;
5580 * Indicates that this is the only struct which contains the same pointer.
5581 * Rust functions which take ownership of an object provided via an argument require
5582 * this to be true and invalidate the object pointed to by inner.
5588 * The result of a [`UtxoLookup::get_utxo`] call. A call may resolve either synchronously,
5589 * returning the `Sync` variant, or asynchronously, returning an [`UtxoFuture`] in the `Async`
5592 typedef enum LDKUtxoResult_Tag {
5594 * A result which was resolved synchronously. It either includes a [`TxOut`] for the output
5595 * requested or a [`UtxoLookupError`].
5599 * A result which will be resolved asynchronously. It includes a [`UtxoFuture`], a `clone` of
5600 * which you must keep locally and call [`UtxoFuture::resolve`] on once the lookup completes.
5602 * Note that in order to avoid runaway memory usage, the number of parallel checks is limited,
5603 * but only fairly loosely. Because a pending checks block all message processing, leaving
5604 * checks pending for an extended time may cause DoS of other functions. It is recommended you
5605 * keep a tight timeout on lookups, on the order of a few seconds.
5607 LDKUtxoResult_Async,
5609 * Must be last for serialization purposes
5611 LDKUtxoResult_Sentinel,
5612 } LDKUtxoResult_Tag;
5614 typedef struct MUST_USE_STRUCT LDKUtxoResult {
5615 LDKUtxoResult_Tag tag;
5618 struct LDKCResult_TxOutUtxoLookupErrorZ sync;
5621 struct LDKUtxoFuture async;
5627 * The `UtxoLookup` trait defines behavior for accessing on-chain UTXOs.
5629 typedef struct LDKUtxoLookup {
5631 * An opaque pointer which is passed to your function implementations as an argument.
5632 * This has no meaning in the LDK, and can be NULL or any other value.
5636 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
5637 * Returns an error if `chain_hash` is for a different chain or if such a transaction output is
5640 * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id
5642 struct LDKUtxoResult (*get_utxo)(const void *this_arg, const uint8_t (*chain_hash)[32], uint64_t short_channel_id);
5644 * Frees any resources associated with this object given its this_arg pointer.
5645 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5647 void (*free)(void *this_arg);
5651 * An enum which can either contain a crate::lightning::routing::utxo::UtxoLookup or not
5653 typedef enum LDKCOption_UtxoLookupZ_Tag {
5655 * When we're in this state, this COption_UtxoLookupZ contains a crate::lightning::routing::utxo::UtxoLookup
5657 LDKCOption_UtxoLookupZ_Some,
5659 * When we're in this state, this COption_UtxoLookupZ contains nothing
5661 LDKCOption_UtxoLookupZ_None,
5663 * Must be last for serialization purposes
5665 LDKCOption_UtxoLookupZ_Sentinel,
5666 } LDKCOption_UtxoLookupZ_Tag;
5668 typedef struct LDKCOption_UtxoLookupZ {
5669 LDKCOption_UtxoLookupZ_Tag tag;
5672 struct LDKUtxoLookup some;
5675 } LDKCOption_UtxoLookupZ;
5678 * The contents of CResult_NoneLightningErrorZ
5680 typedef union LDKCResult_NoneLightningErrorZPtr {
5682 * Note that this value is always NULL, as there are no contents in the OK variant
5686 * A pointer to the contents in the error state.
5687 * Reading from this pointer when `result_ok` is set is undefined.
5689 struct LDKLightningError *err;
5690 } LDKCResult_NoneLightningErrorZPtr;
5693 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
5694 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
5695 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5697 typedef struct LDKCResult_NoneLightningErrorZ {
5699 * The contents of this CResult_NoneLightningErrorZ, accessible via either
5700 * `err` or `result` depending on the state of `result_ok`.
5702 union LDKCResult_NoneLightningErrorZPtr contents;
5704 * Whether this CResult_NoneLightningErrorZ represents a success state.
5707 } LDKCResult_NoneLightningErrorZ;
5710 * The contents of CResult_boolLightningErrorZ
5712 typedef union LDKCResult_boolLightningErrorZPtr {
5714 * A pointer to the contents in the success state.
5715 * Reading from this pointer when `result_ok` is not set is undefined.
5719 * A pointer to the contents in the error state.
5720 * Reading from this pointer when `result_ok` is set is undefined.
5722 struct LDKLightningError *err;
5723 } LDKCResult_boolLightningErrorZPtr;
5726 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
5727 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
5728 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5730 typedef struct LDKCResult_boolLightningErrorZ {
5732 * The contents of this CResult_boolLightningErrorZ, accessible via either
5733 * `err` or `result` depending on the state of `result_ok`.
5735 union LDKCResult_boolLightningErrorZPtr contents;
5737 * Whether this CResult_boolLightningErrorZ represents a success state.
5740 } LDKCResult_boolLightningErrorZ;
5745 * A [`channel_announcement`] message to be sent to or received from a peer.
5747 * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
5749 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
5751 * A pointer to the opaque Rust object.
5752 * Nearly everywhere, inner must be non-null, however in places where
5753 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5755 LDKnativeChannelAnnouncement *inner;
5757 * Indicates that this is the only struct which contains the same pointer.
5758 * Rust functions which take ownership of an object provided via an argument require
5759 * this to be true and invalidate the object pointed to by inner.
5762 } LDKChannelAnnouncement;
5765 * A tuple of 3 elements. See the individual fields for the types contained.
5767 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
5769 * The element at position 0
5771 struct LDKChannelAnnouncement a;
5773 * The element at position 1
5775 struct LDKChannelUpdate b;
5777 * The element at position 2
5779 struct LDKChannelUpdate c;
5780 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
5783 * An enum which can either contain a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ or not
5785 typedef enum LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag {
5787 * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
5789 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some,
5791 * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains nothing
5793 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None,
5795 * Must be last for serialization purposes
5797 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Sentinel,
5798 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag;
5800 typedef struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
5801 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag tag;
5804 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ some;
5807 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
5812 * An [`accept_channel`] message to be sent to or received from a peer.
5814 * Used in V1 channel establishment
5816 * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message
5818 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
5820 * A pointer to the opaque Rust object.
5821 * Nearly everywhere, inner must be non-null, however in places where
5822 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5824 LDKnativeAcceptChannel *inner;
5826 * Indicates that this is the only struct which contains the same pointer.
5827 * Rust functions which take ownership of an object provided via an argument require
5828 * this to be true and invalidate the object pointed to by inner.
5836 * An accept_channel2 message to be sent by or received from the channel accepter.
5838 * Used in V2 channel establishment
5841 typedef struct MUST_USE_STRUCT LDKAcceptChannelV2 {
5843 * A pointer to the opaque Rust object.
5844 * Nearly everywhere, inner must be non-null, however in places where
5845 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5847 LDKnativeAcceptChannelV2 *inner;
5849 * Indicates that this is the only struct which contains the same pointer.
5850 * Rust functions which take ownership of an object provided via an argument require
5851 * this to be true and invalidate the object pointed to by inner.
5854 } LDKAcceptChannelV2;
5859 * An [`open_channel`] message to be sent to or received from a peer.
5861 * Used in V1 channel establishment
5863 * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message
5865 typedef struct MUST_USE_STRUCT LDKOpenChannel {
5867 * A pointer to the opaque Rust object.
5868 * Nearly everywhere, inner must be non-null, however in places where
5869 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5871 LDKnativeOpenChannel *inner;
5873 * Indicates that this is the only struct which contains the same pointer.
5874 * Rust functions which take ownership of an object provided via an argument require
5875 * this to be true and invalidate the object pointed to by inner.
5883 * An open_channel2 message to be sent by or received from the channel initiator.
5885 * Used in V2 channel establishment
5888 typedef struct MUST_USE_STRUCT LDKOpenChannelV2 {
5890 * A pointer to the opaque Rust object.
5891 * Nearly everywhere, inner must be non-null, however in places where
5892 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5894 LDKnativeOpenChannelV2 *inner;
5896 * Indicates that this is the only struct which contains the same pointer.
5897 * Rust functions which take ownership of an object provided via an argument require
5898 * this to be true and invalidate the object pointed to by inner.
5906 * A [`funding_created`] message to be sent to or received from a peer.
5908 * Used in V1 channel establishment
5910 * [`funding_created`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_created-message
5912 typedef struct MUST_USE_STRUCT LDKFundingCreated {
5914 * A pointer to the opaque Rust object.
5915 * Nearly everywhere, inner must be non-null, however in places where
5916 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5918 LDKnativeFundingCreated *inner;
5920 * Indicates that this is the only struct which contains the same pointer.
5921 * Rust functions which take ownership of an object provided via an argument require
5922 * this to be true and invalidate the object pointed to by inner.
5925 } LDKFundingCreated;
5930 * A [`funding_signed`] message to be sent to or received from a peer.
5932 * Used in V1 channel establishment
5934 * [`funding_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_signed-message
5936 typedef struct MUST_USE_STRUCT LDKFundingSigned {
5938 * A pointer to the opaque Rust object.
5939 * Nearly everywhere, inner must be non-null, however in places where
5940 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5942 LDKnativeFundingSigned *inner;
5944 * Indicates that this is the only struct which contains the same pointer.
5945 * Rust functions which take ownership of an object provided via an argument require
5946 * this to be true and invalidate the object pointed to by inner.
5954 * A tx_add_input message for adding an input during interactive transaction construction
5957 typedef struct MUST_USE_STRUCT LDKTxAddInput {
5959 * A pointer to the opaque Rust object.
5960 * Nearly everywhere, inner must be non-null, however in places where
5961 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5963 LDKnativeTxAddInput *inner;
5965 * Indicates that this is the only struct which contains the same pointer.
5966 * Rust functions which take ownership of an object provided via an argument require
5967 * this to be true and invalidate the object pointed to by inner.
5975 * A tx_add_output message for adding an output during interactive transaction construction.
5978 typedef struct MUST_USE_STRUCT LDKTxAddOutput {
5980 * A pointer to the opaque Rust object.
5981 * Nearly everywhere, inner must be non-null, however in places where
5982 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5984 LDKnativeTxAddOutput *inner;
5986 * Indicates that this is the only struct which contains the same pointer.
5987 * Rust functions which take ownership of an object provided via an argument require
5988 * this to be true and invalidate the object pointed to by inner.
5996 * A tx_remove_input message for removing an input during interactive transaction construction.
5999 typedef struct MUST_USE_STRUCT LDKTxRemoveInput {
6001 * A pointer to the opaque Rust object.
6002 * Nearly everywhere, inner must be non-null, however in places where
6003 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6005 LDKnativeTxRemoveInput *inner;
6007 * Indicates that this is the only struct which contains the same pointer.
6008 * Rust functions which take ownership of an object provided via an argument require
6009 * this to be true and invalidate the object pointed to by inner.
6017 * A tx_remove_output message for removing an output during interactive transaction construction.
6020 typedef struct MUST_USE_STRUCT LDKTxRemoveOutput {
6022 * A pointer to the opaque Rust object.
6023 * Nearly everywhere, inner must be non-null, however in places where
6024 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6026 LDKnativeTxRemoveOutput *inner;
6028 * Indicates that this is the only struct which contains the same pointer.
6029 * Rust functions which take ownership of an object provided via an argument require
6030 * this to be true and invalidate the object pointed to by inner.
6033 } LDKTxRemoveOutput;
6038 * A tx_complete message signalling the conclusion of a peer's transaction contributions during
6039 * interactive transaction construction.
6042 typedef struct MUST_USE_STRUCT LDKTxComplete {
6044 * A pointer to the opaque Rust object.
6045 * Nearly everywhere, inner must be non-null, however in places where
6046 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6048 LDKnativeTxComplete *inner;
6050 * Indicates that this is the only struct which contains the same pointer.
6051 * Rust functions which take ownership of an object provided via an argument require
6052 * this to be true and invalidate the object pointed to by inner.
6060 * A tx_signatures message containing the sender's signatures for a transaction constructed with
6061 * interactive transaction construction.
6064 typedef struct MUST_USE_STRUCT LDKTxSignatures {
6066 * A pointer to the opaque Rust object.
6067 * Nearly everywhere, inner must be non-null, however in places where
6068 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6070 LDKnativeTxSignatures *inner;
6072 * Indicates that this is the only struct which contains the same pointer.
6073 * Rust functions which take ownership of an object provided via an argument require
6074 * this to be true and invalidate the object pointed to by inner.
6082 * A tx_init_rbf message which initiates a replacement of the transaction after it's been
6086 typedef struct MUST_USE_STRUCT LDKTxInitRbf {
6088 * A pointer to the opaque Rust object.
6089 * Nearly everywhere, inner must be non-null, however in places where
6090 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6092 LDKnativeTxInitRbf *inner;
6094 * Indicates that this is the only struct which contains the same pointer.
6095 * Rust functions which take ownership of an object provided via an argument require
6096 * this to be true and invalidate the object pointed to by inner.
6104 * A tx_ack_rbf message which acknowledges replacement of the transaction after it's been
6108 typedef struct MUST_USE_STRUCT LDKTxAckRbf {
6110 * A pointer to the opaque Rust object.
6111 * Nearly everywhere, inner must be non-null, however in places where
6112 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6114 LDKnativeTxAckRbf *inner;
6116 * Indicates that this is the only struct which contains the same pointer.
6117 * Rust functions which take ownership of an object provided via an argument require
6118 * this to be true and invalidate the object pointed to by inner.
6126 * A tx_abort message which signals the cancellation of an in-progress transaction negotiation.
6129 typedef struct MUST_USE_STRUCT LDKTxAbort {
6131 * A pointer to the opaque Rust object.
6132 * Nearly everywhere, inner must be non-null, however in places where
6133 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6135 LDKnativeTxAbort *inner;
6137 * Indicates that this is the only struct which contains the same pointer.
6138 * Rust functions which take ownership of an object provided via an argument require
6139 * this to be true and invalidate the object pointed to by inner.
6147 * A [`channel_ready`] message to be sent to or received from a peer.
6149 * [`channel_ready`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-channel_ready-message
6151 typedef struct MUST_USE_STRUCT LDKChannelReady {
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 LDKnativeChannelReady *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 [`announcement_signatures`] message to be sent to or received from a peer.
6171 * [`announcement_signatures`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-announcement_signatures-message
6173 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
6175 * A pointer to the opaque Rust object.
6176 * Nearly everywhere, inner must be non-null, however in places where
6177 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6179 LDKnativeAnnouncementSignatures *inner;
6181 * Indicates that this is the only struct which contains the same pointer.
6182 * Rust functions which take ownership of an object provided via an argument require
6183 * this to be true and invalidate the object pointed to by inner.
6186 } LDKAnnouncementSignatures;
6191 * Struct used to return values from [`RevokeAndACK`] messages, containing a bunch of commitment
6192 * transaction updates if they were pending.
6194 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
6196 * A pointer to the opaque Rust object.
6197 * Nearly everywhere, inner must be non-null, however in places where
6198 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6200 LDKnativeCommitmentUpdate *inner;
6202 * Indicates that this is the only struct which contains the same pointer.
6203 * Rust functions which take ownership of an object provided via an argument require
6204 * this to be true and invalidate the object pointed to by inner.
6207 } LDKCommitmentUpdate;
6212 * A [`revoke_and_ack`] message to be sent to or received from a peer.
6214 * [`revoke_and_ack`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#completing-the-transition-to-the-updated-state-revoke_and_ack
6216 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
6218 * A pointer to the opaque Rust object.
6219 * Nearly everywhere, inner must be non-null, however in places where
6220 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6222 LDKnativeRevokeAndACK *inner;
6224 * Indicates that this is the only struct which contains the same pointer.
6225 * Rust functions which take ownership of an object provided via an argument require
6226 * this to be true and invalidate the object pointed to by inner.
6234 * A [`closing_signed`] message to be sent to or received from a peer.
6236 * [`closing_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-negotiation-closing_signed
6238 typedef struct MUST_USE_STRUCT LDKClosingSigned {
6240 * A pointer to the opaque Rust object.
6241 * Nearly everywhere, inner must be non-null, however in places where
6242 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6244 LDKnativeClosingSigned *inner;
6246 * Indicates that this is the only struct which contains the same pointer.
6247 * Rust functions which take ownership of an object provided via an argument require
6248 * this to be true and invalidate the object pointed to by inner.
6256 * A [`shutdown`] message to be sent to or received from a peer.
6258 * [`shutdown`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-initiation-shutdown
6260 typedef struct MUST_USE_STRUCT LDKShutdown {
6262 * A pointer to the opaque Rust object.
6263 * Nearly everywhere, inner must be non-null, however in places where
6264 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6266 LDKnativeShutdown *inner;
6268 * Indicates that this is the only struct which contains the same pointer.
6269 * Rust functions which take ownership of an object provided via an argument require
6270 * this to be true and invalidate the object pointed to by inner.
6278 * A [`channel_reestablish`] message to be sent to or received from a peer.
6280 * [`channel_reestablish`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#message-retransmission
6282 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
6284 * A pointer to the opaque Rust object.
6285 * Nearly everywhere, inner must be non-null, however in places where
6286 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6288 LDKnativeChannelReestablish *inner;
6290 * Indicates that this is the only struct which contains the same pointer.
6291 * Rust functions which take ownership of an object provided via an argument require
6292 * this to be true and invalidate the object pointed to by inner.
6295 } LDKChannelReestablish;
6300 * A [`node_announcement`] message to be sent to or received from a peer.
6302 * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
6304 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
6306 * A pointer to the opaque Rust object.
6307 * Nearly everywhere, inner must be non-null, however in places where
6308 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6310 LDKnativeNodeAnnouncement *inner;
6312 * Indicates that this is the only struct which contains the same pointer.
6313 * Rust functions which take ownership of an object provided via an argument require
6314 * this to be true and invalidate the object pointed to by inner.
6317 } LDKNodeAnnouncement;
6322 * An [`error`] message to be sent to or received from a peer.
6324 * [`error`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
6326 typedef struct MUST_USE_STRUCT LDKErrorMessage {
6328 * A pointer to the opaque Rust object.
6329 * Nearly everywhere, inner must be non-null, however in places where
6330 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6332 LDKnativeErrorMessage *inner;
6334 * Indicates that this is the only struct which contains the same pointer.
6335 * Rust functions which take ownership of an object provided via an argument require
6336 * this to be true and invalidate the object pointed to by inner.
6344 * A [`warning`] message to be sent to or received from a peer.
6346 * [`warning`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
6348 typedef struct MUST_USE_STRUCT LDKWarningMessage {
6350 * A pointer to the opaque Rust object.
6351 * Nearly everywhere, inner must be non-null, however in places where
6352 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6354 LDKnativeWarningMessage *inner;
6356 * Indicates that this is the only struct which contains the same pointer.
6357 * Rust functions which take ownership of an object provided via an argument require
6358 * this to be true and invalidate the object pointed to by inner.
6361 } LDKWarningMessage;
6364 * Used to put an error message in a [`LightningError`].
6366 typedef enum LDKErrorAction_Tag {
6368 * The peer took some action which made us think they were useless. Disconnect them.
6370 LDKErrorAction_DisconnectPeer,
6372 * The peer did something incorrect. Tell them without closing any channels and disconnect them.
6374 LDKErrorAction_DisconnectPeerWithWarning,
6376 * The peer did something harmless that we weren't able to process, just log and ignore
6378 LDKErrorAction_IgnoreError,
6380 * The peer did something harmless that we weren't able to meaningfully process.
6381 * If the error is logged, log it at the given level.
6383 LDKErrorAction_IgnoreAndLog,
6385 * The peer provided us with a gossip message which we'd already seen. In most cases this
6386 * should be ignored, but it may result in the message being forwarded if it is a duplicate of
6387 * our own channel announcements.
6389 LDKErrorAction_IgnoreDuplicateGossip,
6391 * The peer did something incorrect. Tell them.
6393 LDKErrorAction_SendErrorMessage,
6395 * The peer did something incorrect. Tell them without closing any channels.
6397 LDKErrorAction_SendWarningMessage,
6399 * Must be last for serialization purposes
6401 LDKErrorAction_Sentinel,
6402 } LDKErrorAction_Tag;
6404 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
6406 * An error message which we should make an effort to send before we disconnect.
6408 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
6410 struct LDKErrorMessage msg;
6411 } LDKErrorAction_LDKDisconnectPeer_Body;
6413 typedef struct LDKErrorAction_LDKDisconnectPeerWithWarning_Body {
6415 * A warning message which we should make an effort to send before we disconnect.
6417 struct LDKWarningMessage msg;
6418 } LDKErrorAction_LDKDisconnectPeerWithWarning_Body;
6420 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
6422 * The message to send.
6424 struct LDKErrorMessage msg;
6425 } LDKErrorAction_LDKSendErrorMessage_Body;
6427 typedef struct LDKErrorAction_LDKSendWarningMessage_Body {
6429 * The message to send.
6431 struct LDKWarningMessage msg;
6433 * The peer may have done something harmless that we weren't able to meaningfully process,
6434 * though we should still tell them about it.
6435 * If this event is logged, log it at the given level.
6437 enum LDKLevel log_level;
6438 } LDKErrorAction_LDKSendWarningMessage_Body;
6440 typedef struct MUST_USE_STRUCT LDKErrorAction {
6441 LDKErrorAction_Tag tag;
6443 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
6444 LDKErrorAction_LDKDisconnectPeerWithWarning_Body disconnect_peer_with_warning;
6446 enum LDKLevel ignore_and_log;
6448 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
6449 LDKErrorAction_LDKSendWarningMessage_Body send_warning_message;
6456 * A [`query_channel_range`] message is used to query a peer for channel
6457 * UTXOs in a range of blocks. The recipient of a query makes a best
6458 * effort to reply to the query using one or more [`ReplyChannelRange`]
6461 * [`query_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
6463 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
6465 * A pointer to the opaque Rust object.
6466 * Nearly everywhere, inner must be non-null, however in places where
6467 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6469 LDKnativeQueryChannelRange *inner;
6471 * Indicates that this is the only struct which contains the same pointer.
6472 * Rust functions which take ownership of an object provided via an argument require
6473 * this to be true and invalidate the object pointed to by inner.
6476 } LDKQueryChannelRange;
6481 * A [`query_short_channel_ids`] message is used to query a peer for
6482 * routing gossip messages related to one or more `short_channel_id`s.
6484 * The query recipient will reply with the latest, if available,
6485 * [`ChannelAnnouncement`], [`ChannelUpdate`] and [`NodeAnnouncement`] messages
6486 * it maintains for the requested `short_channel_id`s followed by a
6487 * [`ReplyShortChannelIdsEnd`] message. The `short_channel_id`s sent in
6488 * this query are encoded. We only support `encoding_type=0` uncompressed
6489 * serialization and do not support `encoding_type=1` zlib serialization.
6491 * [`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
6493 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
6495 * A pointer to the opaque Rust object.
6496 * Nearly everywhere, inner must be non-null, however in places where
6497 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6499 LDKnativeQueryShortChannelIds *inner;
6501 * Indicates that this is the only struct which contains the same pointer.
6502 * Rust functions which take ownership of an object provided via an argument require
6503 * this to be true and invalidate the object pointed to by inner.
6506 } LDKQueryShortChannelIds;
6511 * A [`reply_channel_range`] message is a reply to a [`QueryChannelRange`]
6514 * Multiple `reply_channel_range` messages can be sent in reply
6515 * to a single [`QueryChannelRange`] message. The query recipient makes a
6516 * best effort to respond based on their local network view which may
6517 * not be a perfect view of the network. The `short_channel_id`s in the
6518 * reply are encoded. We only support `encoding_type=0` uncompressed
6519 * serialization and do not support `encoding_type=1` zlib serialization.
6521 * [`reply_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
6523 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
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 LDKnativeReplyChannelRange *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.
6536 } LDKReplyChannelRange;
6541 * A [`gossip_timestamp_filter`] message is used by a node to request
6542 * gossip relay for messages in the requested time range when the
6543 * `gossip_queries` feature has been negotiated.
6545 * [`gossip_timestamp_filter`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-gossip_timestamp_filter-message
6547 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
6549 * A pointer to the opaque Rust object.
6550 * Nearly everywhere, inner must be non-null, however in places where
6551 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6553 LDKnativeGossipTimestampFilter *inner;
6555 * Indicates that this is the only struct which contains the same pointer.
6556 * Rust functions which take ownership of an object provided via an argument require
6557 * this to be true and invalidate the object pointed to by inner.
6560 } LDKGossipTimestampFilter;
6563 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
6564 * broadcast to most peers).
6565 * These events are handled by PeerManager::process_events if you are using a PeerManager.
6567 typedef enum LDKMessageSendEvent_Tag {
6569 * Used to indicate that we've accepted a channel open and should send the accept_channel
6570 * message provided to the given peer.
6572 LDKMessageSendEvent_SendAcceptChannel,
6574 * Used to indicate that we've accepted a V2 channel open and should send the accept_channel2
6575 * message provided to the given peer.
6577 LDKMessageSendEvent_SendAcceptChannelV2,
6579 * Used to indicate that we've initiated a channel open and should send the open_channel
6580 * message provided to the given peer.
6582 LDKMessageSendEvent_SendOpenChannel,
6584 * Used to indicate that we've initiated a V2 channel open and should send the open_channel2
6585 * message provided to the given peer.
6587 LDKMessageSendEvent_SendOpenChannelV2,
6589 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
6591 LDKMessageSendEvent_SendFundingCreated,
6593 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
6595 LDKMessageSendEvent_SendFundingSigned,
6597 * Used to indicate that a tx_add_input message should be sent to the peer with the given node_id.
6599 LDKMessageSendEvent_SendTxAddInput,
6601 * Used to indicate that a tx_add_output message should be sent to the peer with the given node_id.
6603 LDKMessageSendEvent_SendTxAddOutput,
6605 * Used to indicate that a tx_remove_input message should be sent to the peer with the given node_id.
6607 LDKMessageSendEvent_SendTxRemoveInput,
6609 * Used to indicate that a tx_remove_output message should be sent to the peer with the given node_id.
6611 LDKMessageSendEvent_SendTxRemoveOutput,
6613 * Used to indicate that a tx_complete message should be sent to the peer with the given node_id.
6615 LDKMessageSendEvent_SendTxComplete,
6617 * Used to indicate that a tx_signatures message should be sent to the peer with the given node_id.
6619 LDKMessageSendEvent_SendTxSignatures,
6621 * Used to indicate that a tx_init_rbf message should be sent to the peer with the given node_id.
6623 LDKMessageSendEvent_SendTxInitRbf,
6625 * Used to indicate that a tx_ack_rbf message should be sent to the peer with the given node_id.
6627 LDKMessageSendEvent_SendTxAckRbf,
6629 * Used to indicate that a tx_abort message should be sent to the peer with the given node_id.
6631 LDKMessageSendEvent_SendTxAbort,
6633 * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
6635 LDKMessageSendEvent_SendChannelReady,
6637 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
6639 LDKMessageSendEvent_SendAnnouncementSignatures,
6641 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
6642 * message should be sent to the peer with the given node_id.
6644 LDKMessageSendEvent_UpdateHTLCs,
6646 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
6648 LDKMessageSendEvent_SendRevokeAndACK,
6650 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
6652 LDKMessageSendEvent_SendClosingSigned,
6654 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
6656 LDKMessageSendEvent_SendShutdown,
6658 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
6660 LDKMessageSendEvent_SendChannelReestablish,
6662 * Used to send a channel_announcement and channel_update to a specific peer, likely on
6663 * initial connection to ensure our peers know about our channels.
6665 LDKMessageSendEvent_SendChannelAnnouncement,
6667 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
6668 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
6670 * Note that after doing so, you very likely (unless you did so very recently) want to
6671 * broadcast a node_announcement (e.g. via [`PeerManager::broadcast_node_announcement`]). This
6672 * ensures that any nodes which see our channel_announcement also have a relevant
6673 * node_announcement, including relevant feature flags which may be important for routing
6676 * [`PeerManager::broadcast_node_announcement`]: crate::ln::peer_handler::PeerManager::broadcast_node_announcement
6678 LDKMessageSendEvent_BroadcastChannelAnnouncement,
6680 * Used to indicate that a channel_update should be broadcast to all peers.
6682 LDKMessageSendEvent_BroadcastChannelUpdate,
6684 * Used to indicate that a node_announcement should be broadcast to all peers.
6686 LDKMessageSendEvent_BroadcastNodeAnnouncement,
6688 * Used to indicate that a channel_update should be sent to a single peer.
6689 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
6690 * private channel and we shouldn't be informing all of our peers of channel parameters.
6692 LDKMessageSendEvent_SendChannelUpdate,
6694 * Broadcast an error downstream to be handled
6696 LDKMessageSendEvent_HandleError,
6698 * Query a peer for channels with funding transaction UTXOs in a block range.
6700 LDKMessageSendEvent_SendChannelRangeQuery,
6702 * Request routing gossip messages from a peer for a list of channels identified by
6703 * their short_channel_ids.
6705 LDKMessageSendEvent_SendShortIdsQuery,
6707 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
6708 * emitted during processing of the query.
6710 LDKMessageSendEvent_SendReplyChannelRange,
6712 * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
6713 * enable receiving gossip messages from the peer.
6715 LDKMessageSendEvent_SendGossipTimestampFilter,
6717 * Must be last for serialization purposes
6719 LDKMessageSendEvent_Sentinel,
6720 } LDKMessageSendEvent_Tag;
6722 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
6724 * The node_id of the node which should receive this message
6726 struct LDKPublicKey node_id;
6728 * The message which should be sent.
6730 struct LDKAcceptChannel msg;
6731 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
6733 typedef struct LDKMessageSendEvent_LDKSendAcceptChannelV2_Body {
6735 * The node_id of the node which should receive this message
6737 struct LDKPublicKey node_id;
6739 * The message which should be sent.
6741 struct LDKAcceptChannelV2 msg;
6742 } LDKMessageSendEvent_LDKSendAcceptChannelV2_Body;
6744 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
6746 * The node_id of the node which should receive this message
6748 struct LDKPublicKey node_id;
6750 * The message which should be sent.
6752 struct LDKOpenChannel msg;
6753 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
6755 typedef struct LDKMessageSendEvent_LDKSendOpenChannelV2_Body {
6757 * The node_id of the node which should receive this message
6759 struct LDKPublicKey node_id;
6761 * The message which should be sent.
6763 struct LDKOpenChannelV2 msg;
6764 } LDKMessageSendEvent_LDKSendOpenChannelV2_Body;
6766 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
6768 * The node_id of the node which should receive this message
6770 struct LDKPublicKey node_id;
6772 * The message which should be sent.
6774 struct LDKFundingCreated msg;
6775 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
6777 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
6779 * The node_id of the node which should receive this message
6781 struct LDKPublicKey node_id;
6783 * The message which should be sent.
6785 struct LDKFundingSigned msg;
6786 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
6788 typedef struct LDKMessageSendEvent_LDKSendTxAddInput_Body {
6790 * The node_id of the node which should receive this message
6792 struct LDKPublicKey node_id;
6794 * The message which should be sent.
6796 struct LDKTxAddInput msg;
6797 } LDKMessageSendEvent_LDKSendTxAddInput_Body;
6799 typedef struct LDKMessageSendEvent_LDKSendTxAddOutput_Body {
6801 * The node_id of the node which should receive this message
6803 struct LDKPublicKey node_id;
6805 * The message which should be sent.
6807 struct LDKTxAddOutput msg;
6808 } LDKMessageSendEvent_LDKSendTxAddOutput_Body;
6810 typedef struct LDKMessageSendEvent_LDKSendTxRemoveInput_Body {
6812 * The node_id of the node which should receive this message
6814 struct LDKPublicKey node_id;
6816 * The message which should be sent.
6818 struct LDKTxRemoveInput msg;
6819 } LDKMessageSendEvent_LDKSendTxRemoveInput_Body;
6821 typedef struct LDKMessageSendEvent_LDKSendTxRemoveOutput_Body {
6823 * The node_id of the node which should receive this message
6825 struct LDKPublicKey node_id;
6827 * The message which should be sent.
6829 struct LDKTxRemoveOutput msg;
6830 } LDKMessageSendEvent_LDKSendTxRemoveOutput_Body;
6832 typedef struct LDKMessageSendEvent_LDKSendTxComplete_Body {
6834 * The node_id of the node which should receive this message
6836 struct LDKPublicKey node_id;
6838 * The message which should be sent.
6840 struct LDKTxComplete msg;
6841 } LDKMessageSendEvent_LDKSendTxComplete_Body;
6843 typedef struct LDKMessageSendEvent_LDKSendTxSignatures_Body {
6845 * The node_id of the node which should receive this message
6847 struct LDKPublicKey node_id;
6849 * The message which should be sent.
6851 struct LDKTxSignatures msg;
6852 } LDKMessageSendEvent_LDKSendTxSignatures_Body;
6854 typedef struct LDKMessageSendEvent_LDKSendTxInitRbf_Body {
6856 * The node_id of the node which should receive this message
6858 struct LDKPublicKey node_id;
6860 * The message which should be sent.
6862 struct LDKTxInitRbf msg;
6863 } LDKMessageSendEvent_LDKSendTxInitRbf_Body;
6865 typedef struct LDKMessageSendEvent_LDKSendTxAckRbf_Body {
6867 * The node_id of the node which should receive this message
6869 struct LDKPublicKey node_id;
6871 * The message which should be sent.
6873 struct LDKTxAckRbf msg;
6874 } LDKMessageSendEvent_LDKSendTxAckRbf_Body;
6876 typedef struct LDKMessageSendEvent_LDKSendTxAbort_Body {
6878 * The node_id of the node which should receive this message
6880 struct LDKPublicKey node_id;
6882 * The message which should be sent.
6884 struct LDKTxAbort msg;
6885 } LDKMessageSendEvent_LDKSendTxAbort_Body;
6887 typedef struct LDKMessageSendEvent_LDKSendChannelReady_Body {
6889 * The node_id of the node which should receive these message(s)
6891 struct LDKPublicKey node_id;
6893 * The channel_ready message which should be sent.
6895 struct LDKChannelReady msg;
6896 } LDKMessageSendEvent_LDKSendChannelReady_Body;
6898 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
6900 * The node_id of the node which should receive these message(s)
6902 struct LDKPublicKey node_id;
6904 * The announcement_signatures message which should be sent.
6906 struct LDKAnnouncementSignatures msg;
6907 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
6909 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
6911 * The node_id of the node which should receive these message(s)
6913 struct LDKPublicKey node_id;
6915 * The update messages which should be sent. ALL messages in the struct should be sent!
6917 struct LDKCommitmentUpdate updates;
6918 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
6920 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
6922 * The node_id of the node which should receive this message
6924 struct LDKPublicKey node_id;
6926 * The message which should be sent.
6928 struct LDKRevokeAndACK msg;
6929 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
6931 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
6933 * The node_id of the node which should receive this message
6935 struct LDKPublicKey node_id;
6937 * The message which should be sent.
6939 struct LDKClosingSigned msg;
6940 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
6942 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
6944 * The node_id of the node which should receive this message
6946 struct LDKPublicKey node_id;
6948 * The message which should be sent.
6950 struct LDKShutdown msg;
6951 } LDKMessageSendEvent_LDKSendShutdown_Body;
6953 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
6955 * The node_id of the node which should receive this message
6957 struct LDKPublicKey node_id;
6959 * The message which should be sent.
6961 struct LDKChannelReestablish msg;
6962 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
6964 typedef struct LDKMessageSendEvent_LDKSendChannelAnnouncement_Body {
6966 * The node_id of the node which should receive this message
6968 struct LDKPublicKey node_id;
6970 * The channel_announcement which should be sent.
6972 struct LDKChannelAnnouncement msg;
6974 * The followup channel_update which should be sent.
6976 struct LDKChannelUpdate update_msg;
6977 } LDKMessageSendEvent_LDKSendChannelAnnouncement_Body;
6979 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
6981 * The channel_announcement which should be sent.
6983 struct LDKChannelAnnouncement msg;
6985 * The followup channel_update which should be sent.
6987 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
6989 struct LDKChannelUpdate update_msg;
6990 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
6992 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
6994 * The channel_update which should be sent.
6996 struct LDKChannelUpdate msg;
6997 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
6999 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
7001 * The node_announcement which should be sent.
7003 struct LDKNodeAnnouncement msg;
7004 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
7006 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
7008 * The node_id of the node which should receive this message
7010 struct LDKPublicKey node_id;
7012 * The channel_update which should be sent.
7014 struct LDKChannelUpdate msg;
7015 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
7017 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
7019 * The node_id of the node which should receive this message
7021 struct LDKPublicKey node_id;
7023 * The action which should be taken.
7025 struct LDKErrorAction action;
7026 } LDKMessageSendEvent_LDKHandleError_Body;
7028 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
7030 * The node_id of this message recipient
7032 struct LDKPublicKey node_id;
7034 * The query_channel_range which should be sent.
7036 struct LDKQueryChannelRange msg;
7037 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
7039 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
7041 * The node_id of this message recipient
7043 struct LDKPublicKey node_id;
7045 * The query_short_channel_ids which should be sent.
7047 struct LDKQueryShortChannelIds msg;
7048 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
7050 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
7052 * The node_id of this message recipient
7054 struct LDKPublicKey node_id;
7056 * The reply_channel_range which should be sent.
7058 struct LDKReplyChannelRange msg;
7059 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
7061 typedef struct LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body {
7063 * The node_id of this message recipient
7065 struct LDKPublicKey node_id;
7067 * The gossip_timestamp_filter which should be sent.
7069 struct LDKGossipTimestampFilter msg;
7070 } LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body;
7072 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
7073 LDKMessageSendEvent_Tag tag;
7075 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
7076 LDKMessageSendEvent_LDKSendAcceptChannelV2_Body send_accept_channel_v2;
7077 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
7078 LDKMessageSendEvent_LDKSendOpenChannelV2_Body send_open_channel_v2;
7079 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
7080 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
7081 LDKMessageSendEvent_LDKSendTxAddInput_Body send_tx_add_input;
7082 LDKMessageSendEvent_LDKSendTxAddOutput_Body send_tx_add_output;
7083 LDKMessageSendEvent_LDKSendTxRemoveInput_Body send_tx_remove_input;
7084 LDKMessageSendEvent_LDKSendTxRemoveOutput_Body send_tx_remove_output;
7085 LDKMessageSendEvent_LDKSendTxComplete_Body send_tx_complete;
7086 LDKMessageSendEvent_LDKSendTxSignatures_Body send_tx_signatures;
7087 LDKMessageSendEvent_LDKSendTxInitRbf_Body send_tx_init_rbf;
7088 LDKMessageSendEvent_LDKSendTxAckRbf_Body send_tx_ack_rbf;
7089 LDKMessageSendEvent_LDKSendTxAbort_Body send_tx_abort;
7090 LDKMessageSendEvent_LDKSendChannelReady_Body send_channel_ready;
7091 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
7092 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
7093 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
7094 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
7095 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
7096 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
7097 LDKMessageSendEvent_LDKSendChannelAnnouncement_Body send_channel_announcement;
7098 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
7099 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
7100 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
7101 LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
7102 LDKMessageSendEvent_LDKHandleError_Body handle_error;
7103 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
7104 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
7105 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
7106 LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body send_gossip_timestamp_filter;
7108 } LDKMessageSendEvent;
7111 * A dynamically-allocated array of crate::lightning::events::MessageSendEvents of arbitrary size.
7112 * This corresponds to std::vector in C++
7114 typedef struct LDKCVec_MessageSendEventZ {
7116 * The elements in the array.
7117 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7119 struct LDKMessageSendEvent *data;
7121 * The number of elements pointed to by `data`.
7124 } LDKCVec_MessageSendEventZ;
7129 * Details about one direction of a channel as received within a [`ChannelUpdate`].
7131 typedef struct MUST_USE_STRUCT LDKChannelUpdateInfo {
7133 * A pointer to the opaque Rust object.
7134 * Nearly everywhere, inner must be non-null, however in places where
7135 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7137 LDKnativeChannelUpdateInfo *inner;
7139 * Indicates that this is the only struct which contains the same pointer.
7140 * Rust functions which take ownership of an object provided via an argument require
7141 * this to be true and invalidate the object pointed to by inner.
7144 } LDKChannelUpdateInfo;
7147 * The contents of CResult_ChannelUpdateInfoDecodeErrorZ
7149 typedef union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr {
7151 * A pointer to the contents in the success state.
7152 * Reading from this pointer when `result_ok` is not set is undefined.
7154 struct LDKChannelUpdateInfo *result;
7156 * A pointer to the contents in the error state.
7157 * Reading from this pointer when `result_ok` is set is undefined.
7159 struct LDKDecodeError *err;
7160 } LDKCResult_ChannelUpdateInfoDecodeErrorZPtr;
7163 * A CResult_ChannelUpdateInfoDecodeErrorZ represents the result of a fallible operation,
7164 * containing a crate::lightning::routing::gossip::ChannelUpdateInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7165 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7167 typedef struct LDKCResult_ChannelUpdateInfoDecodeErrorZ {
7169 * The contents of this CResult_ChannelUpdateInfoDecodeErrorZ, accessible via either
7170 * `err` or `result` depending on the state of `result_ok`.
7172 union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr contents;
7174 * Whether this CResult_ChannelUpdateInfoDecodeErrorZ represents a success state.
7177 } LDKCResult_ChannelUpdateInfoDecodeErrorZ;
7182 * Details about a channel (both directions).
7183 * Received within a channel announcement.
7185 typedef struct MUST_USE_STRUCT LDKChannelInfo {
7187 * A pointer to the opaque Rust object.
7188 * Nearly everywhere, inner must be non-null, however in places where
7189 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7191 LDKnativeChannelInfo *inner;
7193 * Indicates that this is the only struct which contains the same pointer.
7194 * Rust functions which take ownership of an object provided via an argument require
7195 * this to be true and invalidate the object pointed to by inner.
7201 * The contents of CResult_ChannelInfoDecodeErrorZ
7203 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
7205 * A pointer to the contents in the success state.
7206 * Reading from this pointer when `result_ok` is not set is undefined.
7208 struct LDKChannelInfo *result;
7210 * A pointer to the contents in the error state.
7211 * Reading from this pointer when `result_ok` is set is undefined.
7213 struct LDKDecodeError *err;
7214 } LDKCResult_ChannelInfoDecodeErrorZPtr;
7217 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
7218 * containing a crate::lightning::routing::gossip::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7219 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7221 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
7223 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
7224 * `err` or `result` depending on the state of `result_ok`.
7226 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
7228 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
7231 } LDKCResult_ChannelInfoDecodeErrorZ;
7236 * Fees for routing via a given channel or a node
7238 typedef struct MUST_USE_STRUCT LDKRoutingFees {
7240 * A pointer to the opaque Rust object.
7241 * Nearly everywhere, inner must be non-null, however in places where
7242 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7244 LDKnativeRoutingFees *inner;
7246 * Indicates that this is the only struct which contains the same pointer.
7247 * Rust functions which take ownership of an object provided via an argument require
7248 * this to be true and invalidate the object pointed to by inner.
7254 * The contents of CResult_RoutingFeesDecodeErrorZ
7256 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
7258 * A pointer to the contents in the success state.
7259 * Reading from this pointer when `result_ok` is not set is undefined.
7261 struct LDKRoutingFees *result;
7263 * A pointer to the contents in the error state.
7264 * Reading from this pointer when `result_ok` is set is undefined.
7266 struct LDKDecodeError *err;
7267 } LDKCResult_RoutingFeesDecodeErrorZPtr;
7270 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
7271 * containing a crate::lightning::routing::gossip::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
7272 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7274 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
7276 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
7277 * `err` or `result` depending on the state of `result_ok`.
7279 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
7281 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
7284 } LDKCResult_RoutingFeesDecodeErrorZ;
7287 * A 4-byte byte array.
7289 typedef struct LDKFourBytes {
7297 * A 12-byte byte array.
7299 typedef struct LDKTwelveBytes {
7309 * Represents a hostname for serialization purposes.
7310 * Only the character set and length will be validated.
7311 * The character set consists of ASCII alphanumeric characters, hyphens, and periods.
7312 * Its length is guaranteed to be representable by a single byte.
7313 * This serialization is used by [`BOLT 7`] hostnames.
7315 * [`BOLT 7`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md
7317 typedef struct MUST_USE_STRUCT LDKHostname {
7319 * A pointer to the opaque Rust object.
7320 * Nearly everywhere, inner must be non-null, however in places where
7321 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7323 LDKnativeHostname *inner;
7325 * Indicates that this is the only struct which contains the same pointer.
7326 * Rust functions which take ownership of an object provided via an argument require
7327 * this to be true and invalidate the object pointed to by inner.
7333 * An address which can be used to connect to a remote peer.
7335 typedef enum LDKSocketAddress_Tag {
7337 * An IPv4 address and port on which the peer is listening.
7339 LDKSocketAddress_TcpIpV4,
7341 * An IPv6 address and port on which the peer is listening.
7343 LDKSocketAddress_TcpIpV6,
7345 * An old-style Tor onion address/port on which the peer is listening.
7347 * This field is deprecated and the Tor network generally no longer supports V2 Onion
7348 * addresses. Thus, the details are not parsed here.
7350 LDKSocketAddress_OnionV2,
7352 * A new-style Tor onion address/port on which the peer is listening.
7354 * To create the human-readable \"hostname\", concatenate the ED25519 pubkey, checksum, and version,
7355 * wrap as base32 and append \".onion\".
7357 LDKSocketAddress_OnionV3,
7359 * A hostname/port on which the peer is listening.
7361 LDKSocketAddress_Hostname,
7363 * Must be last for serialization purposes
7365 LDKSocketAddress_Sentinel,
7366 } LDKSocketAddress_Tag;
7368 typedef struct LDKSocketAddress_LDKTcpIpV4_Body {
7370 * The 4-byte IPv4 address
7372 struct LDKFourBytes addr;
7374 * The port on which the node is listening
7377 } LDKSocketAddress_LDKTcpIpV4_Body;
7379 typedef struct LDKSocketAddress_LDKTcpIpV6_Body {
7381 * The 16-byte IPv6 address
7383 struct LDKSixteenBytes addr;
7385 * The port on which the node is listening
7388 } LDKSocketAddress_LDKTcpIpV6_Body;
7390 typedef struct LDKSocketAddress_LDKOnionV3_Body {
7392 * The ed25519 long-term public key of the peer
7394 struct LDKThirtyTwoBytes ed25519_pubkey;
7396 * The checksum of the pubkey and version, as included in the onion address
7400 * The version byte, as defined by the Tor Onion v3 spec.
7404 * The port on which the node is listening
7407 } LDKSocketAddress_LDKOnionV3_Body;
7409 typedef struct LDKSocketAddress_LDKHostname_Body {
7411 * The hostname on which the node is listening.
7413 struct LDKHostname hostname;
7415 * The port on which the node is listening.
7418 } LDKSocketAddress_LDKHostname_Body;
7420 typedef struct MUST_USE_STRUCT LDKSocketAddress {
7421 LDKSocketAddress_Tag tag;
7423 LDKSocketAddress_LDKTcpIpV4_Body tcp_ip_v4;
7424 LDKSocketAddress_LDKTcpIpV6_Body tcp_ip_v6;
7426 struct LDKTwelveBytes onion_v2;
7428 LDKSocketAddress_LDKOnionV3_Body onion_v3;
7429 LDKSocketAddress_LDKHostname_Body hostname;
7434 * A dynamically-allocated array of crate::lightning::ln::msgs::SocketAddresss of arbitrary size.
7435 * This corresponds to std::vector in C++
7437 typedef struct LDKCVec_SocketAddressZ {
7439 * The elements in the array.
7440 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7442 struct LDKSocketAddress *data;
7444 * The number of elements pointed to by `data`.
7447 } LDKCVec_SocketAddressZ;
7452 * Information received in the latest node_announcement from this node.
7454 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
7456 * A pointer to the opaque Rust object.
7457 * Nearly everywhere, inner must be non-null, however in places where
7458 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7460 LDKnativeNodeAnnouncementInfo *inner;
7462 * Indicates that this is the only struct which contains the same pointer.
7463 * Rust functions which take ownership of an object provided via an argument require
7464 * this to be true and invalidate the object pointed to by inner.
7467 } LDKNodeAnnouncementInfo;
7470 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
7472 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
7474 * A pointer to the contents in the success state.
7475 * Reading from this pointer when `result_ok` is not set is undefined.
7477 struct LDKNodeAnnouncementInfo *result;
7479 * A pointer to the contents in the error state.
7480 * Reading from this pointer when `result_ok` is set is undefined.
7482 struct LDKDecodeError *err;
7483 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
7486 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
7487 * containing a crate::lightning::routing::gossip::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7488 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7490 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
7492 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
7493 * `err` or `result` depending on the state of `result_ok`.
7495 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
7497 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
7500 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
7505 * A user-defined name for a node, which may be used when displaying the node in a graph.
7507 * Since node aliases are provided by third parties, they are a potential avenue for injection
7508 * attacks. Care must be taken when processing.
7510 typedef struct MUST_USE_STRUCT LDKNodeAlias {
7512 * A pointer to the opaque Rust object.
7513 * Nearly everywhere, inner must be non-null, however in places where
7514 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7516 LDKnativeNodeAlias *inner;
7518 * Indicates that this is the only struct which contains the same pointer.
7519 * Rust functions which take ownership of an object provided via an argument require
7520 * this to be true and invalidate the object pointed to by inner.
7526 * The contents of CResult_NodeAliasDecodeErrorZ
7528 typedef union LDKCResult_NodeAliasDecodeErrorZPtr {
7530 * A pointer to the contents in the success state.
7531 * Reading from this pointer when `result_ok` is not set is undefined.
7533 struct LDKNodeAlias *result;
7535 * A pointer to the contents in the error state.
7536 * Reading from this pointer when `result_ok` is set is undefined.
7538 struct LDKDecodeError *err;
7539 } LDKCResult_NodeAliasDecodeErrorZPtr;
7542 * A CResult_NodeAliasDecodeErrorZ represents the result of a fallible operation,
7543 * containing a crate::lightning::routing::gossip::NodeAlias on success and a crate::lightning::ln::msgs::DecodeError on failure.
7544 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7546 typedef struct LDKCResult_NodeAliasDecodeErrorZ {
7548 * The contents of this CResult_NodeAliasDecodeErrorZ, accessible via either
7549 * `err` or `result` depending on the state of `result_ok`.
7551 union LDKCResult_NodeAliasDecodeErrorZPtr contents;
7553 * Whether this CResult_NodeAliasDecodeErrorZ represents a success state.
7556 } LDKCResult_NodeAliasDecodeErrorZ;
7561 * Details about a node in the network, known from the network announcement.
7563 typedef struct MUST_USE_STRUCT LDKNodeInfo {
7565 * A pointer to the opaque Rust object.
7566 * Nearly everywhere, inner must be non-null, however in places where
7567 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7569 LDKnativeNodeInfo *inner;
7571 * Indicates that this is the only struct which contains the same pointer.
7572 * Rust functions which take ownership of an object provided via an argument require
7573 * this to be true and invalidate the object pointed to by inner.
7579 * The contents of CResult_NodeInfoDecodeErrorZ
7581 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
7583 * A pointer to the contents in the success state.
7584 * Reading from this pointer when `result_ok` is not set is undefined.
7586 struct LDKNodeInfo *result;
7588 * A pointer to the contents in the error state.
7589 * Reading from this pointer when `result_ok` is set is undefined.
7591 struct LDKDecodeError *err;
7592 } LDKCResult_NodeInfoDecodeErrorZPtr;
7595 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
7596 * containing a crate::lightning::routing::gossip::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7597 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7599 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
7601 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
7602 * `err` or `result` depending on the state of `result_ok`.
7604 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
7606 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
7609 } LDKCResult_NodeInfoDecodeErrorZ;
7612 * The contents of CResult_NetworkGraphDecodeErrorZ
7614 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
7616 * A pointer to the contents in the success state.
7617 * Reading from this pointer when `result_ok` is not set is undefined.
7619 struct LDKNetworkGraph *result;
7621 * A pointer to the contents in the error state.
7622 * Reading from this pointer when `result_ok` is set is undefined.
7624 struct LDKDecodeError *err;
7625 } LDKCResult_NetworkGraphDecodeErrorZPtr;
7628 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
7629 * containing a crate::lightning::routing::gossip::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
7630 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7632 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
7634 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
7635 * `err` or `result` depending on the state of `result_ok`.
7637 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
7639 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
7642 } LDKCResult_NetworkGraphDecodeErrorZ;
7645 * An enum which can either contain a crate::c_types::derived::CVec_SocketAddressZ or not
7647 typedef enum LDKCOption_CVec_SocketAddressZZ_Tag {
7649 * When we're in this state, this COption_CVec_SocketAddressZZ contains a crate::c_types::derived::CVec_SocketAddressZ
7651 LDKCOption_CVec_SocketAddressZZ_Some,
7653 * When we're in this state, this COption_CVec_SocketAddressZZ contains nothing
7655 LDKCOption_CVec_SocketAddressZZ_None,
7657 * Must be last for serialization purposes
7659 LDKCOption_CVec_SocketAddressZZ_Sentinel,
7660 } LDKCOption_CVec_SocketAddressZZ_Tag;
7662 typedef struct LDKCOption_CVec_SocketAddressZZ {
7663 LDKCOption_CVec_SocketAddressZZ_Tag tag;
7666 struct LDKCVec_SocketAddressZ some;
7669 } LDKCOption_CVec_SocketAddressZZ;
7672 * A dynamically-allocated array of crate::lightning::ln::chan_utils::HTLCOutputInCommitments of arbitrary size.
7673 * This corresponds to std::vector in C++
7675 typedef struct LDKCVec_HTLCOutputInCommitmentZ {
7677 * The elements in the array.
7678 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7680 struct LDKHTLCOutputInCommitment *data;
7682 * The number of elements pointed to by `data`.
7685 } LDKCVec_HTLCOutputInCommitmentZ;
7688 * A dynamically-allocated array of crate::lightning::sign::HTLCDescriptors of arbitrary size.
7689 * This corresponds to std::vector in C++
7691 typedef struct LDKCVec_HTLCDescriptorZ {
7693 * The elements in the array.
7694 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7696 struct LDKHTLCDescriptor *data;
7698 * The number of elements pointed to by `data`.
7701 } LDKCVec_HTLCDescriptorZ;
7706 * An unspent transaction output that is available to spend resulting from a successful
7707 * [`CoinSelection`] attempt.
7709 typedef struct MUST_USE_STRUCT LDKUtxo {
7711 * A pointer to the opaque Rust object.
7712 * Nearly everywhere, inner must be non-null, however in places where
7713 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7715 LDKnativeUtxo *inner;
7717 * Indicates that this is the only struct which contains the same pointer.
7718 * Rust functions which take ownership of an object provided via an argument require
7719 * this to be true and invalidate the object pointed to by inner.
7725 * A dynamically-allocated array of crate::lightning::events::bump_transaction::Utxos of arbitrary size.
7726 * This corresponds to std::vector in C++
7728 typedef struct LDKCVec_UtxoZ {
7730 * The elements in the array.
7731 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7733 struct LDKUtxo *data;
7735 * The number of elements pointed to by `data`.
7741 * An enum which can either contain a crate::c_types::TxOut or not
7743 typedef enum LDKCOption_TxOutZ_Tag {
7745 * When we're in this state, this COption_TxOutZ contains a crate::c_types::TxOut
7747 LDKCOption_TxOutZ_Some,
7749 * When we're in this state, this COption_TxOutZ contains nothing
7751 LDKCOption_TxOutZ_None,
7753 * Must be last for serialization purposes
7755 LDKCOption_TxOutZ_Sentinel,
7756 } LDKCOption_TxOutZ_Tag;
7758 typedef struct LDKCOption_TxOutZ {
7759 LDKCOption_TxOutZ_Tag tag;
7762 struct LDKTxOut some;
7765 } LDKCOption_TxOutZ;
7770 * An input that must be included in a transaction when performing coin selection through
7771 * [`CoinSelectionSource::select_confirmed_utxos`]. It is guaranteed to be a SegWit input, so it
7772 * must have an empty [`TxIn::script_sig`] when spent.
7774 typedef struct MUST_USE_STRUCT LDKInput {
7776 * A pointer to the opaque Rust object.
7777 * Nearly everywhere, inner must be non-null, however in places where
7778 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7780 LDKnativeInput *inner;
7782 * Indicates that this is the only struct which contains the same pointer.
7783 * Rust functions which take ownership of an object provided via an argument require
7784 * this to be true and invalidate the object pointed to by inner.
7790 * A dynamically-allocated array of crate::lightning::events::bump_transaction::Inputs of arbitrary size.
7791 * This corresponds to std::vector in C++
7793 typedef struct LDKCVec_InputZ {
7795 * The elements in the array.
7796 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7798 struct LDKInput *data;
7800 * The number of elements pointed to by `data`.
7808 * The result of a successful coin selection attempt for a transaction requiring additional UTXOs
7809 * to cover its fees.
7811 typedef struct MUST_USE_STRUCT LDKCoinSelection {
7813 * A pointer to the opaque Rust object.
7814 * Nearly everywhere, inner must be non-null, however in places where
7815 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7817 LDKnativeCoinSelection *inner;
7819 * Indicates that this is the only struct which contains the same pointer.
7820 * Rust functions which take ownership of an object provided via an argument require
7821 * this to be true and invalidate the object pointed to by inner.
7827 * The contents of CResult_CoinSelectionNoneZ
7829 typedef union LDKCResult_CoinSelectionNoneZPtr {
7831 * A pointer to the contents in the success state.
7832 * Reading from this pointer when `result_ok` is not set is undefined.
7834 struct LDKCoinSelection *result;
7836 * Note that this value is always NULL, as there are no contents in the Err variant
7839 } LDKCResult_CoinSelectionNoneZPtr;
7842 * A CResult_CoinSelectionNoneZ represents the result of a fallible operation,
7843 * containing a crate::lightning::events::bump_transaction::CoinSelection on success and a () on failure.
7844 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7846 typedef struct LDKCResult_CoinSelectionNoneZ {
7848 * The contents of this CResult_CoinSelectionNoneZ, accessible via either
7849 * `err` or `result` depending on the state of `result_ok`.
7851 union LDKCResult_CoinSelectionNoneZPtr contents;
7853 * Whether this CResult_CoinSelectionNoneZ represents a success state.
7856 } LDKCResult_CoinSelectionNoneZ;
7859 * The contents of CResult_CVec_UtxoZNoneZ
7861 typedef union LDKCResult_CVec_UtxoZNoneZPtr {
7863 * A pointer to the contents in the success state.
7864 * Reading from this pointer when `result_ok` is not set is undefined.
7866 struct LDKCVec_UtxoZ *result;
7868 * Note that this value is always NULL, as there are no contents in the Err variant
7871 } LDKCResult_CVec_UtxoZNoneZPtr;
7874 * A CResult_CVec_UtxoZNoneZ represents the result of a fallible operation,
7875 * containing a crate::c_types::derived::CVec_UtxoZ on success and a () on failure.
7876 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7878 typedef struct LDKCResult_CVec_UtxoZNoneZ {
7880 * The contents of this CResult_CVec_UtxoZNoneZ, accessible via either
7881 * `err` or `result` depending on the state of `result_ok`.
7883 union LDKCResult_CVec_UtxoZNoneZPtr contents;
7885 * Whether this CResult_CVec_UtxoZNoneZ represents a success state.
7888 } LDKCResult_CVec_UtxoZNoneZ;
7891 * A tuple of 2 elements. See the individual fields for the types contained.
7893 typedef struct LDKC2Tuple_u64u16Z {
7895 * The element at position 0
7899 * The element at position 1
7902 } LDKC2Tuple_u64u16Z;
7905 * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u16Z or not
7907 typedef enum LDKCOption_C2Tuple_u64u16ZZ_Tag {
7909 * When we're in this state, this COption_C2Tuple_u64u16ZZ contains a crate::c_types::derived::C2Tuple_u64u16Z
7911 LDKCOption_C2Tuple_u64u16ZZ_Some,
7913 * When we're in this state, this COption_C2Tuple_u64u16ZZ contains nothing
7915 LDKCOption_C2Tuple_u64u16ZZ_None,
7917 * Must be last for serialization purposes
7919 LDKCOption_C2Tuple_u64u16ZZ_Sentinel,
7920 } LDKCOption_C2Tuple_u64u16ZZ_Tag;
7922 typedef struct LDKCOption_C2Tuple_u64u16ZZ {
7923 LDKCOption_C2Tuple_u64u16ZZ_Tag tag;
7926 struct LDKC2Tuple_u64u16Z some;
7929 } LDKCOption_C2Tuple_u64u16ZZ;
7932 * An enum which can either contain a crate::lightning::ln::channelmanager::ChannelShutdownState or not
7934 typedef enum LDKCOption_ChannelShutdownStateZ_Tag {
7936 * When we're in this state, this COption_ChannelShutdownStateZ contains a crate::lightning::ln::channelmanager::ChannelShutdownState
7938 LDKCOption_ChannelShutdownStateZ_Some,
7940 * When we're in this state, this COption_ChannelShutdownStateZ contains nothing
7942 LDKCOption_ChannelShutdownStateZ_None,
7944 * Must be last for serialization purposes
7946 LDKCOption_ChannelShutdownStateZ_Sentinel,
7947 } LDKCOption_ChannelShutdownStateZ_Tag;
7949 typedef struct LDKCOption_ChannelShutdownStateZ {
7950 LDKCOption_ChannelShutdownStateZ_Tag tag;
7953 enum LDKChannelShutdownState some;
7956 } LDKCOption_ChannelShutdownStateZ;
7959 * The contents of CResult_ThirtyTwoBytesAPIErrorZ
7961 typedef union LDKCResult_ThirtyTwoBytesAPIErrorZPtr {
7963 * A pointer to the contents in the success state.
7964 * Reading from this pointer when `result_ok` is not set is undefined.
7966 struct LDKThirtyTwoBytes *result;
7968 * A pointer to the contents in the error state.
7969 * Reading from this pointer when `result_ok` is set is undefined.
7971 struct LDKAPIError *err;
7972 } LDKCResult_ThirtyTwoBytesAPIErrorZPtr;
7975 * A CResult_ThirtyTwoBytesAPIErrorZ represents the result of a fallible operation,
7976 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7977 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7979 typedef struct LDKCResult_ThirtyTwoBytesAPIErrorZ {
7981 * The contents of this CResult_ThirtyTwoBytesAPIErrorZ, accessible via either
7982 * `err` or `result` depending on the state of `result_ok`.
7984 union LDKCResult_ThirtyTwoBytesAPIErrorZPtr contents;
7986 * Whether this CResult_ThirtyTwoBytesAPIErrorZ represents a success state.
7989 } LDKCResult_ThirtyTwoBytesAPIErrorZ;
7992 * Used by [`ChannelManager::list_recent_payments`] to express the status of recent payments.
7993 * These include payments that have yet to find a successful path, or have unresolved HTLCs.
7995 typedef enum LDKRecentPaymentDetails_Tag {
7997 * When an invoice was requested and thus a payment has not yet been sent.
7999 LDKRecentPaymentDetails_AwaitingInvoice,
8001 * When a payment is still being sent and awaiting successful delivery.
8003 LDKRecentPaymentDetails_Pending,
8005 * When a pending payment is fulfilled, we continue tracking it until all pending HTLCs have
8006 * been resolved. Upon receiving [`Event::PaymentSent`], we delay for a few minutes before the
8007 * payment is removed from tracking.
8009 LDKRecentPaymentDetails_Fulfilled,
8011 * After a payment's retries are exhausted per the provided [`Retry`], or it is explicitly
8012 * abandoned via [`ChannelManager::abandon_payment`], it is marked as abandoned until all
8013 * pending HTLCs for this payment resolve and an [`Event::PaymentFailed`] is generated.
8015 LDKRecentPaymentDetails_Abandoned,
8017 * Must be last for serialization purposes
8019 LDKRecentPaymentDetails_Sentinel,
8020 } LDKRecentPaymentDetails_Tag;
8022 typedef struct LDKRecentPaymentDetails_LDKAwaitingInvoice_Body {
8024 * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
8025 * a payment and ensure idempotency in LDK.
8027 struct LDKThirtyTwoBytes payment_id;
8028 } LDKRecentPaymentDetails_LDKAwaitingInvoice_Body;
8030 typedef struct LDKRecentPaymentDetails_LDKPending_Body {
8032 * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
8033 * a payment and ensure idempotency in LDK.
8035 struct LDKThirtyTwoBytes payment_id;
8037 * Hash of the payment that is currently being sent but has yet to be fulfilled or
8040 struct LDKThirtyTwoBytes payment_hash;
8042 * Total amount (in msat, excluding fees) across all paths for this payment,
8043 * not just the amount currently inflight.
8045 uint64_t total_msat;
8046 } LDKRecentPaymentDetails_LDKPending_Body;
8048 typedef struct LDKRecentPaymentDetails_LDKFulfilled_Body {
8050 * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
8051 * a payment and ensure idempotency in LDK.
8053 struct LDKThirtyTwoBytes payment_id;
8055 * Hash of the payment that was claimed. `None` for serializations of [`ChannelManager`]
8056 * made before LDK version 0.0.104.
8058 struct LDKCOption_ThirtyTwoBytesZ payment_hash;
8059 } LDKRecentPaymentDetails_LDKFulfilled_Body;
8061 typedef struct LDKRecentPaymentDetails_LDKAbandoned_Body {
8063 * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
8064 * a payment and ensure idempotency in LDK.
8066 struct LDKThirtyTwoBytes payment_id;
8068 * Hash of the payment that we have given up trying to send.
8070 struct LDKThirtyTwoBytes payment_hash;
8071 } LDKRecentPaymentDetails_LDKAbandoned_Body;
8073 typedef struct MUST_USE_STRUCT LDKRecentPaymentDetails {
8074 LDKRecentPaymentDetails_Tag tag;
8076 LDKRecentPaymentDetails_LDKAwaitingInvoice_Body awaiting_invoice;
8077 LDKRecentPaymentDetails_LDKPending_Body pending;
8078 LDKRecentPaymentDetails_LDKFulfilled_Body fulfilled;
8079 LDKRecentPaymentDetails_LDKAbandoned_Body abandoned;
8081 } LDKRecentPaymentDetails;
8084 * A dynamically-allocated array of crate::lightning::ln::channelmanager::RecentPaymentDetailss of arbitrary size.
8085 * This corresponds to std::vector in C++
8087 typedef struct LDKCVec_RecentPaymentDetailsZ {
8089 * The elements in the array.
8090 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8092 struct LDKRecentPaymentDetails *data;
8094 * The number of elements pointed to by `data`.
8097 } LDKCVec_RecentPaymentDetailsZ;
8100 * If a payment fails to send with [`ChannelManager::send_payment_with_route`], it can be in one
8101 * of several states. This enum is returned as the Err() type describing which state the payment
8102 * is in, see the description of individual enum states for more.
8104 * [`ChannelManager::send_payment_with_route`]: crate::ln::channelmanager::ChannelManager::send_payment_with_route
8106 typedef enum LDKPaymentSendFailure_Tag {
8108 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
8109 * send the payment at all.
8111 * You can freely resend the payment in full (with the parameter error fixed).
8113 * Because the payment failed outright, no payment tracking is done and no
8114 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
8116 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
8117 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8119 LDKPaymentSendFailure_ParameterError,
8121 * A parameter in a single path which was passed to send_payment was invalid, preventing us
8122 * from attempting to send the payment at all.
8124 * You can freely resend the payment in full (with the parameter error fixed).
8126 * Because the payment failed outright, no payment tracking is done and no
8127 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
8129 * The results here are ordered the same as the paths in the route object which was passed to
8132 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
8133 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8135 LDKPaymentSendFailure_PathParameterError,
8137 * All paths which were attempted failed to send, with no channel state change taking place.
8138 * You can freely resend the payment in full (though you probably want to do so over different
8139 * paths than the ones selected).
8141 * Because the payment failed outright, no payment tracking is done and no
8142 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
8144 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
8145 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8147 LDKPaymentSendFailure_AllFailedResendSafe,
8149 * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
8150 * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
8152 * [`PaymentId`]: crate::ln::channelmanager::PaymentId
8153 * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
8154 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8156 LDKPaymentSendFailure_DuplicatePayment,
8158 * Some paths that were attempted failed to send, though some paths may have succeeded. At least
8159 * some paths have irrevocably committed to the HTLC.
8161 * The results here are ordered the same as the paths in the route object that was passed to
8164 * Any entries that contain `Err(APIError::MonitorUpdateInprogress)` will send once a
8165 * [`MonitorEvent::Completed`] is provided for the next-hop channel with the latest update_id.
8167 * [`MonitorEvent::Completed`]: crate::chain::channelmonitor::MonitorEvent::Completed
8169 LDKPaymentSendFailure_PartialFailure,
8171 * Must be last for serialization purposes
8173 LDKPaymentSendFailure_Sentinel,
8174 } LDKPaymentSendFailure_Tag;
8176 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
8178 * The errors themselves, in the same order as the paths from the route.
8180 struct LDKCVec_CResult_NoneAPIErrorZZ results;
8182 * If some paths failed without irrevocably committing to the new HTLC(s), this will
8183 * contain a [`RouteParameters`] object for the failing paths.
8185 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
8187 struct LDKRouteParameters failed_paths_retry;
8189 * The payment id for the payment, which is now at least partially pending.
8191 struct LDKThirtyTwoBytes payment_id;
8192 } LDKPaymentSendFailure_LDKPartialFailure_Body;
8194 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
8195 LDKPaymentSendFailure_Tag tag;
8198 struct LDKAPIError parameter_error;
8201 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
8204 struct LDKCVec_APIErrorZ all_failed_resend_safe;
8206 LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
8208 } LDKPaymentSendFailure;
8211 * The contents of CResult_NonePaymentSendFailureZ
8213 typedef union LDKCResult_NonePaymentSendFailureZPtr {
8215 * Note that this value is always NULL, as there are no contents in the OK variant
8219 * A pointer to the contents in the error state.
8220 * Reading from this pointer when `result_ok` is set is undefined.
8222 struct LDKPaymentSendFailure *err;
8223 } LDKCResult_NonePaymentSendFailureZPtr;
8226 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
8227 * containing a () on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8228 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8230 typedef struct LDKCResult_NonePaymentSendFailureZ {
8232 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
8233 * `err` or `result` depending on the state of `result_ok`.
8235 union LDKCResult_NonePaymentSendFailureZPtr contents;
8237 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
8240 } LDKCResult_NonePaymentSendFailureZ;
8243 * The contents of CResult_NoneRetryableSendFailureZ
8245 typedef union LDKCResult_NoneRetryableSendFailureZPtr {
8247 * Note that this value is always NULL, as there are no contents in the OK variant
8251 * A pointer to the contents in the error state.
8252 * Reading from this pointer when `result_ok` is set is undefined.
8254 enum LDKRetryableSendFailure *err;
8255 } LDKCResult_NoneRetryableSendFailureZPtr;
8258 * A CResult_NoneRetryableSendFailureZ represents the result of a fallible operation,
8259 * containing a () on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
8260 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8262 typedef struct LDKCResult_NoneRetryableSendFailureZ {
8264 * The contents of this CResult_NoneRetryableSendFailureZ, accessible via either
8265 * `err` or `result` depending on the state of `result_ok`.
8267 union LDKCResult_NoneRetryableSendFailureZPtr contents;
8269 * Whether this CResult_NoneRetryableSendFailureZ represents a success state.
8272 } LDKCResult_NoneRetryableSendFailureZ;
8275 * The contents of CResult_ThirtyTwoBytesPaymentSendFailureZ
8277 typedef union LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr {
8279 * A pointer to the contents in the success state.
8280 * Reading from this pointer when `result_ok` is not set is undefined.
8282 struct LDKThirtyTwoBytes *result;
8284 * A pointer to the contents in the error state.
8285 * Reading from this pointer when `result_ok` is set is undefined.
8287 struct LDKPaymentSendFailure *err;
8288 } LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr;
8291 * A CResult_ThirtyTwoBytesPaymentSendFailureZ represents the result of a fallible operation,
8292 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8293 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8295 typedef struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ {
8297 * The contents of this CResult_ThirtyTwoBytesPaymentSendFailureZ, accessible via either
8298 * `err` or `result` depending on the state of `result_ok`.
8300 union LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr contents;
8302 * Whether this CResult_ThirtyTwoBytesPaymentSendFailureZ represents a success state.
8305 } LDKCResult_ThirtyTwoBytesPaymentSendFailureZ;
8308 * The contents of CResult_ThirtyTwoBytesRetryableSendFailureZ
8310 typedef union LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr {
8312 * A pointer to the contents in the success state.
8313 * Reading from this pointer when `result_ok` is not set is undefined.
8315 struct LDKThirtyTwoBytes *result;
8317 * A pointer to the contents in the error state.
8318 * Reading from this pointer when `result_ok` is set is undefined.
8320 enum LDKRetryableSendFailure *err;
8321 } LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr;
8324 * A CResult_ThirtyTwoBytesRetryableSendFailureZ represents the result of a fallible operation,
8325 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
8326 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8328 typedef struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ {
8330 * The contents of this CResult_ThirtyTwoBytesRetryableSendFailureZ, accessible via either
8331 * `err` or `result` depending on the state of `result_ok`.
8333 union LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr contents;
8335 * Whether this CResult_ThirtyTwoBytesRetryableSendFailureZ represents a success state.
8338 } LDKCResult_ThirtyTwoBytesRetryableSendFailureZ;
8341 * A tuple of 2 elements. See the individual fields for the types contained.
8343 typedef struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ {
8345 * The element at position 0
8347 struct LDKThirtyTwoBytes a;
8349 * The element at position 1
8351 struct LDKThirtyTwoBytes b;
8352 } LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ;
8355 * The contents of CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ
8357 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr {
8359 * A pointer to the contents in the success state.
8360 * Reading from this pointer when `result_ok` is not set is undefined.
8362 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *result;
8364 * A pointer to the contents in the error state.
8365 * Reading from this pointer when `result_ok` is set is undefined.
8367 struct LDKPaymentSendFailure *err;
8368 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr;
8371 * A CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ represents the result of a fallible operation,
8372 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8373 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8375 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ {
8377 * The contents of this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ, accessible via either
8378 * `err` or `result` depending on the state of `result_ok`.
8380 union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr contents;
8382 * Whether this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ represents a success state.
8385 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ;
8388 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZs of arbitrary size.
8389 * This corresponds to std::vector in C++
8391 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ {
8393 * The elements in the array.
8394 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8396 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *data;
8398 * The number of elements pointed to by `data`.
8401 } LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ;
8404 * Indicates that we failed to send a payment probe. Further errors may be surfaced later via
8405 * [`Event::ProbeFailed`].
8407 * [`Event::ProbeFailed`]: crate::events::Event::ProbeFailed
8409 typedef enum LDKProbeSendFailure_Tag {
8411 * We were unable to find a route to the destination.
8413 LDKProbeSendFailure_RouteNotFound,
8415 * We failed to send the payment probes.
8417 LDKProbeSendFailure_SendingFailed,
8419 * Must be last for serialization purposes
8421 LDKProbeSendFailure_Sentinel,
8422 } LDKProbeSendFailure_Tag;
8424 typedef struct MUST_USE_STRUCT LDKProbeSendFailure {
8425 LDKProbeSendFailure_Tag tag;
8428 struct LDKPaymentSendFailure sending_failed;
8431 } LDKProbeSendFailure;
8434 * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ
8436 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr {
8438 * A pointer to the contents in the success state.
8439 * Reading from this pointer when `result_ok` is not set is undefined.
8441 struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ *result;
8443 * A pointer to the contents in the error state.
8444 * Reading from this pointer when `result_ok` is set is undefined.
8446 struct LDKProbeSendFailure *err;
8447 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr;
8450 * A CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ represents the result of a fallible operation,
8451 * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ on success and a crate::lightning::ln::outbound_payment::ProbeSendFailure on failure.
8452 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8454 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ {
8456 * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ, accessible via either
8457 * `err` or `result` depending on the state of `result_ok`.
8459 union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr contents;
8461 * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ represents a success state.
8464 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ;
8467 * A tuple of 2 elements. See the individual fields for the types contained.
8469 typedef struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ {
8471 * The element at position 0
8473 struct LDKThirtyTwoBytes a;
8475 * The element at position 1
8477 struct LDKPublicKey b;
8478 } LDKC2Tuple_ThirtyTwoBytesPublicKeyZ;
8481 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesPublicKeyZs of arbitrary size.
8482 * This corresponds to std::vector in C++
8484 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ {
8486 * The elements in the array.
8487 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8489 struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ *data;
8491 * The number of elements pointed to by `data`.
8494 } LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ;
8497 * An enum which can either contain a crate::c_types::Str or not
8499 typedef enum LDKCOption_StrZ_Tag {
8501 * When we're in this state, this COption_StrZ contains a crate::c_types::Str
8503 LDKCOption_StrZ_Some,
8505 * When we're in this state, this COption_StrZ contains nothing
8507 LDKCOption_StrZ_None,
8509 * Must be last for serialization purposes
8511 LDKCOption_StrZ_Sentinel,
8512 } LDKCOption_StrZ_Tag;
8514 typedef struct LDKCOption_StrZ {
8515 LDKCOption_StrZ_Tag tag;
8524 * The contents of CResult_NoneBolt12SemanticErrorZ
8526 typedef union LDKCResult_NoneBolt12SemanticErrorZPtr {
8528 * Note that this value is always NULL, as there are no contents in the OK variant
8532 * A pointer to the contents in the error state.
8533 * Reading from this pointer when `result_ok` is set is undefined.
8535 enum LDKBolt12SemanticError *err;
8536 } LDKCResult_NoneBolt12SemanticErrorZPtr;
8539 * A CResult_NoneBolt12SemanticErrorZ represents the result of a fallible operation,
8540 * containing a () on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
8541 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8543 typedef struct LDKCResult_NoneBolt12SemanticErrorZ {
8545 * The contents of this CResult_NoneBolt12SemanticErrorZ, accessible via either
8546 * `err` or `result` depending on the state of `result_ok`.
8548 union LDKCResult_NoneBolt12SemanticErrorZPtr contents;
8550 * Whether this CResult_NoneBolt12SemanticErrorZ represents a success state.
8553 } LDKCResult_NoneBolt12SemanticErrorZ;
8556 * The contents of CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ
8558 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr {
8560 * A pointer to the contents in the success state.
8561 * Reading from this pointer when `result_ok` is not set is undefined.
8563 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *result;
8565 * Note that this value is always NULL, as there are no contents in the Err variant
8568 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr;
8571 * A CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ represents the result of a fallible operation,
8572 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ on success and a () on failure.
8573 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8575 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ {
8577 * The contents of this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ, accessible via either
8578 * `err` or `result` depending on the state of `result_ok`.
8580 union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr contents;
8582 * Whether this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ represents a success state.
8585 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ;
8590 * An `InvoiceRequest` is a request for a [`Bolt12Invoice`] formulated from an [`Offer`].
8592 * An offer may provide choices such as quantity, amount, chain, features, etc. An invoice request
8593 * specifies these such that its recipient can send an invoice for payment.
8595 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
8596 * [`Offer`]: crate::offers::offer::Offer
8598 typedef struct MUST_USE_STRUCT LDKInvoiceRequest {
8600 * A pointer to the opaque Rust object.
8601 * Nearly everywhere, inner must be non-null, however in places where
8602 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8604 LDKnativeInvoiceRequest *inner;
8606 * Indicates that this is the only struct which contains the same pointer.
8607 * Rust functions which take ownership of an object provided via an argument require
8608 * this to be true and invalidate the object pointed to by inner.
8611 } LDKInvoiceRequest;
8616 * A `Bolt12Invoice` is a payment request, typically corresponding to an [`Offer`] or a [`Refund`].
8618 * An invoice may be sent in response to an [`InvoiceRequest`] in the case of an offer or sent
8619 * directly after scanning a refund. It includes all the information needed to pay a recipient.
8621 * [`Offer`]: crate::offers::offer::Offer
8622 * [`Refund`]: crate::offers::refund::Refund
8623 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
8625 typedef struct MUST_USE_STRUCT LDKBolt12Invoice {
8627 * A pointer to the opaque Rust object.
8628 * Nearly everywhere, inner must be non-null, however in places where
8629 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8631 LDKnativeBolt12Invoice *inner;
8633 * Indicates that this is the only struct which contains the same pointer.
8634 * Rust functions which take ownership of an object provided via an argument require
8635 * this to be true and invalidate the object pointed to by inner.
8643 * An error in response to an [`InvoiceRequest`] or an [`Bolt12Invoice`].
8645 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
8646 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
8648 typedef struct MUST_USE_STRUCT LDKInvoiceError {
8650 * A pointer to the opaque Rust object.
8651 * Nearly everywhere, inner must be non-null, however in places where
8652 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8654 LDKnativeInvoiceError *inner;
8656 * Indicates that this is the only struct which contains the same pointer.
8657 * Rust functions which take ownership of an object provided via an argument require
8658 * this to be true and invalidate the object pointed to by inner.
8664 * Possible BOLT 12 Offers messages sent and received via an [`OnionMessage`].
8666 * [`OnionMessage`]: crate::ln::msgs::OnionMessage
8668 typedef enum LDKOffersMessage_Tag {
8670 * A request for a [`Bolt12Invoice`] for a particular [`Offer`].
8672 * [`Offer`]: crate::offers::offer::Offer
8674 LDKOffersMessage_InvoiceRequest,
8676 * A [`Bolt12Invoice`] sent in response to an [`InvoiceRequest`] or a [`Refund`].
8678 * [`Refund`]: crate::offers::refund::Refund
8680 LDKOffersMessage_Invoice,
8682 * An error from handling an [`OffersMessage`].
8684 LDKOffersMessage_InvoiceError,
8686 * Must be last for serialization purposes
8688 LDKOffersMessage_Sentinel,
8689 } LDKOffersMessage_Tag;
8691 typedef struct MUST_USE_STRUCT LDKOffersMessage {
8692 LDKOffersMessage_Tag tag;
8695 struct LDKInvoiceRequest invoice_request;
8698 struct LDKBolt12Invoice invoice;
8701 struct LDKInvoiceError invoice_error;
8707 * An enum which can either contain a crate::lightning::onion_message::offers::OffersMessage or not
8709 typedef enum LDKCOption_OffersMessageZ_Tag {
8711 * When we're in this state, this COption_OffersMessageZ contains a crate::lightning::onion_message::offers::OffersMessage
8713 LDKCOption_OffersMessageZ_Some,
8715 * When we're in this state, this COption_OffersMessageZ contains nothing
8717 LDKCOption_OffersMessageZ_None,
8719 * Must be last for serialization purposes
8721 LDKCOption_OffersMessageZ_Sentinel,
8722 } LDKCOption_OffersMessageZ_Tag;
8724 typedef struct LDKCOption_OffersMessageZ {
8725 LDKCOption_OffersMessageZ_Tag tag;
8728 struct LDKOffersMessage some;
8731 } LDKCOption_OffersMessageZ;
8734 * The destination of an onion message.
8736 typedef enum LDKDestination_Tag {
8738 * We're sending this onion message to a node.
8740 LDKDestination_Node,
8742 * We're sending this onion message to a blinded path.
8744 LDKDestination_BlindedPath,
8746 * Must be last for serialization purposes
8748 LDKDestination_Sentinel,
8749 } LDKDestination_Tag;
8751 typedef struct MUST_USE_STRUCT LDKDestination {
8752 LDKDestination_Tag tag;
8755 struct LDKPublicKey node;
8758 struct LDKBlindedPath blinded_path;
8764 * A tuple of 3 elements. See the individual fields for the types contained.
8766 typedef struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ {
8768 * The element at position 0
8770 struct LDKOffersMessage a;
8772 * The element at position 1
8774 struct LDKDestination b;
8776 * The element at position 2
8778 struct LDKBlindedPath c;
8779 } LDKC3Tuple_OffersMessageDestinationBlindedPathZ;
8782 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OffersMessageDestinationBlindedPathZs of arbitrary size.
8783 * This corresponds to std::vector in C++
8785 typedef struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ {
8787 * The elements in the array.
8788 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8790 struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ *data;
8792 * The number of elements pointed to by `data`.
8795 } LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ;
8800 * Information needed for constructing an invoice route hint for this channel.
8802 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
8804 * A pointer to the opaque Rust object.
8805 * Nearly everywhere, inner must be non-null, however in places where
8806 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8808 LDKnativeCounterpartyForwardingInfo *inner;
8810 * Indicates that this is the only struct which contains the same pointer.
8811 * Rust functions which take ownership of an object provided via an argument require
8812 * this to be true and invalidate the object pointed to by inner.
8815 } LDKCounterpartyForwardingInfo;
8818 * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
8820 typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
8822 * A pointer to the contents in the success state.
8823 * Reading from this pointer when `result_ok` is not set is undefined.
8825 struct LDKCounterpartyForwardingInfo *result;
8827 * A pointer to the contents in the error state.
8828 * Reading from this pointer when `result_ok` is set is undefined.
8830 struct LDKDecodeError *err;
8831 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
8834 * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
8835 * containing a crate::lightning::ln::channelmanager::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8836 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8838 typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
8840 * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
8841 * `err` or `result` depending on the state of `result_ok`.
8843 union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
8845 * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
8848 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
8853 * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
8854 * to better separate parameters.
8856 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
8858 * A pointer to the opaque Rust object.
8859 * Nearly everywhere, inner must be non-null, however in places where
8860 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8862 LDKnativeChannelCounterparty *inner;
8864 * Indicates that this is the only struct which contains the same pointer.
8865 * Rust functions which take ownership of an object provided via an argument require
8866 * this to be true and invalidate the object pointed to by inner.
8869 } LDKChannelCounterparty;
8872 * The contents of CResult_ChannelCounterpartyDecodeErrorZ
8874 typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
8876 * A pointer to the contents in the success state.
8877 * Reading from this pointer when `result_ok` is not set is undefined.
8879 struct LDKChannelCounterparty *result;
8881 * A pointer to the contents in the error state.
8882 * Reading from this pointer when `result_ok` is set is undefined.
8884 struct LDKDecodeError *err;
8885 } LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
8888 * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
8889 * containing a crate::lightning::ln::channelmanager::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
8890 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8892 typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
8894 * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
8895 * `err` or `result` depending on the state of `result_ok`.
8897 union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
8899 * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
8902 } LDKCResult_ChannelCounterpartyDecodeErrorZ;
8905 * The contents of CResult_ChannelDetailsDecodeErrorZ
8907 typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
8909 * A pointer to the contents in the success state.
8910 * Reading from this pointer when `result_ok` is not set is undefined.
8912 struct LDKChannelDetails *result;
8914 * A pointer to the contents in the error state.
8915 * Reading from this pointer when `result_ok` is set is undefined.
8917 struct LDKDecodeError *err;
8918 } LDKCResult_ChannelDetailsDecodeErrorZPtr;
8921 * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
8922 * containing a crate::lightning::ln::channelmanager::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
8923 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8925 typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
8927 * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
8928 * `err` or `result` depending on the state of `result_ok`.
8930 union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
8932 * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
8935 } LDKCResult_ChannelDetailsDecodeErrorZ;
8940 * Route hints used in constructing invoices for [phantom node payents].
8942 * [phantom node payments]: crate::sign::PhantomKeysManager
8944 typedef struct MUST_USE_STRUCT LDKPhantomRouteHints {
8946 * A pointer to the opaque Rust object.
8947 * Nearly everywhere, inner must be non-null, however in places where
8948 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8950 LDKnativePhantomRouteHints *inner;
8952 * Indicates that this is the only struct which contains the same pointer.
8953 * Rust functions which take ownership of an object provided via an argument require
8954 * this to be true and invalidate the object pointed to by inner.
8957 } LDKPhantomRouteHints;
8960 * The contents of CResult_PhantomRouteHintsDecodeErrorZ
8962 typedef union LDKCResult_PhantomRouteHintsDecodeErrorZPtr {
8964 * A pointer to the contents in the success state.
8965 * Reading from this pointer when `result_ok` is not set is undefined.
8967 struct LDKPhantomRouteHints *result;
8969 * A pointer to the contents in the error state.
8970 * Reading from this pointer when `result_ok` is set is undefined.
8972 struct LDKDecodeError *err;
8973 } LDKCResult_PhantomRouteHintsDecodeErrorZPtr;
8976 * A CResult_PhantomRouteHintsDecodeErrorZ represents the result of a fallible operation,
8977 * containing a crate::lightning::ln::channelmanager::PhantomRouteHints on success and a crate::lightning::ln::msgs::DecodeError on failure.
8978 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8980 typedef struct LDKCResult_PhantomRouteHintsDecodeErrorZ {
8982 * The contents of this CResult_PhantomRouteHintsDecodeErrorZ, accessible via either
8983 * `err` or `result` depending on the state of `result_ok`.
8985 union LDKCResult_PhantomRouteHintsDecodeErrorZPtr contents;
8987 * Whether this CResult_PhantomRouteHintsDecodeErrorZ represents a success state.
8990 } LDKCResult_PhantomRouteHintsDecodeErrorZ;
8993 * The contents of CResult_ChannelShutdownStateDecodeErrorZ
8995 typedef union LDKCResult_ChannelShutdownStateDecodeErrorZPtr {
8997 * A pointer to the contents in the success state.
8998 * Reading from this pointer when `result_ok` is not set is undefined.
9000 enum LDKChannelShutdownState *result;
9002 * A pointer to the contents in the error state.
9003 * Reading from this pointer when `result_ok` is set is undefined.
9005 struct LDKDecodeError *err;
9006 } LDKCResult_ChannelShutdownStateDecodeErrorZPtr;
9009 * A CResult_ChannelShutdownStateDecodeErrorZ represents the result of a fallible operation,
9010 * containing a crate::lightning::ln::channelmanager::ChannelShutdownState on success and a crate::lightning::ln::msgs::DecodeError on failure.
9011 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9013 typedef struct LDKCResult_ChannelShutdownStateDecodeErrorZ {
9015 * The contents of this CResult_ChannelShutdownStateDecodeErrorZ, accessible via either
9016 * `err` or `result` depending on the state of `result_ok`.
9018 union LDKCResult_ChannelShutdownStateDecodeErrorZPtr contents;
9020 * Whether this CResult_ChannelShutdownStateDecodeErrorZ represents a success state.
9023 } LDKCResult_ChannelShutdownStateDecodeErrorZ;
9028 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
9029 * on-chain transactions to ensure no loss of funds occurs.
9031 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
9032 * information and are actively monitoring the chain.
9034 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
9035 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
9036 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
9037 * returned block hash and the the current chain and then reconnecting blocks to get to the
9038 * best chain) upon deserializing the object!
9040 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
9042 * A pointer to the opaque Rust object.
9043 * Nearly everywhere, inner must be non-null, however in places where
9044 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9046 LDKnativeChannelMonitor *inner;
9048 * Indicates that this is the only struct which contains the same pointer.
9049 * Rust functions which take ownership of an object provided via an argument require
9050 * this to be true and invalidate the object pointed to by inner.
9053 } LDKChannelMonitor;
9056 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
9057 * This corresponds to std::vector in C++
9059 typedef struct LDKCVec_ChannelMonitorZ {
9061 * The elements in the array.
9062 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9064 struct LDKChannelMonitor *data;
9066 * The number of elements pointed to by `data`.
9069 } LDKCVec_ChannelMonitorZ;
9074 * An update generated by the underlying channel itself which contains some new information the
9075 * [`ChannelMonitor`] should be made aware of.
9077 * Because this represents only a small number of updates to the underlying state, it is generally
9078 * much smaller than a full [`ChannelMonitor`]. However, for large single commitment transaction
9079 * updates (e.g. ones during which there are hundreds of HTLCs pending on the commitment
9080 * transaction), a single update may reach upwards of 1 MiB in serialized size.
9082 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
9084 * A pointer to the opaque Rust object.
9085 * Nearly everywhere, inner must be non-null, however in places where
9086 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9088 LDKnativeChannelMonitorUpdate *inner;
9090 * Indicates that this is the only struct which contains the same pointer.
9091 * Rust functions which take ownership of an object provided via an argument require
9092 * this to be true and invalidate the object pointed to by inner.
9095 } LDKChannelMonitorUpdate;
9098 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
9099 * blocks are connected and disconnected.
9101 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
9102 * responsible for maintaining a set of monitors such that they can be updated as channel state
9103 * changes. On each update, *all copies* of a [`ChannelMonitor`] must be updated and the update
9104 * persisted to disk to ensure that the latest [`ChannelMonitor`] state can be reloaded if the
9105 * application crashes.
9107 * See method documentation and [`ChannelMonitorUpdateStatus`] for specific requirements.
9109 typedef struct LDKWatch {
9111 * An opaque pointer which is passed to your function implementations as an argument.
9112 * This has no meaning in the LDK, and can be NULL or any other value.
9116 * Watches a channel identified by `funding_txo` using `monitor`.
9118 * Implementations are responsible for watching the chain for the funding transaction along
9119 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
9120 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
9122 * A return of `Err(())` indicates that the channel should immediately be force-closed without
9123 * broadcasting the funding transaction.
9125 * If the given `funding_txo` has previously been registered via `watch_channel`, `Err(())`
9128 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
9129 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
9130 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
9132 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
9134 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
9136 * Implementations must call [`ChannelMonitor::update_monitor`] with the given update. This
9137 * may fail (returning an `Err(())`), in which case this should return
9138 * [`ChannelMonitorUpdateStatus::InProgress`] (and the update should never complete). This
9139 * generally implies the channel has been closed (either by the funding outpoint being spent
9140 * on-chain or the [`ChannelMonitor`] having decided to do so and broadcasted a transaction),
9141 * and the [`ChannelManager`] state will be updated once it sees the funding spend on-chain.
9143 * In general, persistence failures should be retried after returning
9144 * [`ChannelMonitorUpdateStatus::InProgress`] and eventually complete. If a failure truly
9145 * cannot be retried, the node should shut down immediately after returning
9146 * [`ChannelMonitorUpdateStatus::UnrecoverableError`], see its documentation for more info.
9148 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
9150 enum LDKChannelMonitorUpdateStatus (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, const struct LDKChannelMonitorUpdate *NONNULL_PTR update);
9152 * Returns any monitor events since the last call. Subsequent calls must only return new
9155 * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
9156 * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
9159 * For details on asynchronous [`ChannelMonitor`] updating and returning
9160 * [`MonitorEvent::Completed`] here, see [`ChannelMonitorUpdateStatus::InProgress`].
9162 struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ (*release_pending_monitor_events)(const void *this_arg);
9164 * Frees any resources associated with this object given its this_arg pointer.
9165 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9167 void (*free)(void *this_arg);
9171 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
9172 * This corresponds to std::vector in C++
9174 typedef struct LDKCVec_TransactionZ {
9176 * The elements in the array.
9177 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9179 struct LDKTransaction *data;
9181 * The number of elements pointed to by `data`.
9184 } LDKCVec_TransactionZ;
9187 * An interface to send a transaction to the Bitcoin network.
9189 typedef struct LDKBroadcasterInterface {
9191 * An opaque pointer which is passed to your function implementations as an argument.
9192 * This has no meaning in the LDK, and can be NULL or any other value.
9196 * Sends a list of transactions out to (hopefully) be mined.
9197 * This only needs to handle the actual broadcasting of transactions, LDK will automatically
9198 * rebroadcast transactions that haven't made it into a block.
9200 * In some cases LDK may attempt to broadcast a transaction which double-spends another
9201 * and this isn't a bug and can be safely ignored.
9203 * If more than one transaction is given, these transactions should be considered to be a
9204 * package and broadcast together. Some of the transactions may or may not depend on each other,
9205 * be sure to manage both cases correctly.
9207 * Bitcoin transaction packages are defined in BIP 331 and here:
9208 * https://github.com/bitcoin/bitcoin/blob/master/doc/policy/packages.md
9210 void (*broadcast_transactions)(const void *this_arg, struct LDKCVec_TransactionZ txs);
9212 * Frees any resources associated with this object given its this_arg pointer.
9213 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9215 void (*free)(void *this_arg);
9216 } LDKBroadcasterInterface;
9219 * A trait that describes a source of entropy.
9221 typedef struct LDKEntropySource {
9223 * An opaque pointer which is passed to your function implementations as an argument.
9224 * This has no meaning in the LDK, and can be NULL or any other value.
9228 * Gets a unique, cryptographically-secure, random 32-byte value. This method must return a
9229 * different value each time it is called.
9231 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
9233 * Frees any resources associated with this object given its this_arg pointer.
9234 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9236 void (*free)(void *this_arg);
9240 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
9241 * own the memory pointed to by data.
9243 typedef struct LDKu8slice {
9245 * A pointer to the byte buffer
9247 const uint8_t *data;
9249 * The number of bytes pointed to by `data`.
9257 * A semantically valid [`InvoiceRequest`] that hasn't been signed.
9261 * This is serialized as a TLV stream, which includes TLV records from the originating message. As
9262 * such, it may include unknown, odd TLV records.
9264 typedef struct MUST_USE_STRUCT LDKUnsignedInvoiceRequest {
9266 * A pointer to the opaque Rust object.
9267 * Nearly everywhere, inner must be non-null, however in places where
9268 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9270 LDKnativeUnsignedInvoiceRequest *inner;
9272 * Indicates that this is the only struct which contains the same pointer.
9273 * Rust functions which take ownership of an object provided via an argument require
9274 * this to be true and invalidate the object pointed to by inner.
9277 } LDKUnsignedInvoiceRequest;
9282 * A semantically valid [`Bolt12Invoice`] that hasn't been signed.
9286 * This is serialized as a TLV stream, which includes TLV records from the originating message. As
9287 * such, it may include unknown, odd TLV records.
9289 typedef struct MUST_USE_STRUCT LDKUnsignedBolt12Invoice {
9291 * A pointer to the opaque Rust object.
9292 * Nearly everywhere, inner must be non-null, however in places where
9293 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9295 LDKnativeUnsignedBolt12Invoice *inner;
9297 * Indicates that this is the only struct which contains the same pointer.
9298 * Rust functions which take ownership of an object provided via an argument require
9299 * this to be true and invalidate the object pointed to by inner.
9302 } LDKUnsignedBolt12Invoice;
9307 * The unsigned part of a [`channel_update`] message.
9309 * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
9311 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
9313 * A pointer to the opaque Rust object.
9314 * Nearly everywhere, inner must be non-null, however in places where
9315 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9317 LDKnativeUnsignedChannelUpdate *inner;
9319 * Indicates that this is the only struct which contains the same pointer.
9320 * Rust functions which take ownership of an object provided via an argument require
9321 * this to be true and invalidate the object pointed to by inner.
9324 } LDKUnsignedChannelUpdate;
9329 * The unsigned part of a [`node_announcement`] message.
9331 * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
9333 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
9335 * A pointer to the opaque Rust object.
9336 * Nearly everywhere, inner must be non-null, however in places where
9337 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9339 LDKnativeUnsignedNodeAnnouncement *inner;
9341 * Indicates that this is the only struct which contains the same pointer.
9342 * Rust functions which take ownership of an object provided via an argument require
9343 * this to be true and invalidate the object pointed to by inner.
9346 } LDKUnsignedNodeAnnouncement;
9349 * Represents the set of gossip messages that require a signature from a node's identity key.
9351 typedef enum LDKUnsignedGossipMessage_Tag {
9353 * An unsigned channel announcement.
9355 LDKUnsignedGossipMessage_ChannelAnnouncement,
9357 * An unsigned channel update.
9359 LDKUnsignedGossipMessage_ChannelUpdate,
9361 * An unsigned node announcement.
9363 LDKUnsignedGossipMessage_NodeAnnouncement,
9365 * Must be last for serialization purposes
9367 LDKUnsignedGossipMessage_Sentinel,
9368 } LDKUnsignedGossipMessage_Tag;
9370 typedef struct MUST_USE_STRUCT LDKUnsignedGossipMessage {
9371 LDKUnsignedGossipMessage_Tag tag;
9374 struct LDKUnsignedChannelAnnouncement channel_announcement;
9377 struct LDKUnsignedChannelUpdate channel_update;
9380 struct LDKUnsignedNodeAnnouncement node_announcement;
9383 } LDKUnsignedGossipMessage;
9386 * A trait that can handle cryptographic operations at the scope level of a node.
9388 typedef struct LDKNodeSigner {
9390 * An opaque pointer which is passed to your function implementations as an argument.
9391 * This has no meaning in the LDK, and can be NULL or any other value.
9395 * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
9397 * If the implementor of this trait supports [phantom node payments], then every node that is
9398 * intended to be included in the phantom invoice route hints must return the same value from
9401 * This method must return the same value each time it is called.
9403 * [phantom node payments]: PhantomKeysManager
9405 struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
9407 * Get node id based on the provided [`Recipient`].
9409 * This method must return the same value each time it is called with a given [`Recipient`]
9412 * Errors if the [`Recipient`] variant is not supported by the implementation.
9414 struct LDKCResult_PublicKeyNoneZ (*get_node_id)(const void *this_arg, enum LDKRecipient recipient);
9416 * Gets the ECDH shared secret of our node secret and `other_key`, multiplying by `tweak` if
9417 * one is provided. Note that this tweak can be applied to `other_key` instead of our node
9418 * secret, though this is less efficient.
9420 * Note that if this fails while attempting to forward an HTLC, LDK will panic. The error
9421 * should be resolved to allow LDK to resume forwarding HTLCs.
9423 * Errors if the [`Recipient`] variant is not supported by the implementation.
9425 struct LDKCResult_ThirtyTwoBytesNoneZ (*ecdh)(const void *this_arg, enum LDKRecipient recipient, struct LDKPublicKey other_key, struct LDKCOption_BigEndianScalarZ tweak);
9429 * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of
9430 * this trait to parse the invoice and make sure they're signing what they expect, rather than
9431 * blindly signing the hash.
9433 * The `hrp_bytes` are ASCII bytes, while the `invoice_data` is base32.
9435 * The secret key used to sign the invoice is dependent on the [`Recipient`].
9437 * Errors if the [`Recipient`] variant is not supported by the implementation.
9439 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z invoice_data, enum LDKRecipient recipient);
9441 * Signs the [`TaggedHash`] of a BOLT 12 invoice request.
9443 * May be called by a function passed to [`UnsignedInvoiceRequest::sign`] where
9444 * `invoice_request` is the callee.
9446 * Implementors may check that the `invoice_request` is expected rather than blindly signing
9447 * the tagged hash. An `Ok` result should sign `invoice_request.tagged_hash().as_digest()` with
9448 * the node's signing key or an ephemeral key to preserve privacy, whichever is associated with
9449 * [`UnsignedInvoiceRequest::payer_id`].
9451 * [`TaggedHash`]: crate::offers::merkle::TaggedHash
9453 struct LDKCResult_SchnorrSignatureNoneZ (*sign_bolt12_invoice_request)(const void *this_arg, const struct LDKUnsignedInvoiceRequest *NONNULL_PTR invoice_request);
9455 * Signs the [`TaggedHash`] of a BOLT 12 invoice.
9457 * May be called by a function passed to [`UnsignedBolt12Invoice::sign`] where `invoice` is the
9460 * Implementors may check that the `invoice` is expected rather than blindly signing the tagged
9461 * hash. An `Ok` result should sign `invoice.tagged_hash().as_digest()` with the node's signing
9462 * key or an ephemeral key to preserve privacy, whichever is associated with
9463 * [`UnsignedBolt12Invoice::signing_pubkey`].
9465 * [`TaggedHash`]: crate::offers::merkle::TaggedHash
9467 struct LDKCResult_SchnorrSignatureNoneZ (*sign_bolt12_invoice)(const void *this_arg, const struct LDKUnsignedBolt12Invoice *NONNULL_PTR invoice);
9469 * Sign a gossip message.
9471 * Note that if this fails, LDK may panic and the message will not be broadcast to the network
9472 * or a possible channel counterparty. If LDK panics, the error should be resolved to allow the
9473 * message to be broadcast, as otherwise it may prevent one from receiving funds over the
9474 * corresponding channel.
9476 struct LDKCResult_ECDSASignatureNoneZ (*sign_gossip_message)(const void *this_arg, struct LDKUnsignedGossipMessage msg);
9478 * Frees any resources associated with this object given its this_arg pointer.
9479 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9481 void (*free)(void *this_arg);
9485 * A trait that can return signer instances for individual channels.
9487 typedef struct LDKSignerProvider {
9489 * An opaque pointer which is passed to your function implementations as an argument.
9490 * This has no meaning in the LDK, and can be NULL or any other value.
9494 * Generates a unique `channel_keys_id` that can be used to obtain a [`Self::Signer`] through
9495 * [`SignerProvider::derive_channel_signer`]. The `user_channel_id` is provided to allow
9496 * implementations of [`SignerProvider`] to maintain a mapping between itself and the generated
9497 * `channel_keys_id`.
9499 * This method must return a different value each time it is called.
9501 struct LDKThirtyTwoBytes (*generate_channel_keys_id)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis, struct LDKU128 user_channel_id);
9503 * Derives the private key material backing a `Signer`.
9505 * To derive a new `Signer`, a fresh `channel_keys_id` should be obtained through
9506 * [`SignerProvider::generate_channel_keys_id`]. Otherwise, an existing `Signer` can be
9507 * re-derived from its `channel_keys_id`, which can be obtained through its trait method
9508 * [`ChannelSigner::channel_keys_id`].
9510 struct LDKWriteableEcdsaChannelSigner (*derive_channel_signer)(const void *this_arg, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id);
9512 * Reads a [`Signer`] for this [`SignerProvider`] from the given input stream.
9513 * This is only called during deserialization of other objects which contain
9514 * [`WriteableEcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s).
9515 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
9516 * contain no versioning scheme. You may wish to include your own version prefix and ensure
9517 * you've read all of the provided bytes to ensure no corruption occurred.
9519 * This method is slowly being phased out -- it will only be called when reading objects
9520 * written by LDK versions prior to 0.0.113.
9522 * [`Signer`]: Self::Signer
9523 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
9524 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
9526 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
9528 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
9530 * If this function returns an error, this will result in a channel failing to open.
9532 * This method should return a different value each time it is called, to avoid linking
9533 * on-chain funds across channels as controlled to the same user.
9535 struct LDKCResult_CVec_u8ZNoneZ (*get_destination_script)(const void *this_arg);
9537 * Get a script pubkey which we will send funds to when closing a channel.
9539 * If this function returns an error, this will result in a channel failing to open or close.
9540 * In the event of a failure when the counterparty is initiating a close, this can result in a
9541 * channel force close.
9543 * This method should return a different value each time it is called, to avoid linking
9544 * on-chain funds across channels as controlled to the same user.
9546 struct LDKCResult_ShutdownScriptNoneZ (*get_shutdown_scriptpubkey)(const void *this_arg);
9548 * Frees any resources associated with this object given its this_arg pointer.
9549 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9551 void (*free)(void *this_arg);
9552 } LDKSignerProvider;
9555 * A trait which should be implemented to provide feerate information on a number of time
9558 * If access to a local mempool is not feasible, feerate estimates should be fetched from a set of
9559 * third-parties hosting them. Note that this enables them to affect the propagation of your
9560 * pre-signed transactions at any time and therefore endangers the safety of channels funds. It
9561 * should be considered carefully as a deployment.
9563 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
9564 * called from inside the library in response to chain events, P2P events, or timer events).
9566 typedef struct LDKFeeEstimator {
9568 * An opaque pointer which is passed to your function implementations as an argument.
9569 * This has no meaning in the LDK, and can be NULL or any other value.
9573 * Gets estimated satoshis of fee required per 1000 Weight-Units.
9575 * LDK will wrap this method and ensure that the value returned is no smaller than 253
9576 * (ie 1 satoshi-per-byte rounded up to ensure later round-downs don't put us below 1 satoshi-per-byte).
9578 * The following unit conversions can be used to convert to sats/KW:
9579 * * satoshis-per-byte * 250
9580 * * satoshis-per-kbyte / 4
9582 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
9584 * Frees any resources associated with this object given its this_arg pointer.
9585 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9587 void (*free)(void *this_arg);
9591 * A trait defining behavior for routing a payment.
9593 typedef struct LDKRouter {
9595 * An opaque pointer which is passed to your function implementations as an argument.
9596 * This has no meaning in the LDK, and can be NULL or any other value.
9600 * Finds a [`Route`] for a payment between the given `payer` and a payee.
9602 * The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
9603 * and [`RouteParameters::final_value_msat`], respectively.
9605 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
9607 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);
9609 * Finds a [`Route`] for a payment between the given `payer` and a payee.
9611 * The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
9612 * and [`RouteParameters::final_value_msat`], respectively.
9614 * Includes a [`PaymentHash`] and a [`PaymentId`] to be able to correlate the request with a specific
9617 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
9619 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);
9621 * Frees any resources associated with this object given its this_arg pointer.
9622 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9624 void (*free)(void *this_arg);
9630 * Manager which keeps track of a number of channels and sends messages to the appropriate
9631 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
9633 * Implements [`ChannelMessageHandler`], handling the multi-channel parts and passing things through
9634 * to individual Channels.
9636 * Implements [`Writeable`] to write out all channel state to disk. Implies [`peer_disconnected`] for
9637 * all peers during write/read (though does not modify this instance, only the instance being
9638 * serialized). This will result in any channels which have not yet exchanged [`funding_created`] (i.e.,
9639 * called [`funding_transaction_generated`] for outbound channels) being closed.
9641 * Note that you can be a bit lazier about writing out `ChannelManager` than you can be with
9642 * [`ChannelMonitor`]. With [`ChannelMonitor`] you MUST durably write each
9643 * [`ChannelMonitorUpdate`] before returning from
9644 * [`chain::Watch::watch_channel`]/[`update_channel`] or before completing async writes. With
9645 * `ChannelManager`s, writing updates happens out-of-band (and will prevent any other
9646 * `ChannelManager` operations from occurring during the serialization process). If the
9647 * deserialized version is out-of-date compared to the [`ChannelMonitor`] passed by reference to
9648 * [`read`], those channels will be force-closed based on the `ChannelMonitor` state and no funds
9649 * will be lost (modulo on-chain transaction fees).
9651 * Note that the deserializer is only implemented for `(`[`BlockHash`]`, `[`ChannelManager`]`)`, which
9652 * tells you the last block hash which was connected. You should get the best block tip before using the manager.
9653 * See [`chain::Listen`] and [`chain::Confirm`] for more details.
9655 * Note that `ChannelManager` is responsible for tracking liveness of its channels and generating
9656 * [`ChannelUpdate`] messages informing peers that the channel is temporarily disabled. To avoid
9657 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
9658 * offline for a full minute. In order to track this, you must call
9659 * [`timer_tick_occurred`] roughly once per minute, though it doesn't have to be perfect.
9661 * To avoid trivial DoS issues, `ChannelManager` limits the number of inbound connections and
9662 * inbound channels without confirmed funding transactions. This may result in nodes which we do
9663 * not have a channel with being unable to connect to us or open new channels with us if we have
9664 * many peers with unfunded channels.
9666 * Because it is an indication of trust, inbound channels which we've accepted as 0conf are
9667 * exempted from the count of unfunded channels. Similarly, outbound channels and connections are
9668 * never limited. Please ensure you limit the count of such channels yourself.
9670 * Rather than using a plain `ChannelManager`, it is preferable to use either a [`SimpleArcChannelManager`]
9671 * a [`SimpleRefChannelManager`], for conciseness. See their documentation for more details, but
9672 * essentially you should default to using a [`SimpleRefChannelManager`], and use a
9673 * [`SimpleArcChannelManager`] when you require a `ChannelManager` with a static lifetime, such as when
9674 * you're using lightning-net-tokio.
9676 * [`peer_disconnected`]: msgs::ChannelMessageHandler::peer_disconnected
9677 * [`funding_created`]: msgs::FundingCreated
9678 * [`funding_transaction_generated`]: Self::funding_transaction_generated
9679 * [`BlockHash`]: bitcoin::hash_types::BlockHash
9680 * [`update_channel`]: chain::Watch::update_channel
9681 * [`ChannelUpdate`]: msgs::ChannelUpdate
9682 * [`timer_tick_occurred`]: Self::timer_tick_occurred
9683 * [`read`]: ReadableArgs::read
9685 typedef struct MUST_USE_STRUCT LDKChannelManager {
9687 * A pointer to the opaque Rust object.
9688 * Nearly everywhere, inner must be non-null, however in places where
9689 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9691 LDKnativeChannelManager *inner;
9693 * Indicates that this is the only struct which contains the same pointer.
9694 * Rust functions which take ownership of an object provided via an argument require
9695 * this to be true and invalidate the object pointed to by inner.
9698 } LDKChannelManager;
9701 * A tuple of 2 elements. See the individual fields for the types contained.
9703 typedef struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ {
9705 * The element at position 0
9707 struct LDKThirtyTwoBytes a;
9709 * The element at position 1
9711 struct LDKChannelManager b;
9712 } LDKC2Tuple_ThirtyTwoBytesChannelManagerZ;
9715 * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ
9717 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr {
9719 * A pointer to the contents in the success state.
9720 * Reading from this pointer when `result_ok` is not set is undefined.
9722 struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ *result;
9724 * A pointer to the contents in the error state.
9725 * Reading from this pointer when `result_ok` is set is undefined.
9727 struct LDKDecodeError *err;
9728 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr;
9731 * A CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ represents the result of a fallible operation,
9732 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9733 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9735 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ {
9737 * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ, accessible via either
9738 * `err` or `result` depending on the state of `result_ok`.
9740 union LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr contents;
9742 * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ represents a success state.
9745 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ;
9748 * Options for how to set the max dust HTLC exposure allowed on a channel. See
9749 * [`ChannelConfig::max_dust_htlc_exposure`] for details.
9751 typedef enum LDKMaxDustHTLCExposure_Tag {
9753 * This sets a fixed limit on the total dust exposure in millisatoshis. Setting this too low
9754 * may prevent the sending or receipt of low-value HTLCs on high-traffic nodes, however this
9755 * limit is very important to prevent stealing of large amounts of dust HTLCs by miners
9756 * through [fee griefing
9757 * attacks](https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-May/002714.html).
9759 * Note that if the feerate increases significantly, without a manual increase
9760 * to this maximum the channel may be unable to send/receive HTLCs between the maximum dust
9761 * exposure and the new minimum value for HTLCs to be economically viable to claim.
9763 LDKMaxDustHTLCExposure_FixedLimitMsat,
9765 * This sets a multiplier on the estimated high priority feerate (sats/KW, as obtained from
9766 * [`FeeEstimator`]) to determine the maximum allowed dust exposure. If this variant is used
9767 * then the maximum dust exposure in millisatoshis is calculated as:
9768 * `high_priority_feerate_per_kw * value`. For example, with our default value
9769 * `FeeRateMultiplier(5000)`:
9771 * - For the minimum fee rate of 1 sat/vByte (250 sat/KW, although the minimum
9772 * defaults to 253 sats/KW for rounding, see [`FeeEstimator`]), the max dust exposure would
9773 * be 253 * 5000 = 1,265,000 msats.
9774 * - For a fee rate of 30 sat/vByte (7500 sat/KW), the max dust exposure would be
9775 * 7500 * 5000 = 37,500,000 msats.
9777 * This allows the maximum dust exposure to automatically scale with fee rate changes.
9779 * Note, if you're using a third-party fee estimator, this may leave you more exposed to a
9780 * fee griefing attack, where your fee estimator may purposely overestimate the fee rate,
9781 * causing you to accept more dust HTLCs than you would otherwise.
9783 * This variant is primarily meant to serve pre-anchor channels, as HTLC fees being included
9784 * on HTLC outputs means your channel may be subject to more dust exposure in the event of
9785 * increases in fee rate.
9787 * # Backwards Compatibility
9788 * This variant only became available in LDK 0.0.116, so if you downgrade to a prior version
9789 * by default this will be set to a [`Self::FixedLimitMsat`] of 5,000,000 msat.
9791 * [`FeeEstimator`]: crate::chain::chaininterface::FeeEstimator
9793 LDKMaxDustHTLCExposure_FeeRateMultiplier,
9795 * Must be last for serialization purposes
9797 LDKMaxDustHTLCExposure_Sentinel,
9798 } LDKMaxDustHTLCExposure_Tag;
9800 typedef struct MUST_USE_STRUCT LDKMaxDustHTLCExposure {
9801 LDKMaxDustHTLCExposure_Tag tag;
9804 uint64_t fixed_limit_msat;
9807 uint64_t fee_rate_multiplier;
9810 } LDKMaxDustHTLCExposure;
9813 * The contents of CResult_MaxDustHTLCExposureDecodeErrorZ
9815 typedef union LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr {
9817 * A pointer to the contents in the success state.
9818 * Reading from this pointer when `result_ok` is not set is undefined.
9820 struct LDKMaxDustHTLCExposure *result;
9822 * A pointer to the contents in the error state.
9823 * Reading from this pointer when `result_ok` is set is undefined.
9825 struct LDKDecodeError *err;
9826 } LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr;
9829 * A CResult_MaxDustHTLCExposureDecodeErrorZ represents the result of a fallible operation,
9830 * containing a crate::lightning::util::config::MaxDustHTLCExposure on success and a crate::lightning::ln::msgs::DecodeError on failure.
9831 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9833 typedef struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ {
9835 * The contents of this CResult_MaxDustHTLCExposureDecodeErrorZ, accessible via either
9836 * `err` or `result` depending on the state of `result_ok`.
9838 union LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr contents;
9840 * Whether this CResult_MaxDustHTLCExposureDecodeErrorZ represents a success state.
9843 } LDKCResult_MaxDustHTLCExposureDecodeErrorZ;
9848 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
9849 * with our counterparty.
9851 typedef struct MUST_USE_STRUCT LDKChannelConfig {
9853 * A pointer to the opaque Rust object.
9854 * Nearly everywhere, inner must be non-null, however in places where
9855 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9857 LDKnativeChannelConfig *inner;
9859 * Indicates that this is the only struct which contains the same pointer.
9860 * Rust functions which take ownership of an object provided via an argument require
9861 * this to be true and invalidate the object pointed to by inner.
9867 * The contents of CResult_ChannelConfigDecodeErrorZ
9869 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
9871 * A pointer to the contents in the success state.
9872 * Reading from this pointer when `result_ok` is not set is undefined.
9874 struct LDKChannelConfig *result;
9876 * A pointer to the contents in the error state.
9877 * Reading from this pointer when `result_ok` is set is undefined.
9879 struct LDKDecodeError *err;
9880 } LDKCResult_ChannelConfigDecodeErrorZPtr;
9883 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
9884 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
9885 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9887 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
9889 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
9890 * `err` or `result` depending on the state of `result_ok`.
9892 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
9894 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
9897 } LDKCResult_ChannelConfigDecodeErrorZ;
9900 * An enum which can either contain a crate::lightning::util::config::MaxDustHTLCExposure or not
9902 typedef enum LDKCOption_MaxDustHTLCExposureZ_Tag {
9904 * When we're in this state, this COption_MaxDustHTLCExposureZ contains a crate::lightning::util::config::MaxDustHTLCExposure
9906 LDKCOption_MaxDustHTLCExposureZ_Some,
9908 * When we're in this state, this COption_MaxDustHTLCExposureZ contains nothing
9910 LDKCOption_MaxDustHTLCExposureZ_None,
9912 * Must be last for serialization purposes
9914 LDKCOption_MaxDustHTLCExposureZ_Sentinel,
9915 } LDKCOption_MaxDustHTLCExposureZ_Tag;
9917 typedef struct LDKCOption_MaxDustHTLCExposureZ {
9918 LDKCOption_MaxDustHTLCExposureZ_Tag tag;
9921 struct LDKMaxDustHTLCExposure some;
9924 } LDKCOption_MaxDustHTLCExposureZ;
9927 * An enum which can either contain a crate::lightning::util::errors::APIError or not
9929 typedef enum LDKCOption_APIErrorZ_Tag {
9931 * When we're in this state, this COption_APIErrorZ contains a crate::lightning::util::errors::APIError
9933 LDKCOption_APIErrorZ_Some,
9935 * When we're in this state, this COption_APIErrorZ contains nothing
9937 LDKCOption_APIErrorZ_None,
9939 * Must be last for serialization purposes
9941 LDKCOption_APIErrorZ_Sentinel,
9942 } LDKCOption_APIErrorZ_Tag;
9944 typedef struct LDKCOption_APIErrorZ {
9945 LDKCOption_APIErrorZ_Tag tag;
9948 struct LDKAPIError some;
9951 } LDKCOption_APIErrorZ;
9954 * The contents of CResult_COption_APIErrorZDecodeErrorZ
9956 typedef union LDKCResult_COption_APIErrorZDecodeErrorZPtr {
9958 * A pointer to the contents in the success state.
9959 * Reading from this pointer when `result_ok` is not set is undefined.
9961 struct LDKCOption_APIErrorZ *result;
9963 * A pointer to the contents in the error state.
9964 * Reading from this pointer when `result_ok` is set is undefined.
9966 struct LDKDecodeError *err;
9967 } LDKCResult_COption_APIErrorZDecodeErrorZPtr;
9970 * A CResult_COption_APIErrorZDecodeErrorZ represents the result of a fallible operation,
9971 * containing a crate::c_types::derived::COption_APIErrorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9972 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9974 typedef struct LDKCResult_COption_APIErrorZDecodeErrorZ {
9976 * The contents of this CResult_COption_APIErrorZDecodeErrorZ, accessible via either
9977 * `err` or `result` depending on the state of `result_ok`.
9979 union LDKCResult_COption_APIErrorZDecodeErrorZPtr contents;
9981 * Whether this CResult_COption_APIErrorZDecodeErrorZ represents a success state.
9984 } LDKCResult_COption_APIErrorZDecodeErrorZ;
9987 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
9989 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
9991 * A pointer to the contents in the success state.
9992 * Reading from this pointer when `result_ok` is not set is undefined.
9994 struct LDKChannelMonitorUpdate *result;
9996 * A pointer to the contents in the error state.
9997 * Reading from this pointer when `result_ok` is set is undefined.
9999 struct LDKDecodeError *err;
10000 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
10003 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
10004 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
10005 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10007 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
10009 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
10010 * `err` or `result` depending on the state of `result_ok`.
10012 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
10014 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
10017 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
10020 * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
10022 typedef enum LDKCOption_MonitorEventZ_Tag {
10024 * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
10026 LDKCOption_MonitorEventZ_Some,
10028 * When we're in this state, this COption_MonitorEventZ contains nothing
10030 LDKCOption_MonitorEventZ_None,
10032 * Must be last for serialization purposes
10034 LDKCOption_MonitorEventZ_Sentinel,
10035 } LDKCOption_MonitorEventZ_Tag;
10037 typedef struct LDKCOption_MonitorEventZ {
10038 LDKCOption_MonitorEventZ_Tag tag;
10041 struct LDKMonitorEvent some;
10044 } LDKCOption_MonitorEventZ;
10047 * The contents of CResult_COption_MonitorEventZDecodeErrorZ
10049 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
10051 * A pointer to the contents in the success state.
10052 * Reading from this pointer when `result_ok` is not set is undefined.
10054 struct LDKCOption_MonitorEventZ *result;
10056 * A pointer to the contents in the error state.
10057 * Reading from this pointer when `result_ok` is set is undefined.
10059 struct LDKDecodeError *err;
10060 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
10063 * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
10064 * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10065 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10067 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
10069 * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
10070 * `err` or `result` depending on the state of `result_ok`.
10072 union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
10074 * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
10077 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
10080 * The contents of CResult_HTLCUpdateDecodeErrorZ
10082 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
10084 * A pointer to the contents in the success state.
10085 * Reading from this pointer when `result_ok` is not set is undefined.
10087 struct LDKHTLCUpdate *result;
10089 * A pointer to the contents in the error state.
10090 * Reading from this pointer when `result_ok` is set is undefined.
10092 struct LDKDecodeError *err;
10093 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
10096 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
10097 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
10098 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10100 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
10102 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
10103 * `err` or `result` depending on the state of `result_ok`.
10105 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
10107 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
10110 } LDKCResult_HTLCUpdateDecodeErrorZ;
10113 * A tuple of 2 elements. See the individual fields for the types contained.
10115 typedef struct LDKC2Tuple_OutPointCVec_u8ZZ {
10117 * The element at position 0
10119 struct LDKOutPoint a;
10121 * The element at position 1
10123 struct LDKCVec_u8Z b;
10124 } LDKC2Tuple_OutPointCVec_u8ZZ;
10127 * A tuple of 2 elements. See the individual fields for the types contained.
10129 typedef struct LDKC2Tuple_u32CVec_u8ZZ {
10131 * The element at position 0
10135 * The element at position 1
10137 struct LDKCVec_u8Z b;
10138 } LDKC2Tuple_u32CVec_u8ZZ;
10141 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32CVec_u8ZZs of arbitrary size.
10142 * This corresponds to std::vector in C++
10144 typedef struct LDKCVec_C2Tuple_u32CVec_u8ZZZ {
10146 * The elements in the array.
10147 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10149 struct LDKC2Tuple_u32CVec_u8ZZ *data;
10151 * The number of elements pointed to by `data`.
10154 } LDKCVec_C2Tuple_u32CVec_u8ZZZ;
10157 * A tuple of 2 elements. See the individual fields for the types contained.
10159 typedef struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ {
10161 * The element at position 0
10163 struct LDKThirtyTwoBytes a;
10165 * The element at position 1
10167 struct LDKCVec_C2Tuple_u32CVec_u8ZZZ b;
10168 } LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ;
10171 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZs of arbitrary size.
10172 * This corresponds to std::vector in C++
10174 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ {
10176 * The elements in the array.
10177 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10179 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *data;
10181 * The number of elements pointed to by `data`.
10184 } LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ;
10187 * A dynamically-allocated array of crate::lightning::ln::chan_utils::CommitmentTransactions of arbitrary size.
10188 * This corresponds to std::vector in C++
10190 typedef struct LDKCVec_CommitmentTransactionZ {
10192 * The elements in the array.
10193 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10195 struct LDKCommitmentTransaction *data;
10197 * The number of elements pointed to by `data`.
10200 } LDKCVec_CommitmentTransactionZ;
10203 * A tuple of 2 elements. See the individual fields for the types contained.
10205 typedef struct LDKC2Tuple_u32TxOutZ {
10207 * The element at position 0
10211 * The element at position 1
10214 } LDKC2Tuple_u32TxOutZ;
10217 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
10218 * This corresponds to std::vector in C++
10220 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
10222 * The elements in the array.
10223 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10225 struct LDKC2Tuple_u32TxOutZ *data;
10227 * The number of elements pointed to by `data`.
10230 } LDKCVec_C2Tuple_u32TxOutZZ;
10233 * A tuple of 2 elements. See the individual fields for the types contained.
10235 typedef struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ {
10237 * The element at position 0
10239 struct LDKThirtyTwoBytes a;
10241 * The element at position 1
10243 struct LDKCVec_C2Tuple_u32TxOutZZ b;
10244 } LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ;
10247 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
10248 * This corresponds to std::vector in C++
10250 typedef struct LDKCVec_TransactionOutputsZ {
10252 * The elements in the array.
10253 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10255 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ *data;
10257 * The number of elements pointed to by `data`.
10260 } LDKCVec_TransactionOutputsZ;
10263 * Details about the balance(s) available for spending once the channel appears on chain.
10265 * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
10268 typedef enum LDKBalance_Tag {
10270 * The channel is not yet closed (or the commitment or closing transaction has not yet
10271 * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
10272 * force-closed now.
10274 LDKBalance_ClaimableOnChannelClose,
10276 * The channel has been closed, and the given balance is ours but awaiting confirmations until
10277 * we consider it spendable.
10279 LDKBalance_ClaimableAwaitingConfirmations,
10281 * The channel has been closed, and the given balance should be ours but awaiting spending
10282 * transaction confirmation. If the spending transaction does not confirm in time, it is
10283 * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
10285 * Once the spending transaction confirms, before it has reached enough confirmations to be
10286 * considered safe from chain reorganizations, the balance will instead be provided via
10287 * [`Balance::ClaimableAwaitingConfirmations`].
10289 LDKBalance_ContentiousClaimable,
10291 * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
10292 * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
10293 * likely to be claimed by our counterparty before we do.
10295 LDKBalance_MaybeTimeoutClaimableHTLC,
10297 * HTLCs which we received from our counterparty which are claimable with a preimage which we
10298 * do not currently have. This will only be claimable if we receive the preimage from the node
10299 * to which we forwarded this HTLC before the timeout.
10301 LDKBalance_MaybePreimageClaimableHTLC,
10303 * The channel has been closed, and our counterparty broadcasted a revoked commitment
10306 * Thus, we're able to claim all outputs in the commitment transaction, one of which has the
10307 * following amount.
10309 LDKBalance_CounterpartyRevokedOutputClaimable,
10311 * Must be last for serialization purposes
10313 LDKBalance_Sentinel,
10316 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
10318 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
10319 * required to do so.
10321 uint64_t amount_satoshis;
10322 } LDKBalance_LDKClaimableOnChannelClose_Body;
10324 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
10326 * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
10327 * were spent in broadcasting the transaction.
10329 uint64_t amount_satoshis;
10331 * The height at which an [`Event::SpendableOutputs`] event will be generated for this
10334 uint32_t confirmation_height;
10335 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
10337 typedef struct LDKBalance_LDKContentiousClaimable_Body {
10339 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
10340 * required to do so.
10342 uint64_t amount_satoshis;
10344 * The height at which the counterparty may be able to claim the balance if we have not
10347 uint32_t timeout_height;
10349 * The payment hash that locks this HTLC.
10351 struct LDKThirtyTwoBytes payment_hash;
10353 * The preimage that can be used to claim this HTLC.
10355 struct LDKThirtyTwoBytes payment_preimage;
10356 } LDKBalance_LDKContentiousClaimable_Body;
10358 typedef struct LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body {
10360 * The amount potentially available to claim, in satoshis, excluding the on-chain fees
10361 * which will be required to do so.
10363 uint64_t amount_satoshis;
10365 * The height at which we will be able to claim the balance if our counterparty has not
10368 uint32_t claimable_height;
10370 * The payment hash whose preimage our counterparty needs to claim this HTLC.
10372 struct LDKThirtyTwoBytes payment_hash;
10373 } LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body;
10375 typedef struct LDKBalance_LDKMaybePreimageClaimableHTLC_Body {
10377 * The amount potentially available to claim, in satoshis, excluding the on-chain fees
10378 * which will be required to do so.
10380 uint64_t amount_satoshis;
10382 * The height at which our counterparty will be able to claim the balance if we have not
10383 * yet received the preimage and claimed it ourselves.
10385 uint32_t expiry_height;
10387 * The payment hash whose preimage we need to claim this HTLC.
10389 struct LDKThirtyTwoBytes payment_hash;
10390 } LDKBalance_LDKMaybePreimageClaimableHTLC_Body;
10392 typedef struct LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body {
10394 * The amount, in satoshis, of the output which we can claim.
10396 * Note that for outputs from HTLC balances this may be excluding some on-chain fees that
10397 * were already spent.
10399 uint64_t amount_satoshis;
10400 } LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body;
10402 typedef struct MUST_USE_STRUCT LDKBalance {
10403 LDKBalance_Tag tag;
10405 LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
10406 LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
10407 LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
10408 LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body maybe_timeout_claimable_htlc;
10409 LDKBalance_LDKMaybePreimageClaimableHTLC_Body maybe_preimage_claimable_htlc;
10410 LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body counterparty_revoked_output_claimable;
10415 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
10416 * This corresponds to std::vector in C++
10418 typedef struct LDKCVec_BalanceZ {
10420 * The elements in the array.
10421 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10423 struct LDKBalance *data;
10425 * The number of elements pointed to by `data`.
10428 } LDKCVec_BalanceZ;
10431 * A tuple of 2 elements. See the individual fields for the types contained.
10433 typedef struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ {
10435 * The element at position 0
10437 struct LDKThirtyTwoBytes a;
10439 * The element at position 1
10441 struct LDKChannelMonitor b;
10442 } LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ;
10445 * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ
10447 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr {
10449 * A pointer to the contents in the success state.
10450 * Reading from this pointer when `result_ok` is not set is undefined.
10452 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *result;
10454 * A pointer to the contents in the error state.
10455 * Reading from this pointer when `result_ok` is set is undefined.
10457 struct LDKDecodeError *err;
10458 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr;
10461 * A CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
10462 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10463 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10465 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ {
10467 * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ, accessible via either
10468 * `err` or `result` depending on the state of `result_ok`.
10470 union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr contents;
10472 * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ represents a success state.
10475 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ;
10478 * Defines a type identifier for sending messages over the wire.
10480 * Messages implementing this trait specify a type and must be [`Writeable`].
10482 typedef struct LDKType {
10484 * An opaque pointer which is passed to your function implementations as an argument.
10485 * This has no meaning in the LDK, and can be NULL or any other value.
10489 * Returns the type identifying the message payload.
10491 uint16_t (*type_id)(const void *this_arg);
10493 * Return a human-readable "debug" string describing this object
10495 struct LDKStr (*debug_str)(const void *this_arg);
10497 * Serialize the object into a byte array
10499 struct LDKCVec_u8Z (*write)(const void *this_arg);
10501 * Called, if set, after this Type has been cloned into a duplicate object.
10502 * The new Type is provided, and should be mutated as needed to perform a
10503 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
10505 void (*cloned)(struct LDKType *NONNULL_PTR new_Type);
10507 * Frees any resources associated with this object given its this_arg pointer.
10508 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10510 void (*free)(void *this_arg);
10514 * A tuple of 2 elements. See the individual fields for the types contained.
10516 typedef struct LDKC2Tuple_PublicKeyTypeZ {
10518 * The element at position 0
10520 struct LDKPublicKey a;
10522 * The element at position 1
10525 } LDKC2Tuple_PublicKeyTypeZ;
10528 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
10529 * This corresponds to std::vector in C++
10531 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
10533 * The elements in the array.
10534 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10536 struct LDKC2Tuple_PublicKeyTypeZ *data;
10538 * The number of elements pointed to by `data`.
10541 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
10544 * The contents of an onion message.
10546 typedef struct LDKOnionMessageContents {
10548 * An opaque pointer which is passed to your function implementations as an argument.
10549 * This has no meaning in the LDK, and can be NULL or any other value.
10553 * Returns the TLV type identifying the message contents. MUST be >= 64.
10555 uint64_t (*tlv_type)(const void *this_arg);
10557 * Serialize the object into a byte array
10559 struct LDKCVec_u8Z (*write)(const void *this_arg);
10561 * Called, if set, after this OnionMessageContents has been cloned into a duplicate object.
10562 * The new OnionMessageContents is provided, and should be mutated as needed to perform a
10563 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
10565 void (*cloned)(struct LDKOnionMessageContents *NONNULL_PTR new_OnionMessageContents);
10567 * Frees any resources associated with this object given its this_arg pointer.
10568 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10570 void (*free)(void *this_arg);
10571 } LDKOnionMessageContents;
10574 * An enum which can either contain a crate::lightning::onion_message::packet::OnionMessageContents or not
10576 typedef enum LDKCOption_OnionMessageContentsZ_Tag {
10578 * When we're in this state, this COption_OnionMessageContentsZ contains a crate::lightning::onion_message::packet::OnionMessageContents
10580 LDKCOption_OnionMessageContentsZ_Some,
10582 * When we're in this state, this COption_OnionMessageContentsZ contains nothing
10584 LDKCOption_OnionMessageContentsZ_None,
10586 * Must be last for serialization purposes
10588 LDKCOption_OnionMessageContentsZ_Sentinel,
10589 } LDKCOption_OnionMessageContentsZ_Tag;
10591 typedef struct LDKCOption_OnionMessageContentsZ {
10592 LDKCOption_OnionMessageContentsZ_Tag tag;
10595 struct LDKOnionMessageContents some;
10598 } LDKCOption_OnionMessageContentsZ;
10601 * The contents of CResult_COption_OnionMessageContentsZDecodeErrorZ
10603 typedef union LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr {
10605 * A pointer to the contents in the success state.
10606 * Reading from this pointer when `result_ok` is not set is undefined.
10608 struct LDKCOption_OnionMessageContentsZ *result;
10610 * A pointer to the contents in the error state.
10611 * Reading from this pointer when `result_ok` is set is undefined.
10613 struct LDKDecodeError *err;
10614 } LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr;
10617 * A CResult_COption_OnionMessageContentsZDecodeErrorZ represents the result of a fallible operation,
10618 * containing a crate::c_types::derived::COption_OnionMessageContentsZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10619 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10621 typedef struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ {
10623 * The contents of this CResult_COption_OnionMessageContentsZDecodeErrorZ, accessible via either
10624 * `err` or `result` depending on the state of `result_ok`.
10626 union LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr contents;
10628 * Whether this CResult_COption_OnionMessageContentsZDecodeErrorZ represents a success state.
10631 } LDKCResult_COption_OnionMessageContentsZDecodeErrorZ;
10634 * A tuple of 3 elements. See the individual fields for the types contained.
10636 typedef struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ {
10638 * The element at position 0
10640 struct LDKOnionMessageContents a;
10642 * The element at position 1
10644 struct LDKDestination b;
10646 * The element at position 2
10648 struct LDKBlindedPath c;
10649 } LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ;
10652 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OnionMessageContentsDestinationBlindedPathZs of arbitrary size.
10653 * This corresponds to std::vector in C++
10655 typedef struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ {
10657 * The elements in the array.
10658 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10660 struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *data;
10662 * The number of elements pointed to by `data`.
10665 } LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ;
10668 * An enum which can either contain a crate::lightning::ln::wire::Type or not
10670 typedef enum LDKCOption_TypeZ_Tag {
10672 * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
10674 LDKCOption_TypeZ_Some,
10676 * When we're in this state, this COption_TypeZ contains nothing
10678 LDKCOption_TypeZ_None,
10680 * Must be last for serialization purposes
10682 LDKCOption_TypeZ_Sentinel,
10683 } LDKCOption_TypeZ_Tag;
10685 typedef struct LDKCOption_TypeZ {
10686 LDKCOption_TypeZ_Tag tag;
10689 struct LDKType some;
10692 } LDKCOption_TypeZ;
10695 * The contents of CResult_COption_TypeZDecodeErrorZ
10697 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
10699 * A pointer to the contents in the success state.
10700 * Reading from this pointer when `result_ok` is not set is undefined.
10702 struct LDKCOption_TypeZ *result;
10704 * A pointer to the contents in the error state.
10705 * Reading from this pointer when `result_ok` is set is undefined.
10707 struct LDKDecodeError *err;
10708 } LDKCResult_COption_TypeZDecodeErrorZPtr;
10711 * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
10712 * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10713 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10715 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
10717 * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
10718 * `err` or `result` depending on the state of `result_ok`.
10720 union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
10722 * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
10725 } LDKCResult_COption_TypeZDecodeErrorZ;
10728 * An enum which can either contain a crate::lightning::ln::msgs::SocketAddress or not
10730 typedef enum LDKCOption_SocketAddressZ_Tag {
10732 * When we're in this state, this COption_SocketAddressZ contains a crate::lightning::ln::msgs::SocketAddress
10734 LDKCOption_SocketAddressZ_Some,
10736 * When we're in this state, this COption_SocketAddressZ contains nothing
10738 LDKCOption_SocketAddressZ_None,
10740 * Must be last for serialization purposes
10742 LDKCOption_SocketAddressZ_Sentinel,
10743 } LDKCOption_SocketAddressZ_Tag;
10745 typedef struct LDKCOption_SocketAddressZ {
10746 LDKCOption_SocketAddressZ_Tag tag;
10749 struct LDKSocketAddress some;
10752 } LDKCOption_SocketAddressZ;
10755 * A tuple of 2 elements. See the individual fields for the types contained.
10757 typedef struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ {
10759 * The element at position 0
10761 struct LDKPublicKey a;
10763 * The element at position 1
10765 struct LDKCOption_SocketAddressZ b;
10766 } LDKC2Tuple_PublicKeyCOption_SocketAddressZZ;
10769 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyCOption_SocketAddressZZs of arbitrary size.
10770 * This corresponds to std::vector in C++
10772 typedef struct LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ {
10774 * The elements in the array.
10775 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10777 struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ *data;
10779 * The number of elements pointed to by `data`.
10782 } LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ;
10787 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
10788 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
10791 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
10793 * A pointer to the opaque Rust object.
10794 * Nearly everywhere, inner must be non-null, however in places where
10795 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10797 LDKnativePeerHandleError *inner;
10799 * Indicates that this is the only struct which contains the same pointer.
10800 * Rust functions which take ownership of an object provided via an argument require
10801 * this to be true and invalidate the object pointed to by inner.
10804 } LDKPeerHandleError;
10807 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
10809 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
10811 * A pointer to the contents in the success state.
10812 * Reading from this pointer when `result_ok` is not set is undefined.
10814 struct LDKCVec_u8Z *result;
10816 * A pointer to the contents in the error state.
10817 * Reading from this pointer when `result_ok` is set is undefined.
10819 struct LDKPeerHandleError *err;
10820 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
10823 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
10824 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
10825 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10827 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
10829 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
10830 * `err` or `result` depending on the state of `result_ok`.
10832 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
10834 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
10837 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
10840 * The contents of CResult_NonePeerHandleErrorZ
10842 typedef union LDKCResult_NonePeerHandleErrorZPtr {
10844 * Note that this value is always NULL, as there are no contents in the OK variant
10848 * A pointer to the contents in the error state.
10849 * Reading from this pointer when `result_ok` is set is undefined.
10851 struct LDKPeerHandleError *err;
10852 } LDKCResult_NonePeerHandleErrorZPtr;
10855 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
10856 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
10857 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10859 typedef struct LDKCResult_NonePeerHandleErrorZ {
10861 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
10862 * `err` or `result` depending on the state of `result_ok`.
10864 union LDKCResult_NonePeerHandleErrorZPtr contents;
10866 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
10869 } LDKCResult_NonePeerHandleErrorZ;
10872 * The contents of CResult_boolPeerHandleErrorZ
10874 typedef union LDKCResult_boolPeerHandleErrorZPtr {
10876 * A pointer to the contents in the success state.
10877 * Reading from this pointer when `result_ok` is not set is undefined.
10881 * A pointer to the contents in the error state.
10882 * Reading from this pointer when `result_ok` is set is undefined.
10884 struct LDKPeerHandleError *err;
10885 } LDKCResult_boolPeerHandleErrorZPtr;
10888 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
10889 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
10890 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10892 typedef struct LDKCResult_boolPeerHandleErrorZ {
10894 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
10895 * `err` or `result` depending on the state of `result_ok`.
10897 union LDKCResult_boolPeerHandleErrorZPtr contents;
10899 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
10902 } LDKCResult_boolPeerHandleErrorZ;
10905 * All-encompassing standard error type that processing can return
10907 typedef enum LDKGraphSyncError_Tag {
10909 * Error trying to read the update data, typically due to an erroneous data length indication
10910 * that is greater than the actual amount of data provided
10912 LDKGraphSyncError_DecodeError,
10914 * Error applying the patch to the network graph, usually the result of updates that are too
10915 * old or missing prerequisite data to the application of updates out of order
10917 LDKGraphSyncError_LightningError,
10919 * Must be last for serialization purposes
10921 LDKGraphSyncError_Sentinel,
10922 } LDKGraphSyncError_Tag;
10924 typedef struct MUST_USE_STRUCT LDKGraphSyncError {
10925 LDKGraphSyncError_Tag tag;
10928 struct LDKDecodeError decode_error;
10931 struct LDKLightningError lightning_error;
10934 } LDKGraphSyncError;
10937 * The contents of CResult_u32GraphSyncErrorZ
10939 typedef union LDKCResult_u32GraphSyncErrorZPtr {
10941 * A pointer to the contents in the success state.
10942 * Reading from this pointer when `result_ok` is not set is undefined.
10946 * A pointer to the contents in the error state.
10947 * Reading from this pointer when `result_ok` is set is undefined.
10949 struct LDKGraphSyncError *err;
10950 } LDKCResult_u32GraphSyncErrorZPtr;
10953 * A CResult_u32GraphSyncErrorZ represents the result of a fallible operation,
10954 * containing a u32 on success and a crate::lightning_rapid_gossip_sync::error::GraphSyncError on failure.
10955 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10957 typedef struct LDKCResult_u32GraphSyncErrorZ {
10959 * The contents of this CResult_u32GraphSyncErrorZ, accessible via either
10960 * `err` or `result` depending on the state of `result_ok`.
10962 union LDKCResult_u32GraphSyncErrorZPtr contents;
10964 * Whether this CResult_u32GraphSyncErrorZ represents a success state.
10967 } LDKCResult_u32GraphSyncErrorZ;
10970 * The contents of CResult_CVec_u8ZIOErrorZ
10972 typedef union LDKCResult_CVec_u8ZIOErrorZPtr {
10974 * A pointer to the contents in the success state.
10975 * Reading from this pointer when `result_ok` is not set is undefined.
10977 struct LDKCVec_u8Z *result;
10979 * A pointer to the contents in the error state.
10980 * Reading from this pointer when `result_ok` is set is undefined.
10982 enum LDKIOError *err;
10983 } LDKCResult_CVec_u8ZIOErrorZPtr;
10986 * A CResult_CVec_u8ZIOErrorZ represents the result of a fallible operation,
10987 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::c_types::IOError on failure.
10988 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10990 typedef struct LDKCResult_CVec_u8ZIOErrorZ {
10992 * The contents of this CResult_CVec_u8ZIOErrorZ, accessible via either
10993 * `err` or `result` depending on the state of `result_ok`.
10995 union LDKCResult_CVec_u8ZIOErrorZPtr contents;
10997 * Whether this CResult_CVec_u8ZIOErrorZ represents a success state.
11000 } LDKCResult_CVec_u8ZIOErrorZ;
11003 * A dynamically-allocated array of crate::c_types::Strs of arbitrary size.
11004 * This corresponds to std::vector in C++
11006 typedef struct LDKCVec_StrZ {
11008 * The elements in the array.
11009 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11011 struct LDKStr *data;
11013 * The number of elements pointed to by `data`.
11019 * The contents of CResult_CVec_StrZIOErrorZ
11021 typedef union LDKCResult_CVec_StrZIOErrorZPtr {
11023 * A pointer to the contents in the success state.
11024 * Reading from this pointer when `result_ok` is not set is undefined.
11026 struct LDKCVec_StrZ *result;
11028 * A pointer to the contents in the error state.
11029 * Reading from this pointer when `result_ok` is set is undefined.
11031 enum LDKIOError *err;
11032 } LDKCResult_CVec_StrZIOErrorZPtr;
11035 * A CResult_CVec_StrZIOErrorZ represents the result of a fallible operation,
11036 * containing a crate::c_types::derived::CVec_StrZ on success and a crate::c_types::IOError on failure.
11037 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11039 typedef struct LDKCResult_CVec_StrZIOErrorZ {
11041 * The contents of this CResult_CVec_StrZIOErrorZ, accessible via either
11042 * `err` or `result` depending on the state of `result_ok`.
11044 union LDKCResult_CVec_StrZIOErrorZPtr contents;
11046 * Whether this CResult_CVec_StrZIOErrorZ represents a success state.
11049 } LDKCResult_CVec_StrZIOErrorZ;
11052 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZs of arbitrary size.
11053 * This corresponds to std::vector in C++
11055 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ {
11057 * The elements in the array.
11058 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11060 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *data;
11062 * The number of elements pointed to by `data`.
11065 } LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ;
11068 * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ
11070 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr {
11072 * A pointer to the contents in the success state.
11073 * Reading from this pointer when `result_ok` is not set is undefined.
11075 struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ *result;
11077 * A pointer to the contents in the error state.
11078 * Reading from this pointer when `result_ok` is set is undefined.
11080 enum LDKIOError *err;
11081 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr;
11084 * A CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ represents the result of a fallible operation,
11085 * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ on success and a crate::c_types::IOError on failure.
11086 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11088 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ {
11090 * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ, accessible via either
11091 * `err` or `result` depending on the state of `result_ok`.
11093 union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr contents;
11095 * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ represents a success state.
11098 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ;
11101 * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ
11103 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr {
11105 * A pointer to the contents in the success state.
11106 * Reading from this pointer when `result_ok` is not set is undefined.
11108 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *result;
11110 * A pointer to the contents in the error state.
11111 * Reading from this pointer when `result_ok` is set is undefined.
11113 enum LDKIOError *err;
11114 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr;
11117 * A CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ represents the result of a fallible operation,
11118 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZ on success and a crate::c_types::IOError on failure.
11119 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11121 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ {
11123 * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ, accessible via either
11124 * `err` or `result` depending on the state of `result_ok`.
11126 union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr contents;
11128 * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ represents a success state.
11131 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ;
11134 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
11136 typedef struct LDKSecretKey {
11138 * The bytes of the secret key
11144 * An enum which can either contain a crate::c_types::SecretKey or not
11146 typedef enum LDKCOption_SecretKeyZ_Tag {
11148 * When we're in this state, this COption_SecretKeyZ contains a crate::c_types::SecretKey
11150 LDKCOption_SecretKeyZ_Some,
11152 * When we're in this state, this COption_SecretKeyZ contains nothing
11154 LDKCOption_SecretKeyZ_None,
11156 * Must be last for serialization purposes
11158 LDKCOption_SecretKeyZ_Sentinel,
11159 } LDKCOption_SecretKeyZ_Tag;
11161 typedef struct LDKCOption_SecretKeyZ {
11162 LDKCOption_SecretKeyZ_Tag tag;
11165 struct LDKSecretKey some;
11168 } LDKCOption_SecretKeyZ;
11173 * An [`InvoiceRequest`] that has been verified by [`InvoiceRequest::verify`] and exposes different
11174 * ways to respond depending on whether the signing keys were derived.
11176 typedef struct MUST_USE_STRUCT LDKVerifiedInvoiceRequest {
11178 * A pointer to the opaque Rust object.
11179 * Nearly everywhere, inner must be non-null, however in places where
11180 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11182 LDKnativeVerifiedInvoiceRequest *inner;
11184 * Indicates that this is the only struct which contains the same pointer.
11185 * Rust functions which take ownership of an object provided via an argument require
11186 * this to be true and invalidate the object pointed to by inner.
11189 } LDKVerifiedInvoiceRequest;
11192 * The contents of CResult_VerifiedInvoiceRequestNoneZ
11194 typedef union LDKCResult_VerifiedInvoiceRequestNoneZPtr {
11196 * A pointer to the contents in the success state.
11197 * Reading from this pointer when `result_ok` is not set is undefined.
11199 struct LDKVerifiedInvoiceRequest *result;
11201 * Note that this value is always NULL, as there are no contents in the Err variant
11204 } LDKCResult_VerifiedInvoiceRequestNoneZPtr;
11207 * A CResult_VerifiedInvoiceRequestNoneZ represents the result of a fallible operation,
11208 * containing a crate::lightning::offers::invoice_request::VerifiedInvoiceRequest on success and a () on failure.
11209 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11211 typedef struct LDKCResult_VerifiedInvoiceRequestNoneZ {
11213 * The contents of this CResult_VerifiedInvoiceRequestNoneZ, accessible via either
11214 * `err` or `result` depending on the state of `result_ok`.
11216 union LDKCResult_VerifiedInvoiceRequestNoneZPtr contents;
11218 * Whether this CResult_VerifiedInvoiceRequestNoneZ represents a success state.
11221 } LDKCResult_VerifiedInvoiceRequestNoneZ;
11224 * A dynamically-allocated array of crate::c_types::Witnesss of arbitrary size.
11225 * This corresponds to std::vector in C++
11227 typedef struct LDKCVec_WitnessZ {
11229 * The elements in the array.
11230 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11232 struct LDKWitness *data;
11234 * The number of elements pointed to by `data`.
11237 } LDKCVec_WitnessZ;
11240 * An enum which can either contain a i64 or not
11242 typedef enum LDKCOption_i64Z_Tag {
11244 * When we're in this state, this COption_i64Z contains a i64
11246 LDKCOption_i64Z_Some,
11248 * When we're in this state, this COption_i64Z contains nothing
11250 LDKCOption_i64Z_None,
11252 * Must be last for serialization purposes
11254 LDKCOption_i64Z_Sentinel,
11255 } LDKCOption_i64Z_Tag;
11257 typedef struct LDKCOption_i64Z {
11258 LDKCOption_i64Z_Tag tag;
11267 * The contents of CResult_SocketAddressDecodeErrorZ
11269 typedef union LDKCResult_SocketAddressDecodeErrorZPtr {
11271 * A pointer to the contents in the success state.
11272 * Reading from this pointer when `result_ok` is not set is undefined.
11274 struct LDKSocketAddress *result;
11276 * A pointer to the contents in the error state.
11277 * Reading from this pointer when `result_ok` is set is undefined.
11279 struct LDKDecodeError *err;
11280 } LDKCResult_SocketAddressDecodeErrorZPtr;
11283 * A CResult_SocketAddressDecodeErrorZ represents the result of a fallible operation,
11284 * containing a crate::lightning::ln::msgs::SocketAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
11285 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11287 typedef struct LDKCResult_SocketAddressDecodeErrorZ {
11289 * The contents of this CResult_SocketAddressDecodeErrorZ, accessible via either
11290 * `err` or `result` depending on the state of `result_ok`.
11292 union LDKCResult_SocketAddressDecodeErrorZPtr contents;
11294 * Whether this CResult_SocketAddressDecodeErrorZ represents a success state.
11297 } LDKCResult_SocketAddressDecodeErrorZ;
11300 * The contents of CResult_SocketAddressSocketAddressParseErrorZ
11302 typedef union LDKCResult_SocketAddressSocketAddressParseErrorZPtr {
11304 * A pointer to the contents in the success state.
11305 * Reading from this pointer when `result_ok` is not set is undefined.
11307 struct LDKSocketAddress *result;
11309 * A pointer to the contents in the error state.
11310 * Reading from this pointer when `result_ok` is set is undefined.
11312 enum LDKSocketAddressParseError *err;
11313 } LDKCResult_SocketAddressSocketAddressParseErrorZPtr;
11316 * A CResult_SocketAddressSocketAddressParseErrorZ represents the result of a fallible operation,
11317 * containing a crate::lightning::ln::msgs::SocketAddress on success and a crate::lightning::ln::msgs::SocketAddressParseError on failure.
11318 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11320 typedef struct LDKCResult_SocketAddressSocketAddressParseErrorZ {
11322 * The contents of this CResult_SocketAddressSocketAddressParseErrorZ, accessible via either
11323 * `err` or `result` depending on the state of `result_ok`.
11325 union LDKCResult_SocketAddressSocketAddressParseErrorZPtr contents;
11327 * Whether this CResult_SocketAddressSocketAddressParseErrorZ represents a success state.
11330 } LDKCResult_SocketAddressSocketAddressParseErrorZ;
11335 * An [`update_add_htlc`] message to be sent to or received from a peer.
11337 * [`update_add_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#adding-an-htlc-update_add_htlc
11339 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
11341 * A pointer to the opaque Rust object.
11342 * Nearly everywhere, inner must be non-null, however in places where
11343 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11345 LDKnativeUpdateAddHTLC *inner;
11347 * Indicates that this is the only struct which contains the same pointer.
11348 * Rust functions which take ownership of an object provided via an argument require
11349 * this to be true and invalidate the object pointed to by inner.
11352 } LDKUpdateAddHTLC;
11355 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
11356 * This corresponds to std::vector in C++
11358 typedef struct LDKCVec_UpdateAddHTLCZ {
11360 * The elements in the array.
11361 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11363 struct LDKUpdateAddHTLC *data;
11365 * The number of elements pointed to by `data`.
11368 } LDKCVec_UpdateAddHTLCZ;
11373 * An [`update_fulfill_htlc`] message to be sent to or received from a peer.
11375 * [`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
11377 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
11379 * A pointer to the opaque Rust object.
11380 * Nearly everywhere, inner must be non-null, however in places where
11381 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11383 LDKnativeUpdateFulfillHTLC *inner;
11385 * Indicates that this is the only struct which contains the same pointer.
11386 * Rust functions which take ownership of an object provided via an argument require
11387 * this to be true and invalidate the object pointed to by inner.
11390 } LDKUpdateFulfillHTLC;
11393 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
11394 * This corresponds to std::vector in C++
11396 typedef struct LDKCVec_UpdateFulfillHTLCZ {
11398 * The elements in the array.
11399 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11401 struct LDKUpdateFulfillHTLC *data;
11403 * The number of elements pointed to by `data`.
11406 } LDKCVec_UpdateFulfillHTLCZ;
11411 * An [`update_fail_htlc`] message to be sent to or received from a peer.
11413 * [`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
11415 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
11417 * A pointer to the opaque Rust object.
11418 * Nearly everywhere, inner must be non-null, however in places where
11419 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11421 LDKnativeUpdateFailHTLC *inner;
11423 * Indicates that this is the only struct which contains the same pointer.
11424 * Rust functions which take ownership of an object provided via an argument require
11425 * this to be true and invalidate the object pointed to by inner.
11428 } LDKUpdateFailHTLC;
11431 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
11432 * This corresponds to std::vector in C++
11434 typedef struct LDKCVec_UpdateFailHTLCZ {
11436 * The elements in the array.
11437 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11439 struct LDKUpdateFailHTLC *data;
11441 * The number of elements pointed to by `data`.
11444 } LDKCVec_UpdateFailHTLCZ;
11449 * An [`update_fail_malformed_htlc`] message to be sent to or received from a peer.
11451 * [`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
11453 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
11455 * A pointer to the opaque Rust object.
11456 * Nearly everywhere, inner must be non-null, however in places where
11457 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11459 LDKnativeUpdateFailMalformedHTLC *inner;
11461 * Indicates that this is the only struct which contains the same pointer.
11462 * Rust functions which take ownership of an object provided via an argument require
11463 * this to be true and invalidate the object pointed to by inner.
11466 } LDKUpdateFailMalformedHTLC;
11469 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
11470 * This corresponds to std::vector in C++
11472 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
11474 * The elements in the array.
11475 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11477 struct LDKUpdateFailMalformedHTLC *data;
11479 * The number of elements pointed to by `data`.
11482 } LDKCVec_UpdateFailMalformedHTLCZ;
11485 * The contents of CResult_AcceptChannelDecodeErrorZ
11487 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
11489 * A pointer to the contents in the success state.
11490 * Reading from this pointer when `result_ok` is not set is undefined.
11492 struct LDKAcceptChannel *result;
11494 * A pointer to the contents in the error state.
11495 * Reading from this pointer when `result_ok` is set is undefined.
11497 struct LDKDecodeError *err;
11498 } LDKCResult_AcceptChannelDecodeErrorZPtr;
11501 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
11502 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
11503 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11505 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
11507 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
11508 * `err` or `result` depending on the state of `result_ok`.
11510 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
11512 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
11515 } LDKCResult_AcceptChannelDecodeErrorZ;
11518 * The contents of CResult_AcceptChannelV2DecodeErrorZ
11520 typedef union LDKCResult_AcceptChannelV2DecodeErrorZPtr {
11522 * A pointer to the contents in the success state.
11523 * Reading from this pointer when `result_ok` is not set is undefined.
11525 struct LDKAcceptChannelV2 *result;
11527 * A pointer to the contents in the error state.
11528 * Reading from this pointer when `result_ok` is set is undefined.
11530 struct LDKDecodeError *err;
11531 } LDKCResult_AcceptChannelV2DecodeErrorZPtr;
11534 * A CResult_AcceptChannelV2DecodeErrorZ represents the result of a fallible operation,
11535 * containing a crate::lightning::ln::msgs::AcceptChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
11536 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11538 typedef struct LDKCResult_AcceptChannelV2DecodeErrorZ {
11540 * The contents of this CResult_AcceptChannelV2DecodeErrorZ, accessible via either
11541 * `err` or `result` depending on the state of `result_ok`.
11543 union LDKCResult_AcceptChannelV2DecodeErrorZPtr contents;
11545 * Whether this CResult_AcceptChannelV2DecodeErrorZ represents a success state.
11548 } LDKCResult_AcceptChannelV2DecodeErrorZ;
11551 * The contents of CResult_TxAddInputDecodeErrorZ
11553 typedef union LDKCResult_TxAddInputDecodeErrorZPtr {
11555 * A pointer to the contents in the success state.
11556 * Reading from this pointer when `result_ok` is not set is undefined.
11558 struct LDKTxAddInput *result;
11560 * A pointer to the contents in the error state.
11561 * Reading from this pointer when `result_ok` is set is undefined.
11563 struct LDKDecodeError *err;
11564 } LDKCResult_TxAddInputDecodeErrorZPtr;
11567 * A CResult_TxAddInputDecodeErrorZ represents the result of a fallible operation,
11568 * containing a crate::lightning::ln::msgs::TxAddInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
11569 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11571 typedef struct LDKCResult_TxAddInputDecodeErrorZ {
11573 * The contents of this CResult_TxAddInputDecodeErrorZ, accessible via either
11574 * `err` or `result` depending on the state of `result_ok`.
11576 union LDKCResult_TxAddInputDecodeErrorZPtr contents;
11578 * Whether this CResult_TxAddInputDecodeErrorZ represents a success state.
11581 } LDKCResult_TxAddInputDecodeErrorZ;
11584 * The contents of CResult_TxAddOutputDecodeErrorZ
11586 typedef union LDKCResult_TxAddOutputDecodeErrorZPtr {
11588 * A pointer to the contents in the success state.
11589 * Reading from this pointer when `result_ok` is not set is undefined.
11591 struct LDKTxAddOutput *result;
11593 * A pointer to the contents in the error state.
11594 * Reading from this pointer when `result_ok` is set is undefined.
11596 struct LDKDecodeError *err;
11597 } LDKCResult_TxAddOutputDecodeErrorZPtr;
11600 * A CResult_TxAddOutputDecodeErrorZ represents the result of a fallible operation,
11601 * containing a crate::lightning::ln::msgs::TxAddOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
11602 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11604 typedef struct LDKCResult_TxAddOutputDecodeErrorZ {
11606 * The contents of this CResult_TxAddOutputDecodeErrorZ, accessible via either
11607 * `err` or `result` depending on the state of `result_ok`.
11609 union LDKCResult_TxAddOutputDecodeErrorZPtr contents;
11611 * Whether this CResult_TxAddOutputDecodeErrorZ represents a success state.
11614 } LDKCResult_TxAddOutputDecodeErrorZ;
11617 * The contents of CResult_TxRemoveInputDecodeErrorZ
11619 typedef union LDKCResult_TxRemoveInputDecodeErrorZPtr {
11621 * A pointer to the contents in the success state.
11622 * Reading from this pointer when `result_ok` is not set is undefined.
11624 struct LDKTxRemoveInput *result;
11626 * A pointer to the contents in the error state.
11627 * Reading from this pointer when `result_ok` is set is undefined.
11629 struct LDKDecodeError *err;
11630 } LDKCResult_TxRemoveInputDecodeErrorZPtr;
11633 * A CResult_TxRemoveInputDecodeErrorZ represents the result of a fallible operation,
11634 * containing a crate::lightning::ln::msgs::TxRemoveInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
11635 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11637 typedef struct LDKCResult_TxRemoveInputDecodeErrorZ {
11639 * The contents of this CResult_TxRemoveInputDecodeErrorZ, accessible via either
11640 * `err` or `result` depending on the state of `result_ok`.
11642 union LDKCResult_TxRemoveInputDecodeErrorZPtr contents;
11644 * Whether this CResult_TxRemoveInputDecodeErrorZ represents a success state.
11647 } LDKCResult_TxRemoveInputDecodeErrorZ;
11650 * The contents of CResult_TxRemoveOutputDecodeErrorZ
11652 typedef union LDKCResult_TxRemoveOutputDecodeErrorZPtr {
11654 * A pointer to the contents in the success state.
11655 * Reading from this pointer when `result_ok` is not set is undefined.
11657 struct LDKTxRemoveOutput *result;
11659 * A pointer to the contents in the error state.
11660 * Reading from this pointer when `result_ok` is set is undefined.
11662 struct LDKDecodeError *err;
11663 } LDKCResult_TxRemoveOutputDecodeErrorZPtr;
11666 * A CResult_TxRemoveOutputDecodeErrorZ represents the result of a fallible operation,
11667 * containing a crate::lightning::ln::msgs::TxRemoveOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
11668 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11670 typedef struct LDKCResult_TxRemoveOutputDecodeErrorZ {
11672 * The contents of this CResult_TxRemoveOutputDecodeErrorZ, accessible via either
11673 * `err` or `result` depending on the state of `result_ok`.
11675 union LDKCResult_TxRemoveOutputDecodeErrorZPtr contents;
11677 * Whether this CResult_TxRemoveOutputDecodeErrorZ represents a success state.
11680 } LDKCResult_TxRemoveOutputDecodeErrorZ;
11683 * The contents of CResult_TxCompleteDecodeErrorZ
11685 typedef union LDKCResult_TxCompleteDecodeErrorZPtr {
11687 * A pointer to the contents in the success state.
11688 * Reading from this pointer when `result_ok` is not set is undefined.
11690 struct LDKTxComplete *result;
11692 * A pointer to the contents in the error state.
11693 * Reading from this pointer when `result_ok` is set is undefined.
11695 struct LDKDecodeError *err;
11696 } LDKCResult_TxCompleteDecodeErrorZPtr;
11699 * A CResult_TxCompleteDecodeErrorZ represents the result of a fallible operation,
11700 * containing a crate::lightning::ln::msgs::TxComplete on success and a crate::lightning::ln::msgs::DecodeError on failure.
11701 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11703 typedef struct LDKCResult_TxCompleteDecodeErrorZ {
11705 * The contents of this CResult_TxCompleteDecodeErrorZ, accessible via either
11706 * `err` or `result` depending on the state of `result_ok`.
11708 union LDKCResult_TxCompleteDecodeErrorZPtr contents;
11710 * Whether this CResult_TxCompleteDecodeErrorZ represents a success state.
11713 } LDKCResult_TxCompleteDecodeErrorZ;
11716 * The contents of CResult_TxSignaturesDecodeErrorZ
11718 typedef union LDKCResult_TxSignaturesDecodeErrorZPtr {
11720 * A pointer to the contents in the success state.
11721 * Reading from this pointer when `result_ok` is not set is undefined.
11723 struct LDKTxSignatures *result;
11725 * A pointer to the contents in the error state.
11726 * Reading from this pointer when `result_ok` is set is undefined.
11728 struct LDKDecodeError *err;
11729 } LDKCResult_TxSignaturesDecodeErrorZPtr;
11732 * A CResult_TxSignaturesDecodeErrorZ represents the result of a fallible operation,
11733 * containing a crate::lightning::ln::msgs::TxSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
11734 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11736 typedef struct LDKCResult_TxSignaturesDecodeErrorZ {
11738 * The contents of this CResult_TxSignaturesDecodeErrorZ, accessible via either
11739 * `err` or `result` depending on the state of `result_ok`.
11741 union LDKCResult_TxSignaturesDecodeErrorZPtr contents;
11743 * Whether this CResult_TxSignaturesDecodeErrorZ represents a success state.
11746 } LDKCResult_TxSignaturesDecodeErrorZ;
11749 * The contents of CResult_TxInitRbfDecodeErrorZ
11751 typedef union LDKCResult_TxInitRbfDecodeErrorZPtr {
11753 * A pointer to the contents in the success state.
11754 * Reading from this pointer when `result_ok` is not set is undefined.
11756 struct LDKTxInitRbf *result;
11758 * A pointer to the contents in the error state.
11759 * Reading from this pointer when `result_ok` is set is undefined.
11761 struct LDKDecodeError *err;
11762 } LDKCResult_TxInitRbfDecodeErrorZPtr;
11765 * A CResult_TxInitRbfDecodeErrorZ represents the result of a fallible operation,
11766 * containing a crate::lightning::ln::msgs::TxInitRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
11767 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11769 typedef struct LDKCResult_TxInitRbfDecodeErrorZ {
11771 * The contents of this CResult_TxInitRbfDecodeErrorZ, accessible via either
11772 * `err` or `result` depending on the state of `result_ok`.
11774 union LDKCResult_TxInitRbfDecodeErrorZPtr contents;
11776 * Whether this CResult_TxInitRbfDecodeErrorZ represents a success state.
11779 } LDKCResult_TxInitRbfDecodeErrorZ;
11782 * The contents of CResult_TxAckRbfDecodeErrorZ
11784 typedef union LDKCResult_TxAckRbfDecodeErrorZPtr {
11786 * A pointer to the contents in the success state.
11787 * Reading from this pointer when `result_ok` is not set is undefined.
11789 struct LDKTxAckRbf *result;
11791 * A pointer to the contents in the error state.
11792 * Reading from this pointer when `result_ok` is set is undefined.
11794 struct LDKDecodeError *err;
11795 } LDKCResult_TxAckRbfDecodeErrorZPtr;
11798 * A CResult_TxAckRbfDecodeErrorZ represents the result of a fallible operation,
11799 * containing a crate::lightning::ln::msgs::TxAckRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
11800 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11802 typedef struct LDKCResult_TxAckRbfDecodeErrorZ {
11804 * The contents of this CResult_TxAckRbfDecodeErrorZ, accessible via either
11805 * `err` or `result` depending on the state of `result_ok`.
11807 union LDKCResult_TxAckRbfDecodeErrorZPtr contents;
11809 * Whether this CResult_TxAckRbfDecodeErrorZ represents a success state.
11812 } LDKCResult_TxAckRbfDecodeErrorZ;
11815 * The contents of CResult_TxAbortDecodeErrorZ
11817 typedef union LDKCResult_TxAbortDecodeErrorZPtr {
11819 * A pointer to the contents in the success state.
11820 * Reading from this pointer when `result_ok` is not set is undefined.
11822 struct LDKTxAbort *result;
11824 * A pointer to the contents in the error state.
11825 * Reading from this pointer when `result_ok` is set is undefined.
11827 struct LDKDecodeError *err;
11828 } LDKCResult_TxAbortDecodeErrorZPtr;
11831 * A CResult_TxAbortDecodeErrorZ represents the result of a fallible operation,
11832 * containing a crate::lightning::ln::msgs::TxAbort on success and a crate::lightning::ln::msgs::DecodeError on failure.
11833 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11835 typedef struct LDKCResult_TxAbortDecodeErrorZ {
11837 * The contents of this CResult_TxAbortDecodeErrorZ, accessible via either
11838 * `err` or `result` depending on the state of `result_ok`.
11840 union LDKCResult_TxAbortDecodeErrorZPtr contents;
11842 * Whether this CResult_TxAbortDecodeErrorZ represents a success state.
11845 } LDKCResult_TxAbortDecodeErrorZ;
11848 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
11850 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
11852 * A pointer to the contents in the success state.
11853 * Reading from this pointer when `result_ok` is not set is undefined.
11855 struct LDKAnnouncementSignatures *result;
11857 * A pointer to the contents in the error state.
11858 * Reading from this pointer when `result_ok` is set is undefined.
11860 struct LDKDecodeError *err;
11861 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
11864 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
11865 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
11866 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11868 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
11870 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
11871 * `err` or `result` depending on the state of `result_ok`.
11873 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
11875 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
11878 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
11881 * The contents of CResult_ChannelReestablishDecodeErrorZ
11883 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
11885 * A pointer to the contents in the success state.
11886 * Reading from this pointer when `result_ok` is not set is undefined.
11888 struct LDKChannelReestablish *result;
11890 * A pointer to the contents in the error state.
11891 * Reading from this pointer when `result_ok` is set is undefined.
11893 struct LDKDecodeError *err;
11894 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
11897 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
11898 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
11899 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11901 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
11903 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
11904 * `err` or `result` depending on the state of `result_ok`.
11906 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
11908 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
11911 } LDKCResult_ChannelReestablishDecodeErrorZ;
11914 * The contents of CResult_ClosingSignedDecodeErrorZ
11916 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
11918 * A pointer to the contents in the success state.
11919 * Reading from this pointer when `result_ok` is not set is undefined.
11921 struct LDKClosingSigned *result;
11923 * A pointer to the contents in the error state.
11924 * Reading from this pointer when `result_ok` is set is undefined.
11926 struct LDKDecodeError *err;
11927 } LDKCResult_ClosingSignedDecodeErrorZPtr;
11930 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
11931 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
11932 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11934 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
11936 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
11937 * `err` or `result` depending on the state of `result_ok`.
11939 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
11941 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
11944 } LDKCResult_ClosingSignedDecodeErrorZ;
11949 * The minimum and maximum fees which the sender is willing to place on the closing transaction.
11951 * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
11954 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
11956 * A pointer to the opaque Rust object.
11957 * Nearly everywhere, inner must be non-null, however in places where
11958 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11960 LDKnativeClosingSignedFeeRange *inner;
11962 * Indicates that this is the only struct which contains the same pointer.
11963 * Rust functions which take ownership of an object provided via an argument require
11964 * this to be true and invalidate the object pointed to by inner.
11967 } LDKClosingSignedFeeRange;
11970 * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
11972 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
11974 * A pointer to the contents in the success state.
11975 * Reading from this pointer when `result_ok` is not set is undefined.
11977 struct LDKClosingSignedFeeRange *result;
11979 * A pointer to the contents in the error state.
11980 * Reading from this pointer when `result_ok` is set is undefined.
11982 struct LDKDecodeError *err;
11983 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
11986 * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
11987 * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
11988 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11990 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
11992 * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
11993 * `err` or `result` depending on the state of `result_ok`.
11995 union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
11997 * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
12000 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
12005 * A [`commitment_signed`] message to be sent to or received from a peer.
12007 * [`commitment_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#committing-updates-so-far-commitment_signed
12009 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
12011 * A pointer to the opaque Rust object.
12012 * Nearly everywhere, inner must be non-null, however in places where
12013 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12015 LDKnativeCommitmentSigned *inner;
12017 * Indicates that this is the only struct which contains the same pointer.
12018 * Rust functions which take ownership of an object provided via an argument require
12019 * this to be true and invalidate the object pointed to by inner.
12022 } LDKCommitmentSigned;
12025 * The contents of CResult_CommitmentSignedDecodeErrorZ
12027 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
12029 * A pointer to the contents in the success state.
12030 * Reading from this pointer when `result_ok` is not set is undefined.
12032 struct LDKCommitmentSigned *result;
12034 * A pointer to the contents in the error state.
12035 * Reading from this pointer when `result_ok` is set is undefined.
12037 struct LDKDecodeError *err;
12038 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
12041 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
12042 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
12043 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12045 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
12047 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
12048 * `err` or `result` depending on the state of `result_ok`.
12050 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
12052 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
12055 } LDKCResult_CommitmentSignedDecodeErrorZ;
12058 * The contents of CResult_FundingCreatedDecodeErrorZ
12060 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
12062 * A pointer to the contents in the success state.
12063 * Reading from this pointer when `result_ok` is not set is undefined.
12065 struct LDKFundingCreated *result;
12067 * A pointer to the contents in the error state.
12068 * Reading from this pointer when `result_ok` is set is undefined.
12070 struct LDKDecodeError *err;
12071 } LDKCResult_FundingCreatedDecodeErrorZPtr;
12074 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
12075 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
12076 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12078 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
12080 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
12081 * `err` or `result` depending on the state of `result_ok`.
12083 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
12085 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
12088 } LDKCResult_FundingCreatedDecodeErrorZ;
12091 * The contents of CResult_FundingSignedDecodeErrorZ
12093 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
12095 * A pointer to the contents in the success state.
12096 * Reading from this pointer when `result_ok` is not set is undefined.
12098 struct LDKFundingSigned *result;
12100 * A pointer to the contents in the error state.
12101 * Reading from this pointer when `result_ok` is set is undefined.
12103 struct LDKDecodeError *err;
12104 } LDKCResult_FundingSignedDecodeErrorZPtr;
12107 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
12108 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
12109 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12111 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
12113 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
12114 * `err` or `result` depending on the state of `result_ok`.
12116 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
12118 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
12121 } LDKCResult_FundingSignedDecodeErrorZ;
12124 * The contents of CResult_ChannelReadyDecodeErrorZ
12126 typedef union LDKCResult_ChannelReadyDecodeErrorZPtr {
12128 * A pointer to the contents in the success state.
12129 * Reading from this pointer when `result_ok` is not set is undefined.
12131 struct LDKChannelReady *result;
12133 * A pointer to the contents in the error state.
12134 * Reading from this pointer when `result_ok` is set is undefined.
12136 struct LDKDecodeError *err;
12137 } LDKCResult_ChannelReadyDecodeErrorZPtr;
12140 * A CResult_ChannelReadyDecodeErrorZ represents the result of a fallible operation,
12141 * containing a crate::lightning::ln::msgs::ChannelReady on success and a crate::lightning::ln::msgs::DecodeError on failure.
12142 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12144 typedef struct LDKCResult_ChannelReadyDecodeErrorZ {
12146 * The contents of this CResult_ChannelReadyDecodeErrorZ, accessible via either
12147 * `err` or `result` depending on the state of `result_ok`.
12149 union LDKCResult_ChannelReadyDecodeErrorZPtr contents;
12151 * Whether this CResult_ChannelReadyDecodeErrorZ represents a success state.
12154 } LDKCResult_ChannelReadyDecodeErrorZ;
12159 * An [`init`] message to be sent to or received from a peer.
12161 * [`init`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-init-message
12163 typedef struct MUST_USE_STRUCT LDKInit {
12165 * A pointer to the opaque Rust object.
12166 * Nearly everywhere, inner must be non-null, however in places where
12167 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12169 LDKnativeInit *inner;
12171 * Indicates that this is the only struct which contains the same pointer.
12172 * Rust functions which take ownership of an object provided via an argument require
12173 * this to be true and invalidate the object pointed to by inner.
12179 * The contents of CResult_InitDecodeErrorZ
12181 typedef union LDKCResult_InitDecodeErrorZPtr {
12183 * A pointer to the contents in the success state.
12184 * Reading from this pointer when `result_ok` is not set is undefined.
12186 struct LDKInit *result;
12188 * A pointer to the contents in the error state.
12189 * Reading from this pointer when `result_ok` is set is undefined.
12191 struct LDKDecodeError *err;
12192 } LDKCResult_InitDecodeErrorZPtr;
12195 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
12196 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
12197 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12199 typedef struct LDKCResult_InitDecodeErrorZ {
12201 * The contents of this CResult_InitDecodeErrorZ, accessible via either
12202 * `err` or `result` depending on the state of `result_ok`.
12204 union LDKCResult_InitDecodeErrorZPtr contents;
12206 * Whether this CResult_InitDecodeErrorZ represents a success state.
12209 } LDKCResult_InitDecodeErrorZ;
12212 * The contents of CResult_OpenChannelDecodeErrorZ
12214 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
12216 * A pointer to the contents in the success state.
12217 * Reading from this pointer when `result_ok` is not set is undefined.
12219 struct LDKOpenChannel *result;
12221 * A pointer to the contents in the error state.
12222 * Reading from this pointer when `result_ok` is set is undefined.
12224 struct LDKDecodeError *err;
12225 } LDKCResult_OpenChannelDecodeErrorZPtr;
12228 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
12229 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
12230 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12232 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
12234 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
12235 * `err` or `result` depending on the state of `result_ok`.
12237 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
12239 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
12242 } LDKCResult_OpenChannelDecodeErrorZ;
12245 * The contents of CResult_OpenChannelV2DecodeErrorZ
12247 typedef union LDKCResult_OpenChannelV2DecodeErrorZPtr {
12249 * A pointer to the contents in the success state.
12250 * Reading from this pointer when `result_ok` is not set is undefined.
12252 struct LDKOpenChannelV2 *result;
12254 * A pointer to the contents in the error state.
12255 * Reading from this pointer when `result_ok` is set is undefined.
12257 struct LDKDecodeError *err;
12258 } LDKCResult_OpenChannelV2DecodeErrorZPtr;
12261 * A CResult_OpenChannelV2DecodeErrorZ represents the result of a fallible operation,
12262 * containing a crate::lightning::ln::msgs::OpenChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
12263 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12265 typedef struct LDKCResult_OpenChannelV2DecodeErrorZ {
12267 * The contents of this CResult_OpenChannelV2DecodeErrorZ, accessible via either
12268 * `err` or `result` depending on the state of `result_ok`.
12270 union LDKCResult_OpenChannelV2DecodeErrorZPtr contents;
12272 * Whether this CResult_OpenChannelV2DecodeErrorZ represents a success state.
12275 } LDKCResult_OpenChannelV2DecodeErrorZ;
12278 * The contents of CResult_RevokeAndACKDecodeErrorZ
12280 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
12282 * A pointer to the contents in the success state.
12283 * Reading from this pointer when `result_ok` is not set is undefined.
12285 struct LDKRevokeAndACK *result;
12287 * A pointer to the contents in the error state.
12288 * Reading from this pointer when `result_ok` is set is undefined.
12290 struct LDKDecodeError *err;
12291 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
12294 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
12295 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
12296 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12298 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
12300 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
12301 * `err` or `result` depending on the state of `result_ok`.
12303 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
12305 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
12308 } LDKCResult_RevokeAndACKDecodeErrorZ;
12311 * The contents of CResult_ShutdownDecodeErrorZ
12313 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
12315 * A pointer to the contents in the success state.
12316 * Reading from this pointer when `result_ok` is not set is undefined.
12318 struct LDKShutdown *result;
12320 * A pointer to the contents in the error state.
12321 * Reading from this pointer when `result_ok` is set is undefined.
12323 struct LDKDecodeError *err;
12324 } LDKCResult_ShutdownDecodeErrorZPtr;
12327 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
12328 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
12329 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12331 typedef struct LDKCResult_ShutdownDecodeErrorZ {
12333 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
12334 * `err` or `result` depending on the state of `result_ok`.
12336 union LDKCResult_ShutdownDecodeErrorZPtr contents;
12338 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
12341 } LDKCResult_ShutdownDecodeErrorZ;
12344 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
12346 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
12348 * A pointer to the contents in the success state.
12349 * Reading from this pointer when `result_ok` is not set is undefined.
12351 struct LDKUpdateFailHTLC *result;
12353 * A pointer to the contents in the error state.
12354 * Reading from this pointer when `result_ok` is set is undefined.
12356 struct LDKDecodeError *err;
12357 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
12360 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
12361 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
12362 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12364 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
12366 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
12367 * `err` or `result` depending on the state of `result_ok`.
12369 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
12371 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
12374 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
12377 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
12379 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
12381 * A pointer to the contents in the success state.
12382 * Reading from this pointer when `result_ok` is not set is undefined.
12384 struct LDKUpdateFailMalformedHTLC *result;
12386 * A pointer to the contents in the error state.
12387 * Reading from this pointer when `result_ok` is set is undefined.
12389 struct LDKDecodeError *err;
12390 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
12393 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
12394 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
12395 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12397 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
12399 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
12400 * `err` or `result` depending on the state of `result_ok`.
12402 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
12404 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
12407 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
12412 * An [`update_fee`] message to be sent to or received from a peer
12414 * [`update_fee`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#updating-fees-update_fee
12416 typedef struct MUST_USE_STRUCT LDKUpdateFee {
12418 * A pointer to the opaque Rust object.
12419 * Nearly everywhere, inner must be non-null, however in places where
12420 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12422 LDKnativeUpdateFee *inner;
12424 * Indicates that this is the only struct which contains the same pointer.
12425 * Rust functions which take ownership of an object provided via an argument require
12426 * this to be true and invalidate the object pointed to by inner.
12432 * The contents of CResult_UpdateFeeDecodeErrorZ
12434 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
12436 * A pointer to the contents in the success state.
12437 * Reading from this pointer when `result_ok` is not set is undefined.
12439 struct LDKUpdateFee *result;
12441 * A pointer to the contents in the error state.
12442 * Reading from this pointer when `result_ok` is set is undefined.
12444 struct LDKDecodeError *err;
12445 } LDKCResult_UpdateFeeDecodeErrorZPtr;
12448 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
12449 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
12450 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12452 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
12454 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
12455 * `err` or `result` depending on the state of `result_ok`.
12457 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
12459 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
12462 } LDKCResult_UpdateFeeDecodeErrorZ;
12465 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
12467 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
12469 * A pointer to the contents in the success state.
12470 * Reading from this pointer when `result_ok` is not set is undefined.
12472 struct LDKUpdateFulfillHTLC *result;
12474 * A pointer to the contents in the error state.
12475 * Reading from this pointer when `result_ok` is set is undefined.
12477 struct LDKDecodeError *err;
12478 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
12481 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
12482 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
12483 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12485 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
12487 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
12488 * `err` or `result` depending on the state of `result_ok`.
12490 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
12492 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
12495 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
12498 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
12500 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
12502 * A pointer to the contents in the success state.
12503 * Reading from this pointer when `result_ok` is not set is undefined.
12505 struct LDKUpdateAddHTLC *result;
12507 * A pointer to the contents in the error state.
12508 * Reading from this pointer when `result_ok` is set is undefined.
12510 struct LDKDecodeError *err;
12511 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
12514 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
12515 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
12516 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12518 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
12520 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
12521 * `err` or `result` depending on the state of `result_ok`.
12523 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
12525 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
12528 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
12533 * An onion message to be sent to or received from a peer.
12536 typedef struct MUST_USE_STRUCT LDKOnionMessage {
12538 * A pointer to the opaque Rust object.
12539 * Nearly everywhere, inner must be non-null, however in places where
12540 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12542 LDKnativeOnionMessage *inner;
12544 * Indicates that this is the only struct which contains the same pointer.
12545 * Rust functions which take ownership of an object provided via an argument require
12546 * this to be true and invalidate the object pointed to by inner.
12552 * The contents of CResult_OnionMessageDecodeErrorZ
12554 typedef union LDKCResult_OnionMessageDecodeErrorZPtr {
12556 * A pointer to the contents in the success state.
12557 * Reading from this pointer when `result_ok` is not set is undefined.
12559 struct LDKOnionMessage *result;
12561 * A pointer to the contents in the error state.
12562 * Reading from this pointer when `result_ok` is set is undefined.
12564 struct LDKDecodeError *err;
12565 } LDKCResult_OnionMessageDecodeErrorZPtr;
12568 * A CResult_OnionMessageDecodeErrorZ represents the result of a fallible operation,
12569 * containing a crate::lightning::ln::msgs::OnionMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
12570 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12572 typedef struct LDKCResult_OnionMessageDecodeErrorZ {
12574 * The contents of this CResult_OnionMessageDecodeErrorZ, accessible via either
12575 * `err` or `result` depending on the state of `result_ok`.
12577 union LDKCResult_OnionMessageDecodeErrorZPtr contents;
12579 * Whether this CResult_OnionMessageDecodeErrorZ represents a success state.
12582 } LDKCResult_OnionMessageDecodeErrorZ;
12587 * A [`ping`] message to be sent to or received from a peer.
12589 * [`ping`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
12591 typedef struct MUST_USE_STRUCT LDKPing {
12593 * A pointer to the opaque Rust object.
12594 * Nearly everywhere, inner must be non-null, however in places where
12595 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12597 LDKnativePing *inner;
12599 * Indicates that this is the only struct which contains the same pointer.
12600 * Rust functions which take ownership of an object provided via an argument require
12601 * this to be true and invalidate the object pointed to by inner.
12607 * The contents of CResult_PingDecodeErrorZ
12609 typedef union LDKCResult_PingDecodeErrorZPtr {
12611 * A pointer to the contents in the success state.
12612 * Reading from this pointer when `result_ok` is not set is undefined.
12614 struct LDKPing *result;
12616 * A pointer to the contents in the error state.
12617 * Reading from this pointer when `result_ok` is set is undefined.
12619 struct LDKDecodeError *err;
12620 } LDKCResult_PingDecodeErrorZPtr;
12623 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
12624 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
12625 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12627 typedef struct LDKCResult_PingDecodeErrorZ {
12629 * The contents of this CResult_PingDecodeErrorZ, accessible via either
12630 * `err` or `result` depending on the state of `result_ok`.
12632 union LDKCResult_PingDecodeErrorZPtr contents;
12634 * Whether this CResult_PingDecodeErrorZ represents a success state.
12637 } LDKCResult_PingDecodeErrorZ;
12642 * A [`pong`] message to be sent to or received from a peer.
12644 * [`pong`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
12646 typedef struct MUST_USE_STRUCT LDKPong {
12648 * A pointer to the opaque Rust object.
12649 * Nearly everywhere, inner must be non-null, however in places where
12650 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12652 LDKnativePong *inner;
12654 * Indicates that this is the only struct which contains the same pointer.
12655 * Rust functions which take ownership of an object provided via an argument require
12656 * this to be true and invalidate the object pointed to by inner.
12662 * The contents of CResult_PongDecodeErrorZ
12664 typedef union LDKCResult_PongDecodeErrorZPtr {
12666 * A pointer to the contents in the success state.
12667 * Reading from this pointer when `result_ok` is not set is undefined.
12669 struct LDKPong *result;
12671 * A pointer to the contents in the error state.
12672 * Reading from this pointer when `result_ok` is set is undefined.
12674 struct LDKDecodeError *err;
12675 } LDKCResult_PongDecodeErrorZPtr;
12678 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
12679 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
12680 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12682 typedef struct LDKCResult_PongDecodeErrorZ {
12684 * The contents of this CResult_PongDecodeErrorZ, accessible via either
12685 * `err` or `result` depending on the state of `result_ok`.
12687 union LDKCResult_PongDecodeErrorZPtr contents;
12689 * Whether this CResult_PongDecodeErrorZ represents a success state.
12692 } LDKCResult_PongDecodeErrorZ;
12695 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
12697 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
12699 * A pointer to the contents in the success state.
12700 * Reading from this pointer when `result_ok` is not set is undefined.
12702 struct LDKUnsignedChannelAnnouncement *result;
12704 * A pointer to the contents in the error state.
12705 * Reading from this pointer when `result_ok` is set is undefined.
12707 struct LDKDecodeError *err;
12708 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
12711 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
12712 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12713 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12715 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
12717 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
12718 * `err` or `result` depending on the state of `result_ok`.
12720 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
12722 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
12725 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
12728 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
12730 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
12732 * A pointer to the contents in the success state.
12733 * Reading from this pointer when `result_ok` is not set is undefined.
12735 struct LDKChannelAnnouncement *result;
12737 * A pointer to the contents in the error state.
12738 * Reading from this pointer when `result_ok` is set is undefined.
12740 struct LDKDecodeError *err;
12741 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
12744 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
12745 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12746 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12748 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
12750 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
12751 * `err` or `result` depending on the state of `result_ok`.
12753 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
12755 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
12758 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
12761 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
12763 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
12765 * A pointer to the contents in the success state.
12766 * Reading from this pointer when `result_ok` is not set is undefined.
12768 struct LDKUnsignedChannelUpdate *result;
12770 * A pointer to the contents in the error state.
12771 * Reading from this pointer when `result_ok` is set is undefined.
12773 struct LDKDecodeError *err;
12774 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
12777 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
12778 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
12779 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12781 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
12783 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
12784 * `err` or `result` depending on the state of `result_ok`.
12786 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
12788 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
12791 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
12794 * The contents of CResult_ChannelUpdateDecodeErrorZ
12796 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
12798 * A pointer to the contents in the success state.
12799 * Reading from this pointer when `result_ok` is not set is undefined.
12801 struct LDKChannelUpdate *result;
12803 * A pointer to the contents in the error state.
12804 * Reading from this pointer when `result_ok` is set is undefined.
12806 struct LDKDecodeError *err;
12807 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
12810 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
12811 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
12812 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12814 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
12816 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
12817 * `err` or `result` depending on the state of `result_ok`.
12819 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
12821 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
12824 } LDKCResult_ChannelUpdateDecodeErrorZ;
12827 * The contents of CResult_ErrorMessageDecodeErrorZ
12829 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
12831 * A pointer to the contents in the success state.
12832 * Reading from this pointer when `result_ok` is not set is undefined.
12834 struct LDKErrorMessage *result;
12836 * A pointer to the contents in the error state.
12837 * Reading from this pointer when `result_ok` is set is undefined.
12839 struct LDKDecodeError *err;
12840 } LDKCResult_ErrorMessageDecodeErrorZPtr;
12843 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
12844 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
12845 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12847 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
12849 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
12850 * `err` or `result` depending on the state of `result_ok`.
12852 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
12854 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
12857 } LDKCResult_ErrorMessageDecodeErrorZ;
12860 * The contents of CResult_WarningMessageDecodeErrorZ
12862 typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
12864 * A pointer to the contents in the success state.
12865 * Reading from this pointer when `result_ok` is not set is undefined.
12867 struct LDKWarningMessage *result;
12869 * A pointer to the contents in the error state.
12870 * Reading from this pointer when `result_ok` is set is undefined.
12872 struct LDKDecodeError *err;
12873 } LDKCResult_WarningMessageDecodeErrorZPtr;
12876 * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
12877 * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
12878 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12880 typedef struct LDKCResult_WarningMessageDecodeErrorZ {
12882 * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
12883 * `err` or `result` depending on the state of `result_ok`.
12885 union LDKCResult_WarningMessageDecodeErrorZPtr contents;
12887 * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
12890 } LDKCResult_WarningMessageDecodeErrorZ;
12893 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
12895 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
12897 * A pointer to the contents in the success state.
12898 * Reading from this pointer when `result_ok` is not set is undefined.
12900 struct LDKUnsignedNodeAnnouncement *result;
12902 * A pointer to the contents in the error state.
12903 * Reading from this pointer when `result_ok` is set is undefined.
12905 struct LDKDecodeError *err;
12906 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
12909 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
12910 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12911 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12913 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
12915 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
12916 * `err` or `result` depending on the state of `result_ok`.
12918 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
12920 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
12923 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
12926 * The contents of CResult_NodeAnnouncementDecodeErrorZ
12928 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
12930 * A pointer to the contents in the success state.
12931 * Reading from this pointer when `result_ok` is not set is undefined.
12933 struct LDKNodeAnnouncement *result;
12935 * A pointer to the contents in the error state.
12936 * Reading from this pointer when `result_ok` is set is undefined.
12938 struct LDKDecodeError *err;
12939 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
12942 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
12943 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12944 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12946 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
12948 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
12949 * `err` or `result` depending on the state of `result_ok`.
12951 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
12953 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
12956 } LDKCResult_NodeAnnouncementDecodeErrorZ;
12959 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
12961 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
12963 * A pointer to the contents in the success state.
12964 * Reading from this pointer when `result_ok` is not set is undefined.
12966 struct LDKQueryShortChannelIds *result;
12968 * A pointer to the contents in the error state.
12969 * Reading from this pointer when `result_ok` is set is undefined.
12971 struct LDKDecodeError *err;
12972 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
12975 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
12976 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
12977 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12979 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
12981 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
12982 * `err` or `result` depending on the state of `result_ok`.
12984 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
12986 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
12989 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
12994 * A [`reply_short_channel_ids_end`] message is sent as a reply to a
12995 * message. The query recipient makes a best
12996 * effort to respond based on their local network view which may not be
12997 * a perfect view of the network.
12999 * [`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
13001 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
13003 * A pointer to the opaque Rust object.
13004 * Nearly everywhere, inner must be non-null, however in places where
13005 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13007 LDKnativeReplyShortChannelIdsEnd *inner;
13009 * Indicates that this is the only struct which contains the same pointer.
13010 * Rust functions which take ownership of an object provided via an argument require
13011 * this to be true and invalidate the object pointed to by inner.
13014 } LDKReplyShortChannelIdsEnd;
13017 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
13019 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
13021 * A pointer to the contents in the success state.
13022 * Reading from this pointer when `result_ok` is not set is undefined.
13024 struct LDKReplyShortChannelIdsEnd *result;
13026 * A pointer to the contents in the error state.
13027 * Reading from this pointer when `result_ok` is set is undefined.
13029 struct LDKDecodeError *err;
13030 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
13033 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
13034 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
13035 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13037 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
13039 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
13040 * `err` or `result` depending on the state of `result_ok`.
13042 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
13044 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
13047 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
13050 * The contents of CResult_QueryChannelRangeDecodeErrorZ
13052 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
13054 * A pointer to the contents in the success state.
13055 * Reading from this pointer when `result_ok` is not set is undefined.
13057 struct LDKQueryChannelRange *result;
13059 * A pointer to the contents in the error state.
13060 * Reading from this pointer when `result_ok` is set is undefined.
13062 struct LDKDecodeError *err;
13063 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
13066 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
13067 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
13068 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13070 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
13072 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
13073 * `err` or `result` depending on the state of `result_ok`.
13075 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
13077 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
13080 } LDKCResult_QueryChannelRangeDecodeErrorZ;
13083 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
13085 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
13087 * A pointer to the contents in the success state.
13088 * Reading from this pointer when `result_ok` is not set is undefined.
13090 struct LDKReplyChannelRange *result;
13092 * A pointer to the contents in the error state.
13093 * Reading from this pointer when `result_ok` is set is undefined.
13095 struct LDKDecodeError *err;
13096 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
13099 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
13100 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
13101 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13103 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
13105 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
13106 * `err` or `result` depending on the state of `result_ok`.
13108 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
13110 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
13113 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
13116 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
13118 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
13120 * A pointer to the contents in the success state.
13121 * Reading from this pointer when `result_ok` is not set is undefined.
13123 struct LDKGossipTimestampFilter *result;
13125 * A pointer to the contents in the error state.
13126 * Reading from this pointer when `result_ok` is set is undefined.
13128 struct LDKDecodeError *err;
13129 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
13132 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
13133 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
13134 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13136 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
13138 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
13139 * `err` or `result` depending on the state of `result_ok`.
13141 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
13143 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
13146 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
13149 * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
13150 * This corresponds to std::vector in C++
13152 typedef struct LDKCVec_PhantomRouteHintsZ {
13154 * The elements in the array.
13155 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13157 struct LDKPhantomRouteHints *data;
13159 * The number of elements pointed to by `data`.
13162 } LDKCVec_PhantomRouteHintsZ;
13167 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
13169 * There are three ways to construct a `Bolt11Invoice`:
13170 * 1. using [`InvoiceBuilder`]
13171 * 2. using [`Bolt11Invoice::from_signed`]
13172 * 3. using `str::parse::<Bolt11Invoice>(&str)` (see [`Bolt11Invoice::from_str`])
13174 * [`Bolt11Invoice::from_str`]: crate::Bolt11Invoice#impl-FromStr
13176 typedef struct MUST_USE_STRUCT LDKBolt11Invoice {
13178 * A pointer to the opaque Rust object.
13179 * Nearly everywhere, inner must be non-null, however in places where
13180 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13182 LDKnativeBolt11Invoice *inner;
13184 * Indicates that this is the only struct which contains the same pointer.
13185 * Rust functions which take ownership of an object provided via an argument require
13186 * this to be true and invalidate the object pointed to by inner.
13189 } LDKBolt11Invoice;
13192 * When signing using a fallible method either an user-supplied `SignError` or a [`CreationError`]
13195 typedef enum LDKSignOrCreationError_Tag {
13197 * An error occurred during signing
13199 LDKSignOrCreationError_SignError,
13201 * An error occurred while building the transaction
13203 LDKSignOrCreationError_CreationError,
13205 * Must be last for serialization purposes
13207 LDKSignOrCreationError_Sentinel,
13208 } LDKSignOrCreationError_Tag;
13210 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
13211 LDKSignOrCreationError_Tag tag;
13214 enum LDKCreationError creation_error;
13217 } LDKSignOrCreationError;
13220 * The contents of CResult_Bolt11InvoiceSignOrCreationErrorZ
13222 typedef union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr {
13224 * A pointer to the contents in the success state.
13225 * Reading from this pointer when `result_ok` is not set is undefined.
13227 struct LDKBolt11Invoice *result;
13229 * A pointer to the contents in the error state.
13230 * Reading from this pointer when `result_ok` is set is undefined.
13232 struct LDKSignOrCreationError *err;
13233 } LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr;
13236 * A CResult_Bolt11InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
13237 * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
13238 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13240 typedef struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ {
13242 * The contents of this CResult_Bolt11InvoiceSignOrCreationErrorZ, accessible via either
13243 * `err` or `result` depending on the state of `result_ok`.
13245 union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr contents;
13247 * Whether this CResult_Bolt11InvoiceSignOrCreationErrorZ represents a success state.
13250 } LDKCResult_Bolt11InvoiceSignOrCreationErrorZ;
13255 * A simple future which can complete once, and calls some callback(s) when it does so.
13257 * Clones can be made and all futures cloned from the same source will complete at the same time.
13259 typedef struct MUST_USE_STRUCT LDKFuture {
13261 * A pointer to the opaque Rust object.
13262 * Nearly everywhere, inner must be non-null, however in places where
13263 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13265 LDKnativeFuture *inner;
13267 * Indicates that this is the only struct which contains the same pointer.
13268 * Rust functions which take ownership of an object provided via an argument require
13269 * this to be true and invalidate the object pointed to by inner.
13275 * A dynamically-allocated array of crate::lightning::util::wakers::Futures of arbitrary size.
13276 * This corresponds to std::vector in C++
13278 typedef struct LDKCVec_FutureZ {
13280 * The elements in the array.
13281 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13283 struct LDKFuture *data;
13285 * The number of elements pointed to by `data`.
13291 * The contents of CResult_OffersMessageDecodeErrorZ
13293 typedef union LDKCResult_OffersMessageDecodeErrorZPtr {
13295 * A pointer to the contents in the success state.
13296 * Reading from this pointer when `result_ok` is not set is undefined.
13298 struct LDKOffersMessage *result;
13300 * A pointer to the contents in the error state.
13301 * Reading from this pointer when `result_ok` is set is undefined.
13303 struct LDKDecodeError *err;
13304 } LDKCResult_OffersMessageDecodeErrorZPtr;
13307 * A CResult_OffersMessageDecodeErrorZ represents the result of a fallible operation,
13308 * containing a crate::lightning::onion_message::offers::OffersMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
13309 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13311 typedef struct LDKCResult_OffersMessageDecodeErrorZ {
13313 * The contents of this CResult_OffersMessageDecodeErrorZ, accessible via either
13314 * `err` or `result` depending on the state of `result_ok`.
13316 union LDKCResult_OffersMessageDecodeErrorZPtr contents;
13318 * Whether this CResult_OffersMessageDecodeErrorZ represents a success state.
13321 } LDKCResult_OffersMessageDecodeErrorZ;
13324 * An enum which can either contain a crate::lightning::ln::chan_utils::HTLCClaim or not
13326 typedef enum LDKCOption_HTLCClaimZ_Tag {
13328 * When we're in this state, this COption_HTLCClaimZ contains a crate::lightning::ln::chan_utils::HTLCClaim
13330 LDKCOption_HTLCClaimZ_Some,
13332 * When we're in this state, this COption_HTLCClaimZ contains nothing
13334 LDKCOption_HTLCClaimZ_None,
13336 * Must be last for serialization purposes
13338 LDKCOption_HTLCClaimZ_Sentinel,
13339 } LDKCOption_HTLCClaimZ_Tag;
13341 typedef struct LDKCOption_HTLCClaimZ {
13342 LDKCOption_HTLCClaimZ_Tag tag;
13345 enum LDKHTLCClaim some;
13348 } LDKCOption_HTLCClaimZ;
13353 * Implements the per-commitment secret storage scheme from
13354 * [BOLT 3](https://github.com/lightning/bolts/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage).
13356 * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes
13359 typedef struct MUST_USE_STRUCT LDKCounterpartyCommitmentSecrets {
13361 * A pointer to the opaque Rust object.
13362 * Nearly everywhere, inner must be non-null, however in places where
13363 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13365 LDKnativeCounterpartyCommitmentSecrets *inner;
13367 * Indicates that this is the only struct which contains the same pointer.
13368 * Rust functions which take ownership of an object provided via an argument require
13369 * this to be true and invalidate the object pointed to by inner.
13372 } LDKCounterpartyCommitmentSecrets;
13375 * The contents of CResult_CounterpartyCommitmentSecretsDecodeErrorZ
13377 typedef union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr {
13379 * A pointer to the contents in the success state.
13380 * Reading from this pointer when `result_ok` is not set is undefined.
13382 struct LDKCounterpartyCommitmentSecrets *result;
13384 * A pointer to the contents in the error state.
13385 * Reading from this pointer when `result_ok` is set is undefined.
13387 struct LDKDecodeError *err;
13388 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr;
13391 * A CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents the result of a fallible operation,
13392 * containing a crate::lightning::ln::chan_utils::CounterpartyCommitmentSecrets on success and a crate::lightning::ln::msgs::DecodeError on failure.
13393 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13395 typedef struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ {
13397 * The contents of this CResult_CounterpartyCommitmentSecretsDecodeErrorZ, accessible via either
13398 * `err` or `result` depending on the state of `result_ok`.
13400 union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr contents;
13402 * Whether this CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents a success state.
13405 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ;
13410 * The set of public keys which are used in the creation of one commitment transaction.
13411 * These are derived from the channel base keys and per-commitment data.
13413 * A broadcaster key is provided from potential broadcaster of the computed transaction.
13414 * A countersignatory key is coming from a protocol participant unable to broadcast the
13417 * These keys are assumed to be good, either because the code derived them from
13418 * channel basepoints via the new function, or they were obtained via
13419 * CommitmentTransaction.trust().keys() because we trusted the source of the
13420 * pre-calculated keys.
13422 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
13424 * A pointer to the opaque Rust object.
13425 * Nearly everywhere, inner must be non-null, however in places where
13426 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13428 LDKnativeTxCreationKeys *inner;
13430 * Indicates that this is the only struct which contains the same pointer.
13431 * Rust functions which take ownership of an object provided via an argument require
13432 * this to be true and invalidate the object pointed to by inner.
13435 } LDKTxCreationKeys;
13438 * The contents of CResult_TxCreationKeysDecodeErrorZ
13440 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
13442 * A pointer to the contents in the success state.
13443 * Reading from this pointer when `result_ok` is not set is undefined.
13445 struct LDKTxCreationKeys *result;
13447 * A pointer to the contents in the error state.
13448 * Reading from this pointer when `result_ok` is set is undefined.
13450 struct LDKDecodeError *err;
13451 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
13454 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
13455 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
13456 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13458 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
13460 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
13461 * `err` or `result` depending on the state of `result_ok`.
13463 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
13465 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
13468 } LDKCResult_TxCreationKeysDecodeErrorZ;
13471 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
13473 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
13475 * A pointer to the contents in the success state.
13476 * Reading from this pointer when `result_ok` is not set is undefined.
13478 struct LDKChannelPublicKeys *result;
13480 * A pointer to the contents in the error state.
13481 * Reading from this pointer when `result_ok` is set is undefined.
13483 struct LDKDecodeError *err;
13484 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
13487 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
13488 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
13489 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13491 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
13493 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
13494 * `err` or `result` depending on the state of `result_ok`.
13496 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
13498 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
13501 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
13504 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
13506 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
13508 * A pointer to the contents in the success state.
13509 * Reading from this pointer when `result_ok` is not set is undefined.
13511 struct LDKHTLCOutputInCommitment *result;
13513 * A pointer to the contents in the error state.
13514 * Reading from this pointer when `result_ok` is set is undefined.
13516 struct LDKDecodeError *err;
13517 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
13520 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
13521 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
13522 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13524 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
13526 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
13527 * `err` or `result` depending on the state of `result_ok`.
13529 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
13531 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
13534 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
13539 * Late-bound per-channel counterparty data used to build transactions.
13541 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
13543 * A pointer to the opaque Rust object.
13544 * Nearly everywhere, inner must be non-null, however in places where
13545 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13547 LDKnativeCounterpartyChannelTransactionParameters *inner;
13549 * Indicates that this is the only struct which contains the same pointer.
13550 * Rust functions which take ownership of an object provided via an argument require
13551 * this to be true and invalidate the object pointed to by inner.
13554 } LDKCounterpartyChannelTransactionParameters;
13557 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
13559 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
13561 * A pointer to the contents in the success state.
13562 * Reading from this pointer when `result_ok` is not set is undefined.
13564 struct LDKCounterpartyChannelTransactionParameters *result;
13566 * A pointer to the contents in the error state.
13567 * Reading from this pointer when `result_ok` is set is undefined.
13569 struct LDKDecodeError *err;
13570 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
13573 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
13574 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
13575 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13577 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
13579 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
13580 * `err` or `result` depending on the state of `result_ok`.
13582 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
13584 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
13587 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
13590 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
13592 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
13594 * A pointer to the contents in the success state.
13595 * Reading from this pointer when `result_ok` is not set is undefined.
13597 struct LDKChannelTransactionParameters *result;
13599 * A pointer to the contents in the error state.
13600 * Reading from this pointer when `result_ok` is set is undefined.
13602 struct LDKDecodeError *err;
13603 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
13606 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
13607 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
13608 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13610 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
13612 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
13613 * `err` or `result` depending on the state of `result_ok`.
13615 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
13617 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
13620 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
13623 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
13625 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
13627 * A pointer to the contents in the success state.
13628 * Reading from this pointer when `result_ok` is not set is undefined.
13630 struct LDKHolderCommitmentTransaction *result;
13632 * A pointer to the contents in the error state.
13633 * Reading from this pointer when `result_ok` is set is undefined.
13635 struct LDKDecodeError *err;
13636 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
13639 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
13640 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
13641 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13643 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
13645 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
13646 * `err` or `result` depending on the state of `result_ok`.
13648 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
13650 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
13653 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
13658 * A pre-built Bitcoin commitment transaction and its txid.
13660 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
13662 * A pointer to the opaque Rust object.
13663 * Nearly everywhere, inner must be non-null, however in places where
13664 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13666 LDKnativeBuiltCommitmentTransaction *inner;
13668 * Indicates that this is the only struct which contains the same pointer.
13669 * Rust functions which take ownership of an object provided via an argument require
13670 * this to be true and invalidate the object pointed to by inner.
13673 } LDKBuiltCommitmentTransaction;
13676 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
13678 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
13680 * A pointer to the contents in the success state.
13681 * Reading from this pointer when `result_ok` is not set is undefined.
13683 struct LDKBuiltCommitmentTransaction *result;
13685 * A pointer to the contents in the error state.
13686 * Reading from this pointer when `result_ok` is set is undefined.
13688 struct LDKDecodeError *err;
13689 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
13692 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
13693 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
13694 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13696 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
13698 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
13699 * `err` or `result` depending on the state of `result_ok`.
13701 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
13703 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
13706 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
13711 * A wrapper on ClosingTransaction indicating that the built bitcoin
13712 * transaction is trusted.
13714 * See trust() and verify() functions on CommitmentTransaction.
13716 * This structure implements Deref.
13718 typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
13720 * A pointer to the opaque Rust object.
13721 * Nearly everywhere, inner must be non-null, however in places where
13722 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13724 LDKnativeTrustedClosingTransaction *inner;
13726 * Indicates that this is the only struct which contains the same pointer.
13727 * Rust functions which take ownership of an object provided via an argument require
13728 * this to be true and invalidate the object pointed to by inner.
13731 } LDKTrustedClosingTransaction;
13734 * The contents of CResult_TrustedClosingTransactionNoneZ
13736 typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
13738 * A pointer to the contents in the success state.
13739 * Reading from this pointer when `result_ok` is not set is undefined.
13741 struct LDKTrustedClosingTransaction *result;
13743 * Note that this value is always NULL, as there are no contents in the Err variant
13746 } LDKCResult_TrustedClosingTransactionNoneZPtr;
13749 * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
13750 * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
13751 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13753 typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
13755 * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
13756 * `err` or `result` depending on the state of `result_ok`.
13758 union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
13760 * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
13763 } LDKCResult_TrustedClosingTransactionNoneZ;
13766 * The contents of CResult_CommitmentTransactionDecodeErrorZ
13768 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
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 LDKCommitmentTransaction *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_CommitmentTransactionDecodeErrorZPtr;
13782 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
13783 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction 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_CommitmentTransactionDecodeErrorZ {
13788 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
13789 * `err` or `result` depending on the state of `result_ok`.
13791 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
13793 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
13796 } LDKCResult_CommitmentTransactionDecodeErrorZ;
13801 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
13802 * transaction and the transaction creation keys) are trusted.
13804 * See trust() and verify() functions on CommitmentTransaction.
13806 * This structure implements Deref.
13808 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
13810 * A pointer to the opaque Rust object.
13811 * Nearly everywhere, inner must be non-null, however in places where
13812 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13814 LDKnativeTrustedCommitmentTransaction *inner;
13816 * Indicates that this is the only struct which contains the same pointer.
13817 * Rust functions which take ownership of an object provided via an argument require
13818 * this to be true and invalidate the object pointed to by inner.
13821 } LDKTrustedCommitmentTransaction;
13824 * The contents of CResult_TrustedCommitmentTransactionNoneZ
13826 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
13828 * A pointer to the contents in the success state.
13829 * Reading from this pointer when `result_ok` is not set is undefined.
13831 struct LDKTrustedCommitmentTransaction *result;
13833 * Note that this value is always NULL, as there are no contents in the Err variant
13836 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
13839 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
13840 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
13841 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13843 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
13845 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
13846 * `err` or `result` depending on the state of `result_ok`.
13848 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
13850 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
13853 } LDKCResult_TrustedCommitmentTransactionNoneZ;
13856 * The contents of CResult_CVec_ECDSASignatureZNoneZ
13858 typedef union LDKCResult_CVec_ECDSASignatureZNoneZPtr {
13860 * A pointer to the contents in the success state.
13861 * Reading from this pointer when `result_ok` is not set is undefined.
13863 struct LDKCVec_ECDSASignatureZ *result;
13865 * Note that this value is always NULL, as there are no contents in the Err variant
13868 } LDKCResult_CVec_ECDSASignatureZNoneZPtr;
13871 * A CResult_CVec_ECDSASignatureZNoneZ represents the result of a fallible operation,
13872 * containing a crate::c_types::derived::CVec_ECDSASignatureZ on success and a () on failure.
13873 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13875 typedef struct LDKCResult_CVec_ECDSASignatureZNoneZ {
13877 * The contents of this CResult_CVec_ECDSASignatureZNoneZ, accessible via either
13878 * `err` or `result` depending on the state of `result_ok`.
13880 union LDKCResult_CVec_ECDSASignatureZNoneZPtr contents;
13882 * Whether this CResult_CVec_ECDSASignatureZNoneZ represents a success state.
13885 } LDKCResult_CVec_ECDSASignatureZNoneZ;
13888 * An enum which can either contain a usize or not
13890 typedef enum LDKCOption_usizeZ_Tag {
13892 * When we're in this state, this COption_usizeZ contains a usize
13894 LDKCOption_usizeZ_Some,
13896 * When we're in this state, this COption_usizeZ contains nothing
13898 LDKCOption_usizeZ_None,
13900 * Must be last for serialization purposes
13902 LDKCOption_usizeZ_Sentinel,
13903 } LDKCOption_usizeZ_Tag;
13905 typedef struct LDKCOption_usizeZ {
13906 LDKCOption_usizeZ_Tag tag;
13912 } LDKCOption_usizeZ;
13915 * The contents of CResult_ShutdownScriptDecodeErrorZ
13917 typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
13919 * A pointer to the contents in the success state.
13920 * Reading from this pointer when `result_ok` is not set is undefined.
13922 struct LDKShutdownScript *result;
13924 * A pointer to the contents in the error state.
13925 * Reading from this pointer when `result_ok` is set is undefined.
13927 struct LDKDecodeError *err;
13928 } LDKCResult_ShutdownScriptDecodeErrorZPtr;
13931 * A CResult_ShutdownScriptDecodeErrorZ represents the result of a fallible operation,
13932 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::msgs::DecodeError on failure.
13933 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13935 typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
13937 * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
13938 * `err` or `result` depending on the state of `result_ok`.
13940 union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
13942 * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
13945 } LDKCResult_ShutdownScriptDecodeErrorZ;
13950 * An error occurring when converting from [`Script`] to [`ShutdownScript`].
13952 typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
13954 * A pointer to the opaque Rust object.
13955 * Nearly everywhere, inner must be non-null, however in places where
13956 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13958 LDKnativeInvalidShutdownScript *inner;
13960 * Indicates that this is the only struct which contains the same pointer.
13961 * Rust functions which take ownership of an object provided via an argument require
13962 * this to be true and invalidate the object pointed to by inner.
13965 } LDKInvalidShutdownScript;
13968 * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
13970 typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
13972 * A pointer to the contents in the success state.
13973 * Reading from this pointer when `result_ok` is not set is undefined.
13975 struct LDKShutdownScript *result;
13977 * A pointer to the contents in the error state.
13978 * Reading from this pointer when `result_ok` is set is undefined.
13980 struct LDKInvalidShutdownScript *err;
13981 } LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
13984 * A CResult_ShutdownScriptInvalidShutdownScriptZ represents the result of a fallible operation,
13985 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::script::InvalidShutdownScript on failure.
13986 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13988 typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
13990 * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
13991 * `err` or `result` depending on the state of `result_ok`.
13993 union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
13995 * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
13998 } LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
14001 * Some information provided on receipt of payment depends on whether the payment received is a
14002 * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
14004 typedef enum LDKPaymentPurpose_Tag {
14006 * Information for receiving a payment that we generated an invoice for.
14008 LDKPaymentPurpose_InvoicePayment,
14010 * Because this is a spontaneous payment, the payer generated their own preimage rather than us
14011 * (the payee) providing a preimage.
14013 LDKPaymentPurpose_SpontaneousPayment,
14015 * Must be last for serialization purposes
14017 LDKPaymentPurpose_Sentinel,
14018 } LDKPaymentPurpose_Tag;
14020 typedef struct LDKPaymentPurpose_LDKInvoicePayment_Body {
14022 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
14023 * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
14024 * [`ChannelManager::claim_funds`].
14026 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
14027 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
14029 struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
14031 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
14032 * number of deanonymization attacks during the routing process.
14033 * It is provided here for your reference, however its accuracy is enforced directly by
14034 * [`ChannelManager`] using the values you previously provided to
14035 * [`ChannelManager::create_inbound_payment`] or
14036 * [`ChannelManager::create_inbound_payment_for_hash`].
14038 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
14039 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
14040 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
14042 struct LDKThirtyTwoBytes payment_secret;
14043 } LDKPaymentPurpose_LDKInvoicePayment_Body;
14045 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
14046 LDKPaymentPurpose_Tag tag;
14048 LDKPaymentPurpose_LDKInvoicePayment_Body invoice_payment;
14050 struct LDKThirtyTwoBytes spontaneous_payment;
14053 } LDKPaymentPurpose;
14056 * The contents of CResult_PaymentPurposeDecodeErrorZ
14058 typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
14060 * A pointer to the contents in the success state.
14061 * Reading from this pointer when `result_ok` is not set is undefined.
14063 struct LDKPaymentPurpose *result;
14065 * A pointer to the contents in the error state.
14066 * Reading from this pointer when `result_ok` is set is undefined.
14068 struct LDKDecodeError *err;
14069 } LDKCResult_PaymentPurposeDecodeErrorZPtr;
14072 * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
14073 * containing a crate::lightning::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
14074 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14076 typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
14078 * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
14079 * `err` or `result` depending on the state of `result_ok`.
14081 union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
14083 * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
14086 } LDKCResult_PaymentPurposeDecodeErrorZ;
14091 * Information about an HTLC that is part of a payment that can be claimed.
14093 typedef struct MUST_USE_STRUCT LDKClaimedHTLC {
14095 * A pointer to the opaque Rust object.
14096 * Nearly everywhere, inner must be non-null, however in places where
14097 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14099 LDKnativeClaimedHTLC *inner;
14101 * Indicates that this is the only struct which contains the same pointer.
14102 * Rust functions which take ownership of an object provided via an argument require
14103 * this to be true and invalidate the object pointed to by inner.
14109 * The contents of CResult_ClaimedHTLCDecodeErrorZ
14111 typedef union LDKCResult_ClaimedHTLCDecodeErrorZPtr {
14113 * A pointer to the contents in the success state.
14114 * Reading from this pointer when `result_ok` is not set is undefined.
14116 struct LDKClaimedHTLC *result;
14118 * A pointer to the contents in the error state.
14119 * Reading from this pointer when `result_ok` is set is undefined.
14121 struct LDKDecodeError *err;
14122 } LDKCResult_ClaimedHTLCDecodeErrorZPtr;
14125 * A CResult_ClaimedHTLCDecodeErrorZ represents the result of a fallible operation,
14126 * containing a crate::lightning::events::ClaimedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
14127 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14129 typedef struct LDKCResult_ClaimedHTLCDecodeErrorZ {
14131 * The contents of this CResult_ClaimedHTLCDecodeErrorZ, accessible via either
14132 * `err` or `result` depending on the state of `result_ok`.
14134 union LDKCResult_ClaimedHTLCDecodeErrorZPtr contents;
14136 * Whether this CResult_ClaimedHTLCDecodeErrorZ represents a success state.
14139 } LDKCResult_ClaimedHTLCDecodeErrorZ;
14142 * When the payment path failure took place and extra details about it. [`PathFailure::OnPath`] may
14143 * contain a [`NetworkUpdate`] that needs to be applied to the [`NetworkGraph`].
14145 * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
14146 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
14148 typedef enum LDKPathFailure_Tag {
14150 * We failed to initially send the payment and no HTLC was committed to. Contains the relevant
14153 LDKPathFailure_InitialSend,
14155 * A hop on the path failed to forward our payment.
14157 LDKPathFailure_OnPath,
14159 * Must be last for serialization purposes
14161 LDKPathFailure_Sentinel,
14162 } LDKPathFailure_Tag;
14164 typedef struct LDKPathFailure_LDKInitialSend_Body {
14166 * The error surfaced from initial send.
14168 struct LDKAPIError err;
14169 } LDKPathFailure_LDKInitialSend_Body;
14171 typedef struct LDKPathFailure_LDKOnPath_Body {
14173 * If present, this [`NetworkUpdate`] should be applied to the [`NetworkGraph`] so that routing
14174 * decisions can take into account the update.
14176 * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
14177 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
14179 struct LDKCOption_NetworkUpdateZ network_update;
14180 } LDKPathFailure_LDKOnPath_Body;
14182 typedef struct MUST_USE_STRUCT LDKPathFailure {
14183 LDKPathFailure_Tag tag;
14185 LDKPathFailure_LDKInitialSend_Body initial_send;
14186 LDKPathFailure_LDKOnPath_Body on_path;
14191 * An enum which can either contain a crate::lightning::events::PathFailure or not
14193 typedef enum LDKCOption_PathFailureZ_Tag {
14195 * When we're in this state, this COption_PathFailureZ contains a crate::lightning::events::PathFailure
14197 LDKCOption_PathFailureZ_Some,
14199 * When we're in this state, this COption_PathFailureZ contains nothing
14201 LDKCOption_PathFailureZ_None,
14203 * Must be last for serialization purposes
14205 LDKCOption_PathFailureZ_Sentinel,
14206 } LDKCOption_PathFailureZ_Tag;
14208 typedef struct LDKCOption_PathFailureZ {
14209 LDKCOption_PathFailureZ_Tag tag;
14212 struct LDKPathFailure some;
14215 } LDKCOption_PathFailureZ;
14218 * The contents of CResult_COption_PathFailureZDecodeErrorZ
14220 typedef union LDKCResult_COption_PathFailureZDecodeErrorZPtr {
14222 * A pointer to the contents in the success state.
14223 * Reading from this pointer when `result_ok` is not set is undefined.
14225 struct LDKCOption_PathFailureZ *result;
14227 * A pointer to the contents in the error state.
14228 * Reading from this pointer when `result_ok` is set is undefined.
14230 struct LDKDecodeError *err;
14231 } LDKCResult_COption_PathFailureZDecodeErrorZPtr;
14234 * A CResult_COption_PathFailureZDecodeErrorZ represents the result of a fallible operation,
14235 * containing a crate::c_types::derived::COption_PathFailureZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
14236 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14238 typedef struct LDKCResult_COption_PathFailureZDecodeErrorZ {
14240 * The contents of this CResult_COption_PathFailureZDecodeErrorZ, accessible via either
14241 * `err` or `result` depending on the state of `result_ok`.
14243 union LDKCResult_COption_PathFailureZDecodeErrorZPtr contents;
14245 * Whether this CResult_COption_PathFailureZDecodeErrorZ represents a success state.
14248 } LDKCResult_COption_PathFailureZDecodeErrorZ;
14253 * Struct to `Display` fields in a safe way using `PrintableString`
14255 typedef struct MUST_USE_STRUCT LDKUntrustedString {
14257 * A pointer to the opaque Rust object.
14258 * Nearly everywhere, inner must be non-null, however in places where
14259 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14261 LDKnativeUntrustedString *inner;
14263 * Indicates that this is the only struct which contains the same pointer.
14264 * Rust functions which take ownership of an object provided via an argument require
14265 * this to be true and invalidate the object pointed to by inner.
14268 } LDKUntrustedString;
14271 * The reason the channel was closed. See individual variants for more details.
14273 typedef enum LDKClosureReason_Tag {
14275 * Closure generated from receiving a peer error message.
14277 * Our counterparty may have broadcasted their latest commitment state, and we have
14280 LDKClosureReason_CounterpartyForceClosed,
14282 * Closure generated from [`ChannelManager::force_close_channel`], called by the user.
14284 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
14286 LDKClosureReason_HolderForceClosed,
14288 * The channel was closed after negotiating a cooperative close and we've now broadcasted
14289 * the cooperative close transaction. Note the shutdown may have been initiated by us.
14291 LDKClosureReason_CooperativeClosure,
14293 * A commitment transaction was confirmed on chain, closing the channel. Most likely this
14294 * commitment transaction came from our counterparty, but it may also have come from
14295 * a copy of our own `ChannelMonitor`.
14297 LDKClosureReason_CommitmentTxConfirmed,
14299 * The funding transaction failed to confirm in a timely manner on an inbound channel.
14301 LDKClosureReason_FundingTimedOut,
14303 * Closure generated from processing an event, likely a HTLC forward/relay/reception.
14305 LDKClosureReason_ProcessingError,
14307 * The peer disconnected prior to funding completing. In this case the spec mandates that we
14308 * forget the channel entirely - we can attempt again if the peer reconnects.
14310 * This includes cases where we restarted prior to funding completion, including prior to the
14311 * initial [`ChannelMonitor`] persistence completing.
14313 * In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the
14314 * peer because of mutual incompatibility between us and our channel counterparty.
14316 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
14318 LDKClosureReason_DisconnectedPeer,
14320 * Closure generated from `ChannelManager::read` if the [`ChannelMonitor`] is newer than
14321 * the [`ChannelManager`] deserialized.
14323 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
14324 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
14326 LDKClosureReason_OutdatedChannelManager,
14328 * The counterparty requested a cooperative close of a channel that had not been funded yet.
14329 * The channel has been immediately closed.
14331 LDKClosureReason_CounterpartyCoopClosedUnfundedChannel,
14333 * Another channel in the same funding batch closed before the funding transaction
14334 * was ready to be broadcast.
14336 LDKClosureReason_FundingBatchClosure,
14338 * Must be last for serialization purposes
14340 LDKClosureReason_Sentinel,
14341 } LDKClosureReason_Tag;
14343 typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
14345 * The error which the peer sent us.
14347 * Be careful about printing the peer_msg, a well-crafted message could exploit
14348 * a security vulnerability in the terminal emulator or the logging subsystem.
14349 * To be safe, use `Display` on `UntrustedString`
14351 * [`UntrustedString`]: crate::util::string::UntrustedString
14353 struct LDKUntrustedString peer_msg;
14354 } LDKClosureReason_LDKCounterpartyForceClosed_Body;
14356 typedef struct LDKClosureReason_LDKProcessingError_Body {
14358 * A developer-readable error message which we generated.
14361 } LDKClosureReason_LDKProcessingError_Body;
14363 typedef struct MUST_USE_STRUCT LDKClosureReason {
14364 LDKClosureReason_Tag tag;
14366 LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
14367 LDKClosureReason_LDKProcessingError_Body processing_error;
14369 } LDKClosureReason;
14372 * An enum which can either contain a crate::lightning::events::ClosureReason or not
14374 typedef enum LDKCOption_ClosureReasonZ_Tag {
14376 * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::events::ClosureReason
14378 LDKCOption_ClosureReasonZ_Some,
14380 * When we're in this state, this COption_ClosureReasonZ contains nothing
14382 LDKCOption_ClosureReasonZ_None,
14384 * Must be last for serialization purposes
14386 LDKCOption_ClosureReasonZ_Sentinel,
14387 } LDKCOption_ClosureReasonZ_Tag;
14389 typedef struct LDKCOption_ClosureReasonZ {
14390 LDKCOption_ClosureReasonZ_Tag tag;
14393 struct LDKClosureReason some;
14396 } LDKCOption_ClosureReasonZ;
14399 * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
14401 typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
14403 * A pointer to the contents in the success state.
14404 * Reading from this pointer when `result_ok` is not set is undefined.
14406 struct LDKCOption_ClosureReasonZ *result;
14408 * A pointer to the contents in the error state.
14409 * Reading from this pointer when `result_ok` is set is undefined.
14411 struct LDKDecodeError *err;
14412 } LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
14415 * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
14416 * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
14417 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14419 typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
14421 * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
14422 * `err` or `result` depending on the state of `result_ok`.
14424 union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
14426 * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
14429 } LDKCResult_COption_ClosureReasonZDecodeErrorZ;
14432 * Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
14434 typedef enum LDKHTLCDestination_Tag {
14436 * We tried forwarding to a channel but failed to do so. An example of such an instance is when
14437 * there is insufficient capacity in our outbound channel.
14439 LDKHTLCDestination_NextHopChannel,
14441 * Scenario where we are unsure of the next node to forward the HTLC to.
14443 LDKHTLCDestination_UnknownNextHop,
14445 * We couldn't forward to the outgoing scid. An example would be attempting to send a duplicate
14448 LDKHTLCDestination_InvalidForward,
14450 * Failure scenario where an HTLC may have been forwarded to be intended for us,
14451 * but is invalid for some reason, so we reject it.
14453 * Some of the reasons may include:
14455 * * Excess HTLCs for a payment that we have already fully received, over-paying for the
14457 * * The counterparty node modified the HTLC in transit,
14458 * * A probing attack where an intermediary node is trying to detect if we are the ultimate
14459 * recipient for a payment.
14461 LDKHTLCDestination_FailedPayment,
14463 * Must be last for serialization purposes
14465 LDKHTLCDestination_Sentinel,
14466 } LDKHTLCDestination_Tag;
14468 typedef struct LDKHTLCDestination_LDKNextHopChannel_Body {
14470 * The `node_id` of the next node. For backwards compatibility, this field is
14471 * marked as optional, versions prior to 0.0.110 may not always be able to provide
14472 * counterparty node information.
14474 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
14476 struct LDKPublicKey node_id;
14478 * The outgoing `channel_id` between us and the next node.
14480 struct LDKThirtyTwoBytes channel_id;
14481 } LDKHTLCDestination_LDKNextHopChannel_Body;
14483 typedef struct LDKHTLCDestination_LDKUnknownNextHop_Body {
14485 * Short channel id we are requesting to forward an HTLC to.
14487 uint64_t requested_forward_scid;
14488 } LDKHTLCDestination_LDKUnknownNextHop_Body;
14490 typedef struct LDKHTLCDestination_LDKInvalidForward_Body {
14492 * Short channel id we are requesting to forward an HTLC to.
14494 uint64_t requested_forward_scid;
14495 } LDKHTLCDestination_LDKInvalidForward_Body;
14497 typedef struct LDKHTLCDestination_LDKFailedPayment_Body {
14499 * The payment hash of the payment we attempted to process.
14501 struct LDKThirtyTwoBytes payment_hash;
14502 } LDKHTLCDestination_LDKFailedPayment_Body;
14504 typedef struct MUST_USE_STRUCT LDKHTLCDestination {
14505 LDKHTLCDestination_Tag tag;
14507 LDKHTLCDestination_LDKNextHopChannel_Body next_hop_channel;
14508 LDKHTLCDestination_LDKUnknownNextHop_Body unknown_next_hop;
14509 LDKHTLCDestination_LDKInvalidForward_Body invalid_forward;
14510 LDKHTLCDestination_LDKFailedPayment_Body failed_payment;
14512 } LDKHTLCDestination;
14515 * An enum which can either contain a crate::lightning::events::HTLCDestination or not
14517 typedef enum LDKCOption_HTLCDestinationZ_Tag {
14519 * When we're in this state, this COption_HTLCDestinationZ contains a crate::lightning::events::HTLCDestination
14521 LDKCOption_HTLCDestinationZ_Some,
14523 * When we're in this state, this COption_HTLCDestinationZ contains nothing
14525 LDKCOption_HTLCDestinationZ_None,
14527 * Must be last for serialization purposes
14529 LDKCOption_HTLCDestinationZ_Sentinel,
14530 } LDKCOption_HTLCDestinationZ_Tag;
14532 typedef struct LDKCOption_HTLCDestinationZ {
14533 LDKCOption_HTLCDestinationZ_Tag tag;
14536 struct LDKHTLCDestination some;
14539 } LDKCOption_HTLCDestinationZ;
14542 * The contents of CResult_COption_HTLCDestinationZDecodeErrorZ
14544 typedef union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr {
14546 * A pointer to the contents in the success state.
14547 * Reading from this pointer when `result_ok` is not set is undefined.
14549 struct LDKCOption_HTLCDestinationZ *result;
14551 * A pointer to the contents in the error state.
14552 * Reading from this pointer when `result_ok` is set is undefined.
14554 struct LDKDecodeError *err;
14555 } LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr;
14558 * A CResult_COption_HTLCDestinationZDecodeErrorZ represents the result of a fallible operation,
14559 * containing a crate::c_types::derived::COption_HTLCDestinationZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
14560 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14562 typedef struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ {
14564 * The contents of this CResult_COption_HTLCDestinationZDecodeErrorZ, accessible via either
14565 * `err` or `result` depending on the state of `result_ok`.
14567 union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr contents;
14569 * Whether this CResult_COption_HTLCDestinationZDecodeErrorZ represents a success state.
14572 } LDKCResult_COption_HTLCDestinationZDecodeErrorZ;
14575 * The contents of CResult_PaymentFailureReasonDecodeErrorZ
14577 typedef union LDKCResult_PaymentFailureReasonDecodeErrorZPtr {
14579 * A pointer to the contents in the success state.
14580 * Reading from this pointer when `result_ok` is not set is undefined.
14582 enum LDKPaymentFailureReason *result;
14584 * A pointer to the contents in the error state.
14585 * Reading from this pointer when `result_ok` is set is undefined.
14587 struct LDKDecodeError *err;
14588 } LDKCResult_PaymentFailureReasonDecodeErrorZPtr;
14591 * A CResult_PaymentFailureReasonDecodeErrorZ represents the result of a fallible operation,
14592 * containing a crate::lightning::events::PaymentFailureReason on success and a crate::lightning::ln::msgs::DecodeError on failure.
14593 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14595 typedef struct LDKCResult_PaymentFailureReasonDecodeErrorZ {
14597 * The contents of this CResult_PaymentFailureReasonDecodeErrorZ, accessible via either
14598 * `err` or `result` depending on the state of `result_ok`.
14600 union LDKCResult_PaymentFailureReasonDecodeErrorZPtr contents;
14602 * Whether this CResult_PaymentFailureReasonDecodeErrorZ represents a success state.
14605 } LDKCResult_PaymentFailureReasonDecodeErrorZ;
14608 * An enum which can either contain a crate::c_types::U128 or not
14610 typedef enum LDKCOption_U128Z_Tag {
14612 * When we're in this state, this COption_U128Z contains a crate::c_types::U128
14614 LDKCOption_U128Z_Some,
14616 * When we're in this state, this COption_U128Z contains nothing
14618 LDKCOption_U128Z_None,
14620 * Must be last for serialization purposes
14622 LDKCOption_U128Z_Sentinel,
14623 } LDKCOption_U128Z_Tag;
14625 typedef struct LDKCOption_U128Z {
14626 LDKCOption_U128Z_Tag tag;
14629 struct LDKU128 some;
14632 } LDKCOption_U128Z;
14635 * A dynamically-allocated array of crate::lightning::events::ClaimedHTLCs of arbitrary size.
14636 * This corresponds to std::vector in C++
14638 typedef struct LDKCVec_ClaimedHTLCZ {
14640 * The elements in the array.
14641 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14643 struct LDKClaimedHTLC *data;
14645 * The number of elements pointed to by `data`.
14648 } LDKCVec_ClaimedHTLCZ;
14651 * An enum which can either contain a crate::lightning::events::PaymentFailureReason or not
14653 typedef enum LDKCOption_PaymentFailureReasonZ_Tag {
14655 * When we're in this state, this COption_PaymentFailureReasonZ contains a crate::lightning::events::PaymentFailureReason
14657 LDKCOption_PaymentFailureReasonZ_Some,
14659 * When we're in this state, this COption_PaymentFailureReasonZ contains nothing
14661 LDKCOption_PaymentFailureReasonZ_None,
14663 * Must be last for serialization purposes
14665 LDKCOption_PaymentFailureReasonZ_Sentinel,
14666 } LDKCOption_PaymentFailureReasonZ_Tag;
14668 typedef struct LDKCOption_PaymentFailureReasonZ {
14669 LDKCOption_PaymentFailureReasonZ_Tag tag;
14672 enum LDKPaymentFailureReason some;
14675 } LDKCOption_PaymentFailureReasonZ;
14680 * A descriptor used to sign for a commitment transaction's anchor output.
14682 typedef struct MUST_USE_STRUCT LDKAnchorDescriptor {
14684 * A pointer to the opaque Rust object.
14685 * Nearly everywhere, inner must be non-null, however in places where
14686 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14688 LDKnativeAnchorDescriptor *inner;
14690 * Indicates that this is the only struct which contains the same pointer.
14691 * Rust functions which take ownership of an object provided via an argument require
14692 * this to be true and invalidate the object pointed to by inner.
14695 } LDKAnchorDescriptor;
14698 * Represents the different types of transactions, originating from LDK, to be bumped.
14700 typedef enum LDKBumpTransactionEvent_Tag {
14702 * Indicates that a channel featuring anchor outputs is to be closed by broadcasting the local
14703 * commitment transaction. Since commitment transactions have a static feerate pre-agreed upon,
14704 * they may need additional fees to be attached through a child transaction using the popular
14705 * [Child-Pays-For-Parent](https://bitcoinops.org/en/topics/cpfp) fee bumping technique. This
14706 * child transaction must include the anchor input described within `anchor_descriptor` along
14707 * with additional inputs to meet the target feerate. Failure to meet the target feerate
14708 * decreases the confirmation odds of the transaction package (which includes the commitment
14709 * and child anchor transactions), possibly resulting in a loss of funds. Once the transaction
14710 * is constructed, it must be fully signed for and broadcast by the consumer of the event
14711 * along with the `commitment_tx` enclosed. Note that the `commitment_tx` must always be
14712 * broadcast first, as the child anchor transaction depends on it.
14714 * The consumer should be able to sign for any of the additional inputs included within the
14715 * child anchor transaction. To sign its anchor input, an [`EcdsaChannelSigner`] should be
14716 * re-derived through [`AnchorDescriptor::derive_channel_signer`]. The anchor input signature
14717 * can be computed with [`EcdsaChannelSigner::sign_holder_anchor_input`], which can then be
14718 * provided to [`build_anchor_input_witness`] along with the `funding_pubkey` to obtain the
14719 * full witness required to spend.
14721 * It is possible to receive more than one instance of this event if a valid child anchor
14722 * transaction is never broadcast or is but not with a sufficient fee to be mined. Care should
14723 * be taken by the consumer of the event to ensure any future iterations of the child anchor
14724 * transaction adhere to the [Replace-By-Fee
14725 * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
14726 * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
14727 * these events is not user-controlled, users may ignore/drop the event if they are no longer
14728 * able to commit external confirmed funds to the child anchor transaction.
14730 * The set of `pending_htlcs` on the commitment transaction to be broadcast can be inspected to
14731 * determine whether a significant portion of the channel's funds are allocated to HTLCs,
14732 * enabling users to make their own decisions regarding the importance of the commitment
14733 * transaction's confirmation. Note that this is not required, but simply exists as an option
14734 * for users to override LDK's behavior. On commitments with no HTLCs (indicated by those with
14735 * an empty `pending_htlcs`), confirmation of the commitment transaction can be considered to
14738 * [`EcdsaChannelSigner`]: crate::sign::EcdsaChannelSigner
14739 * [`EcdsaChannelSigner::sign_holder_anchor_input`]: crate::sign::EcdsaChannelSigner::sign_holder_anchor_input
14740 * [`build_anchor_input_witness`]: crate::ln::chan_utils::build_anchor_input_witness
14742 LDKBumpTransactionEvent_ChannelClose,
14744 * Indicates that a channel featuring anchor outputs has unilaterally closed on-chain by a
14745 * holder commitment transaction and its HTLC(s) need to be resolved on-chain. With the
14746 * zero-HTLC-transaction-fee variant of anchor outputs, the pre-signed HTLC
14747 * transactions have a zero fee, thus requiring additional inputs and/or outputs to be attached
14748 * for a timely confirmation within the chain. These additional inputs and/or outputs must be
14749 * appended to the resulting HTLC transaction to meet the target feerate. Failure to meet the
14750 * target feerate decreases the confirmation odds of the transaction, possibly resulting in a
14751 * loss of funds. Once the transaction meets the target feerate, it must be signed for and
14752 * broadcast by the consumer of the event.
14754 * The consumer should be able to sign for any of the non-HTLC inputs added to the resulting
14755 * HTLC transaction. To sign HTLC inputs, an [`EcdsaChannelSigner`] should be re-derived
14756 * through [`HTLCDescriptor::derive_channel_signer`]. Each HTLC input's signature can be
14757 * computed with [`EcdsaChannelSigner::sign_holder_htlc_transaction`], which can then be
14758 * provided to [`HTLCDescriptor::tx_input_witness`] to obtain the fully signed witness required
14761 * It is possible to receive more than one instance of this event if a valid HTLC transaction
14762 * is never broadcast or is but not with a sufficient fee to be mined. Care should be taken by
14763 * the consumer of the event to ensure any future iterations of the HTLC transaction adhere to
14764 * the [Replace-By-Fee
14765 * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
14766 * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
14767 * these events is not user-controlled, users may ignore/drop the event if either they are no
14768 * longer able to commit external confirmed funds to the HTLC transaction or the fee committed
14769 * to the HTLC transaction is greater in value than the HTLCs being claimed.
14771 * [`EcdsaChannelSigner`]: crate::sign::EcdsaChannelSigner
14772 * [`EcdsaChannelSigner::sign_holder_htlc_transaction`]: crate::sign::EcdsaChannelSigner::sign_holder_htlc_transaction
14774 LDKBumpTransactionEvent_HTLCResolution,
14776 * Must be last for serialization purposes
14778 LDKBumpTransactionEvent_Sentinel,
14779 } LDKBumpTransactionEvent_Tag;
14781 typedef struct LDKBumpTransactionEvent_LDKChannelClose_Body {
14783 * The unique identifier for the claim of the anchor output in the commitment transaction.
14785 * The identifier must map to the set of external UTXOs assigned to the claim, such that
14786 * they can be reused when a new claim with the same identifier needs to be made, resulting
14787 * in a fee-bumping attempt.
14789 struct LDKThirtyTwoBytes claim_id;
14791 * The target feerate that the transaction package, which consists of the commitment
14792 * transaction and the to-be-crafted child anchor transaction, must meet.
14794 uint32_t package_target_feerate_sat_per_1000_weight;
14796 * The channel's commitment transaction to bump the fee of. This transaction should be
14797 * broadcast along with the anchor transaction constructed as a result of consuming this
14800 struct LDKTransaction commitment_tx;
14802 * The absolute fee in satoshis of the commitment transaction. This can be used along the
14803 * with weight of the commitment transaction to determine its feerate.
14805 uint64_t commitment_tx_fee_satoshis;
14807 * The descriptor to sign the anchor input of the anchor transaction constructed as a
14808 * result of consuming this event.
14810 struct LDKAnchorDescriptor anchor_descriptor;
14812 * The set of pending HTLCs on the commitment transaction that need to be resolved once the
14813 * commitment transaction confirms.
14815 struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs;
14816 } LDKBumpTransactionEvent_LDKChannelClose_Body;
14818 typedef struct LDKBumpTransactionEvent_LDKHTLCResolution_Body {
14820 * The unique identifier for the claim of the HTLCs in the confirmed commitment
14823 * The identifier must map to the set of external UTXOs assigned to the claim, such that
14824 * they can be reused when a new claim with the same identifier needs to be made, resulting
14825 * in a fee-bumping attempt.
14827 struct LDKThirtyTwoBytes claim_id;
14829 * The target feerate that the resulting HTLC transaction must meet.
14831 uint32_t target_feerate_sat_per_1000_weight;
14833 * The set of pending HTLCs on the confirmed commitment that need to be claimed, preferably
14834 * by the same transaction.
14836 struct LDKCVec_HTLCDescriptorZ htlc_descriptors;
14838 * The locktime required for the resulting HTLC transaction.
14840 uint32_t tx_lock_time;
14841 } LDKBumpTransactionEvent_LDKHTLCResolution_Body;
14843 typedef struct MUST_USE_STRUCT LDKBumpTransactionEvent {
14844 LDKBumpTransactionEvent_Tag tag;
14846 LDKBumpTransactionEvent_LDKChannelClose_Body channel_close;
14847 LDKBumpTransactionEvent_LDKHTLCResolution_Body htlc_resolution;
14849 } LDKBumpTransactionEvent;
14852 * An Event which you should probably take some action in response to.
14854 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
14855 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
14856 * written as it makes no sense to respond to it after reconnecting to peers).
14858 typedef enum LDKEvent_Tag {
14860 * Used to indicate that the client should generate a funding transaction with the given
14861 * parameters and then call [`ChannelManager::funding_transaction_generated`].
14862 * Generated in [`ChannelManager`] message handling.
14863 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
14864 * counterparty can steal your funds!
14866 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
14867 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
14869 LDKEvent_FundingGenerationReady,
14871 * Indicates that we've been offered a payment and it needs to be claimed via calling
14872 * [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`].
14874 * Note that if the preimage is not known, you should call
14875 * [`ChannelManager::fail_htlc_backwards`] or [`ChannelManager::fail_htlc_backwards_with_reason`]
14876 * to free up resources for this HTLC and avoid network congestion.
14878 * If [`Event::PaymentClaimable::onion_fields`] is `Some`, and includes custom TLVs with even type
14879 * numbers, you should use [`ChannelManager::fail_htlc_backwards_with_reason`] with
14880 * [`FailureCode::InvalidOnionPayload`] if you fail to understand and handle the contents, or
14881 * [`ChannelManager::claim_funds_with_known_custom_tlvs`] upon successful handling.
14882 * If you don't intend to check for custom TLVs, you can simply use
14883 * [`ChannelManager::claim_funds`], which will automatically fail back even custom TLVs.
14885 * If you fail to call [`ChannelManager::claim_funds`],
14886 * [`ChannelManager::claim_funds_with_known_custom_tlvs`],
14887 * [`ChannelManager::fail_htlc_backwards`], or
14888 * [`ChannelManager::fail_htlc_backwards_with_reason`] within the HTLC's timeout, the HTLC will
14889 * be automatically failed.
14892 * LDK will not stop an inbound payment from being paid multiple times, so multiple
14893 * `PaymentClaimable` events may be generated for the same payment. In such a case it is
14894 * polite (and required in the lightning specification) to fail the payment the second time
14895 * and give the sender their money back rather than accepting double payment.
14898 * This event used to be called `PaymentReceived` in LDK versions 0.0.112 and earlier.
14900 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
14901 * [`ChannelManager::claim_funds_with_known_custom_tlvs`]: crate::ln::channelmanager::ChannelManager::claim_funds_with_known_custom_tlvs
14902 * [`FailureCode::InvalidOnionPayload`]: crate::ln::channelmanager::FailureCode::InvalidOnionPayload
14903 * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
14904 * [`ChannelManager::fail_htlc_backwards_with_reason`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards_with_reason
14906 LDKEvent_PaymentClaimable,
14908 * Indicates a payment has been claimed and we've received money!
14910 * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
14911 * to an [`Event::PaymentClaimable`]. However, if we previously crashed during a
14912 * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
14913 * [`Event::PaymentClaimable`] event.
14916 * LDK will not stop an inbound payment from being paid multiple times, so multiple
14917 * `PaymentClaimable` events may be generated for the same payment. If you then call
14918 * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentClaimable`] you may get
14919 * multiple `PaymentClaimed` events.
14921 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
14923 LDKEvent_PaymentClaimed,
14925 * Indicates a request for an invoice failed to yield a response in a reasonable amount of time
14926 * or was explicitly abandoned by [`ChannelManager::abandon_payment`]. This may be for an
14927 * [`InvoiceRequest`] sent for an [`Offer`] or for a [`Refund`] that hasn't been redeemed.
14929 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
14930 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
14931 * [`Offer`]: crate::offers::offer::Offer
14932 * [`Refund`]: crate::offers::refund::Refund
14934 LDKEvent_InvoiceRequestFailed,
14936 * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
14937 * and we got back the payment preimage for it).
14939 * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
14940 * event. In this situation, you SHOULD treat this payment as having succeeded.
14942 LDKEvent_PaymentSent,
14944 * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
14945 * provide failure information for each path attempt in the payment, including retries.
14947 * This event is provided once there are no further pending HTLCs for the payment and the
14948 * payment is no longer retryable, due either to the [`Retry`] provided or
14949 * [`ChannelManager::abandon_payment`] having been called for the corresponding payment.
14951 * In exceedingly rare cases, it is possible that an [`Event::PaymentFailed`] is generated for
14952 * a payment after an [`Event::PaymentSent`] event for this same payment has already been
14953 * received and processed. In this case, the [`Event::PaymentFailed`] event MUST be ignored,
14954 * and the payment MUST be treated as having succeeded.
14956 * [`Retry`]: crate::ln::channelmanager::Retry
14957 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
14959 LDKEvent_PaymentFailed,
14961 * Indicates that a path for an outbound payment was successful.
14963 * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
14964 * [`Event::PaymentSent`] for obtaining the payment preimage.
14966 LDKEvent_PaymentPathSuccessful,
14968 * Indicates an outbound HTLC we sent failed, likely due to an intermediary node being unable to
14971 * Note that this does *not* indicate that all paths for an MPP payment have failed, see
14972 * [`Event::PaymentFailed`].
14974 * See [`ChannelManager::abandon_payment`] for giving up on this payment before its retries have
14977 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
14979 LDKEvent_PaymentPathFailed,
14981 * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
14983 LDKEvent_ProbeSuccessful,
14985 * Indicates that a probe payment we sent failed at an intermediary node on the path.
14987 LDKEvent_ProbeFailed,
14989 * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
14990 * a time in the future.
14992 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
14994 LDKEvent_PendingHTLCsForwardable,
14996 * Used to indicate that we've intercepted an HTLC forward. This event will only be generated if
14997 * you've encoded an intercept scid in the receiver's invoice route hints using
14998 * [`ChannelManager::get_intercept_scid`] and have set [`UserConfig::accept_intercept_htlcs`].
15000 * [`ChannelManager::forward_intercepted_htlc`] or
15001 * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to this event. See
15002 * their docs for more information.
15004 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
15005 * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
15006 * [`ChannelManager::forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
15007 * [`ChannelManager::fail_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::fail_intercepted_htlc
15009 LDKEvent_HTLCIntercepted,
15011 * Used to indicate that an output which you should know how to spend was confirmed on chain
15012 * and is now spendable.
15013 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
15014 * counterparty spending them due to some kind of timeout. Thus, you need to store them
15015 * somewhere and spend them when you create on-chain transactions.
15017 LDKEvent_SpendableOutputs,
15019 * This event is generated when a payment has been successfully forwarded through us and a
15020 * forwarding fee earned.
15022 LDKEvent_PaymentForwarded,
15024 * Used to indicate that a channel with the given `channel_id` is being opened and pending
15025 * confirmation on-chain.
15027 * This event is emitted when the funding transaction has been signed and is broadcast to the
15028 * network. For 0conf channels it will be immediately followed by the corresponding
15029 * [`Event::ChannelReady`] event.
15031 LDKEvent_ChannelPending,
15033 * Used to indicate that a channel with the given `channel_id` is ready to
15034 * be used. This event is emitted either when the funding transaction has been confirmed
15035 * on-chain, or, in case of a 0conf channel, when both parties have confirmed the channel
15038 LDKEvent_ChannelReady,
15040 * Used to indicate that a previously opened channel with the given `channel_id` is in the
15041 * process of closure.
15043 * Note that this event is only triggered for accepted channels: if the
15044 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true and the channel is
15045 * rejected, no `ChannelClosed` event will be sent.
15047 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15048 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
15050 LDKEvent_ChannelClosed,
15052 * Used to indicate to the user that they can abandon the funding transaction and recycle the
15053 * inputs for another purpose.
15055 * This event is not guaranteed to be generated for channels that are closed due to a restart.
15057 LDKEvent_DiscardFunding,
15059 * Indicates a request to open a new channel by a peer.
15061 * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the request,
15062 * call [`ChannelManager::force_close_without_broadcasting_txn`]. Note that a ['ChannelClosed`]
15063 * event will _not_ be triggered if the channel is rejected.
15065 * The event is only triggered when a new open channel request is received and the
15066 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
15068 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15069 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
15070 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
15072 LDKEvent_OpenChannelRequest,
15074 * Indicates that the HTLC was accepted, but could not be processed when or after attempting to
15077 * Some scenarios where this event may be sent include:
15078 * * Insufficient capacity in the outbound channel
15079 * * While waiting to forward the HTLC, the channel it is meant to be forwarded through closes
15080 * * When an unknown SCID is requested for forwarding a payment.
15081 * * Expected MPP amount has already been reached
15082 * * The HTLC has timed out
15084 * This event, however, does not get generated if an HTLC fails to meet the forwarding
15085 * requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
15087 LDKEvent_HTLCHandlingFailed,
15089 * Indicates that a transaction originating from LDK needs to have its fee bumped. This event
15090 * requires confirmed external funds to be readily available to spend.
15092 * LDK does not currently generate this event unless the
15093 * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`] config flag is set to true.
15094 * It is limited to the scope of channels with anchor outputs.
15096 * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`]: crate::util::config::ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx
15098 LDKEvent_BumpTransaction,
15100 * Must be last for serialization purposes
15105 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
15107 * The random channel_id we picked which you'll need to pass into
15108 * [`ChannelManager::funding_transaction_generated`].
15110 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
15112 struct LDKThirtyTwoBytes temporary_channel_id;
15114 * The counterparty's node_id, which you'll need to pass back into
15115 * [`ChannelManager::funding_transaction_generated`].
15117 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
15119 struct LDKPublicKey counterparty_node_id;
15121 * The value, in satoshis, that the output should have.
15123 uint64_t channel_value_satoshis;
15125 * The script which should be used in the transaction output.
15127 struct LDKCVec_u8Z output_script;
15129 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
15130 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
15131 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
15132 * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
15133 * serialized with LDK versions prior to 0.0.113.
15135 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
15136 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15137 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
15139 struct LDKU128 user_channel_id;
15140 } LDKEvent_LDKFundingGenerationReady_Body;
15142 typedef struct LDKEvent_LDKPaymentClaimable_Body {
15144 * The node that will receive the payment after it has been claimed.
15145 * This is useful to identify payments received via [phantom nodes].
15146 * This field will always be filled in when the event was generated by LDK versions
15147 * 0.0.113 and above.
15149 * [phantom nodes]: crate::sign::PhantomKeysManager
15151 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
15153 struct LDKPublicKey receiver_node_id;
15155 * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
15156 * not stop you from registering duplicate payment hashes for inbound payments.
15158 struct LDKThirtyTwoBytes payment_hash;
15160 * The fields in the onion which were received with each HTLC. Only fields which were
15161 * identical in each HTLC involved in the payment will be included here.
15163 * Payments received on LDK versions prior to 0.0.115 will have this field unset.
15165 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
15167 struct LDKRecipientOnionFields onion_fields;
15169 * The value, in thousandths of a satoshi, that this payment is claimable for. May be greater
15170 * than the invoice amount.
15172 * May be less than the invoice amount if [`ChannelConfig::accept_underpaying_htlcs`] is set
15173 * and the previous hop took an extra fee.
15176 * If [`ChannelConfig::accept_underpaying_htlcs`] is set and you claim without verifying this
15177 * field, you may lose money!
15179 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
15181 uint64_t amount_msat;
15183 * The value, in thousands of a satoshi, that was skimmed off of this payment as an extra fee
15184 * taken by our channel counterparty.
15186 * Will always be 0 unless [`ChannelConfig::accept_underpaying_htlcs`] is set.
15188 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
15190 uint64_t counterparty_skimmed_fee_msat;
15192 * Information for claiming this received payment, based on whether the purpose of the
15193 * payment is to pay an invoice or to send a spontaneous payment.
15195 struct LDKPaymentPurpose purpose;
15197 * The `channel_id` indicating over which channel we received the payment.
15199 struct LDKCOption_ThirtyTwoBytesZ via_channel_id;
15201 * The `user_channel_id` indicating over which channel we received the payment.
15203 struct LDKCOption_U128Z via_user_channel_id;
15205 * The block height at which this payment will be failed back and will no longer be
15206 * eligible for claiming.
15208 * Prior to this height, a call to [`ChannelManager::claim_funds`] is guaranteed to
15209 * succeed, however you should wait for [`Event::PaymentClaimed`] to be sure.
15211 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
15213 struct LDKCOption_u32Z claim_deadline;
15214 } LDKEvent_LDKPaymentClaimable_Body;
15216 typedef struct LDKEvent_LDKPaymentClaimed_Body {
15218 * The node that received the payment.
15219 * This is useful to identify payments which were received via [phantom nodes].
15220 * This field will always be filled in when the event was generated by LDK versions
15221 * 0.0.113 and above.
15223 * [phantom nodes]: crate::sign::PhantomKeysManager
15225 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
15227 struct LDKPublicKey receiver_node_id;
15229 * The payment hash of the claimed payment. Note that LDK will not stop you from
15230 * registering duplicate payment hashes for inbound payments.
15232 struct LDKThirtyTwoBytes payment_hash;
15234 * The value, in thousandths of a satoshi, that this payment is for. May be greater than the
15237 uint64_t amount_msat;
15239 * The purpose of the claimed payment, i.e. whether the payment was for an invoice or a
15240 * spontaneous payment.
15242 struct LDKPaymentPurpose purpose;
15244 * The HTLCs that comprise the claimed payment. This will be empty for events serialized prior
15245 * to LDK version 0.0.117.
15247 struct LDKCVec_ClaimedHTLCZ htlcs;
15249 * The sender-intended sum total of all the MPP parts. This will be `None` for events
15250 * serialized prior to LDK version 0.0.117.
15252 struct LDKCOption_u64Z sender_intended_total_msat;
15253 } LDKEvent_LDKPaymentClaimed_Body;
15255 typedef struct LDKEvent_LDKInvoiceRequestFailed_Body {
15257 * The `payment_id` to have been associated with payment for the requested invoice.
15259 struct LDKThirtyTwoBytes payment_id;
15260 } LDKEvent_LDKInvoiceRequestFailed_Body;
15262 typedef struct LDKEvent_LDKPaymentSent_Body {
15264 * The `payment_id` passed to [`ChannelManager::send_payment`].
15266 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15268 struct LDKCOption_ThirtyTwoBytesZ payment_id;
15270 * The preimage to the hash given to ChannelManager::send_payment.
15271 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
15272 * store it somehow!
15274 struct LDKThirtyTwoBytes payment_preimage;
15276 * The hash that was given to [`ChannelManager::send_payment`].
15278 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15280 struct LDKThirtyTwoBytes payment_hash;
15282 * The total fee which was spent at intermediate hops in this payment, across all paths.
15284 * Note that, like [`Route::get_total_fees`] this does *not* include any potential
15285 * overpayment to the recipient node.
15287 * If the recipient or an intermediate node misbehaves and gives us free money, this may
15288 * overstate the amount paid, though this is unlikely.
15290 * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
15292 struct LDKCOption_u64Z fee_paid_msat;
15293 } LDKEvent_LDKPaymentSent_Body;
15295 typedef struct LDKEvent_LDKPaymentFailed_Body {
15297 * The `payment_id` passed to [`ChannelManager::send_payment`].
15299 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15301 struct LDKThirtyTwoBytes payment_id;
15303 * The hash that was given to [`ChannelManager::send_payment`].
15305 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15307 struct LDKThirtyTwoBytes payment_hash;
15309 * The reason the payment failed. This is only `None` for events generated or serialized
15310 * by versions prior to 0.0.115.
15312 struct LDKCOption_PaymentFailureReasonZ reason;
15313 } LDKEvent_LDKPaymentFailed_Body;
15315 typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
15317 * The `payment_id` passed to [`ChannelManager::send_payment`].
15319 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15321 struct LDKThirtyTwoBytes payment_id;
15323 * The hash that was given to [`ChannelManager::send_payment`].
15325 * This will be `Some` for all payments which completed on LDK 0.0.104 or later.
15327 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15329 struct LDKCOption_ThirtyTwoBytesZ payment_hash;
15331 * The payment path that was successful.
15333 * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
15335 struct LDKPath path;
15336 } LDKEvent_LDKPaymentPathSuccessful_Body;
15338 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
15340 * The `payment_id` passed to [`ChannelManager::send_payment`].
15342 * This will be `Some` for all payment paths which failed on LDK 0.0.103 or later.
15344 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15345 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
15347 struct LDKCOption_ThirtyTwoBytesZ payment_id;
15349 * The hash that was given to [`ChannelManager::send_payment`].
15351 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15353 struct LDKThirtyTwoBytes payment_hash;
15355 * Indicates the payment was rejected for some reason by the recipient. This implies that
15356 * the payment has failed, not just the route in question. If this is not set, the payment may
15357 * be retried via a different route.
15359 bool payment_failed_permanently;
15361 * Extra error details based on the failure type. May contain an update that needs to be
15362 * applied to the [`NetworkGraph`].
15364 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
15366 struct LDKPathFailure failure;
15368 * The payment path that failed.
15370 struct LDKPath path;
15372 * The channel responsible for the failed payment path.
15374 * Note that for route hints or for the first hop in a path this may be an SCID alias and
15375 * may not refer to a channel in the public network graph. These aliases may also collide
15376 * with channels in the public network graph.
15378 * If this is `Some`, then the corresponding channel should be avoided when the payment is
15379 * retried. May be `None` for older [`Event`] serializations.
15381 struct LDKCOption_u64Z short_channel_id;
15382 } LDKEvent_LDKPaymentPathFailed_Body;
15384 typedef struct LDKEvent_LDKProbeSuccessful_Body {
15386 * The id returned by [`ChannelManager::send_probe`].
15388 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
15390 struct LDKThirtyTwoBytes payment_id;
15392 * The hash generated by [`ChannelManager::send_probe`].
15394 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
15396 struct LDKThirtyTwoBytes payment_hash;
15398 * The payment path that was successful.
15400 struct LDKPath path;
15401 } LDKEvent_LDKProbeSuccessful_Body;
15403 typedef struct LDKEvent_LDKProbeFailed_Body {
15405 * The id returned by [`ChannelManager::send_probe`].
15407 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
15409 struct LDKThirtyTwoBytes payment_id;
15411 * The hash generated by [`ChannelManager::send_probe`].
15413 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
15415 struct LDKThirtyTwoBytes payment_hash;
15417 * The payment path that failed.
15419 struct LDKPath path;
15421 * The channel responsible for the failed probe.
15423 * Note that for route hints or for the first hop in a path this may be an SCID alias and
15424 * may not refer to a channel in the public network graph. These aliases may also collide
15425 * with channels in the public network graph.
15427 struct LDKCOption_u64Z short_channel_id;
15428 } LDKEvent_LDKProbeFailed_Body;
15430 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
15432 * The minimum amount of time that should be waited prior to calling
15433 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
15434 * you should wait a random amount of time in roughly the range (now + time_forwardable,
15435 * now + 5*time_forwardable).
15437 uint64_t time_forwardable;
15438 } LDKEvent_LDKPendingHTLCsForwardable_Body;
15440 typedef struct LDKEvent_LDKHTLCIntercepted_Body {
15442 * An id to help LDK identify which HTLC is being forwarded or failed.
15444 struct LDKThirtyTwoBytes intercept_id;
15446 * The fake scid that was programmed as the next hop's scid, generated using
15447 * [`ChannelManager::get_intercept_scid`].
15449 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
15451 uint64_t requested_next_hop_scid;
15453 * The payment hash used for this HTLC.
15455 struct LDKThirtyTwoBytes payment_hash;
15457 * How many msats were received on the inbound edge of this HTLC.
15459 uint64_t inbound_amount_msat;
15461 * How many msats the payer intended to route to the next node. Depending on the reason you are
15462 * intercepting this payment, you might take a fee by forwarding less than this amount.
15463 * Forwarding less than this amount may break compatibility with LDK versions prior to 0.0.116.
15465 * Note that LDK will NOT check that expected fees were factored into this value. You MUST
15466 * check that whatever fee you want has been included here or subtract it as required. Further,
15467 * LDK will not stop you from forwarding more than you received.
15469 uint64_t expected_outbound_amount_msat;
15470 } LDKEvent_LDKHTLCIntercepted_Body;
15472 typedef struct LDKEvent_LDKSpendableOutputs_Body {
15474 * The outputs which you should store as spendable by you.
15476 struct LDKCVec_SpendableOutputDescriptorZ outputs;
15478 * The `channel_id` indicating which channel the spendable outputs belong to.
15480 * This will always be `Some` for events generated by LDK versions 0.0.117 and above.
15482 struct LDKCOption_ThirtyTwoBytesZ channel_id;
15483 } LDKEvent_LDKSpendableOutputs_Body;
15485 typedef struct LDKEvent_LDKPaymentForwarded_Body {
15487 * The incoming channel between the previous node and us. This is only `None` for events
15488 * generated or serialized by versions prior to 0.0.107.
15490 struct LDKCOption_ThirtyTwoBytesZ prev_channel_id;
15492 * The outgoing channel between the next node and us. This is only `None` for events
15493 * generated or serialized by versions prior to 0.0.107.
15495 struct LDKCOption_ThirtyTwoBytesZ next_channel_id;
15497 * The fee, in milli-satoshis, which was earned as a result of the payment.
15499 * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
15500 * was pending, the amount the next hop claimed will have been rounded down to the nearest
15501 * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
15502 * claimed the full value in millisatoshis from the source. In this case,
15503 * `claim_from_onchain_tx` will be set.
15505 * If the channel which sent us the payment has been force-closed, we will claim the funds
15506 * via an on-chain transaction. In that case we do not yet know the on-chain transaction
15507 * fees which we will spend and will instead set this to `None`. It is possible duplicate
15508 * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
15511 struct LDKCOption_u64Z fee_earned_msat;
15513 * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
15516 bool claim_from_onchain_tx;
15518 * The final amount forwarded, in milli-satoshis, after the fee is deducted.
15520 * The caveat described above the `fee_earned_msat` field applies here as well.
15522 struct LDKCOption_u64Z outbound_amount_forwarded_msat;
15523 } LDKEvent_LDKPaymentForwarded_Body;
15525 typedef struct LDKEvent_LDKChannelPending_Body {
15527 * The `channel_id` of the channel that is pending confirmation.
15529 struct LDKThirtyTwoBytes channel_id;
15531 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
15532 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
15533 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
15534 * `user_channel_id` will be randomized for an inbound channel.
15536 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
15537 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15538 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
15540 struct LDKU128 user_channel_id;
15542 * The `temporary_channel_id` this channel used to be known by during channel establishment.
15544 * Will be `None` for channels created prior to LDK version 0.0.115.
15546 struct LDKCOption_ThirtyTwoBytesZ former_temporary_channel_id;
15548 * The `node_id` of the channel counterparty.
15550 struct LDKPublicKey counterparty_node_id;
15552 * The outpoint of the channel's funding transaction.
15554 struct LDKOutPoint funding_txo;
15555 } LDKEvent_LDKChannelPending_Body;
15557 typedef struct LDKEvent_LDKChannelReady_Body {
15559 * The `channel_id` of the channel that is ready.
15561 struct LDKThirtyTwoBytes channel_id;
15563 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
15564 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
15565 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
15566 * `user_channel_id` will be randomized for an inbound channel.
15568 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
15569 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15570 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
15572 struct LDKU128 user_channel_id;
15574 * The `node_id` of the channel counterparty.
15576 struct LDKPublicKey counterparty_node_id;
15578 * The features that this channel will operate with.
15580 struct LDKChannelTypeFeatures channel_type;
15581 } LDKEvent_LDKChannelReady_Body;
15583 typedef struct LDKEvent_LDKChannelClosed_Body {
15585 * The `channel_id` of the channel which has been closed. Note that on-chain transactions
15586 * resolving the channel are likely still awaiting confirmation.
15588 struct LDKThirtyTwoBytes channel_id;
15590 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
15591 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
15592 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
15593 * `user_channel_id` will be randomized for inbound channels.
15594 * This may be zero for inbound channels serialized prior to 0.0.113 and will always be
15595 * zero for objects serialized with LDK versions prior to 0.0.102.
15597 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
15598 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15599 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
15601 struct LDKU128 user_channel_id;
15603 * The reason the channel was closed.
15605 struct LDKClosureReason reason;
15607 * Counterparty in the closed channel.
15609 * This field will be `None` for objects serialized prior to LDK 0.0.117.
15611 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
15613 struct LDKPublicKey counterparty_node_id;
15615 * Channel capacity of the closing channel (sats).
15617 * This field will be `None` for objects serialized prior to LDK 0.0.117.
15619 struct LDKCOption_u64Z channel_capacity_sats;
15620 } LDKEvent_LDKChannelClosed_Body;
15622 typedef struct LDKEvent_LDKDiscardFunding_Body {
15624 * The channel_id of the channel which has been closed.
15626 struct LDKThirtyTwoBytes channel_id;
15628 * The full transaction received from the user
15630 struct LDKTransaction transaction;
15631 } LDKEvent_LDKDiscardFunding_Body;
15633 typedef struct LDKEvent_LDKOpenChannelRequest_Body {
15635 * The temporary channel ID of the channel requested to be opened.
15637 * When responding to the request, the `temporary_channel_id` should be passed
15638 * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
15639 * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
15641 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15642 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
15644 struct LDKThirtyTwoBytes temporary_channel_id;
15646 * The node_id of the counterparty requesting to open the channel.
15648 * When responding to the request, the `counterparty_node_id` should be passed
15649 * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
15650 * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
15653 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15654 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
15656 struct LDKPublicKey counterparty_node_id;
15658 * The channel value of the requested channel.
15660 uint64_t funding_satoshis;
15662 * Our starting balance in the channel if the request is accepted, in milli-satoshi.
15664 uint64_t push_msat;
15666 * The features that this channel will operate with. If you reject the channel, a
15667 * well-behaved counterparty may automatically re-attempt the channel with a new set of
15670 * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
15671 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
15674 * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
15675 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
15676 * 0.0.107. Channels setting this type also need to get manually accepted via
15677 * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
15678 * or will be rejected otherwise.
15680 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
15682 struct LDKChannelTypeFeatures channel_type;
15683 } LDKEvent_LDKOpenChannelRequest_Body;
15685 typedef struct LDKEvent_LDKHTLCHandlingFailed_Body {
15687 * The channel over which the HTLC was received.
15689 struct LDKThirtyTwoBytes prev_channel_id;
15691 * Destination of the HTLC that failed to be processed.
15693 struct LDKHTLCDestination failed_next_destination;
15694 } LDKEvent_LDKHTLCHandlingFailed_Body;
15696 typedef struct MUST_USE_STRUCT LDKEvent {
15699 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
15700 LDKEvent_LDKPaymentClaimable_Body payment_claimable;
15701 LDKEvent_LDKPaymentClaimed_Body payment_claimed;
15702 LDKEvent_LDKInvoiceRequestFailed_Body invoice_request_failed;
15703 LDKEvent_LDKPaymentSent_Body payment_sent;
15704 LDKEvent_LDKPaymentFailed_Body payment_failed;
15705 LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
15706 LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
15707 LDKEvent_LDKProbeSuccessful_Body probe_successful;
15708 LDKEvent_LDKProbeFailed_Body probe_failed;
15709 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
15710 LDKEvent_LDKHTLCIntercepted_Body htlc_intercepted;
15711 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
15712 LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
15713 LDKEvent_LDKChannelPending_Body channel_pending;
15714 LDKEvent_LDKChannelReady_Body channel_ready;
15715 LDKEvent_LDKChannelClosed_Body channel_closed;
15716 LDKEvent_LDKDiscardFunding_Body discard_funding;
15717 LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
15718 LDKEvent_LDKHTLCHandlingFailed_Body htlc_handling_failed;
15720 struct LDKBumpTransactionEvent bump_transaction;
15726 * An enum which can either contain a crate::lightning::events::Event or not
15728 typedef enum LDKCOption_EventZ_Tag {
15730 * When we're in this state, this COption_EventZ contains a crate::lightning::events::Event
15732 LDKCOption_EventZ_Some,
15734 * When we're in this state, this COption_EventZ contains nothing
15736 LDKCOption_EventZ_None,
15738 * Must be last for serialization purposes
15740 LDKCOption_EventZ_Sentinel,
15741 } LDKCOption_EventZ_Tag;
15743 typedef struct LDKCOption_EventZ {
15744 LDKCOption_EventZ_Tag tag;
15747 struct LDKEvent some;
15750 } LDKCOption_EventZ;
15753 * The contents of CResult_COption_EventZDecodeErrorZ
15755 typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
15757 * A pointer to the contents in the success state.
15758 * Reading from this pointer when `result_ok` is not set is undefined.
15760 struct LDKCOption_EventZ *result;
15762 * A pointer to the contents in the error state.
15763 * Reading from this pointer when `result_ok` is set is undefined.
15765 struct LDKDecodeError *err;
15766 } LDKCResult_COption_EventZDecodeErrorZPtr;
15769 * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
15770 * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
15771 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15773 typedef struct LDKCResult_COption_EventZDecodeErrorZ {
15775 * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
15776 * `err` or `result` depending on the state of `result_ok`.
15778 union LDKCResult_COption_EventZDecodeErrorZPtr contents;
15780 * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
15783 } LDKCResult_COption_EventZDecodeErrorZ;
15786 * Sub-errors which don't have specific information in them use this type.
15788 typedef struct LDKError {
15790 * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
15796 * Errors that indicate what is wrong with the invoice. They have some granularity for debug
15797 * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
15799 typedef enum LDKBolt11ParseError_Tag {
15800 LDKBolt11ParseError_Bech32Error,
15801 LDKBolt11ParseError_ParseAmountError,
15802 LDKBolt11ParseError_MalformedSignature,
15803 LDKBolt11ParseError_BadPrefix,
15804 LDKBolt11ParseError_UnknownCurrency,
15805 LDKBolt11ParseError_UnknownSiPrefix,
15806 LDKBolt11ParseError_MalformedHRP,
15807 LDKBolt11ParseError_TooShortDataPart,
15808 LDKBolt11ParseError_UnexpectedEndOfTaggedFields,
15809 LDKBolt11ParseError_DescriptionDecodeError,
15810 LDKBolt11ParseError_PaddingError,
15811 LDKBolt11ParseError_IntegerOverflowError,
15812 LDKBolt11ParseError_InvalidSegWitProgramLength,
15813 LDKBolt11ParseError_InvalidPubKeyHashLength,
15814 LDKBolt11ParseError_InvalidScriptHashLength,
15815 LDKBolt11ParseError_InvalidRecoveryId,
15816 LDKBolt11ParseError_InvalidSliceLength,
15818 * Not an error, but used internally to signal that a part of the invoice should be ignored
15819 * according to BOLT11
15821 LDKBolt11ParseError_Skip,
15823 * Must be last for serialization purposes
15825 LDKBolt11ParseError_Sentinel,
15826 } LDKBolt11ParseError_Tag;
15828 typedef struct MUST_USE_STRUCT LDKBolt11ParseError {
15829 LDKBolt11ParseError_Tag tag;
15832 struct LDKBech32Error bech32_error;
15835 struct LDKError parse_amount_error;
15838 enum LDKSecp256k1Error malformed_signature;
15841 struct LDKError description_decode_error;
15844 struct LDKStr invalid_slice_length;
15847 } LDKBolt11ParseError;
15850 * The contents of CResult_SiPrefixBolt11ParseErrorZ
15852 typedef union LDKCResult_SiPrefixBolt11ParseErrorZPtr {
15854 * A pointer to the contents in the success state.
15855 * Reading from this pointer when `result_ok` is not set is undefined.
15857 enum LDKSiPrefix *result;
15859 * A pointer to the contents in the error state.
15860 * Reading from this pointer when `result_ok` is set is undefined.
15862 struct LDKBolt11ParseError *err;
15863 } LDKCResult_SiPrefixBolt11ParseErrorZPtr;
15866 * A CResult_SiPrefixBolt11ParseErrorZ represents the result of a fallible operation,
15867 * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::Bolt11ParseError on failure.
15868 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15870 typedef struct LDKCResult_SiPrefixBolt11ParseErrorZ {
15872 * The contents of this CResult_SiPrefixBolt11ParseErrorZ, accessible via either
15873 * `err` or `result` depending on the state of `result_ok`.
15875 union LDKCResult_SiPrefixBolt11ParseErrorZPtr contents;
15877 * Whether this CResult_SiPrefixBolt11ParseErrorZ represents a success state.
15880 } LDKCResult_SiPrefixBolt11ParseErrorZ;
15883 * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
15884 * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
15885 * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
15887 typedef enum LDKParseOrSemanticError_Tag {
15889 * The invoice couldn't be decoded
15891 LDKParseOrSemanticError_ParseError,
15893 * The invoice could be decoded but violates the BOLT11 standard
15895 LDKParseOrSemanticError_SemanticError,
15897 * Must be last for serialization purposes
15899 LDKParseOrSemanticError_Sentinel,
15900 } LDKParseOrSemanticError_Tag;
15902 typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
15903 LDKParseOrSemanticError_Tag tag;
15906 struct LDKBolt11ParseError parse_error;
15909 enum LDKBolt11SemanticError semantic_error;
15912 } LDKParseOrSemanticError;
15915 * The contents of CResult_Bolt11InvoiceParseOrSemanticErrorZ
15917 typedef union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr {
15919 * A pointer to the contents in the success state.
15920 * Reading from this pointer when `result_ok` is not set is undefined.
15922 struct LDKBolt11Invoice *result;
15924 * A pointer to the contents in the error state.
15925 * Reading from this pointer when `result_ok` is set is undefined.
15927 struct LDKParseOrSemanticError *err;
15928 } LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr;
15931 * A CResult_Bolt11InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
15932 * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
15933 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15935 typedef struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ {
15937 * The contents of this CResult_Bolt11InvoiceParseOrSemanticErrorZ, accessible via either
15938 * `err` or `result` depending on the state of `result_ok`.
15940 union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr contents;
15942 * Whether this CResult_Bolt11InvoiceParseOrSemanticErrorZ represents a success state.
15945 } LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ;
15950 * Represents a signed [`RawBolt11Invoice`] with cached hash. The signature is not checked and may be
15954 * The hash has to be either from the deserialized invoice or from the serialized [`RawBolt11Invoice`].
15956 typedef struct MUST_USE_STRUCT LDKSignedRawBolt11Invoice {
15958 * A pointer to the opaque Rust object.
15959 * Nearly everywhere, inner must be non-null, however in places where
15960 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15962 LDKnativeSignedRawBolt11Invoice *inner;
15964 * Indicates that this is the only struct which contains the same pointer.
15965 * Rust functions which take ownership of an object provided via an argument require
15966 * this to be true and invalidate the object pointed to by inner.
15969 } LDKSignedRawBolt11Invoice;
15972 * The contents of CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ
15974 typedef union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr {
15976 * A pointer to the contents in the success state.
15977 * Reading from this pointer when `result_ok` is not set is undefined.
15979 struct LDKSignedRawBolt11Invoice *result;
15981 * A pointer to the contents in the error state.
15982 * Reading from this pointer when `result_ok` is set is undefined.
15984 struct LDKBolt11ParseError *err;
15985 } LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr;
15988 * A CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents the result of a fallible operation,
15989 * containing a crate::lightning_invoice::SignedRawBolt11Invoice on success and a crate::lightning_invoice::Bolt11ParseError on failure.
15990 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15992 typedef struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ {
15994 * The contents of this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ, accessible via either
15995 * `err` or `result` depending on the state of `result_ok`.
15997 union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr contents;
15999 * Whether this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents a success state.
16002 } LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ;
16007 * Represents an syntactically correct [`Bolt11Invoice`] for a payment on the lightning network,
16008 * but without the signature information.
16009 * Decoding and encoding should not lead to information loss but may lead to different hashes.
16011 * For methods without docs see the corresponding methods in [`Bolt11Invoice`].
16013 typedef struct MUST_USE_STRUCT LDKRawBolt11Invoice {
16015 * A pointer to the opaque Rust object.
16016 * Nearly everywhere, inner must be non-null, however in places where
16017 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16019 LDKnativeRawBolt11Invoice *inner;
16021 * Indicates that this is the only struct which contains the same pointer.
16022 * Rust functions which take ownership of an object provided via an argument require
16023 * this to be true and invalidate the object pointed to by inner.
16026 } LDKRawBolt11Invoice;
16031 * Recoverable signature
16033 typedef struct MUST_USE_STRUCT LDKBolt11InvoiceSignature {
16035 * A pointer to the opaque Rust object.
16036 * Nearly everywhere, inner must be non-null, however in places where
16037 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16039 LDKnativeBolt11InvoiceSignature *inner;
16041 * Indicates that this is the only struct which contains the same pointer.
16042 * Rust functions which take ownership of an object provided via an argument require
16043 * this to be true and invalidate the object pointed to by inner.
16046 } LDKBolt11InvoiceSignature;
16049 * A tuple of 3 elements. See the individual fields for the types contained.
16051 typedef struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ {
16053 * The element at position 0
16055 struct LDKRawBolt11Invoice a;
16057 * The element at position 1
16059 struct LDKThirtyTwoBytes b;
16061 * The element at position 2
16063 struct LDKBolt11InvoiceSignature c;
16064 } LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ;
16071 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
16073 * A pointer to the opaque Rust object.
16074 * Nearly everywhere, inner must be non-null, however in places where
16075 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16077 LDKnativePayeePubKey *inner;
16079 * Indicates that this is the only struct which contains the same pointer.
16080 * Rust functions which take ownership of an object provided via an argument require
16081 * this to be true and invalidate the object pointed to by inner.
16087 * The contents of CResult_PayeePubKeySecp256k1ErrorZ
16089 typedef union LDKCResult_PayeePubKeySecp256k1ErrorZPtr {
16091 * A pointer to the contents in the success state.
16092 * Reading from this pointer when `result_ok` is not set is undefined.
16094 struct LDKPayeePubKey *result;
16096 * A pointer to the contents in the error state.
16097 * Reading from this pointer when `result_ok` is set is undefined.
16099 enum LDKSecp256k1Error *err;
16100 } LDKCResult_PayeePubKeySecp256k1ErrorZPtr;
16103 * A CResult_PayeePubKeySecp256k1ErrorZ represents the result of a fallible operation,
16104 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
16105 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16107 typedef struct LDKCResult_PayeePubKeySecp256k1ErrorZ {
16109 * The contents of this CResult_PayeePubKeySecp256k1ErrorZ, accessible via either
16110 * `err` or `result` depending on the state of `result_ok`.
16112 union LDKCResult_PayeePubKeySecp256k1ErrorZPtr contents;
16114 * Whether this CResult_PayeePubKeySecp256k1ErrorZ represents a success state.
16117 } LDKCResult_PayeePubKeySecp256k1ErrorZ;
16122 * Private routing information
16125 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
16128 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
16130 * A pointer to the opaque Rust object.
16131 * Nearly everywhere, inner must be non-null, however in places where
16132 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16134 LDKnativePrivateRoute *inner;
16136 * Indicates that this is the only struct which contains the same pointer.
16137 * Rust functions which take ownership of an object provided via an argument require
16138 * this to be true and invalidate the object pointed to by inner.
16144 * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
16145 * This corresponds to std::vector in C++
16147 typedef struct LDKCVec_PrivateRouteZ {
16149 * The elements in the array.
16150 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
16152 struct LDKPrivateRoute *data;
16154 * The number of elements pointed to by `data`.
16157 } LDKCVec_PrivateRouteZ;
16162 * A timestamp that refers to a date after 1 January 1970.
16166 * The Unix timestamp representing the stored time has to be positive and no greater than
16167 * [`MAX_TIMESTAMP`].
16169 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
16171 * A pointer to the opaque Rust object.
16172 * Nearly everywhere, inner must be non-null, however in places where
16173 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16175 LDKnativePositiveTimestamp *inner;
16177 * Indicates that this is the only struct which contains the same pointer.
16178 * Rust functions which take ownership of an object provided via an argument require
16179 * this to be true and invalidate the object pointed to by inner.
16182 } LDKPositiveTimestamp;
16185 * The contents of CResult_PositiveTimestampCreationErrorZ
16187 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
16189 * A pointer to the contents in the success state.
16190 * Reading from this pointer when `result_ok` is not set is undefined.
16192 struct LDKPositiveTimestamp *result;
16194 * A pointer to the contents in the error state.
16195 * Reading from this pointer when `result_ok` is set is undefined.
16197 enum LDKCreationError *err;
16198 } LDKCResult_PositiveTimestampCreationErrorZPtr;
16201 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
16202 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
16203 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16205 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
16207 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
16208 * `err` or `result` depending on the state of `result_ok`.
16210 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
16212 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
16215 } LDKCResult_PositiveTimestampCreationErrorZ;
16218 * The contents of CResult_NoneBolt11SemanticErrorZ
16220 typedef union LDKCResult_NoneBolt11SemanticErrorZPtr {
16222 * Note that this value is always NULL, as there are no contents in the OK variant
16226 * A pointer to the contents in the error state.
16227 * Reading from this pointer when `result_ok` is set is undefined.
16229 enum LDKBolt11SemanticError *err;
16230 } LDKCResult_NoneBolt11SemanticErrorZPtr;
16233 * A CResult_NoneBolt11SemanticErrorZ represents the result of a fallible operation,
16234 * containing a () on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
16235 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16237 typedef struct LDKCResult_NoneBolt11SemanticErrorZ {
16239 * The contents of this CResult_NoneBolt11SemanticErrorZ, accessible via either
16240 * `err` or `result` depending on the state of `result_ok`.
16242 union LDKCResult_NoneBolt11SemanticErrorZPtr contents;
16244 * Whether this CResult_NoneBolt11SemanticErrorZ represents a success state.
16247 } LDKCResult_NoneBolt11SemanticErrorZ;
16250 * The contents of CResult_Bolt11InvoiceBolt11SemanticErrorZ
16252 typedef union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr {
16254 * A pointer to the contents in the success state.
16255 * Reading from this pointer when `result_ok` is not set is undefined.
16257 struct LDKBolt11Invoice *result;
16259 * A pointer to the contents in the error state.
16260 * Reading from this pointer when `result_ok` is set is undefined.
16262 enum LDKBolt11SemanticError *err;
16263 } LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr;
16266 * A CResult_Bolt11InvoiceBolt11SemanticErrorZ represents the result of a fallible operation,
16267 * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
16268 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16270 typedef struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ {
16272 * The contents of this CResult_Bolt11InvoiceBolt11SemanticErrorZ, accessible via either
16273 * `err` or `result` depending on the state of `result_ok`.
16275 union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr contents;
16277 * Whether this CResult_Bolt11InvoiceBolt11SemanticErrorZ represents a success state.
16280 } LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ;
16285 * Description string
16288 * The description can be at most 639 __bytes__ long
16290 typedef struct MUST_USE_STRUCT LDKDescription {
16292 * A pointer to the opaque Rust object.
16293 * Nearly everywhere, inner must be non-null, however in places where
16294 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16296 LDKnativeDescription *inner;
16298 * Indicates that this is the only struct which contains the same pointer.
16299 * Rust functions which take ownership of an object provided via an argument require
16300 * this to be true and invalidate the object pointed to by inner.
16306 * The contents of CResult_DescriptionCreationErrorZ
16308 typedef union LDKCResult_DescriptionCreationErrorZPtr {
16310 * A pointer to the contents in the success state.
16311 * Reading from this pointer when `result_ok` is not set is undefined.
16313 struct LDKDescription *result;
16315 * A pointer to the contents in the error state.
16316 * Reading from this pointer when `result_ok` is set is undefined.
16318 enum LDKCreationError *err;
16319 } LDKCResult_DescriptionCreationErrorZPtr;
16322 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
16323 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
16324 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16326 typedef struct LDKCResult_DescriptionCreationErrorZ {
16328 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
16329 * `err` or `result` depending on the state of `result_ok`.
16331 union LDKCResult_DescriptionCreationErrorZPtr contents;
16333 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
16336 } LDKCResult_DescriptionCreationErrorZ;
16339 * The contents of CResult_PrivateRouteCreationErrorZ
16341 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
16343 * A pointer to the contents in the success state.
16344 * Reading from this pointer when `result_ok` is not set is undefined.
16346 struct LDKPrivateRoute *result;
16348 * A pointer to the contents in the error state.
16349 * Reading from this pointer when `result_ok` is set is undefined.
16351 enum LDKCreationError *err;
16352 } LDKCResult_PrivateRouteCreationErrorZPtr;
16355 * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
16356 * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
16357 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16359 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
16361 * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
16362 * `err` or `result` depending on the state of `result_ok`.
16364 union LDKCResult_PrivateRouteCreationErrorZPtr contents;
16366 * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
16369 } LDKCResult_PrivateRouteCreationErrorZ;
16372 * The contents of CResult_OutPointDecodeErrorZ
16374 typedef union LDKCResult_OutPointDecodeErrorZPtr {
16376 * A pointer to the contents in the success state.
16377 * Reading from this pointer when `result_ok` is not set is undefined.
16379 struct LDKOutPoint *result;
16381 * A pointer to the contents in the error state.
16382 * Reading from this pointer when `result_ok` is set is undefined.
16384 struct LDKDecodeError *err;
16385 } LDKCResult_OutPointDecodeErrorZPtr;
16388 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
16389 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
16390 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16392 typedef struct LDKCResult_OutPointDecodeErrorZ {
16394 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
16395 * `err` or `result` depending on the state of `result_ok`.
16397 union LDKCResult_OutPointDecodeErrorZPtr contents;
16399 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
16402 } LDKCResult_OutPointDecodeErrorZ;
16407 * Lightning TLV uses a custom variable-length integer called `BigSize`. It is similar to Bitcoin's
16408 * variable-length integers except that it is serialized in big-endian instead of little-endian.
16410 * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
16411 * encoded in several different ways, which we must check for at deserialization-time. Thus, if
16412 * you're looking for an example of a variable-length integer to use for your own project, move
16413 * along, this is a rather poor design.
16415 typedef struct MUST_USE_STRUCT LDKBigSize {
16417 * A pointer to the opaque Rust object.
16418 * Nearly everywhere, inner must be non-null, however in places where
16419 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16421 LDKnativeBigSize *inner;
16423 * Indicates that this is the only struct which contains the same pointer.
16424 * Rust functions which take ownership of an object provided via an argument require
16425 * this to be true and invalidate the object pointed to by inner.
16431 * The contents of CResult_BigSizeDecodeErrorZ
16433 typedef union LDKCResult_BigSizeDecodeErrorZPtr {
16435 * A pointer to the contents in the success state.
16436 * Reading from this pointer when `result_ok` is not set is undefined.
16438 struct LDKBigSize *result;
16440 * A pointer to the contents in the error state.
16441 * Reading from this pointer when `result_ok` is set is undefined.
16443 struct LDKDecodeError *err;
16444 } LDKCResult_BigSizeDecodeErrorZPtr;
16447 * A CResult_BigSizeDecodeErrorZ represents the result of a fallible operation,
16448 * containing a crate::lightning::util::ser::BigSize on success and a crate::lightning::ln::msgs::DecodeError on failure.
16449 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16451 typedef struct LDKCResult_BigSizeDecodeErrorZ {
16453 * The contents of this CResult_BigSizeDecodeErrorZ, accessible via either
16454 * `err` or `result` depending on the state of `result_ok`.
16456 union LDKCResult_BigSizeDecodeErrorZPtr contents;
16458 * Whether this CResult_BigSizeDecodeErrorZ represents a success state.
16461 } LDKCResult_BigSizeDecodeErrorZ;
16464 * The contents of CResult_HostnameDecodeErrorZ
16466 typedef union LDKCResult_HostnameDecodeErrorZPtr {
16468 * A pointer to the contents in the success state.
16469 * Reading from this pointer when `result_ok` is not set is undefined.
16471 struct LDKHostname *result;
16473 * A pointer to the contents in the error state.
16474 * Reading from this pointer when `result_ok` is set is undefined.
16476 struct LDKDecodeError *err;
16477 } LDKCResult_HostnameDecodeErrorZPtr;
16480 * A CResult_HostnameDecodeErrorZ represents the result of a fallible operation,
16481 * containing a crate::lightning::util::ser::Hostname on success and a crate::lightning::ln::msgs::DecodeError on failure.
16482 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16484 typedef struct LDKCResult_HostnameDecodeErrorZ {
16486 * The contents of this CResult_HostnameDecodeErrorZ, accessible via either
16487 * `err` or `result` depending on the state of `result_ok`.
16489 union LDKCResult_HostnameDecodeErrorZPtr contents;
16491 * Whether this CResult_HostnameDecodeErrorZ represents a success state.
16494 } LDKCResult_HostnameDecodeErrorZ;
16499 * A wrapper for a `Transaction` which can only be constructed with [`TransactionU16LenLimited::new`]
16500 * if the `Transaction`'s consensus-serialized length is <= u16::MAX.
16502 * Use [`TransactionU16LenLimited::into_transaction`] to convert into the contained `Transaction`.
16504 typedef struct MUST_USE_STRUCT LDKTransactionU16LenLimited {
16506 * A pointer to the opaque Rust object.
16507 * Nearly everywhere, inner must be non-null, however in places where
16508 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16510 LDKnativeTransactionU16LenLimited *inner;
16512 * Indicates that this is the only struct which contains the same pointer.
16513 * Rust functions which take ownership of an object provided via an argument require
16514 * this to be true and invalidate the object pointed to by inner.
16517 } LDKTransactionU16LenLimited;
16520 * The contents of CResult_TransactionU16LenLimitedNoneZ
16522 typedef union LDKCResult_TransactionU16LenLimitedNoneZPtr {
16524 * A pointer to the contents in the success state.
16525 * Reading from this pointer when `result_ok` is not set is undefined.
16527 struct LDKTransactionU16LenLimited *result;
16529 * Note that this value is always NULL, as there are no contents in the Err variant
16532 } LDKCResult_TransactionU16LenLimitedNoneZPtr;
16535 * A CResult_TransactionU16LenLimitedNoneZ represents the result of a fallible operation,
16536 * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a () on failure.
16537 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16539 typedef struct LDKCResult_TransactionU16LenLimitedNoneZ {
16541 * The contents of this CResult_TransactionU16LenLimitedNoneZ, accessible via either
16542 * `err` or `result` depending on the state of `result_ok`.
16544 union LDKCResult_TransactionU16LenLimitedNoneZPtr contents;
16546 * Whether this CResult_TransactionU16LenLimitedNoneZ represents a success state.
16549 } LDKCResult_TransactionU16LenLimitedNoneZ;
16552 * The contents of CResult_TransactionU16LenLimitedDecodeErrorZ
16554 typedef union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr {
16556 * A pointer to the contents in the success state.
16557 * Reading from this pointer when `result_ok` is not set is undefined.
16559 struct LDKTransactionU16LenLimited *result;
16561 * A pointer to the contents in the error state.
16562 * Reading from this pointer when `result_ok` is set is undefined.
16564 struct LDKDecodeError *err;
16565 } LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr;
16568 * A CResult_TransactionU16LenLimitedDecodeErrorZ represents the result of a fallible operation,
16569 * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a crate::lightning::ln::msgs::DecodeError on failure.
16570 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16572 typedef struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ {
16574 * The contents of this CResult_TransactionU16LenLimitedDecodeErrorZ, accessible via either
16575 * `err` or `result` depending on the state of `result_ok`.
16577 union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr contents;
16579 * Whether this CResult_TransactionU16LenLimitedDecodeErrorZ represents a success state.
16582 } LDKCResult_TransactionU16LenLimitedDecodeErrorZ;
16585 * The contents of CResult_UntrustedStringDecodeErrorZ
16587 typedef union LDKCResult_UntrustedStringDecodeErrorZPtr {
16589 * A pointer to the contents in the success state.
16590 * Reading from this pointer when `result_ok` is not set is undefined.
16592 struct LDKUntrustedString *result;
16594 * A pointer to the contents in the error state.
16595 * Reading from this pointer when `result_ok` is set is undefined.
16597 struct LDKDecodeError *err;
16598 } LDKCResult_UntrustedStringDecodeErrorZPtr;
16601 * A CResult_UntrustedStringDecodeErrorZ represents the result of a fallible operation,
16602 * containing a crate::lightning::util::string::UntrustedString on success and a crate::lightning::ln::msgs::DecodeError on failure.
16603 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16605 typedef struct LDKCResult_UntrustedStringDecodeErrorZ {
16607 * The contents of this CResult_UntrustedStringDecodeErrorZ, accessible via either
16608 * `err` or `result` depending on the state of `result_ok`.
16610 union LDKCResult_UntrustedStringDecodeErrorZPtr contents;
16612 * Whether this CResult_UntrustedStringDecodeErrorZ represents a success state.
16615 } LDKCResult_UntrustedStringDecodeErrorZ;
16620 * Data to construct a [`BlindedHop`] for receiving a payment. This payload is custom to LDK and
16621 * may not be valid if received by another lightning implementation.
16623 typedef struct MUST_USE_STRUCT LDKReceiveTlvs {
16625 * A pointer to the opaque Rust object.
16626 * Nearly everywhere, inner must be non-null, however in places where
16627 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16629 LDKnativeReceiveTlvs *inner;
16631 * Indicates that this is the only struct which contains the same pointer.
16632 * Rust functions which take ownership of an object provided via an argument require
16633 * this to be true and invalidate the object pointed to by inner.
16639 * The contents of CResult_ReceiveTlvsDecodeErrorZ
16641 typedef union LDKCResult_ReceiveTlvsDecodeErrorZPtr {
16643 * A pointer to the contents in the success state.
16644 * Reading from this pointer when `result_ok` is not set is undefined.
16646 struct LDKReceiveTlvs *result;
16648 * A pointer to the contents in the error state.
16649 * Reading from this pointer when `result_ok` is set is undefined.
16651 struct LDKDecodeError *err;
16652 } LDKCResult_ReceiveTlvsDecodeErrorZPtr;
16655 * A CResult_ReceiveTlvsDecodeErrorZ represents the result of a fallible operation,
16656 * containing a crate::lightning::blinded_path::payment::ReceiveTlvs on success and a crate::lightning::ln::msgs::DecodeError on failure.
16657 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16659 typedef struct LDKCResult_ReceiveTlvsDecodeErrorZ {
16661 * The contents of this CResult_ReceiveTlvsDecodeErrorZ, accessible via either
16662 * `err` or `result` depending on the state of `result_ok`.
16664 union LDKCResult_ReceiveTlvsDecodeErrorZPtr contents;
16666 * Whether this CResult_ReceiveTlvsDecodeErrorZ represents a success state.
16669 } LDKCResult_ReceiveTlvsDecodeErrorZ;
16674 * Parameters for relaying over a given [`BlindedHop`].
16676 * [`BlindedHop`]: crate::blinded_path::BlindedHop
16678 typedef struct MUST_USE_STRUCT LDKPaymentRelay {
16680 * A pointer to the opaque Rust object.
16681 * Nearly everywhere, inner must be non-null, however in places where
16682 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16684 LDKnativePaymentRelay *inner;
16686 * Indicates that this is the only struct which contains the same pointer.
16687 * Rust functions which take ownership of an object provided via an argument require
16688 * this to be true and invalidate the object pointed to by inner.
16694 * The contents of CResult_PaymentRelayDecodeErrorZ
16696 typedef union LDKCResult_PaymentRelayDecodeErrorZPtr {
16698 * A pointer to the contents in the success state.
16699 * Reading from this pointer when `result_ok` is not set is undefined.
16701 struct LDKPaymentRelay *result;
16703 * A pointer to the contents in the error state.
16704 * Reading from this pointer when `result_ok` is set is undefined.
16706 struct LDKDecodeError *err;
16707 } LDKCResult_PaymentRelayDecodeErrorZPtr;
16710 * A CResult_PaymentRelayDecodeErrorZ represents the result of a fallible operation,
16711 * containing a crate::lightning::blinded_path::payment::PaymentRelay on success and a crate::lightning::ln::msgs::DecodeError on failure.
16712 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16714 typedef struct LDKCResult_PaymentRelayDecodeErrorZ {
16716 * The contents of this CResult_PaymentRelayDecodeErrorZ, accessible via either
16717 * `err` or `result` depending on the state of `result_ok`.
16719 union LDKCResult_PaymentRelayDecodeErrorZPtr contents;
16721 * Whether this CResult_PaymentRelayDecodeErrorZ represents a success state.
16724 } LDKCResult_PaymentRelayDecodeErrorZ;
16729 * Constraints for relaying over a given [`BlindedHop`].
16731 * [`BlindedHop`]: crate::blinded_path::BlindedHop
16733 typedef struct MUST_USE_STRUCT LDKPaymentConstraints {
16735 * A pointer to the opaque Rust object.
16736 * Nearly everywhere, inner must be non-null, however in places where
16737 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16739 LDKnativePaymentConstraints *inner;
16741 * Indicates that this is the only struct which contains the same pointer.
16742 * Rust functions which take ownership of an object provided via an argument require
16743 * this to be true and invalidate the object pointed to by inner.
16746 } LDKPaymentConstraints;
16749 * The contents of CResult_PaymentConstraintsDecodeErrorZ
16751 typedef union LDKCResult_PaymentConstraintsDecodeErrorZPtr {
16753 * A pointer to the contents in the success state.
16754 * Reading from this pointer when `result_ok` is not set is undefined.
16756 struct LDKPaymentConstraints *result;
16758 * A pointer to the contents in the error state.
16759 * Reading from this pointer when `result_ok` is set is undefined.
16761 struct LDKDecodeError *err;
16762 } LDKCResult_PaymentConstraintsDecodeErrorZPtr;
16765 * A CResult_PaymentConstraintsDecodeErrorZ represents the result of a fallible operation,
16766 * containing a crate::lightning::blinded_path::payment::PaymentConstraints on success and a crate::lightning::ln::msgs::DecodeError on failure.
16767 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16769 typedef struct LDKCResult_PaymentConstraintsDecodeErrorZ {
16771 * The contents of this CResult_PaymentConstraintsDecodeErrorZ, accessible via either
16772 * `err` or `result` depending on the state of `result_ok`.
16774 union LDKCResult_PaymentConstraintsDecodeErrorZPtr contents;
16776 * Whether this CResult_PaymentConstraintsDecodeErrorZ represents a success state.
16779 } LDKCResult_PaymentConstraintsDecodeErrorZ;
16782 * An error that may occur when making a payment.
16784 typedef enum LDKPaymentError_Tag {
16786 * An error resulting from the provided [`Bolt11Invoice`] or payment hash.
16788 LDKPaymentError_Invoice,
16790 * An error occurring when sending a payment.
16792 LDKPaymentError_Sending,
16794 * Must be last for serialization purposes
16796 LDKPaymentError_Sentinel,
16797 } LDKPaymentError_Tag;
16799 typedef struct MUST_USE_STRUCT LDKPaymentError {
16800 LDKPaymentError_Tag tag;
16803 struct LDKStr invoice;
16806 enum LDKRetryableSendFailure sending;
16812 * The contents of CResult_ThirtyTwoBytesPaymentErrorZ
16814 typedef union LDKCResult_ThirtyTwoBytesPaymentErrorZPtr {
16816 * A pointer to the contents in the success state.
16817 * Reading from this pointer when `result_ok` is not set is undefined.
16819 struct LDKThirtyTwoBytes *result;
16821 * A pointer to the contents in the error state.
16822 * Reading from this pointer when `result_ok` is set is undefined.
16824 struct LDKPaymentError *err;
16825 } LDKCResult_ThirtyTwoBytesPaymentErrorZPtr;
16828 * A CResult_ThirtyTwoBytesPaymentErrorZ represents the result of a fallible operation,
16829 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning_invoice::payment::PaymentError on failure.
16830 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16832 typedef struct LDKCResult_ThirtyTwoBytesPaymentErrorZ {
16834 * The contents of this CResult_ThirtyTwoBytesPaymentErrorZ, accessible via either
16835 * `err` or `result` depending on the state of `result_ok`.
16837 union LDKCResult_ThirtyTwoBytesPaymentErrorZPtr contents;
16839 * Whether this CResult_ThirtyTwoBytesPaymentErrorZ represents a success state.
16842 } LDKCResult_ThirtyTwoBytesPaymentErrorZ;
16845 * The contents of CResult_NonePaymentErrorZ
16847 typedef union LDKCResult_NonePaymentErrorZPtr {
16849 * Note that this value is always NULL, as there are no contents in the OK variant
16853 * A pointer to the contents in the error state.
16854 * Reading from this pointer when `result_ok` is set is undefined.
16856 struct LDKPaymentError *err;
16857 } LDKCResult_NonePaymentErrorZPtr;
16860 * A CResult_NonePaymentErrorZ represents the result of a fallible operation,
16861 * containing a () on success and a crate::lightning_invoice::payment::PaymentError on failure.
16862 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16864 typedef struct LDKCResult_NonePaymentErrorZ {
16866 * The contents of this CResult_NonePaymentErrorZ, accessible via either
16867 * `err` or `result` depending on the state of `result_ok`.
16869 union LDKCResult_NonePaymentErrorZPtr contents;
16871 * Whether this CResult_NonePaymentErrorZ represents a success state.
16874 } LDKCResult_NonePaymentErrorZ;
16877 * An error that may occur when sending a payment probe.
16879 typedef enum LDKProbingError_Tag {
16881 * An error resulting from the provided [`Bolt11Invoice`].
16883 LDKProbingError_Invoice,
16885 * An error occurring when sending a payment probe.
16887 LDKProbingError_Sending,
16889 * Must be last for serialization purposes
16891 LDKProbingError_Sentinel,
16892 } LDKProbingError_Tag;
16894 typedef struct MUST_USE_STRUCT LDKProbingError {
16895 LDKProbingError_Tag tag;
16898 struct LDKStr invoice;
16901 struct LDKProbeSendFailure sending;
16907 * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ
16909 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZPtr {
16911 * A pointer to the contents in the success state.
16912 * Reading from this pointer when `result_ok` is not set is undefined.
16914 struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ *result;
16916 * A pointer to the contents in the error state.
16917 * Reading from this pointer when `result_ok` is set is undefined.
16919 struct LDKProbingError *err;
16920 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZPtr;
16923 * A CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ represents the result of a fallible operation,
16924 * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ on success and a crate::lightning_invoice::payment::ProbingError on failure.
16925 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16927 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ {
16929 * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ, accessible via either
16930 * `err` or `result` depending on the state of `result_ok`.
16932 union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZPtr contents;
16934 * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ represents a success state.
16937 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ;
16940 * The contents of CResult_StrSecp256k1ErrorZ
16942 typedef union LDKCResult_StrSecp256k1ErrorZPtr {
16944 * A pointer to the contents in the success state.
16945 * Reading from this pointer when `result_ok` is not set is undefined.
16947 struct LDKStr *result;
16949 * A pointer to the contents in the error state.
16950 * Reading from this pointer when `result_ok` is set is undefined.
16952 enum LDKSecp256k1Error *err;
16953 } LDKCResult_StrSecp256k1ErrorZPtr;
16956 * A CResult_StrSecp256k1ErrorZ represents the result of a fallible operation,
16957 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
16958 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16960 typedef struct LDKCResult_StrSecp256k1ErrorZ {
16962 * The contents of this CResult_StrSecp256k1ErrorZ, accessible via either
16963 * `err` or `result` depending on the state of `result_ok`.
16965 union LDKCResult_StrSecp256k1ErrorZPtr contents;
16967 * Whether this CResult_StrSecp256k1ErrorZ represents a success state.
16970 } LDKCResult_StrSecp256k1ErrorZ;
16975 * A path for sending an [`OnionMessage`].
16977 typedef struct MUST_USE_STRUCT LDKOnionMessagePath {
16979 * A pointer to the opaque Rust object.
16980 * Nearly everywhere, inner must be non-null, however in places where
16981 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16983 LDKnativeOnionMessagePath *inner;
16985 * Indicates that this is the only struct which contains the same pointer.
16986 * Rust functions which take ownership of an object provided via an argument require
16987 * this to be true and invalidate the object pointed to by inner.
16990 } LDKOnionMessagePath;
16993 * The contents of CResult_OnionMessagePathNoneZ
16995 typedef union LDKCResult_OnionMessagePathNoneZPtr {
16997 * A pointer to the contents in the success state.
16998 * Reading from this pointer when `result_ok` is not set is undefined.
17000 struct LDKOnionMessagePath *result;
17002 * Note that this value is always NULL, as there are no contents in the Err variant
17005 } LDKCResult_OnionMessagePathNoneZPtr;
17008 * A CResult_OnionMessagePathNoneZ represents the result of a fallible operation,
17009 * containing a crate::lightning::onion_message::messenger::OnionMessagePath on success and a () on failure.
17010 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17012 typedef struct LDKCResult_OnionMessagePathNoneZ {
17014 * The contents of this CResult_OnionMessagePathNoneZ, accessible via either
17015 * `err` or `result` depending on the state of `result_ok`.
17017 union LDKCResult_OnionMessagePathNoneZPtr contents;
17019 * Whether this CResult_OnionMessagePathNoneZ represents a success state.
17022 } LDKCResult_OnionMessagePathNoneZ;
17025 * A tuple of 2 elements. See the individual fields for the types contained.
17027 typedef struct LDKC2Tuple_PublicKeyOnionMessageZ {
17029 * The element at position 0
17031 struct LDKPublicKey a;
17033 * The element at position 1
17035 struct LDKOnionMessage b;
17036 } LDKC2Tuple_PublicKeyOnionMessageZ;
17039 * Errors that may occur when [sending an onion message].
17041 * [sending an onion message]: OnionMessenger::send_onion_message
17043 typedef enum LDKSendError_Tag {
17045 * Errored computing onion message packet keys.
17047 LDKSendError_Secp256k1,
17049 * Because implementations such as Eclair will drop onion messages where the message packet
17050 * exceeds 32834 bytes, we refuse to send messages where the packet exceeds this size.
17052 LDKSendError_TooBigPacket,
17054 * The provided [`Destination`] was an invalid [`BlindedPath`] due to not having any blinded
17057 LDKSendError_TooFewBlindedHops,
17059 * Our next-hop peer was offline or does not support onion message forwarding.
17061 LDKSendError_InvalidFirstHop,
17063 * Onion message contents must have a TLV type >= 64.
17065 LDKSendError_InvalidMessage,
17067 * Our next-hop peer's buffer was full or our total outbound buffer was full.
17069 LDKSendError_BufferFull,
17071 * Failed to retrieve our node id from the provided [`NodeSigner`].
17073 * [`NodeSigner`]: crate::sign::NodeSigner
17075 LDKSendError_GetNodeIdFailed,
17077 * We attempted to send to a blinded path where we are the introduction node, and failed to
17078 * advance the blinded path to make the second hop the new introduction node. Either
17079 * [`NodeSigner::ecdh`] failed, we failed to tweak the current blinding point to get the
17080 * new blinding point, or we were attempting to send to ourselves.
17082 LDKSendError_BlindedPathAdvanceFailed,
17084 * Must be last for serialization purposes
17086 LDKSendError_Sentinel,
17087 } LDKSendError_Tag;
17089 typedef struct MUST_USE_STRUCT LDKSendError {
17090 LDKSendError_Tag tag;
17093 enum LDKSecp256k1Error secp256k1;
17099 * The contents of CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ
17101 typedef union LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZPtr {
17103 * A pointer to the contents in the success state.
17104 * Reading from this pointer when `result_ok` is not set is undefined.
17106 struct LDKC2Tuple_PublicKeyOnionMessageZ *result;
17108 * A pointer to the contents in the error state.
17109 * Reading from this pointer when `result_ok` is set is undefined.
17111 struct LDKSendError *err;
17112 } LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZPtr;
17115 * A CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ represents the result of a fallible operation,
17116 * containing a crate::c_types::derived::C2Tuple_PublicKeyOnionMessageZ on success and a crate::lightning::onion_message::messenger::SendError on failure.
17117 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17119 typedef struct LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ {
17121 * The contents of this CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ, accessible via either
17122 * `err` or `result` depending on the state of `result_ok`.
17124 union LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZPtr contents;
17126 * Whether this CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ represents a success state.
17129 } LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ;
17132 * The contents of an [`OnionMessage`] as read from the wire.
17134 * [`OnionMessage`]: crate::ln::msgs::OnionMessage
17136 typedef enum LDKParsedOnionMessageContents_Tag {
17138 * A message related to BOLT 12 Offers.
17140 LDKParsedOnionMessageContents_Offers,
17142 * A custom onion message specified by the user.
17144 LDKParsedOnionMessageContents_Custom,
17146 * Must be last for serialization purposes
17148 LDKParsedOnionMessageContents_Sentinel,
17149 } LDKParsedOnionMessageContents_Tag;
17151 typedef struct MUST_USE_STRUCT LDKParsedOnionMessageContents {
17152 LDKParsedOnionMessageContents_Tag tag;
17155 struct LDKOffersMessage offers;
17158 struct LDKOnionMessageContents custom;
17161 } LDKParsedOnionMessageContents;
17164 * A processed incoming onion message, containing either a Forward (another onion message)
17165 * or a Receive payload with decrypted contents.
17167 typedef enum LDKPeeledOnion_Tag {
17169 * Forwarded onion, with the next node id and a new onion
17171 LDKPeeledOnion_Forward,
17173 * Received onion message, with decrypted contents, path_id, and reply path
17175 LDKPeeledOnion_Receive,
17177 * Must be last for serialization purposes
17179 LDKPeeledOnion_Sentinel,
17180 } LDKPeeledOnion_Tag;
17182 typedef struct LDKPeeledOnion_LDKForward_Body {
17183 struct LDKPublicKey _0;
17184 struct LDKOnionMessage _1;
17185 } LDKPeeledOnion_LDKForward_Body;
17187 typedef struct LDKPeeledOnion_LDKReceive_Body {
17188 struct LDKParsedOnionMessageContents _0;
17191 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
17193 struct LDKThirtyTwoBytes _1;
17196 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
17198 struct LDKBlindedPath _2;
17199 } LDKPeeledOnion_LDKReceive_Body;
17201 typedef struct MUST_USE_STRUCT LDKPeeledOnion {
17202 LDKPeeledOnion_Tag tag;
17204 LDKPeeledOnion_LDKForward_Body forward;
17205 LDKPeeledOnion_LDKReceive_Body receive;
17210 * The contents of CResult_PeeledOnionNoneZ
17212 typedef union LDKCResult_PeeledOnionNoneZPtr {
17214 * A pointer to the contents in the success state.
17215 * Reading from this pointer when `result_ok` is not set is undefined.
17217 struct LDKPeeledOnion *result;
17219 * Note that this value is always NULL, as there are no contents in the Err variant
17222 } LDKCResult_PeeledOnionNoneZPtr;
17225 * A CResult_PeeledOnionNoneZ represents the result of a fallible operation,
17226 * containing a crate::lightning::onion_message::messenger::PeeledOnion on success and a () on failure.
17227 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17229 typedef struct LDKCResult_PeeledOnionNoneZ {
17231 * The contents of this CResult_PeeledOnionNoneZ, accessible via either
17232 * `err` or `result` depending on the state of `result_ok`.
17234 union LDKCResult_PeeledOnionNoneZPtr contents;
17236 * Whether this CResult_PeeledOnionNoneZ represents a success state.
17239 } LDKCResult_PeeledOnionNoneZ;
17242 * The contents of CResult_NoneSendErrorZ
17244 typedef union LDKCResult_NoneSendErrorZPtr {
17246 * Note that this value is always NULL, as there are no contents in the OK variant
17250 * A pointer to the contents in the error state.
17251 * Reading from this pointer when `result_ok` is set is undefined.
17253 struct LDKSendError *err;
17254 } LDKCResult_NoneSendErrorZPtr;
17257 * A CResult_NoneSendErrorZ represents the result of a fallible operation,
17258 * containing a () on success and a crate::lightning::onion_message::messenger::SendError on failure.
17259 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17261 typedef struct LDKCResult_NoneSendErrorZ {
17263 * The contents of this CResult_NoneSendErrorZ, accessible via either
17264 * `err` or `result` depending on the state of `result_ok`.
17266 union LDKCResult_NoneSendErrorZPtr contents;
17268 * Whether this CResult_NoneSendErrorZ represents a success state.
17271 } LDKCResult_NoneSendErrorZ;
17274 * The contents of CResult_BlindedPathNoneZ
17276 typedef union LDKCResult_BlindedPathNoneZPtr {
17278 * A pointer to the contents in the success state.
17279 * Reading from this pointer when `result_ok` is not set is undefined.
17281 struct LDKBlindedPath *result;
17283 * Note that this value is always NULL, as there are no contents in the Err variant
17286 } LDKCResult_BlindedPathNoneZPtr;
17289 * A CResult_BlindedPathNoneZ represents the result of a fallible operation,
17290 * containing a crate::lightning::blinded_path::BlindedPath on success and a () on failure.
17291 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17293 typedef struct LDKCResult_BlindedPathNoneZ {
17295 * The contents of this CResult_BlindedPathNoneZ, accessible via either
17296 * `err` or `result` depending on the state of `result_ok`.
17298 union LDKCResult_BlindedPathNoneZPtr contents;
17300 * Whether this CResult_BlindedPathNoneZ represents a success state.
17303 } LDKCResult_BlindedPathNoneZ;
17306 * The contents of CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ
17308 typedef union LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr {
17310 * A pointer to the contents in the success state.
17311 * Reading from this pointer when `result_ok` is not set is undefined.
17313 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *result;
17315 * Note that this value is always NULL, as there are no contents in the Err variant
17318 } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr;
17321 * A CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ represents the result of a fallible operation,
17322 * containing a crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZ on success and a () on failure.
17323 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17325 typedef struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ {
17327 * The contents of this CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ, accessible via either
17328 * `err` or `result` depending on the state of `result_ok`.
17330 union LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr contents;
17332 * Whether this CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ represents a success state.
17335 } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ;
17338 * The contents of CResult_BlindedPathDecodeErrorZ
17340 typedef union LDKCResult_BlindedPathDecodeErrorZPtr {
17342 * A pointer to the contents in the success state.
17343 * Reading from this pointer when `result_ok` is not set is undefined.
17345 struct LDKBlindedPath *result;
17347 * A pointer to the contents in the error state.
17348 * Reading from this pointer when `result_ok` is set is undefined.
17350 struct LDKDecodeError *err;
17351 } LDKCResult_BlindedPathDecodeErrorZPtr;
17354 * A CResult_BlindedPathDecodeErrorZ represents the result of a fallible operation,
17355 * containing a crate::lightning::blinded_path::BlindedPath on success and a crate::lightning::ln::msgs::DecodeError on failure.
17356 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17358 typedef struct LDKCResult_BlindedPathDecodeErrorZ {
17360 * The contents of this CResult_BlindedPathDecodeErrorZ, accessible via either
17361 * `err` or `result` depending on the state of `result_ok`.
17363 union LDKCResult_BlindedPathDecodeErrorZPtr contents;
17365 * Whether this CResult_BlindedPathDecodeErrorZ represents a success state.
17368 } LDKCResult_BlindedPathDecodeErrorZ;
17371 * The contents of CResult_BlindedHopDecodeErrorZ
17373 typedef union LDKCResult_BlindedHopDecodeErrorZPtr {
17375 * A pointer to the contents in the success state.
17376 * Reading from this pointer when `result_ok` is not set is undefined.
17378 struct LDKBlindedHop *result;
17380 * A pointer to the contents in the error state.
17381 * Reading from this pointer when `result_ok` is set is undefined.
17383 struct LDKDecodeError *err;
17384 } LDKCResult_BlindedHopDecodeErrorZPtr;
17387 * A CResult_BlindedHopDecodeErrorZ represents the result of a fallible operation,
17388 * containing a crate::lightning::blinded_path::BlindedHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
17389 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17391 typedef struct LDKCResult_BlindedHopDecodeErrorZ {
17393 * The contents of this CResult_BlindedHopDecodeErrorZ, accessible via either
17394 * `err` or `result` depending on the state of `result_ok`.
17396 union LDKCResult_BlindedHopDecodeErrorZPtr contents;
17398 * Whether this CResult_BlindedHopDecodeErrorZ represents a success state.
17401 } LDKCResult_BlindedHopDecodeErrorZ;
17404 * The contents of CResult_InvoiceErrorDecodeErrorZ
17406 typedef union LDKCResult_InvoiceErrorDecodeErrorZPtr {
17408 * A pointer to the contents in the success state.
17409 * Reading from this pointer when `result_ok` is not set is undefined.
17411 struct LDKInvoiceError *result;
17413 * A pointer to the contents in the error state.
17414 * Reading from this pointer when `result_ok` is set is undefined.
17416 struct LDKDecodeError *err;
17417 } LDKCResult_InvoiceErrorDecodeErrorZPtr;
17420 * A CResult_InvoiceErrorDecodeErrorZ represents the result of a fallible operation,
17421 * containing a crate::lightning::offers::invoice_error::InvoiceError on success and a crate::lightning::ln::msgs::DecodeError on failure.
17422 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17424 typedef struct LDKCResult_InvoiceErrorDecodeErrorZ {
17426 * The contents of this CResult_InvoiceErrorDecodeErrorZ, accessible via either
17427 * `err` or `result` depending on the state of `result_ok`.
17429 union LDKCResult_InvoiceErrorDecodeErrorZPtr contents;
17431 * Whether this CResult_InvoiceErrorDecodeErrorZ represents a success state.
17434 } LDKCResult_InvoiceErrorDecodeErrorZ;
17439 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
17441 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
17442 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
17443 * [`Confirm::transactions_confirmed`].
17445 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
17446 * may have been spent there. See [`Filter::register_output`] for details.
17448 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
17449 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
17451 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
17453 * A pointer to the opaque Rust object.
17454 * Nearly everywhere, inner must be non-null, however in places where
17455 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17457 LDKnativeWatchedOutput *inner;
17459 * Indicates that this is the only struct which contains the same pointer.
17460 * Rust functions which take ownership of an object provided via an argument require
17461 * this to be true and invalidate the object pointed to by inner.
17464 } LDKWatchedOutput;
17467 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
17470 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
17471 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
17472 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
17473 * receiving full blocks from a chain source, any further filtering is unnecessary.
17475 * After an output has been registered, subsequent block retrievals from the chain source must not
17476 * exclude any transactions matching the new criteria nor any in-block descendants of such
17479 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
17480 * should not block on I/O. Implementations should instead queue the newly monitored data to be
17481 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
17482 * invocation that has called the `Filter` must return [`InProgress`].
17484 * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
17485 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
17486 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
17488 typedef struct LDKFilter {
17490 * An opaque pointer which is passed to your function implementations as an argument.
17491 * This has no meaning in the LDK, and can be NULL or any other value.
17495 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
17496 * a spending condition.
17498 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
17500 * Registers interest in spends of a transaction output.
17502 * Note that this method might be called during processing of a new block. You therefore need
17503 * to ensure that also dependent output spents within an already connected block are correctly
17504 * handled, e.g., by re-scanning the block in question whenever new outputs have been
17505 * registered mid-processing.
17507 void (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
17509 * Frees any resources associated with this object given its this_arg pointer.
17510 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17512 void (*free)(void *this_arg);
17516 * An enum which can either contain a crate::lightning::chain::Filter or not
17518 typedef enum LDKCOption_FilterZ_Tag {
17520 * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
17522 LDKCOption_FilterZ_Some,
17524 * When we're in this state, this COption_FilterZ contains nothing
17526 LDKCOption_FilterZ_None,
17528 * Must be last for serialization purposes
17530 LDKCOption_FilterZ_Sentinel,
17531 } LDKCOption_FilterZ_Tag;
17533 typedef struct LDKCOption_FilterZ {
17534 LDKCOption_FilterZ_Tag tag;
17537 struct LDKFilter some;
17540 } LDKCOption_FilterZ;
17545 * A read-only reference to a current ChannelMonitor.
17547 * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
17550 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
17552 * A pointer to the opaque Rust object.
17553 * Nearly everywhere, inner must be non-null, however in places where
17554 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17556 LDKnativeLockedChannelMonitor *inner;
17558 * Indicates that this is the only struct which contains the same pointer.
17559 * Rust functions which take ownership of an object provided via an argument require
17560 * this to be true and invalidate the object pointed to by inner.
17563 } LDKLockedChannelMonitor;
17566 * The contents of CResult_LockedChannelMonitorNoneZ
17568 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
17570 * A pointer to the contents in the success state.
17571 * Reading from this pointer when `result_ok` is not set is undefined.
17573 struct LDKLockedChannelMonitor *result;
17575 * Note that this value is always NULL, as there are no contents in the Err variant
17578 } LDKCResult_LockedChannelMonitorNoneZPtr;
17581 * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
17582 * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
17583 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17585 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
17587 * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
17588 * `err` or `result` depending on the state of `result_ok`.
17590 union LDKCResult_LockedChannelMonitorNoneZPtr contents;
17592 * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
17595 } LDKCResult_LockedChannelMonitorNoneZ;
17598 * A dynamically-allocated array of crate::lightning::chain::transaction::OutPoints of arbitrary size.
17599 * This corresponds to std::vector in C++
17601 typedef struct LDKCVec_OutPointZ {
17603 * The elements in the array.
17604 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
17606 struct LDKOutPoint *data;
17608 * The number of elements pointed to by `data`.
17611 } LDKCVec_OutPointZ;
17616 * An opaque identifier describing a specific [`Persist`] method call.
17618 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
17620 * A pointer to the opaque Rust object.
17621 * Nearly everywhere, inner must be non-null, however in places where
17622 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17624 LDKnativeMonitorUpdateId *inner;
17626 * Indicates that this is the only struct which contains the same pointer.
17627 * Rust functions which take ownership of an object provided via an argument require
17628 * this to be true and invalidate the object pointed to by inner.
17631 } LDKMonitorUpdateId;
17634 * A dynamically-allocated array of crate::lightning::chain::chainmonitor::MonitorUpdateIds of arbitrary size.
17635 * This corresponds to std::vector in C++
17637 typedef struct LDKCVec_MonitorUpdateIdZ {
17639 * The elements in the array.
17640 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
17642 struct LDKMonitorUpdateId *data;
17644 * The number of elements pointed to by `data`.
17647 } LDKCVec_MonitorUpdateIdZ;
17650 * A tuple of 2 elements. See the individual fields for the types contained.
17652 typedef struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ {
17654 * The element at position 0
17656 struct LDKOutPoint a;
17658 * The element at position 1
17660 struct LDKCVec_MonitorUpdateIdZ b;
17661 } LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ;
17664 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointCVec_MonitorUpdateIdZZs of arbitrary size.
17665 * This corresponds to std::vector in C++
17667 typedef struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ {
17669 * The elements in the array.
17670 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
17672 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *data;
17674 * The number of elements pointed to by `data`.
17677 } LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ;
17680 * Provides an interface that allows storage and retrieval of persisted values that are associated
17683 * In order to avoid collisions the key space is segmented based on the given `primary_namespace`s
17684 * and `secondary_namespace`s. Implementations of this trait are free to handle them in different
17685 * ways, as long as per-namespace key uniqueness is asserted.
17687 * Keys and namespaces are required to be valid ASCII strings in the range of
17688 * [`KVSTORE_NAMESPACE_KEY_ALPHABET`] and no longer than [`KVSTORE_NAMESPACE_KEY_MAX_LEN`]. Empty
17689 * primary namespaces and secondary namespaces (`\"\"`) are assumed to be a valid, however, if
17690 * `primary_namespace` is empty, `secondary_namespace` is required to be empty, too. This means
17691 * that concerns should always be separated by primary namespace first, before secondary
17692 * namespaces are used. While the number of primary namespaces will be relatively small and is
17693 * determined at compile time, there may be many secondary namespaces per primary namespace. Note
17694 * that per-namespace uniqueness needs to also hold for keys *and* namespaces in any given
17695 * namespace, i.e., conflicts between keys and equally named
17696 * primary namespaces/secondary namespaces must be avoided.
17698 * **Note:** Users migrating custom persistence backends from the pre-v0.0.117 `KVStorePersister`
17699 * interface can use a concatenation of `[{primary_namespace}/[{secondary_namespace}/]]{key}` to
17700 * recover a `key` compatible with the data model previously assumed by `KVStorePersister::persist`.
17702 typedef struct LDKKVStore {
17704 * An opaque pointer which is passed to your function implementations as an argument.
17705 * This has no meaning in the LDK, and can be NULL or any other value.
17709 * Returns the data stored for the given `primary_namespace`, `secondary_namespace`, and
17712 * Returns an [`ErrorKind::NotFound`] if the given `key` could not be found in the given
17713 * `primary_namespace` and `secondary_namespace`.
17715 * [`ErrorKind::NotFound`]: io::ErrorKind::NotFound
17717 struct LDKCResult_CVec_u8ZIOErrorZ (*read)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key);
17719 * Persists the given data under the given `key`.
17721 * Will create the given `primary_namespace` and `secondary_namespace` if not already present
17724 struct LDKCResult_NoneIOErrorZ (*write)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, struct LDKu8slice buf);
17726 * Removes any data that had previously been persisted under the given `key`.
17728 * If the `lazy` flag is set to `true`, the backend implementation might choose to lazily
17729 * remove the given `key` at some point in time after the method returns, e.g., as part of an
17730 * eventual batch deletion of multiple keys. As a consequence, subsequent calls to
17731 * [`KVStore::list`] might include the removed key until the changes are actually persisted.
17733 * Note that while setting the `lazy` flag reduces the I/O burden of multiple subsequent
17734 * `remove` calls, it also influences the atomicity guarantees as lazy `remove`s could
17735 * potentially get lost on crash after the method returns. Therefore, this flag should only be
17736 * set for `remove` operations that can be safely replayed at a later time.
17738 * Returns successfully if no data will be stored for the given `primary_namespace`,
17739 * `secondary_namespace`, and `key`, independently of whether it was present before its
17740 * invokation or not.
17742 struct LDKCResult_NoneIOErrorZ (*remove)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, bool lazy);
17744 * Returns a list of keys that are stored under the given `secondary_namespace` in
17745 * `primary_namespace`.
17747 * Returns the keys in arbitrary order, so users requiring a particular order need to sort the
17748 * returned keys. Returns an empty list if `primary_namespace` or `secondary_namespace` is unknown.
17750 struct LDKCResult_CVec_StrZIOErrorZ (*list)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace);
17752 * Frees any resources associated with this object given its this_arg pointer.
17753 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17755 void (*free)(void *this_arg);
17759 * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk.
17761 typedef struct LDKPersister {
17763 * An opaque pointer which is passed to your function implementations as an argument.
17764 * This has no meaning in the LDK, and can be NULL or any other value.
17768 * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
17770 struct LDKCResult_NoneIOErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
17772 * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
17774 struct LDKCResult_NoneIOErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
17776 * Persist the given [`WriteableScore`] to disk, returning an error if persistence failed.
17778 struct LDKCResult_NoneIOErrorZ (*persist_scorer)(const void *this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer);
17780 * Frees any resources associated with this object given its this_arg pointer.
17781 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17783 void (*free)(void *this_arg);
17789 * Implements [`Persist`] in a way that writes and reads both [`ChannelMonitor`]s and
17790 * [`ChannelMonitorUpdate`]s.
17794 * The main benefit this provides over the [`KVStore`]'s [`Persist`] implementation is decreased
17795 * I/O bandwidth and storage churn, at the expense of more IOPS (including listing, reading, and
17796 * deleting) and complexity. This is because it writes channel monitor differential updates,
17797 * whereas the other (default) implementation rewrites the entire monitor on each update. For
17798 * routing nodes, updates can happen many times per second to a channel, and monitors can be tens
17799 * of megabytes (or more). Updates can be as small as a few hundred bytes.
17801 * Note that monitors written with `MonitorUpdatingPersister` are _not_ backward-compatible with
17802 * the default [`KVStore`]'s [`Persist`] implementation. They have a prepended byte sequence,
17803 * [`MONITOR_UPDATING_PERSISTER_PREPEND_SENTINEL`], applied to prevent deserialization with other
17804 * persisters. This is because monitors written by this struct _may_ have unapplied updates. In
17805 * order to downgrade, you must ensure that all updates are applied to the monitor, and remove the
17808 * # Storing monitors
17810 * Monitors are stored by implementing the [`Persist`] trait, which has two functions:
17812 * - [`Persist::persist_new_channel`], which persists whole [`ChannelMonitor`]s.
17813 * - [`Persist::update_persisted_channel`], which persists only a [`ChannelMonitorUpdate`]
17815 * Whole [`ChannelMonitor`]s are stored in the [`CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE`],
17816 * using the familiar encoding of an [`OutPoint`] (for example, `[SOME-64-CHAR-HEX-STRING]_1`).
17818 * Each [`ChannelMonitorUpdate`] is stored in a dynamic secondary namespace, as follows:
17820 * - primary namespace: [`CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE`]
17821 * - secondary namespace: [the monitor's encoded outpoint name]
17823 * Under that secondary namespace, each update is stored with a number string, like `21`, which
17824 * represents its `update_id` value.
17826 * For example, consider this channel, named for its transaction ID and index, or [`OutPoint`]:
17828 * - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
17831 * Full channel monitors would be stored at a single key:
17833 * `[CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
17835 * Updates would be stored as follows (with `/` delimiting primary_namespace/secondary_namespace/key):
17838 * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/1
17839 * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/2
17840 * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/3
17844 * # Reading channel state from storage
17846 * Channel state can be reconstructed by calling
17847 * [`MonitorUpdatingPersister::read_all_channel_monitors_with_updates`]. Alternatively, users can
17848 * list channel monitors themselves and load channels individually using
17849 * [`MonitorUpdatingPersister::read_channel_monitor_with_updates`].
17851 * ## EXTREMELY IMPORTANT
17853 * It is extremely important that your [`KVStore::read`] implementation uses the
17854 * [`io::ErrorKind::NotFound`] variant correctly: that is, when a file is not found, and _only_ in
17855 * that circumstance (not when there is really a permissions error, for example). This is because
17856 * neither channel monitor reading function lists updates. Instead, either reads the monitor, and
17857 * using its stored `update_id`, synthesizes update storage keys, and tries them in sequence until
17858 * one is not found. All _other_ errors will be bubbled up in the function's [`Result`].
17860 * # Pruning stale channel updates
17862 * Stale updates are pruned when a full monitor is written. The old monitor is first read, and if
17863 * that succeeds, updates in the range between the old and new monitors are deleted. The `lazy`
17864 * flag is used on the [`KVStore::remove`] method, so there are no guarantees that the deletions
17865 * will complete. However, stale updates are not a problem for data integrity, since updates are
17866 * only read that are higher than the stored [`ChannelMonitor`]'s `update_id`.
17868 * If you have many stale updates stored (such as after a crash with pending lazy deletes), and
17869 * would like to get rid of them, consider using the
17870 * [`MonitorUpdatingPersister::cleanup_stale_updates`] function.
17872 typedef struct MUST_USE_STRUCT LDKMonitorUpdatingPersister {
17874 * A pointer to the opaque Rust object.
17875 * Nearly everywhere, inner must be non-null, however in places where
17876 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17878 LDKnativeMonitorUpdatingPersister *inner;
17880 * Indicates that this is the only struct which contains the same pointer.
17881 * Rust functions which take ownership of an object provided via an argument require
17882 * this to be true and invalidate the object pointed to by inner.
17885 } LDKMonitorUpdatingPersister;
17888 * `Persist` defines behavior for persisting channel monitors: this could mean
17889 * writing once to disk, and/or uploading to one or more backup services.
17891 * Persistence can happen in one of two ways - synchronously completing before the trait method
17892 * calls return or asynchronously in the background.
17894 * # For those implementing synchronous persistence
17896 * * If persistence completes fully (including any relevant `fsync()` calls), the implementation
17897 * should return [`ChannelMonitorUpdateStatus::Completed`], indicating normal channel operation
17900 * * If persistence fails for some reason, implementations should consider returning
17901 * [`ChannelMonitorUpdateStatus::InProgress`] and retry all pending persistence operations in
17902 * the background with [`ChainMonitor::list_pending_monitor_updates`] and
17903 * [`ChainMonitor::get_monitor`].
17905 * Once a full [`ChannelMonitor`] has been persisted, all pending updates for that channel can
17906 * be marked as complete via [`ChainMonitor::channel_monitor_updated`].
17908 * If at some point no further progress can be made towards persisting the pending updates, the
17909 * node should simply shut down.
17911 * * If the persistence has failed and cannot be retried further (e.g. because of an outage),
17912 * [`ChannelMonitorUpdateStatus::UnrecoverableError`] can be used, though this will result in
17913 * an immediate panic and future operations in LDK generally failing.
17915 * # For those implementing asynchronous persistence
17917 * All calls should generally spawn a background task and immediately return
17918 * [`ChannelMonitorUpdateStatus::InProgress`]. Once the update completes,
17919 * [`ChainMonitor::channel_monitor_updated`] should be called with the corresponding
17920 * [`MonitorUpdateId`].
17922 * Note that unlike the direct [`chain::Watch`] interface,
17923 * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
17925 * If at some point no further progress can be made towards persisting a pending update, the node
17926 * should simply shut down. Until then, the background task should either loop indefinitely, or
17927 * persistence should be regularly retried with [`ChainMonitor::list_pending_monitor_updates`]
17928 * and [`ChainMonitor::get_monitor`] (note that if a full monitor is persisted all pending
17929 * monitor updates may be marked completed).
17931 * # Using remote watchtowers
17933 * Watchtowers may be updated as a part of an implementation of this trait, utilizing the async
17934 * update process described above while the watchtower is being updated. The following methods are
17935 * provided for bulding transactions for a watchtower:
17936 * [`ChannelMonitor::initial_counterparty_commitment_tx`],
17937 * [`ChannelMonitor::counterparty_commitment_txs_from_update`],
17938 * [`ChannelMonitor::sign_to_local_justice_tx`], [`TrustedCommitmentTransaction::revokeable_output_index`],
17939 * [`TrustedCommitmentTransaction::build_to_local_justice_tx`].
17941 * [`TrustedCommitmentTransaction::revokeable_output_index`]: crate::ln::chan_utils::TrustedCommitmentTransaction::revokeable_output_index
17942 * [`TrustedCommitmentTransaction::build_to_local_justice_tx`]: crate::ln::chan_utils::TrustedCommitmentTransaction::build_to_local_justice_tx
17944 typedef struct LDKPersist {
17946 * An opaque pointer which is passed to your function implementations as an argument.
17947 * This has no meaning in the LDK, and can be NULL or any other value.
17951 * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
17952 * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
17954 * The data can be stored any way you want, but the identifier provided by LDK is the
17955 * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
17956 * and the stored channel data). Note that you **must** persist every new monitor to disk.
17958 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
17959 * if you return [`ChannelMonitorUpdateStatus::InProgress`].
17961 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
17962 * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
17964 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
17965 * [`Writeable::write`]: crate::util::ser::Writeable::write
17967 enum LDKChannelMonitorUpdateStatus (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
17969 * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
17972 * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
17973 * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
17976 * During blockchain synchronization operations, and in some rare cases, this may be called with
17977 * no [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
17978 * Note that after the full [`ChannelMonitor`] is persisted any previous
17979 * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
17980 * applied to the persisted [`ChannelMonitor`] as they were already applied.
17982 * If an implementer chooses to persist the updates only, they need to make
17983 * sure that all the updates are applied to the `ChannelMonitors` *before*
17984 * the set of channel monitors is given to the `ChannelManager`
17985 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
17986 * applying a monitor update to a monitor. If full `ChannelMonitors` are
17987 * persisted, then there is no need to persist individual updates.
17989 * Note that there could be a performance tradeoff between persisting complete
17990 * channel monitors on every update vs. persisting only updates and applying
17991 * them in batches. The size of each monitor grows `O(number of state updates)`
17992 * whereas updates are small and `O(1)`.
17994 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
17995 * if you return [`ChannelMonitorUpdateStatus::InProgress`].
17997 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
17998 * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
17999 * [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
18001 * [`Writeable::write`]: crate::util::ser::Writeable::write
18003 * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
18005 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);
18007 * Frees any resources associated with this object given its this_arg pointer.
18008 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18010 void (*free)(void *this_arg);
18016 * A string that displays only printable characters, replacing control characters with
18017 * [`core::char::REPLACEMENT_CHARACTER`].
18019 typedef struct MUST_USE_STRUCT LDKPrintableString {
18021 * A pointer to the opaque Rust object.
18022 * Nearly everywhere, inner must be non-null, however in places where
18023 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18025 LDKnativePrintableString *inner;
18027 * Indicates that this is the only struct which contains the same pointer.
18028 * Rust functions which take ownership of an object provided via an argument require
18029 * this to be true and invalidate the object pointed to by inner.
18032 } LDKPrintableString;
18035 * A callback which is called when a [`Future`] completes.
18037 * Note that this MUST NOT call back into LDK directly, it must instead schedule actions to be
18038 * taken later. Rust users should use the [`std::future::Future`] implementation for [`Future`]
18041 * Note that the [`std::future::Future`] implementation may only work for runtimes which schedule
18042 * futures when they receive a wake, rather than immediately executing them.
18044 typedef struct LDKFutureCallback {
18046 * An opaque pointer which is passed to your function implementations as an argument.
18047 * This has no meaning in the LDK, and can be NULL or any other value.
18051 * The method which is called.
18053 void (*call)(const void *this_arg);
18055 * Frees any resources associated with this object given its this_arg pointer.
18056 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18058 void (*free)(void *this_arg);
18059 } LDKFutureCallback;
18064 * A struct which can be used to select across many [`Future`]s at once without relying on a full
18067 typedef struct MUST_USE_STRUCT LDKSleeper {
18069 * A pointer to the opaque Rust object.
18070 * Nearly everywhere, inner must be non-null, however in places where
18071 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18073 LDKnativeSleeper *inner;
18075 * Indicates that this is the only struct which contains the same pointer.
18076 * Rust functions which take ownership of an object provided via an argument require
18077 * this to be true and invalidate the object pointed to by inner.
18085 * Configuration we set when applicable.
18087 * Default::default() provides sane defaults.
18089 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
18091 * A pointer to the opaque Rust object.
18092 * Nearly everywhere, inner must be non-null, however in places where
18093 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18095 LDKnativeChannelHandshakeConfig *inner;
18097 * Indicates that this is the only struct which contains the same pointer.
18098 * Rust functions which take ownership of an object provided via an argument require
18099 * this to be true and invalidate the object pointed to by inner.
18102 } LDKChannelHandshakeConfig;
18107 * Optional channel limits which are applied during channel creation.
18109 * These limits are only applied to our counterparty's limits, not our own.
18111 * Use 0/`<type>::max_value()` as appropriate to skip checking.
18113 * Provides sane defaults for most configurations.
18115 * Most additional limits are disabled except those with which specify a default in individual
18116 * field documentation. Note that this may result in barely-usable channels, but since they
18117 * are applied mostly only to incoming channels that's not much of a problem.
18119 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
18121 * A pointer to the opaque Rust object.
18122 * Nearly everywhere, inner must be non-null, however in places where
18123 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18125 LDKnativeChannelHandshakeLimits *inner;
18127 * Indicates that this is the only struct which contains the same pointer.
18128 * Rust functions which take ownership of an object provided via an argument require
18129 * this to be true and invalidate the object pointed to by inner.
18132 } LDKChannelHandshakeLimits;
18137 * A parallel struct to [`ChannelConfig`] to define partial updates.
18139 typedef struct MUST_USE_STRUCT LDKChannelConfigUpdate {
18141 * A pointer to the opaque Rust object.
18142 * Nearly everywhere, inner must be non-null, however in places where
18143 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18145 LDKnativeChannelConfigUpdate *inner;
18147 * Indicates that this is the only struct which contains the same pointer.
18148 * Rust functions which take ownership of an object provided via an argument require
18149 * this to be true and invalidate the object pointed to by inner.
18152 } LDKChannelConfigUpdate;
18157 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
18159 * Default::default() provides sane defaults for most configurations
18160 * (but currently with 0 relay fees!)
18162 typedef struct MUST_USE_STRUCT LDKUserConfig {
18164 * A pointer to the opaque Rust object.
18165 * Nearly everywhere, inner must be non-null, however in places where
18166 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18168 LDKnativeUserConfig *inner;
18170 * Indicates that this is the only struct which contains the same pointer.
18171 * Rust functions which take ownership of an object provided via an argument require
18172 * this to be true and invalidate the object pointed to by inner.
18180 * The best known block as identified by its hash and height.
18182 typedef struct MUST_USE_STRUCT LDKBestBlock {
18184 * A pointer to the opaque Rust object.
18185 * Nearly everywhere, inner must be non-null, however in places where
18186 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18188 LDKnativeBestBlock *inner;
18190 * Indicates that this is the only struct which contains the same pointer.
18191 * Rust functions which take ownership of an object provided via an argument require
18192 * this to be true and invalidate the object pointed to by inner.
18198 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
18201 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
18202 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
18203 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
18206 * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
18207 * entire header chain and only blocks with matching transaction data using BIP 157 filters or
18208 * other similar filtering.
18210 typedef struct LDKListen {
18212 * An opaque pointer which is passed to your function implementations as an argument.
18213 * This has no meaning in the LDK, and can be NULL or any other value.
18217 * Notifies the listener that a block was added at the given height, with the transaction data
18218 * possibly filtered.
18220 void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
18222 * Notifies the listener that a block was added at the given height.
18224 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
18226 * Notifies the listener that a block was removed at the given height.
18228 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
18230 * Frees any resources associated with this object given its this_arg pointer.
18231 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18233 void (*free)(void *this_arg);
18237 * The `Confirm` trait is used to notify LDK when relevant transactions have been confirmed on
18238 * chain or unconfirmed during a chain reorganization.
18240 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
18241 * [`Listen`]. For instance, an Electrum-based transaction sync implementation may implement
18242 * [`Filter`] to subscribe to relevant transactions and unspent outputs it should monitor for
18243 * on-chain activity. Then, it needs to notify LDK via this interface upon observing any changes
18244 * with reference to the confirmation status of the monitored objects.
18247 * The intended use is as follows:
18248 * - Call [`transactions_confirmed`] to notify LDK whenever any of the registered transactions or
18249 * outputs are, respectively, confirmed or spent on chain.
18250 * - Call [`transaction_unconfirmed`] to notify LDK whenever any transaction returned by
18251 * [`get_relevant_txids`] is no longer confirmed in the block with the given block hash.
18252 * - Call [`best_block_updated`] to notify LDK whenever a new chain tip becomes available.
18256 * Clients must call these methods in chain order. Specifically:
18257 * - Transactions which are confirmed in a particular block must be given before transactions
18258 * confirmed in a later block.
18259 * - Dependent transactions within the same block must be given in topological order, possibly in
18261 * - All unconfirmed transactions must be given after the original confirmations and before *any*
18262 * reconfirmations, i.e., [`transactions_confirmed`] and [`transaction_unconfirmed`] calls should
18263 * never be interleaved, but always conduced *en bloc*.
18264 * - Any reconfirmed transactions need to be explicitly unconfirmed before they are reconfirmed
18265 * in regard to the new block.
18267 * See individual method documentation for further details.
18269 * [`transactions_confirmed`]: Self::transactions_confirmed
18270 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
18271 * [`best_block_updated`]: Self::best_block_updated
18272 * [`get_relevant_txids`]: Self::get_relevant_txids
18274 typedef struct LDKConfirm {
18276 * An opaque pointer which is passed to your function implementations as an argument.
18277 * This has no meaning in the LDK, and can be NULL or any other value.
18281 * Notifies LDK of transactions confirmed in a block with a given header and height.
18283 * Must be called for any transactions registered by [`Filter::register_tx`] or any
18284 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
18285 * appearing in the same block do not need to be included in the same call; instead, multiple
18286 * calls with additional transactions may be made so long as they are made in [chain order].
18288 * May be called before or after [`best_block_updated`] for the corresponding block. However,
18289 * in the event of a chain reorganization, it must not be called with a `header` that is no
18290 * longer in the chain as of the last call to [`best_block_updated`].
18292 * [chain order]: Confirm#order
18293 * [`best_block_updated`]: Self::best_block_updated
18295 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
18297 * Notifies LDK of a transaction that is no longer confirmed as result of a chain reorganization.
18299 * Must be called for any transaction returned by [`get_relevant_txids`] if it has been
18300 * reorganized out of the best chain or if it is no longer confirmed in the block with the
18301 * given block hash. Once called, the given transaction will not be returned
18302 * by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`].
18304 * [`get_relevant_txids`]: Self::get_relevant_txids
18305 * [`transactions_confirmed`]: Self::transactions_confirmed
18307 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
18309 * Notifies LDK of an update to the best header connected at the given height.
18311 * Must be called whenever a new chain tip becomes available. May be skipped for intermediary
18314 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
18316 * Returns transactions that must be monitored for reorganization out of the chain along
18317 * with the hash of the block as part of which it had been previously confirmed.
18319 * Note that the returned `Option<BlockHash>` might be `None` for channels created with LDK
18320 * 0.0.112 and prior, in which case you need to manually track previous confirmations.
18322 * Will include any transactions passed to [`transactions_confirmed`] that have insufficient
18323 * confirmations to be safe from a chain reorganization. Will not include any transactions
18324 * passed to [`transaction_unconfirmed`], unless later reconfirmed.
18326 * Must be called to determine the subset of transactions that must be monitored for
18327 * reorganization. Will be idempotent between calls but may change as a result of calls to the
18328 * other interface methods. Thus, this is useful to determine which transactions must be
18329 * given to [`transaction_unconfirmed`].
18331 * If any of the returned transactions are confirmed in a block other than the one with the
18332 * given hash, they need to be unconfirmed and reconfirmed via [`transaction_unconfirmed`] and
18333 * [`transactions_confirmed`], respectively.
18335 * [`transactions_confirmed`]: Self::transactions_confirmed
18336 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
18338 struct LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ (*get_relevant_txids)(const void *this_arg);
18340 * Frees any resources associated with this object given its this_arg pointer.
18341 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18343 void (*free)(void *this_arg);
18349 * An implementation of [`chain::Watch`] for monitoring channels.
18351 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
18352 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
18353 * or used independently to monitor channels remotely. See the [module-level documentation] for
18356 * Note that `ChainMonitor` should regularly trigger rebroadcasts/fee bumps of pending claims from
18357 * a force-closed channel. This is crucial in preventing certain classes of pinning attacks,
18358 * detecting substantial mempool feerate changes between blocks, and ensuring reliability if
18359 * broadcasting fails. We recommend invoking this every 30 seconds, or lower if running in an
18360 * environment with spotty connections, like on mobile.
18362 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
18363 * [module-level documentation]: crate::chain::chainmonitor
18364 * [`rebroadcast_pending_claims`]: Self::rebroadcast_pending_claims
18366 typedef struct MUST_USE_STRUCT LDKChainMonitor {
18368 * A pointer to the opaque Rust object.
18369 * Nearly everywhere, inner must be non-null, however in places where
18370 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18372 LDKnativeChainMonitor *inner;
18374 * Indicates that this is the only struct which contains the same pointer.
18375 * Rust functions which take ownership of an object provided via an argument require
18376 * this to be true and invalidate the object pointed to by inner.
18382 * A trait implemented for objects handling events from [`EventsProvider`].
18384 * An async variation also exists for implementations of [`EventsProvider`] that support async
18385 * event handling. The async event handler should satisfy the generic bounds: `F:
18386 * core::future::Future, H: Fn(Event) -> F`.
18388 typedef struct LDKEventHandler {
18390 * An opaque pointer which is passed to your function implementations as an argument.
18391 * This has no meaning in the LDK, and can be NULL or any other value.
18395 * Handles the given [`Event`].
18397 * See [`EventsProvider`] for details that must be considered when implementing this method.
18399 void (*handle_event)(const void *this_arg, struct LDKEvent event);
18401 * Frees any resources associated with this object given its this_arg pointer.
18402 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18404 void (*free)(void *this_arg);
18408 * A trait indicating an object may generate events.
18410 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
18412 * Implementations of this trait may also feature an async version of event handling, as shown with
18413 * [`ChannelManager::process_pending_events_async`] and
18414 * [`ChainMonitor::process_pending_events_async`].
18418 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
18419 * event since the last invocation.
18421 * In order to ensure no [`Event`]s are lost, implementors of this trait will persist [`Event`]s
18422 * and replay any unhandled events on startup. An [`Event`] is considered handled when
18423 * [`process_pending_events`] returns, thus handlers MUST fully handle [`Event`]s and persist any
18424 * relevant changes to disk *before* returning.
18426 * Further, because an application may crash between an [`Event`] being handled and the
18427 * implementor of this trait being re-serialized, [`Event`] handling must be idempotent - in
18428 * effect, [`Event`]s may be replayed.
18430 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
18431 * consult the provider's documentation on the implication of processing events and how a handler
18432 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
18433 * [`ChainMonitor::process_pending_events`]).
18435 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
18438 * [`process_pending_events`]: Self::process_pending_events
18439 * [`handle_event`]: EventHandler::handle_event
18440 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
18441 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
18442 * [`ChannelManager::process_pending_events_async`]: crate::ln::channelmanager::ChannelManager::process_pending_events_async
18443 * [`ChainMonitor::process_pending_events_async`]: crate::chain::chainmonitor::ChainMonitor::process_pending_events_async
18445 typedef struct LDKEventsProvider {
18447 * An opaque pointer which is passed to your function implementations as an argument.
18448 * This has no meaning in the LDK, and can be NULL or any other value.
18452 * Processes any events generated since the last call using the given event handler.
18454 * See the trait-level documentation for requirements.
18456 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
18458 * Frees any resources associated with this object given its this_arg pointer.
18459 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18461 void (*free)(void *this_arg);
18462 } LDKEventsProvider;
18465 * This enum is used to specify which error data to send to peers when failing back an HTLC
18466 * using [`ChannelManager::fail_htlc_backwards_with_reason`].
18468 * For more info on failure codes, see <https://github.com/lightning/bolts/blob/master/04-onion-routing.md#failure-messages>.
18470 typedef enum LDKFailureCode_Tag {
18472 * We had a temporary error processing the payment. Useful if no other error codes fit
18473 * and you want to indicate that the payer may want to retry.
18475 LDKFailureCode_TemporaryNodeFailure,
18477 * We have a required feature which was not in this onion. For example, you may require
18478 * some additional metadata that was not provided with this payment.
18480 LDKFailureCode_RequiredNodeFeatureMissing,
18482 * You may wish to use this when a `payment_preimage` is unknown, or the CLTV expiry of
18483 * the HTLC is too close to the current block height for safe handling.
18484 * Using this failure code in [`ChannelManager::fail_htlc_backwards_with_reason`] is
18485 * equivalent to calling [`ChannelManager::fail_htlc_backwards`].
18487 LDKFailureCode_IncorrectOrUnknownPaymentDetails,
18489 * We failed to process the payload after the onion was decrypted. You may wish to
18490 * use this when receiving custom HTLC TLVs with even type numbers that you don't recognize.
18492 * If available, the tuple data may include the type number and byte offset in the
18493 * decrypted byte stream where the failure occurred.
18495 LDKFailureCode_InvalidOnionPayload,
18497 * Must be last for serialization purposes
18499 LDKFailureCode_Sentinel,
18500 } LDKFailureCode_Tag;
18502 typedef struct MUST_USE_STRUCT LDKFailureCode {
18503 LDKFailureCode_Tag tag;
18506 struct LDKCOption_C2Tuple_u64u16ZZ invalid_onion_payload;
18514 * Chain-related parameters used to construct a new `ChannelManager`.
18516 * Typically, the block-specific parameters are derived from the best block hash for the network,
18517 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
18518 * are not needed when deserializing a previously constructed `ChannelManager`.
18520 typedef struct MUST_USE_STRUCT LDKChainParameters {
18522 * A pointer to the opaque Rust object.
18523 * Nearly everywhere, inner must be non-null, however in places where
18524 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18526 LDKnativeChainParameters *inner;
18528 * Indicates that this is the only struct which contains the same pointer.
18529 * Rust functions which take ownership of an object provided via an argument require
18530 * this to be true and invalidate the object pointed to by inner.
18533 } LDKChainParameters;
18536 * A trait indicating an object may generate message send events
18538 typedef struct LDKMessageSendEventsProvider {
18540 * An opaque pointer which is passed to your function implementations as an argument.
18541 * This has no meaning in the LDK, and can be NULL or any other value.
18545 * Gets the list of pending events which were generated by previous actions, clearing the list
18548 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
18550 * Frees any resources associated with this object given its this_arg pointer.
18551 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18553 void (*free)(void *this_arg);
18554 } LDKMessageSendEventsProvider;
18557 * A trait to describe an object which can receive channel messages.
18559 * Messages MAY be called in parallel when they originate from different `their_node_ids`, however
18560 * they MUST NOT be called in parallel when the two calls have the same `their_node_id`.
18562 typedef struct LDKChannelMessageHandler {
18564 * An opaque pointer which is passed to your function implementations as an argument.
18565 * This has no meaning in the LDK, and can be NULL or any other value.
18569 * Handle an incoming `open_channel` message from the given peer.
18571 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannel *NONNULL_PTR msg);
18573 * Handle an incoming `open_channel2` message from the given peer.
18575 void (*handle_open_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannelV2 *NONNULL_PTR msg);
18577 * Handle an incoming `accept_channel` message from the given peer.
18579 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannel *NONNULL_PTR msg);
18581 * Handle an incoming `accept_channel2` message from the given peer.
18583 void (*handle_accept_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannelV2 *NONNULL_PTR msg);
18585 * Handle an incoming `funding_created` message from the given peer.
18587 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
18589 * Handle an incoming `funding_signed` message from the given peer.
18591 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
18593 * Handle an incoming `channel_ready` message from the given peer.
18595 void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
18597 * Handle an incoming `shutdown` message from the given peer.
18599 void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg);
18601 * Handle an incoming `closing_signed` message from the given peer.
18603 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
18605 * Handle an incoming `tx_add_input message` from the given peer.
18607 void (*handle_tx_add_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddInput *NONNULL_PTR msg);
18609 * Handle an incoming `tx_add_output` message from the given peer.
18611 void (*handle_tx_add_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddOutput *NONNULL_PTR msg);
18613 * Handle an incoming `tx_remove_input` message from the given peer.
18615 void (*handle_tx_remove_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveInput *NONNULL_PTR msg);
18617 * Handle an incoming `tx_remove_output` message from the given peer.
18619 void (*handle_tx_remove_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveOutput *NONNULL_PTR msg);
18621 * Handle an incoming `tx_complete message` from the given peer.
18623 void (*handle_tx_complete)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxComplete *NONNULL_PTR msg);
18625 * Handle an incoming `tx_signatures` message from the given peer.
18627 void (*handle_tx_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxSignatures *NONNULL_PTR msg);
18629 * Handle an incoming `tx_init_rbf` message from the given peer.
18631 void (*handle_tx_init_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxInitRbf *NONNULL_PTR msg);
18633 * Handle an incoming `tx_ack_rbf` message from the given peer.
18635 void (*handle_tx_ack_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAckRbf *NONNULL_PTR msg);
18637 * Handle an incoming `tx_abort message` from the given peer.
18639 void (*handle_tx_abort)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAbort *NONNULL_PTR msg);
18641 * Handle an incoming `update_add_htlc` message from the given peer.
18643 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
18645 * Handle an incoming `update_fulfill_htlc` message from the given peer.
18647 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
18649 * Handle an incoming `update_fail_htlc` message from the given peer.
18651 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
18653 * Handle an incoming `update_fail_malformed_htlc` message from the given peer.
18655 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
18657 * Handle an incoming `commitment_signed` message from the given peer.
18659 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
18661 * Handle an incoming `revoke_and_ack` message from the given peer.
18663 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
18665 * Handle an incoming `update_fee` message from the given peer.
18667 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
18669 * Handle an incoming `announcement_signatures` message from the given peer.
18671 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
18673 * Indicates a connection to the peer failed/an existing connection was lost.
18675 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
18677 * Handle a peer reconnecting, possibly generating `channel_reestablish` message(s).
18679 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
18680 * with us. Implementors should be somewhat conservative about doing so, however, as other
18681 * message handlers may still wish to communicate with this peer.
18683 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg, bool inbound);
18685 * Handle an incoming `channel_reestablish` message from the given peer.
18687 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
18689 * Handle an incoming `channel_update` message from the given peer.
18691 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
18693 * Handle an incoming `error` message from the given peer.
18695 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
18697 * Gets the node feature flags which this handler itself supports. All available handlers are
18698 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
18699 * which are broadcasted in our [`NodeAnnouncement`] message.
18701 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
18703 * Gets the init feature flags which should be sent to the given peer. All available handlers
18704 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
18705 * which are sent in our [`Init`] message.
18707 * Note that this method is called before [`Self::peer_connected`].
18709 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
18711 * Gets the chain hashes for this `ChannelMessageHandler` indicating which chains it supports.
18713 * If it's `None`, then no particular network chain hash compatibility will be enforced when
18714 * connecting to peers.
18716 struct LDKCOption_CVec_ThirtyTwoBytesZZ (*get_chain_hashes)(const void *this_arg);
18718 * Implementation of MessageSendEventsProvider for this object.
18720 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
18722 * Frees any resources associated with this object given its this_arg pointer.
18723 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18725 void (*free)(void *this_arg);
18726 } LDKChannelMessageHandler;
18729 * A handler for an [`OnionMessage`] containing a BOLT 12 Offers message as its payload.
18731 * [`OnionMessage`]: crate::ln::msgs::OnionMessage
18733 typedef struct LDKOffersMessageHandler {
18735 * An opaque pointer which is passed to your function implementations as an argument.
18736 * This has no meaning in the LDK, and can be NULL or any other value.
18740 * Handles the given message by either responding with an [`Bolt12Invoice`], sending a payment,
18741 * or replying with an error.
18743 * The returned [`OffersMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
18745 * [`OnionMessenger`]: crate::onion_message::OnionMessenger
18747 struct LDKCOption_OffersMessageZ (*handle_message)(const void *this_arg, struct LDKOffersMessage message);
18749 * Releases any [`OffersMessage`]s that need to be sent.
18751 * Typically, this is used for messages initiating a payment flow rather than in response to
18752 * another message. The latter should use the return value of [`Self::handle_message`].
18754 struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ (*release_pending_messages)(const void *this_arg);
18756 * Frees any resources associated with this object given its this_arg pointer.
18757 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18759 void (*free)(void *this_arg);
18760 } LDKOffersMessageHandler;
18765 * Arguments for the creation of a ChannelManager that are not deserialized.
18767 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
18769 * 1) Deserialize all stored [`ChannelMonitor`]s.
18770 * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
18771 * `<(BlockHash, ChannelManager)>::read(reader, args)`
18772 * This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
18773 * [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
18774 * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
18775 * same way you would handle a [`chain::Filter`] call using
18776 * [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
18777 * 4) Reconnect blocks on your [`ChannelMonitor`]s.
18778 * 5) Disconnect/connect blocks on the [`ChannelManager`].
18779 * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
18780 * Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
18781 * will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
18783 * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
18784 * [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
18786 * Note that the ordering of #4-7 is not of importance, however all four must occur before you
18787 * call any other methods on the newly-deserialized [`ChannelManager`].
18789 * Note that because some channels may be closed during deserialization, it is critical that you
18790 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
18791 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
18792 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
18793 * not force-close the same channels but consider them live), you may end up revoking a state for
18794 * which you've already broadcasted the transaction.
18796 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
18798 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
18800 * A pointer to the opaque Rust object.
18801 * Nearly everywhere, inner must be non-null, however in places where
18802 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18804 LDKnativeChannelManagerReadArgs *inner;
18806 * Indicates that this is the only struct which contains the same pointer.
18807 * Rust functions which take ownership of an object provided via an argument require
18808 * this to be true and invalidate the object pointed to by inner.
18811 } LDKChannelManagerReadArgs;
18816 * A set of keys that were HKDF-expanded from an initial call to
18817 * [`NodeSigner::get_inbound_payment_key_material`].
18819 * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
18821 typedef struct MUST_USE_STRUCT LDKExpandedKey {
18823 * A pointer to the opaque Rust object.
18824 * Nearly everywhere, inner must be non-null, however in places where
18825 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18827 LDKnativeExpandedKey *inner;
18829 * Indicates that this is the only struct which contains the same pointer.
18830 * Rust functions which take ownership of an object provided via an argument require
18831 * this to be true and invalidate the object pointed to by inner.
18839 * Packet of hop data for next peer
18841 typedef struct MUST_USE_STRUCT LDKPacket {
18843 * A pointer to the opaque Rust object.
18844 * Nearly everywhere, inner must be non-null, however in places where
18845 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18847 LDKnativePacket *inner;
18849 * Indicates that this is the only struct which contains the same pointer.
18850 * Rust functions which take ownership of an object provided via an argument require
18851 * this to be true and invalidate the object pointed to by inner.
18857 * A 3-byte byte array.
18859 typedef struct LDKThreeBytes {
18867 * A trait to describe an object which can receive routing messages.
18869 * # Implementor DoS Warnings
18871 * For messages enabled with the `gossip_queries` feature there are potential DoS vectors when
18872 * handling inbound queries. Implementors using an on-disk network graph should be aware of
18873 * repeated disk I/O for queries accessing different parts of the network graph.
18875 typedef struct LDKRoutingMessageHandler {
18877 * An opaque pointer which is passed to your function implementations as an argument.
18878 * This has no meaning in the LDK, and can be NULL or any other value.
18882 * Handle an incoming `node_announcement` message, returning `true` if it should be forwarded on,
18883 * `false` or returning an `Err` otherwise.
18885 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
18887 * Handle a `channel_announcement` message, returning `true` if it should be forwarded on, `false`
18888 * or returning an `Err` otherwise.
18890 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
18892 * Handle an incoming `channel_update` message, returning true if it should be forwarded on,
18893 * `false` or returning an `Err` otherwise.
18895 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
18897 * Gets channel announcements and updates required to dump our routing table to a remote node,
18898 * starting at the `short_channel_id` indicated by `starting_point` and including announcements
18899 * for a single channel.
18901 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcement)(const void *this_arg, uint64_t starting_point);
18903 * Gets a node announcement required to dump our routing table to a remote node, starting at
18904 * the node *after* the provided pubkey and including up to one announcement immediately
18905 * higher (as defined by `<PublicKey as Ord>::cmp`) than `starting_point`.
18906 * If `None` is provided for `starting_point`, we start at the first node.
18908 * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
18909 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18911 struct LDKNodeAnnouncement (*get_next_node_announcement)(const void *this_arg, struct LDKNodeId starting_point);
18913 * Called when a connection is established with a peer. This can be used to
18914 * perform routing table synchronization using a strategy defined by the
18917 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
18918 * with us. Implementors should be somewhat conservative about doing so, however, as other
18919 * message handlers may still wish to communicate with this peer.
18921 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
18923 * Handles the reply of a query we initiated to learn about channels
18924 * for a given range of blocks. We can expect to receive one or more
18925 * replies to a single query.
18927 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
18929 * Handles the reply of a query we initiated asking for routing gossip
18930 * messages for a list of channels. We should receive this message when
18931 * a node has completed its best effort to send us the pertaining routing
18934 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
18936 * Handles when a peer asks us to send a list of `short_channel_id`s
18937 * for the requested range of blocks.
18939 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
18941 * Handles when a peer asks us to send routing gossip messages for a
18942 * list of `short_channel_id`s.
18944 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
18946 * Indicates that there are a large number of [`ChannelAnnouncement`] (or other) messages
18947 * pending some async action. While there is no guarantee of the rate of future messages, the
18948 * caller should seek to reduce the rate of new gossip messages handled, especially
18949 * [`ChannelAnnouncement`]s.
18951 bool (*processing_queue_high)(const void *this_arg);
18953 * Gets the node feature flags which this handler itself supports. All available handlers are
18954 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
18955 * which are broadcasted in our [`NodeAnnouncement`] message.
18957 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
18959 * Gets the init feature flags which should be sent to the given peer. All available handlers
18960 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
18961 * which are sent in our [`Init`] message.
18963 * Note that this method is called before [`Self::peer_connected`].
18965 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
18967 * Implementation of MessageSendEventsProvider for this object.
18969 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
18971 * Frees any resources associated with this object given its this_arg pointer.
18972 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18974 void (*free)(void *this_arg);
18975 } LDKRoutingMessageHandler;
18978 * A handler for received [`OnionMessage`]s and for providing generated ones to send.
18980 typedef struct LDKOnionMessageHandler {
18982 * An opaque pointer which is passed to your function implementations as an argument.
18983 * This has no meaning in the LDK, and can be NULL or any other value.
18987 * Handle an incoming `onion_message` message from the given peer.
18989 void (*handle_onion_message)(const void *this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg);
18991 * Returns the next pending onion message for the peer with the given node id.
18993 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18995 struct LDKOnionMessage (*next_onion_message_for_peer)(const void *this_arg, struct LDKPublicKey peer_node_id);
18997 * Called when a connection is established with a peer. Can be used to track which peers
18998 * advertise onion message support and are online.
19000 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
19001 * with us. Implementors should be somewhat conservative about doing so, however, as other
19002 * message handlers may still wish to communicate with this peer.
19004 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
19006 * Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
19007 * drop and refuse to forward onion messages to this peer.
19009 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
19011 * Gets the node feature flags which this handler itself supports. All available handlers are
19012 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
19013 * which are broadcasted in our [`NodeAnnouncement`] message.
19015 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
19017 * Gets the init feature flags which should be sent to the given peer. All available handlers
19018 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
19019 * which are sent in our [`Init`] message.
19021 * Note that this method is called before [`Self::peer_connected`].
19023 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
19025 * Frees any resources associated with this object given its this_arg pointer.
19026 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19028 void (*free)(void *this_arg);
19029 } LDKOnionMessageHandler;
19032 * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
19035 typedef struct LDKCustomMessageReader {
19037 * An opaque pointer which is passed to your function implementations as an argument.
19038 * This has no meaning in the LDK, and can be NULL or any other value.
19042 * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
19043 * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
19044 * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
19045 * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
19047 struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
19049 * Frees any resources associated with this object given its this_arg pointer.
19050 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19052 void (*free)(void *this_arg);
19053 } LDKCustomMessageReader;
19056 * A handler provided to [`PeerManager`] for reading and handling custom messages.
19058 * [BOLT 1] specifies a custom message type range for use with experimental or application-specific
19059 * messages. `CustomMessageHandler` allows for user-defined handling of such types. See the
19060 * [`lightning_custom_message`] crate for tools useful in composing more than one custom handler.
19062 * [BOLT 1]: https://github.com/lightning/bolts/blob/master/01-messaging.md
19063 * [`lightning_custom_message`]: https://docs.rs/lightning_custom_message/latest/lightning_custom_message
19065 typedef struct LDKCustomMessageHandler {
19067 * An opaque pointer which is passed to your function implementations as an argument.
19068 * This has no meaning in the LDK, and can be NULL or any other value.
19072 * Handles the given message sent from `sender_node_id`, possibly producing messages for
19073 * [`CustomMessageHandler::get_and_clear_pending_msg`] to return and thus for [`PeerManager`]
19076 struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
19078 * Returns the list of pending messages that were generated by the handler, clearing the list
19079 * in the process. Each message is paired with the node id of the intended recipient. If no
19080 * connection to the node exists, then the message is simply not sent.
19082 struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
19084 * Gets the node feature flags which this handler itself supports. All available handlers are
19085 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
19086 * which are broadcasted in our [`NodeAnnouncement`] message.
19088 * [`NodeAnnouncement`]: crate::ln::msgs::NodeAnnouncement
19090 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
19092 * Gets the init feature flags which should be sent to the given peer. All available handlers
19093 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
19094 * which are sent in our [`Init`] message.
19096 * [`Init`]: crate::ln::msgs::Init
19098 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
19100 * Implementation of CustomMessageReader for this object.
19102 struct LDKCustomMessageReader CustomMessageReader;
19104 * Frees any resources associated with this object given its this_arg pointer.
19105 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19107 void (*free)(void *this_arg);
19108 } LDKCustomMessageHandler;
19113 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
19114 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
19116 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
19118 * A pointer to the opaque Rust object.
19119 * Nearly everywhere, inner must be non-null, however in places where
19120 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19122 LDKnativeIgnoringMessageHandler *inner;
19124 * Indicates that this is the only struct which contains the same pointer.
19125 * Rust functions which take ownership of an object provided via an argument require
19126 * this to be true and invalidate the object pointed to by inner.
19129 } LDKIgnoringMessageHandler;
19132 * Handler for custom onion messages. If you are using [`SimpleArcOnionMessenger`],
19133 * [`SimpleRefOnionMessenger`], or prefer to ignore inbound custom onion messages,
19134 * [`IgnoringMessageHandler`] must be provided to [`OnionMessenger::new`]. Otherwise, a custom
19135 * implementation of this trait must be provided, with [`CustomMessage`] specifying the supported
19138 * See [`OnionMessenger`] for example usage.
19140 * [`IgnoringMessageHandler`]: crate::ln::peer_handler::IgnoringMessageHandler
19141 * [`CustomMessage`]: Self::CustomMessage
19143 typedef struct LDKCustomOnionMessageHandler {
19145 * An opaque pointer which is passed to your function implementations as an argument.
19146 * This has no meaning in the LDK, and can be NULL or any other value.
19150 * Called with the custom message that was received, returning a response to send, if any.
19152 * The returned [`Self::CustomMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
19154 struct LDKCOption_OnionMessageContentsZ (*handle_custom_message)(const void *this_arg, struct LDKOnionMessageContents msg);
19156 * Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
19157 * message type is unknown.
19159 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ (*read_custom_message)(const void *this_arg, uint64_t message_type, struct LDKu8slice buffer);
19161 * Releases any [`Self::CustomMessage`]s that need to be sent.
19163 * Typically, this is used for messages initiating a message flow rather than in response to
19164 * another message. The latter should use the return value of [`Self::handle_custom_message`].
19166 struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ (*release_pending_custom_messages)(const void *this_arg);
19168 * Frees any resources associated with this object given its this_arg pointer.
19169 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19171 void (*free)(void *this_arg);
19172 } LDKCustomOnionMessageHandler;
19177 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
19178 * You can provide one of these as the route_handler in a MessageHandler.
19180 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
19182 * A pointer to the opaque Rust object.
19183 * Nearly everywhere, inner must be non-null, however in places where
19184 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19186 LDKnativeErroringMessageHandler *inner;
19188 * Indicates that this is the only struct which contains the same pointer.
19189 * Rust functions which take ownership of an object provided via an argument require
19190 * this to be true and invalidate the object pointed to by inner.
19193 } LDKErroringMessageHandler;
19198 * Provides references to trait impls which handle different types of messages.
19200 typedef struct MUST_USE_STRUCT LDKMessageHandler {
19202 * A pointer to the opaque Rust object.
19203 * Nearly everywhere, inner must be non-null, however in places where
19204 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19206 LDKnativeMessageHandler *inner;
19208 * Indicates that this is the only struct which contains the same pointer.
19209 * Rust functions which take ownership of an object provided via an argument require
19210 * this to be true and invalidate the object pointed to by inner.
19213 } LDKMessageHandler;
19216 * Provides an object which can be used to send data to and which uniquely identifies a connection
19217 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
19218 * implement Hash to meet the PeerManager API.
19220 * For efficiency, [`Clone`] should be relatively cheap for this type.
19222 * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
19223 * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
19224 * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
19225 * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
19226 * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
19227 * to simply use another value which is guaranteed to be globally unique instead.
19229 typedef struct LDKSocketDescriptor {
19231 * An opaque pointer which is passed to your function implementations as an argument.
19232 * This has no meaning in the LDK, and can be NULL or any other value.
19236 * Attempts to send some data from the given slice to the peer.
19238 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
19239 * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
19240 * called and further write attempts may occur until that time.
19242 * If the returned size is smaller than `data.len()`, a
19243 * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
19244 * written. Additionally, until a `send_data` event completes fully, no further
19245 * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
19246 * prevent denial-of-service issues, you should not read or buffer any data from the socket
19249 * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
19250 * (indicating that read events should be paused to prevent DoS in the send buffer),
19251 * `resume_read` may be set indicating that read events on this descriptor should resume. A
19252 * `resume_read` of false carries no meaning, and should not cause any action.
19254 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
19256 * Disconnect the socket pointed to by this SocketDescriptor.
19258 * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
19259 * call (doing so is a noop).
19261 void (*disconnect_socket)(void *this_arg);
19263 * Checks if two objects are equal given this object's this_arg pointer and another object.
19265 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
19267 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
19268 * This is used, for example, for inclusion of this object in a hash map.
19270 uint64_t (*hash)(const void *this_arg);
19272 * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
19273 * The new SocketDescriptor is provided, and should be mutated as needed to perform a
19274 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
19276 void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
19278 * Frees any resources associated with this object given its this_arg pointer.
19279 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19281 void (*free)(void *this_arg);
19282 } LDKSocketDescriptor;
19287 * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
19288 * socket events into messages which it passes on to its [`MessageHandler`].
19290 * Locks are taken internally, so you must never assume that reentrancy from a
19291 * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
19293 * Calls to [`read_event`] will decode relevant messages and pass them to the
19294 * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
19295 * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
19296 * [`PeerManager`] functions related to the same connection must occur only in serial, making new
19297 * calls only after previous ones have returned.
19299 * Rather than using a plain [`PeerManager`], it is preferable to use either a [`SimpleArcPeerManager`]
19300 * a [`SimpleRefPeerManager`], for conciseness. See their documentation for more details, but
19301 * essentially you should default to using a [`SimpleRefPeerManager`], and use a
19302 * [`SimpleArcPeerManager`] when you require a `PeerManager` with a static lifetime, such as when
19303 * you're using lightning-net-tokio.
19305 * [`read_event`]: PeerManager::read_event
19307 typedef struct MUST_USE_STRUCT LDKPeerManager {
19309 * A pointer to the opaque Rust object.
19310 * Nearly everywhere, inner must be non-null, however in places where
19311 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19313 LDKnativePeerManager *inner;
19315 * Indicates that this is the only struct which contains the same pointer.
19316 * Rust functions which take ownership of an object provided via an argument require
19317 * this to be true and invalidate the object pointed to by inner.
19325 * Static channel fields used to build transactions given per-commitment fields, organized by
19326 * broadcaster/countersignatory.
19328 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
19329 * as_holder_broadcastable and as_counterparty_broadcastable functions.
19331 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
19333 * A pointer to the opaque Rust object.
19334 * Nearly everywhere, inner must be non-null, however in places where
19335 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19337 LDKnativeDirectedChannelTransactionParameters *inner;
19339 * Indicates that this is the only struct which contains the same pointer.
19340 * Rust functions which take ownership of an object provided via an argument require
19341 * this to be true and invalidate the object pointed to by inner.
19344 } LDKDirectedChannelTransactionParameters;
19349 * Features used within an `offer`.
19351 typedef struct MUST_USE_STRUCT LDKOfferFeatures {
19353 * A pointer to the opaque Rust object.
19354 * Nearly everywhere, inner must be non-null, however in places where
19355 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19357 LDKnativeOfferFeatures *inner;
19359 * Indicates that this is the only struct which contains the same pointer.
19360 * Rust functions which take ownership of an object provided via an argument require
19361 * this to be true and invalidate the object pointed to by inner.
19364 } LDKOfferFeatures;
19369 * Features used within an `invoice_request`.
19371 typedef struct MUST_USE_STRUCT LDKInvoiceRequestFeatures {
19373 * A pointer to the opaque Rust object.
19374 * Nearly everywhere, inner must be non-null, however in places where
19375 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19377 LDKnativeInvoiceRequestFeatures *inner;
19379 * Indicates that this is the only struct which contains the same pointer.
19380 * Rust functions which take ownership of an object provided via an argument require
19381 * this to be true and invalidate the object pointed to by inner.
19384 } LDKInvoiceRequestFeatures;
19387 * Integer in the range `0..=16`
19389 typedef struct LDKWitnessVersion {
19391 } LDKWitnessVersion;
19396 * The minimum amount required for an item in an [`Offer`], denominated in either bitcoin or
19397 * another currency.
19399 typedef struct MUST_USE_STRUCT LDKAmount {
19401 * A pointer to the opaque Rust object.
19402 * Nearly everywhere, inner must be non-null, however in places where
19403 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19405 LDKnativeAmount *inner;
19407 * Indicates that this is the only struct which contains the same pointer.
19408 * Rust functions which take ownership of an object provided via an argument require
19409 * this to be true and invalidate the object pointed to by inner.
19417 * Quantity of items supported by an [`Offer`].
19419 typedef struct MUST_USE_STRUCT LDKQuantity {
19421 * A pointer to the opaque Rust object.
19422 * Nearly everywhere, inner must be non-null, however in places where
19423 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19425 LDKnativeQuantity *inner;
19427 * Indicates that this is the only struct which contains the same pointer.
19428 * Rust functions which take ownership of an object provided via an argument require
19429 * this to be true and invalidate the object pointed to by inner.
19437 * A hash for use in a specific context by tweaking with a context-dependent tag as per [BIP 340]
19438 * and computed over the merkle root of a TLV stream to sign as defined in [BOLT 12].
19440 * [BIP 340]: https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki
19441 * [BOLT 12]: https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md#signature-calculation
19443 typedef struct MUST_USE_STRUCT LDKTaggedHash {
19445 * A pointer to the opaque Rust object.
19446 * Nearly everywhere, inner must be non-null, however in places where
19447 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19449 LDKnativeTaggedHash *inner;
19451 * Indicates that this is the only struct which contains the same pointer.
19452 * Rust functions which take ownership of an object provided via an argument require
19453 * this to be true and invalidate the object pointed to by inner.
19461 * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
19463 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
19464 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
19466 typedef struct MUST_USE_STRUCT LDKErroneousField {
19468 * A pointer to the opaque Rust object.
19469 * Nearly everywhere, inner must be non-null, however in places where
19470 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19472 LDKnativeErroneousField *inner;
19474 * Indicates that this is the only struct which contains the same pointer.
19475 * Rust functions which take ownership of an object provided via an argument require
19476 * this to be true and invalidate the object pointed to by inner.
19479 } LDKErroneousField;
19484 * Receives and validates network updates from peers,
19485 * stores authentic and relevant data as a network graph.
19486 * This network graph is then used for routing payments.
19487 * Provides interface to help with initial routing sync by
19488 * serving historical announcements.
19490 typedef struct MUST_USE_STRUCT LDKP2PGossipSync {
19492 * A pointer to the opaque Rust object.
19493 * Nearly everywhere, inner must be non-null, however in places where
19494 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19496 LDKnativeP2PGossipSync *inner;
19498 * Indicates that this is the only struct which contains the same pointer.
19499 * Rust functions which take ownership of an object provided via an argument require
19500 * this to be true and invalidate the object pointed to by inner.
19503 } LDKP2PGossipSync;
19508 * A read-only view of [`NetworkGraph`].
19510 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
19512 * A pointer to the opaque Rust object.
19513 * Nearly everywhere, inner must be non-null, however in places where
19514 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19516 LDKnativeReadOnlyNetworkGraph *inner;
19518 * Indicates that this is the only struct which contains the same pointer.
19519 * Rust functions which take ownership of an object provided via an argument require
19520 * this to be true and invalidate the object pointed to by inner.
19523 } LDKReadOnlyNetworkGraph;
19528 * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
19529 * source node to a target node.
19531 typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
19533 * A pointer to the opaque Rust object.
19534 * Nearly everywhere, inner must be non-null, however in places where
19535 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19537 LDKnativeDirectedChannelInfo *inner;
19539 * Indicates that this is the only struct which contains the same pointer.
19540 * Rust functions which take ownership of an object provided via an argument require
19541 * this to be true and invalidate the object pointed to by inner.
19544 } LDKDirectedChannelInfo;
19547 * The effective capacity of a channel for routing purposes.
19549 * While this may be smaller than the actual channel capacity, amounts greater than
19550 * [`Self::as_msat`] should not be routed through the channel.
19552 typedef enum LDKEffectiveCapacity_Tag {
19554 * The available liquidity in the channel known from being a channel counterparty, and thus a
19557 LDKEffectiveCapacity_ExactLiquidity,
19559 * The maximum HTLC amount in one direction as advertised on the gossip network.
19561 LDKEffectiveCapacity_AdvertisedMaxHTLC,
19563 * The total capacity of the channel as determined by the funding transaction.
19565 LDKEffectiveCapacity_Total,
19567 * A capacity sufficient to route any payment, typically used for private channels provided by
19570 LDKEffectiveCapacity_Infinite,
19572 * The maximum HTLC amount as provided by an invoice route hint.
19574 LDKEffectiveCapacity_HintMaxHTLC,
19576 * A capacity that is unknown possibly because either the chain state is unavailable to know
19577 * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
19579 LDKEffectiveCapacity_Unknown,
19581 * Must be last for serialization purposes
19583 LDKEffectiveCapacity_Sentinel,
19584 } LDKEffectiveCapacity_Tag;
19586 typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
19588 * Either the inbound or outbound liquidity depending on the direction, denominated in
19591 uint64_t liquidity_msat;
19592 } LDKEffectiveCapacity_LDKExactLiquidity_Body;
19594 typedef struct LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body {
19596 * The maximum HTLC amount denominated in millisatoshi.
19598 uint64_t amount_msat;
19599 } LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body;
19601 typedef struct LDKEffectiveCapacity_LDKTotal_Body {
19603 * The funding amount denominated in millisatoshi.
19605 uint64_t capacity_msat;
19607 * The maximum HTLC amount denominated in millisatoshi.
19609 uint64_t htlc_maximum_msat;
19610 } LDKEffectiveCapacity_LDKTotal_Body;
19612 typedef struct LDKEffectiveCapacity_LDKHintMaxHTLC_Body {
19614 * The maximum HTLC amount denominated in millisatoshi.
19616 uint64_t amount_msat;
19617 } LDKEffectiveCapacity_LDKHintMaxHTLC_Body;
19619 typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
19620 LDKEffectiveCapacity_Tag tag;
19622 LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
19623 LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body advertised_max_htlc;
19624 LDKEffectiveCapacity_LDKTotal_Body total;
19625 LDKEffectiveCapacity_LDKHintMaxHTLC_Body hint_max_htlc;
19627 } LDKEffectiveCapacity;
19632 * A [`Router`] implemented using [`find_route`].
19634 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
19636 * A pointer to the opaque Rust object.
19637 * Nearly everywhere, inner must be non-null, however in places where
19638 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19640 LDKnativeDefaultRouter *inner;
19642 * Indicates that this is the only struct which contains the same pointer.
19643 * Rust functions which take ownership of an object provided via an argument require
19644 * this to be true and invalidate the object pointed to by inner.
19647 } LDKDefaultRouter;
19652 * [`ScoreLookUp`] implementation that factors in in-flight HTLC liquidity.
19654 * Useful for custom [`Router`] implementations to wrap their [`ScoreLookUp`] on-the-fly when calling
19657 * [`ScoreLookUp`]: crate::routing::scoring::ScoreLookUp
19659 typedef struct MUST_USE_STRUCT LDKScorerAccountingForInFlightHtlcs {
19661 * A pointer to the opaque Rust object.
19662 * Nearly everywhere, inner must be non-null, however in places where
19663 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19665 LDKnativeScorerAccountingForInFlightHtlcs *inner;
19667 * Indicates that this is the only struct which contains the same pointer.
19668 * Rust functions which take ownership of an object provided via an argument require
19669 * this to be true and invalidate the object pointed to by inner.
19672 } LDKScorerAccountingForInFlightHtlcs;
19675 * The recipient of a payment, differing based on whether they've hidden their identity with route
19678 typedef enum LDKPayee_Tag {
19680 * The recipient provided blinded paths and payinfo to reach them. The blinded paths themselves
19681 * will be included in the final [`Route`].
19685 * The recipient included these route hints in their BOLT11 invoice.
19689 * Must be last for serialization purposes
19694 typedef struct LDKPayee_LDKBlinded_Body {
19696 * Aggregated routing info and blinded paths, for routing to the payee without knowing their
19699 struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints;
19701 * Features supported by the payee.
19703 * May be set from the payee's invoice. May be `None` if the invoice does not contain any
19706 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
19708 struct LDKBolt12InvoiceFeatures features;
19709 } LDKPayee_LDKBlinded_Body;
19711 typedef struct LDKPayee_LDKClear_Body {
19713 * The node id of the payee.
19715 struct LDKPublicKey node_id;
19717 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
19719 struct LDKCVec_RouteHintZ route_hints;
19721 * Features supported by the payee.
19723 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
19724 * does not contain any features.
19726 * [`for_keysend`]: PaymentParameters::for_keysend
19728 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
19730 struct LDKBolt11InvoiceFeatures features;
19732 * The minimum CLTV delta at the end of the route. This value must not be zero.
19734 uint32_t final_cltv_expiry_delta;
19735 } LDKPayee_LDKClear_Body;
19737 typedef struct MUST_USE_STRUCT LDKPayee {
19740 LDKPayee_LDKBlinded_Body blinded;
19741 LDKPayee_LDKClear_Body clear;
19746 * A trait which can both lookup and update routing channel penalty scores.
19748 * This is used in places where both bounds are required and implemented for all types which
19749 * implement [`ScoreLookUp`] and [`ScoreUpdate`].
19751 * Bindings users may need to manually implement this for their custom scoring implementations.
19753 typedef struct LDKScore {
19755 * An opaque pointer which is passed to your function implementations as an argument.
19756 * This has no meaning in the LDK, and can be NULL or any other value.
19760 * Implementation of ScoreLookUp for this object.
19762 struct LDKScoreLookUp ScoreLookUp;
19764 * Implementation of ScoreUpdate for this object.
19766 struct LDKScoreUpdate ScoreUpdate;
19768 * Serialize the object into a byte array
19770 struct LDKCVec_u8Z (*write)(const void *this_arg);
19772 * Frees any resources associated with this object given its this_arg pointer.
19773 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19775 void (*free)(void *this_arg);
19781 * A concrete implementation of [`LockableScore`] which supports multi-threading.
19783 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
19785 * A pointer to the opaque Rust object.
19786 * Nearly everywhere, inner must be non-null, however in places where
19787 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19789 LDKnativeMultiThreadedLockableScore *inner;
19791 * Indicates that this is the only struct which contains the same pointer.
19792 * Rust functions which take ownership of an object provided via an argument require
19793 * this to be true and invalidate the object pointed to by inner.
19796 } LDKMultiThreadedLockableScore;
19801 * A locked `MultiThreadedLockableScore`.
19803 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockRead {
19805 * A pointer to the opaque Rust object.
19806 * Nearly everywhere, inner must be non-null, however in places where
19807 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19809 LDKnativeMultiThreadedScoreLockRead *inner;
19811 * Indicates that this is the only struct which contains the same pointer.
19812 * Rust functions which take ownership of an object provided via an argument require
19813 * this to be true and invalidate the object pointed to by inner.
19816 } LDKMultiThreadedScoreLockRead;
19821 * A locked `MultiThreadedLockableScore`.
19823 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockWrite {
19825 * A pointer to the opaque Rust object.
19826 * Nearly everywhere, inner must be non-null, however in places where
19827 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19829 LDKnativeMultiThreadedScoreLockWrite *inner;
19831 * Indicates that this is the only struct which contains the same pointer.
19832 * Rust functions which take ownership of an object provided via an argument require
19833 * this to be true and invalidate the object pointed to by inner.
19836 } LDKMultiThreadedScoreLockWrite;
19841 * Parameters for configuring [`ProbabilisticScorer`].
19843 * Used to configure decay parameters that are static throughout the lifetime of the scorer.
19844 * these decay parameters affect the score of the channel penalty and are not changed on a
19845 * per-route penalty cost call.
19847 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringDecayParameters {
19849 * A pointer to the opaque Rust object.
19850 * Nearly everywhere, inner must be non-null, however in places where
19851 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19853 LDKnativeProbabilisticScoringDecayParameters *inner;
19855 * Indicates that this is the only struct which contains the same pointer.
19856 * Rust functions which take ownership of an object provided via an argument require
19857 * this to be true and invalidate the object pointed to by inner.
19860 } LDKProbabilisticScoringDecayParameters;
19865 * Simple implementation of [`EntropySource`], [`NodeSigner`], and [`SignerProvider`] that takes a
19866 * 32-byte seed for use as a BIP 32 extended key and derives keys from that.
19868 * Your `node_id` is seed/0'.
19869 * Unilateral closes may use seed/1'.
19870 * Cooperative closes may use seed/2'.
19871 * The two close keys may be needed to claim on-chain funds!
19873 * This struct cannot be used for nodes that wish to support receiving phantom payments;
19874 * [`PhantomKeysManager`] must be used instead.
19876 * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
19877 * previously issued invoices and attempts to pay previous invoices will fail.
19879 typedef struct MUST_USE_STRUCT LDKKeysManager {
19881 * A pointer to the opaque Rust object.
19882 * Nearly everywhere, inner must be non-null, however in places where
19883 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19885 LDKnativeKeysManager *inner;
19887 * Indicates that this is the only struct which contains the same pointer.
19888 * Rust functions which take ownership of an object provided via an argument require
19889 * this to be true and invalidate the object pointed to by inner.
19897 * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
19900 * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
19901 * paid to one of multiple nodes. This works because we encode the invoice route hints such that
19902 * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
19903 * itself without ever needing to forward to this fake node.
19905 * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
19906 * provide some fault tolerance, because payers will automatically retry paying other provided
19907 * nodes in the case that one node goes down.
19909 * Note that multi-path payments are not supported in phantom invoices for security reasons.
19910 * Switching between this struct and [`KeysManager`] will invalidate any previously issued
19911 * invoices and attempts to pay previous invoices will fail.
19913 typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
19915 * A pointer to the opaque Rust object.
19916 * Nearly everywhere, inner must be non-null, however in places where
19917 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19919 LDKnativePhantomKeysManager *inner;
19921 * Indicates that this is the only struct which contains the same pointer.
19922 * Rust functions which take ownership of an object provided via an argument require
19923 * this to be true and invalidate the object pointed to by inner.
19926 } LDKPhantomKeysManager;
19929 * A trait defining behavior for routing an [`OnionMessage`].
19931 typedef struct LDKMessageRouter {
19933 * An opaque pointer which is passed to your function implementations as an argument.
19934 * This has no meaning in the LDK, and can be NULL or any other value.
19938 * Returns a route for sending an [`OnionMessage`] to the given [`Destination`].
19940 struct LDKCResult_OnionMessagePathNoneZ (*find_path)(const void *this_arg, struct LDKPublicKey sender, struct LDKCVec_PublicKeyZ peers, struct LDKDestination destination);
19942 * Frees any resources associated with this object given its this_arg pointer.
19943 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19945 void (*free)(void *this_arg);
19946 } LDKMessageRouter;
19951 * A sender, receiver and forwarder of [`OnionMessage`]s.
19953 * # Handling Messages
19955 * `OnionMessenger` implements [`OnionMessageHandler`], making it responsible for either forwarding
19956 * messages to peers or delegating to the appropriate handler for the message type. Currently, the
19957 * available handlers are:
19958 * * [`OffersMessageHandler`], for responding to [`InvoiceRequest`]s and paying [`Bolt12Invoice`]s
19959 * * [`CustomOnionMessageHandler`], for handling user-defined message types
19961 * # Sending Messages
19963 * [`OnionMessage`]s are sent initially using [`OnionMessenger::send_onion_message`]. When handling
19964 * a message, the matched handler may return a response message which `OnionMessenger` will send
19970 * # extern crate bitcoin;
19971 * # use bitcoin::hashes::_export::_core::time::Duration;
19972 * # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
19973 * # use lightning::blinded_path::BlindedPath;
19974 * # use lightning::sign::KeysManager;
19975 * # use lightning::ln::peer_handler::IgnoringMessageHandler;
19976 * # use lightning::onion_message::messenger::{Destination, MessageRouter, OnionMessenger, OnionMessagePath};
19977 * # use lightning::onion_message::packet::OnionMessageContents;
19978 * # use lightning::util::logger::{Logger, Record};
19979 * # use lightning::util::ser::{Writeable, Writer};
19980 * # use lightning::io;
19981 * # use std::sync::Arc;
19982 * # struct FakeLogger;
19983 * # impl Logger for FakeLogger {
19984 * # fn log(&self, record: &Record) { unimplemented!() }
19986 * # struct FakeMessageRouter {}
19987 * # impl MessageRouter for FakeMessageRouter {
19988 * # fn find_path(&self, sender: PublicKey, peers: Vec<PublicKey>, destination: Destination) -> Result<OnionMessagePath, ()> {
19989 * # unimplemented!()
19992 * # let seed = [42u8; 32];
19993 * # let time = Duration::from_secs(123456);
19994 * # let keys_manager = KeysManager::new(&seed, time.as_secs(), time.subsec_nanos());
19995 * # let logger = Arc::new(FakeLogger {});
19996 * # let node_secret = SecretKey::from_slice(&hex::decode(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
19997 * # let secp_ctx = Secp256k1::new();
19998 * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
19999 * # let (hop_node_id2, hop_node_id3, hop_node_id4) = (hop_node_id1, hop_node_id1, hop_node_id1);
20000 * # let destination_node_id = hop_node_id1;
20001 * # let message_router = Arc::new(FakeMessageRouter {});
20002 * # let custom_message_handler = IgnoringMessageHandler {};
20003 * # let offers_message_handler = IgnoringMessageHandler {};
20004 * // Create the onion messenger. This must use the same `keys_manager` as is passed to your
20005 * // ChannelManager.
20006 * let onion_messenger = OnionMessenger::new(
20007 * &keys_manager, &keys_manager, logger, message_router, &offers_message_handler,
20008 * &custom_message_handler
20011 * # #[derive(Clone)]
20012 * # struct YourCustomMessage {}
20013 * impl Writeable for YourCustomMessage {
20014 * \tfn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
20016 * \t\t// Write your custom onion message to `w`
20019 * impl OnionMessageContents for YourCustomMessage {
20020 * \tfn tlv_type(&self) -> u64 {
20021 * \t\t# let your_custom_message_type = 42;
20022 * \t\tyour_custom_message_type
20025 * // Send a custom onion message to a node id.
20026 * let path = OnionMessagePath {
20027 * \tintermediate_nodes: vec![hop_node_id1, hop_node_id2],
20028 * \tdestination: Destination::Node(destination_node_id),
20030 * let reply_path = None;
20031 * # let message = YourCustomMessage {};
20032 * onion_messenger.send_onion_message(path, message, reply_path);
20034 * // Create a blinded path to yourself, for someone to send an onion message to.
20035 * # let your_node_id = hop_node_id1;
20036 * let hops = [hop_node_id3, hop_node_id4, your_node_id];
20037 * let blinded_path = BlindedPath::new_for_message(&hops, &keys_manager, &secp_ctx).unwrap();
20039 * // Send a custom onion message to a blinded path.
20040 * let path = OnionMessagePath {
20041 * \tintermediate_nodes: vec![hop_node_id1, hop_node_id2],
20042 * \tdestination: Destination::BlindedPath(blinded_path),
20044 * let reply_path = None;
20045 * # let message = YourCustomMessage {};
20046 * onion_messenger.send_onion_message(path, message, reply_path);
20049 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
20050 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
20052 typedef struct MUST_USE_STRUCT LDKOnionMessenger {
20054 * A pointer to the opaque Rust object.
20055 * Nearly everywhere, inner must be non-null, however in places where
20056 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20058 LDKnativeOnionMessenger *inner;
20060 * Indicates that this is the only struct which contains the same pointer.
20061 * Rust functions which take ownership of an object provided via an argument require
20062 * this to be true and invalidate the object pointed to by inner.
20065 } LDKOnionMessenger;
20070 * A [`MessageRouter`] that can only route to a directly connected [`Destination`].
20072 typedef struct MUST_USE_STRUCT LDKDefaultMessageRouter {
20074 * A pointer to the opaque Rust object.
20075 * Nearly everywhere, inner must be non-null, however in places where
20076 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20078 LDKnativeDefaultMessageRouter *inner;
20080 * Indicates that this is the only struct which contains the same pointer.
20081 * Rust functions which take ownership of an object provided via an argument require
20082 * this to be true and invalidate the object pointed to by inner.
20085 } LDKDefaultMessageRouter;
20090 * An intermediate node, its outbound channel, and relay parameters.
20092 typedef struct MUST_USE_STRUCT LDKForwardNode {
20094 * A pointer to the opaque Rust object.
20095 * Nearly everywhere, inner must be non-null, however in places where
20096 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20098 LDKnativeForwardNode *inner;
20100 * Indicates that this is the only struct which contains the same pointer.
20101 * Rust functions which take ownership of an object provided via an argument require
20102 * this to be true and invalidate the object pointed to by inner.
20110 * Data to construct a [`BlindedHop`] for forwarding a payment.
20112 typedef struct MUST_USE_STRUCT LDKForwardTlvs {
20114 * A pointer to the opaque Rust object.
20115 * Nearly everywhere, inner must be non-null, however in places where
20116 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20118 LDKnativeForwardTlvs *inner;
20120 * Indicates that this is the only struct which contains the same pointer.
20121 * Rust functions which take ownership of an object provided via an argument require
20122 * this to be true and invalidate the object pointed to by inner.
20128 * An abstraction over a bitcoin wallet that can perform coin selection over a set of UTXOs and can
20129 * sign for them. The coin selection method aims to mimic Bitcoin Core's `fundrawtransaction` RPC,
20130 * which most wallets should be able to satisfy. Otherwise, consider implementing [`WalletSource`],
20131 * which can provide a default implementation of this trait when used with [`Wallet`].
20133 typedef struct LDKCoinSelectionSource {
20135 * An opaque pointer which is passed to your function implementations as an argument.
20136 * This has no meaning in the LDK, and can be NULL or any other value.
20140 * Performs coin selection of a set of UTXOs, with at least 1 confirmation each, that are
20141 * available to spend. Implementations are free to pick their coin selection algorithm of
20142 * choice, as long as the following requirements are met:
20144 * 1. `must_spend` contains a set of [`Input`]s that must be included in the transaction
20145 * throughout coin selection, but must not be returned as part of the result.
20146 * 2. `must_pay_to` contains a set of [`TxOut`]s that must be included in the transaction
20147 * throughout coin selection. In some cases, like when funding an anchor transaction, this
20148 * set is empty. Implementations should ensure they handle this correctly on their end,
20149 * e.g., Bitcoin Core's `fundrawtransaction` RPC requires at least one output to be
20150 * provided, in which case a zero-value empty OP_RETURN output can be used instead.
20151 * 3. Enough inputs must be selected/contributed for the resulting transaction (including the
20152 * inputs and outputs noted above) to meet `target_feerate_sat_per_1000_weight`.
20154 * Implementations must take note that [`Input::satisfaction_weight`] only tracks the weight of
20155 * the input's `script_sig` and `witness`. Some wallets, like Bitcoin Core's, may require
20156 * providing the full input weight. Failing to do so may lead to underestimating fee bumps and
20157 * delaying block inclusion.
20159 * The `claim_id` must map to the set of external UTXOs assigned to the claim, such that they
20160 * can be re-used within new fee-bumped iterations of the original claiming transaction,
20161 * ensuring that claims don't double spend each other. If a specific `claim_id` has never had a
20162 * transaction associated with it, and all of the available UTXOs have already been assigned to
20163 * other claims, implementations must be willing to double spend their UTXOs. The choice of
20164 * which UTXOs to double spend is left to the implementation, but it must strive to keep the
20165 * set of other claims being double spent to a minimum.
20167 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);
20169 * Signs and provides the full witness for all inputs within the transaction known to the
20170 * trait (i.e., any provided via [`CoinSelectionSource::select_confirmed_utxos`]).
20172 struct LDKCResult_TransactionNoneZ (*sign_tx)(const void *this_arg, struct LDKTransaction tx);
20174 * Frees any resources associated with this object given its this_arg pointer.
20175 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
20177 void (*free)(void *this_arg);
20178 } LDKCoinSelectionSource;
20181 * An alternative to [`CoinSelectionSource`] that can be implemented and used along [`Wallet`] to
20182 * provide a default implementation to [`CoinSelectionSource`].
20184 typedef struct LDKWalletSource {
20186 * An opaque pointer which is passed to your function implementations as an argument.
20187 * This has no meaning in the LDK, and can be NULL or any other value.
20191 * Returns all UTXOs, with at least 1 confirmation each, that are available to spend.
20193 struct LDKCResult_CVec_UtxoZNoneZ (*list_confirmed_utxos)(const void *this_arg);
20195 * Returns a script to use for change above dust resulting from a successful coin selection
20198 struct LDKCResult_CVec_u8ZNoneZ (*get_change_script)(const void *this_arg);
20200 * Signs and provides the full [`TxIn::script_sig`] and [`TxIn::witness`] for all inputs within
20201 * the transaction known to the wallet (i.e., any provided via
20202 * [`WalletSource::list_confirmed_utxos`]).
20204 struct LDKCResult_TransactionNoneZ (*sign_tx)(const void *this_arg, struct LDKTransaction tx);
20206 * Frees any resources associated with this object given its this_arg pointer.
20207 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
20209 void (*free)(void *this_arg);
20215 * A wrapper over [`WalletSource`] that implements [`CoinSelection`] by preferring UTXOs that would
20216 * avoid conflicting double spends. If not enough UTXOs are available to do so, conflicting double
20217 * spends may happen.
20219 typedef struct MUST_USE_STRUCT LDKWallet {
20221 * A pointer to the opaque Rust object.
20222 * Nearly everywhere, inner must be non-null, however in places where
20223 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20225 LDKnativeWallet *inner;
20227 * Indicates that this is the only struct which contains the same pointer.
20228 * Rust functions which take ownership of an object provided via an argument require
20229 * this to be true and invalidate the object pointed to by inner.
20237 * A handler for [`Event::BumpTransaction`] events that sources confirmed UTXOs from a
20238 * [`CoinSelectionSource`] to fee bump transactions via Child-Pays-For-Parent (CPFP) or
20239 * Replace-By-Fee (RBF).
20241 * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
20243 typedef struct MUST_USE_STRUCT LDKBumpTransactionEventHandler {
20245 * A pointer to the opaque Rust object.
20246 * Nearly everywhere, inner must be non-null, however in places where
20247 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20249 LDKnativeBumpTransactionEventHandler *inner;
20251 * Indicates that this is the only struct which contains the same pointer.
20252 * Rust functions which take ownership of an object provided via an argument require
20253 * this to be true and invalidate the object pointed to by inner.
20256 } LDKBumpTransactionEventHandler;
20261 * A [`KVStore`] implementation that writes to and reads from the file system.
20263 typedef struct MUST_USE_STRUCT LDKFilesystemStore {
20265 * A pointer to the opaque Rust object.
20266 * Nearly everywhere, inner must be non-null, however in places where
20267 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20269 LDKnativeFilesystemStore *inner;
20271 * Indicates that this is the only struct which contains the same pointer.
20272 * Rust functions which take ownership of an object provided via an argument require
20273 * this to be true and invalidate the object pointed to by inner.
20276 } LDKFilesystemStore;
20281 * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
20282 * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
20283 * responsibilities are:
20284 * * Processing [`Event`]s with a user-provided [`EventHandler`].
20285 * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
20286 * writing it to disk/backups by invoking the callback given to it at startup.
20287 * [`ChannelManager`] persistence should be done in the background.
20288 * * Calling [`ChannelManager::timer_tick_occurred`], [`ChainMonitor::rebroadcast_pending_claims`]
20289 * and [`PeerManager::timer_tick_occurred`] at the appropriate intervals.
20290 * * Calling [`NetworkGraph::remove_stale_channels_and_tracking`] (if a [`GossipSync`] with a
20291 * [`NetworkGraph`] is provided to [`BackgroundProcessor::start`]).
20293 * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
20294 * upon as doing so may result in high latency.
20298 * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
20299 * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
20300 * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
20301 * unilateral chain closure fees are at risk.
20303 * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
20304 * [`Event`]: lightning::events::Event
20305 * [`PeerManager::timer_tick_occurred`]: lightning::ln::peer_handler::PeerManager::timer_tick_occurred
20306 * [`PeerManager::process_events`]: lightning::ln::peer_handler::PeerManager::process_events
20307 *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
20309 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
20311 * A pointer to the opaque Rust object.
20312 * Nearly everywhere, inner must be non-null, however in places where
20313 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20315 LDKnativeBackgroundProcessor *inner;
20317 * Indicates that this is the only struct which contains the same pointer.
20318 * Rust functions which take ownership of an object provided via an argument require
20319 * this to be true and invalidate the object pointed to by inner.
20322 } LDKBackgroundProcessor;
20327 * The main Rapid Gossip Sync object.
20329 * See [crate-level documentation] for usage.
20331 * [crate-level documentation]: crate
20333 typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
20335 * A pointer to the opaque Rust object.
20336 * Nearly everywhere, inner must be non-null, however in places where
20337 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20339 LDKnativeRapidGossipSync *inner;
20341 * Indicates that this is the only struct which contains the same pointer.
20342 * Rust functions which take ownership of an object provided via an argument require
20343 * this to be true and invalidate the object pointed to by inner.
20346 } LDKRapidGossipSync;
20349 * Either [`P2PGossipSync`] or [`RapidGossipSync`].
20351 typedef enum LDKGossipSync_Tag {
20353 * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
20357 * Rapid gossip sync from a trusted server.
20359 LDKGossipSync_Rapid,
20363 LDKGossipSync_None,
20365 * Must be last for serialization purposes
20367 LDKGossipSync_Sentinel,
20368 } LDKGossipSync_Tag;
20370 typedef struct MUST_USE_STRUCT LDKGossipSync {
20371 LDKGossipSync_Tag tag;
20375 * Note that this field is expected to be a reference.
20377 struct LDKP2PGossipSync p2p;
20381 * Note that this field is expected to be a reference.
20383 struct LDKRapidGossipSync rapid;
20391 * Data of the [`RawBolt11Invoice`] that is encoded in the data part
20393 typedef struct MUST_USE_STRUCT LDKRawDataPart {
20395 * A pointer to the opaque Rust object.
20396 * Nearly everywhere, inner must be non-null, however in places where
20397 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20399 LDKnativeRawDataPart *inner;
20401 * Indicates that this is the only struct which contains the same pointer.
20402 * Rust functions which take ownership of an object provided via an argument require
20403 * this to be true and invalidate the object pointed to by inner.
20413 typedef struct MUST_USE_STRUCT LDKSha256 {
20415 * A pointer to the opaque Rust object.
20416 * Nearly everywhere, inner must be non-null, however in places where
20417 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20419 LDKnativeSha256 *inner;
20421 * Indicates that this is the only struct which contains the same pointer.
20422 * Rust functions which take ownership of an object provided via an argument require
20423 * this to be true and invalidate the object pointed to by inner.
20431 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
20434 typedef struct MUST_USE_STRUCT LDKExpiryTime {
20436 * A pointer to the opaque Rust object.
20437 * Nearly everywhere, inner must be non-null, however in places where
20438 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20440 LDKnativeExpiryTime *inner;
20442 * Indicates that this is the only struct which contains the same pointer.
20443 * Rust functions which take ownership of an object provided via an argument require
20444 * this to be true and invalidate the object pointed to by inner.
20452 * `min_final_cltv_expiry_delta` to use for the last HTLC in the route
20454 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiryDelta {
20456 * A pointer to the opaque Rust object.
20457 * Nearly everywhere, inner must be non-null, however in places where
20458 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20460 LDKnativeMinFinalCltvExpiryDelta *inner;
20462 * Indicates that this is the only struct which contains the same pointer.
20463 * Rust functions which take ownership of an object provided via an argument require
20464 * this to be true and invalidate the object pointed to by inner.
20467 } LDKMinFinalCltvExpiryDelta;
20470 * A 20-byte byte array.
20472 typedef struct LDKTwentyBytes {
20480 * Fallback address in case no LN payment is possible
20482 typedef enum LDKFallback_Tag {
20483 LDKFallback_SegWitProgram,
20484 LDKFallback_PubKeyHash,
20485 LDKFallback_ScriptHash,
20487 * Must be last for serialization purposes
20489 LDKFallback_Sentinel,
20492 typedef struct LDKFallback_LDKSegWitProgram_Body {
20493 struct LDKWitnessVersion version;
20494 struct LDKCVec_u8Z program;
20495 } LDKFallback_LDKSegWitProgram_Body;
20497 typedef struct MUST_USE_STRUCT LDKFallback {
20498 LDKFallback_Tag tag;
20500 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
20502 struct LDKTwentyBytes pub_key_hash;
20505 struct LDKTwentyBytes script_hash;
20510 extern const uintptr_t MAX_BUF_SIZE;
20512 extern const uintptr_t KVSTORE_NAMESPACE_KEY_MAX_LEN;
20514 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
20516 extern const uint32_t FEERATE_FLOOR_SATS_PER_KW;
20518 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
20520 extern const uint32_t ANTI_REORG_DELAY;
20522 extern const uint16_t BREAKDOWN_TIMEOUT;
20524 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
20526 extern const uint16_t MIN_FINAL_CLTV_EXPIRY_DELTA;
20528 extern const uint16_t MAX_HTLCS;
20530 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT;
20532 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT_ANCHORS;
20534 extern const uintptr_t MAX_ACCEPTED_HTLC_SCRIPT_WEIGHT;
20536 extern const uint64_t ANCHOR_INPUT_WITNESS_WEIGHT;
20538 extern const uint64_t HTLC_TIMEOUT_INPUT_ANCHOR_WITNESS_WEIGHT;
20540 extern const uint64_t HTLC_SUCCESS_INPUT_ANCHOR_WITNESS_WEIGHT;
20542 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
20544 extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
20546 extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
20548 extern const uint8_t DEFAULT_MAX_PATH_COUNT;
20550 extern const uint64_t MAX_TIMESTAMP;
20552 extern const uint64_t DEFAULT_EXPIRY_TIME;
20554 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA;
20556 extern const uint8_t TAG_PAYMENT_HASH;
20558 extern const uint8_t TAG_DESCRIPTION;
20560 extern const uint8_t TAG_PAYEE_PUB_KEY;
20562 extern const uint8_t TAG_DESCRIPTION_HASH;
20564 extern const uint8_t TAG_EXPIRY_TIME;
20566 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY_DELTA;
20568 extern const uint8_t TAG_FALLBACK;
20570 extern const uint8_t TAG_PRIVATE_ROUTE;
20572 extern const uint8_t TAG_PAYMENT_SECRET;
20574 extern const uint8_t TAG_PAYMENT_METADATA;
20576 extern const uint8_t TAG_FEATURES;
20578 struct LDKStr _ldk_get_compiled_version(void);
20580 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
20583 * Gets the 128-bit integer, as 16 little-endian bytes
20585 struct LDKSixteenBytes U128_le_bytes(struct LDKU128 val);
20588 * Constructs a new U128 from 16 little-endian bytes
20590 struct LDKU128 U128_new(struct LDKSixteenBytes le_bytes);
20593 * Convenience function for constructing a new BigEndianScalar
20595 struct LDKBigEndianScalar BigEndianScalar_new(struct LDKThirtyTwoBytes big_endian_bytes);
20598 * Creates a new Bech32Error which has the same data as `orig`
20600 struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
20603 * Releases any memory held by the given `Bech32Error` (which is currently none)
20605 void Bech32Error_free(struct LDKBech32Error o);
20608 * Frees the data buffer, if data_is_owned is set and datalen > 0.
20610 void Transaction_free(struct LDKTransaction _res);
20613 * Creates a new Witness which has the same data as `orig` but with a new buffer.
20615 struct LDKWitness Witness_clone(const struct LDKWitness *NONNULL_PTR orig);
20618 * Frees the data pointed to by data
20620 void Witness_free(struct LDKWitness _res);
20623 * Frees the witness and script_sig in a TxIn
20625 void TxIn_free(struct LDKTxIn _res);
20628 * Convenience function for constructing a new TxIn
20630 struct LDKTxIn TxIn_new(struct LDKWitness witness, struct LDKCVec_u8Z script_sig, uint32_t sequence, struct LDKThirtyTwoBytes previous_txid, uint32_t previous_vout);
20633 * Convenience function for constructing a new TxOut
20635 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
20638 * Frees the data pointed to by script_pubkey.
20640 void TxOut_free(struct LDKTxOut _res);
20643 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
20645 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
20648 * Frees the data buffer, if chars_is_owned is set and len > 0.
20650 void Str_free(struct LDKStr _res);
20652 #if defined(LDK_DEBUG_BUILD)
20654 * This function exists for memory safety testing purposes. It should never be used in production
20657 const void *__unmangle_inner_ptr(const void *ptr);
20661 * Constructs a new COption_u64Z containing a u64
20663 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
20666 * Constructs a new COption_u64Z containing nothing
20668 struct LDKCOption_u64Z COption_u64Z_none(void);
20671 * Frees any resources associated with the u64, if we are in the Some state
20673 void COption_u64Z_free(struct LDKCOption_u64Z _res);
20676 * Creates a new COption_u64Z which has the same data as `orig`
20677 * but with all dynamically-allocated buffers duplicated in new buffers.
20679 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
20682 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20684 void CVec_BlindedPathZ_free(struct LDKCVec_BlindedPathZ _res);
20687 * Creates a new CResult_RefundBolt12ParseErrorZ in the success state.
20689 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_ok(struct LDKRefund o);
20692 * Creates a new CResult_RefundBolt12ParseErrorZ in the error state.
20694 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
20697 * Checks if the given object is currently in the success state
20699 bool CResult_RefundBolt12ParseErrorZ_is_ok(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR o);
20702 * Frees any resources used by the CResult_RefundBolt12ParseErrorZ.
20704 void CResult_RefundBolt12ParseErrorZ_free(struct LDKCResult_RefundBolt12ParseErrorZ _res);
20707 * Creates a new CResult_RefundBolt12ParseErrorZ which has the same data as `orig`
20708 * but with all dynamically-allocated buffers duplicated in new buffers.
20710 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_clone(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR orig);
20713 * Creates a new CResult_RetryDecodeErrorZ in the success state.
20715 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_ok(struct LDKRetry o);
20718 * Creates a new CResult_RetryDecodeErrorZ in the error state.
20720 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_err(struct LDKDecodeError e);
20723 * Checks if the given object is currently in the success state
20725 bool CResult_RetryDecodeErrorZ_is_ok(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR o);
20728 * Frees any resources used by the CResult_RetryDecodeErrorZ.
20730 void CResult_RetryDecodeErrorZ_free(struct LDKCResult_RetryDecodeErrorZ _res);
20733 * Creates a new CResult_RetryDecodeErrorZ which has the same data as `orig`
20734 * but with all dynamically-allocated buffers duplicated in new buffers.
20736 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_clone(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR orig);
20739 * Creates a new CResult_NoneAPIErrorZ in the success state.
20741 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
20744 * Creates a new CResult_NoneAPIErrorZ in the error state.
20746 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
20749 * Checks if the given object is currently in the success state
20751 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
20754 * Frees any resources used by the CResult_NoneAPIErrorZ.
20756 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
20759 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
20760 * but with all dynamically-allocated buffers duplicated in new buffers.
20762 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
20765 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20767 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
20770 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20772 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
20775 * Constructs a new COption_ThirtyTwoBytesZ containing a crate::c_types::ThirtyTwoBytes
20777 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_some(struct LDKThirtyTwoBytes o);
20780 * Constructs a new COption_ThirtyTwoBytesZ containing nothing
20782 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_none(void);
20785 * Frees any resources associated with the crate::c_types::ThirtyTwoBytes, if we are in the Some state
20787 void COption_ThirtyTwoBytesZ_free(struct LDKCOption_ThirtyTwoBytesZ _res);
20790 * Creates a new COption_ThirtyTwoBytesZ which has the same data as `orig`
20791 * but with all dynamically-allocated buffers duplicated in new buffers.
20793 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_clone(const struct LDKCOption_ThirtyTwoBytesZ *NONNULL_PTR orig);
20796 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20798 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
20801 * Constructs a new COption_CVec_u8ZZ containing a crate::c_types::derived::CVec_u8Z
20803 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_some(struct LDKCVec_u8Z o);
20806 * Constructs a new COption_CVec_u8ZZ containing nothing
20808 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_none(void);
20811 * Frees any resources associated with the crate::c_types::derived::CVec_u8Z, if we are in the Some state
20813 void COption_CVec_u8ZZ_free(struct LDKCOption_CVec_u8ZZ _res);
20816 * Creates a new COption_CVec_u8ZZ which has the same data as `orig`
20817 * but with all dynamically-allocated buffers duplicated in new buffers.
20819 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_clone(const struct LDKCOption_CVec_u8ZZ *NONNULL_PTR orig);
20822 * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the success state.
20824 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_ok(struct LDKRecipientOnionFields o);
20827 * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the error state.
20829 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_err(struct LDKDecodeError e);
20832 * Checks if the given object is currently in the success state
20834 bool CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR o);
20837 * Frees any resources used by the CResult_RecipientOnionFieldsDecodeErrorZ.
20839 void CResult_RecipientOnionFieldsDecodeErrorZ_free(struct LDKCResult_RecipientOnionFieldsDecodeErrorZ _res);
20842 * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ which has the same data as `orig`
20843 * but with all dynamically-allocated buffers duplicated in new buffers.
20845 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_clone(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR orig);
20848 * Creates a new tuple which has the same data as `orig`
20849 * but with all dynamically-allocated buffers duplicated in new buffers.
20851 struct LDKC2Tuple_u64CVec_u8ZZ C2Tuple_u64CVec_u8ZZ_clone(const struct LDKC2Tuple_u64CVec_u8ZZ *NONNULL_PTR orig);
20854 * Creates a new C2Tuple_u64CVec_u8ZZ from the contained elements.
20856 struct LDKC2Tuple_u64CVec_u8ZZ C2Tuple_u64CVec_u8ZZ_new(uint64_t a, struct LDKCVec_u8Z b);
20859 * Frees any resources used by the C2Tuple_u64CVec_u8ZZ.
20861 void C2Tuple_u64CVec_u8ZZ_free(struct LDKC2Tuple_u64CVec_u8ZZ _res);
20864 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20866 void CVec_C2Tuple_u64CVec_u8ZZZ_free(struct LDKCVec_C2Tuple_u64CVec_u8ZZZ _res);
20869 * Creates a new CResult_RecipientOnionFieldsNoneZ in the success state.
20871 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_ok(struct LDKRecipientOnionFields o);
20874 * Creates a new CResult_RecipientOnionFieldsNoneZ in the error state.
20876 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_err(void);
20879 * Checks if the given object is currently in the success state
20881 bool CResult_RecipientOnionFieldsNoneZ_is_ok(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR o);
20884 * Frees any resources used by the CResult_RecipientOnionFieldsNoneZ.
20886 void CResult_RecipientOnionFieldsNoneZ_free(struct LDKCResult_RecipientOnionFieldsNoneZ _res);
20889 * Creates a new CResult_RecipientOnionFieldsNoneZ which has the same data as `orig`
20890 * but with all dynamically-allocated buffers duplicated in new buffers.
20892 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_clone(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR orig);
20895 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20897 void CVec_ThirtyTwoBytesZ_free(struct LDKCVec_ThirtyTwoBytesZ _res);
20900 * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing a crate::c_types::derived::CVec_ThirtyTwoBytesZ
20902 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_some(struct LDKCVec_ThirtyTwoBytesZ o);
20905 * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing nothing
20907 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_none(void);
20910 * Frees any resources associated with the crate::c_types::derived::CVec_ThirtyTwoBytesZ, if we are in the Some state
20912 void COption_CVec_ThirtyTwoBytesZZ_free(struct LDKCOption_CVec_ThirtyTwoBytesZZ _res);
20915 * Creates a new COption_CVec_ThirtyTwoBytesZZ which has the same data as `orig`
20916 * but with all dynamically-allocated buffers duplicated in new buffers.
20918 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_clone(const struct LDKCOption_CVec_ThirtyTwoBytesZZ *NONNULL_PTR orig);
20921 * Creates a new CResult_ThirtyTwoBytesNoneZ in the success state.
20923 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_ok(struct LDKThirtyTwoBytes o);
20926 * Creates a new CResult_ThirtyTwoBytesNoneZ in the error state.
20928 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_err(void);
20931 * Checks if the given object is currently in the success state
20933 bool CResult_ThirtyTwoBytesNoneZ_is_ok(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR o);
20936 * Frees any resources used by the CResult_ThirtyTwoBytesNoneZ.
20938 void CResult_ThirtyTwoBytesNoneZ_free(struct LDKCResult_ThirtyTwoBytesNoneZ _res);
20941 * Creates a new CResult_ThirtyTwoBytesNoneZ which has the same data as `orig`
20942 * but with all dynamically-allocated buffers duplicated in new buffers.
20944 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_clone(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR orig);
20947 * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the success state.
20949 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_ok(struct LDKBlindedPayInfo o);
20952 * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the error state.
20954 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_err(struct LDKDecodeError e);
20957 * Checks if the given object is currently in the success state
20959 bool CResult_BlindedPayInfoDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR o);
20962 * Frees any resources used by the CResult_BlindedPayInfoDecodeErrorZ.
20964 void CResult_BlindedPayInfoDecodeErrorZ_free(struct LDKCResult_BlindedPayInfoDecodeErrorZ _res);
20967 * Creates a new CResult_BlindedPayInfoDecodeErrorZ which has the same data as `orig`
20968 * but with all dynamically-allocated buffers duplicated in new buffers.
20970 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_clone(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR orig);
20973 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
20975 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
20978 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
20980 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
20983 * Checks if the given object is currently in the success state
20985 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
20988 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
20990 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
20993 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
20994 * but with all dynamically-allocated buffers duplicated in new buffers.
20996 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
20999 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
21001 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
21004 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
21006 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
21009 * Checks if the given object is currently in the success state
21011 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
21014 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
21016 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
21019 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
21020 * but with all dynamically-allocated buffers duplicated in new buffers.
21022 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
21025 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
21027 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
21030 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
21032 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
21035 * Checks if the given object is currently in the success state
21037 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
21040 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
21042 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
21045 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
21046 * but with all dynamically-allocated buffers duplicated in new buffers.
21048 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
21051 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21053 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
21056 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21058 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
21061 * Constructs a new COption_u32Z containing a u32
21063 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
21066 * Constructs a new COption_u32Z containing nothing
21068 struct LDKCOption_u32Z COption_u32Z_none(void);
21071 * Frees any resources associated with the u32, if we are in the Some state
21073 void COption_u32Z_free(struct LDKCOption_u32Z _res);
21076 * Creates a new COption_u32Z which has the same data as `orig`
21077 * but with all dynamically-allocated buffers duplicated in new buffers.
21079 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
21082 * Creates a new tuple which has the same data as `orig`
21083 * but with all dynamically-allocated buffers duplicated in new buffers.
21085 struct LDKC2Tuple_CVec_u8ZusizeZ C2Tuple_CVec_u8ZusizeZ_clone(const struct LDKC2Tuple_CVec_u8ZusizeZ *NONNULL_PTR orig);
21088 * Creates a new C2Tuple_CVec_u8ZusizeZ from the contained elements.
21090 struct LDKC2Tuple_CVec_u8ZusizeZ C2Tuple_CVec_u8ZusizeZ_new(struct LDKCVec_u8Z a, uintptr_t b);
21093 * Frees any resources used by the C2Tuple_CVec_u8ZusizeZ.
21095 void C2Tuple_CVec_u8ZusizeZ_free(struct LDKC2Tuple_CVec_u8ZusizeZ _res);
21098 * Creates a new CResult_C2Tuple_CVec_u8ZusizeZNoneZ in the success state.
21100 struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ CResult_C2Tuple_CVec_u8ZusizeZNoneZ_ok(struct LDKC2Tuple_CVec_u8ZusizeZ o);
21103 * Creates a new CResult_C2Tuple_CVec_u8ZusizeZNoneZ in the error state.
21105 struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ CResult_C2Tuple_CVec_u8ZusizeZNoneZ_err(void);
21108 * Checks if the given object is currently in the success state
21110 bool CResult_C2Tuple_CVec_u8ZusizeZNoneZ_is_ok(const struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ *NONNULL_PTR o);
21113 * Frees any resources used by the CResult_C2Tuple_CVec_u8ZusizeZNoneZ.
21115 void CResult_C2Tuple_CVec_u8ZusizeZNoneZ_free(struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ _res);
21118 * Creates a new CResult_C2Tuple_CVec_u8ZusizeZNoneZ which has the same data as `orig`
21119 * but with all dynamically-allocated buffers duplicated in new buffers.
21121 struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ CResult_C2Tuple_CVec_u8ZusizeZNoneZ_clone(const struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ *NONNULL_PTR orig);
21124 * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the success state.
21126 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_ok(struct LDKChannelDerivationParameters o);
21129 * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the error state.
21131 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_err(struct LDKDecodeError e);
21134 * Checks if the given object is currently in the success state
21136 bool CResult_ChannelDerivationParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR o);
21139 * Frees any resources used by the CResult_ChannelDerivationParametersDecodeErrorZ.
21141 void CResult_ChannelDerivationParametersDecodeErrorZ_free(struct LDKCResult_ChannelDerivationParametersDecodeErrorZ _res);
21144 * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ which has the same data as `orig`
21145 * but with all dynamically-allocated buffers duplicated in new buffers.
21147 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR orig);
21150 * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the success state.
21152 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_ok(struct LDKHTLCDescriptor o);
21155 * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the error state.
21157 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
21160 * Checks if the given object is currently in the success state
21162 bool CResult_HTLCDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR o);
21165 * Frees any resources used by the CResult_HTLCDescriptorDecodeErrorZ.
21167 void CResult_HTLCDescriptorDecodeErrorZ_free(struct LDKCResult_HTLCDescriptorDecodeErrorZ _res);
21170 * Creates a new CResult_HTLCDescriptorDecodeErrorZ which has the same data as `orig`
21171 * but with all dynamically-allocated buffers duplicated in new buffers.
21173 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_clone(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR orig);
21176 * Creates a new CResult_NoneNoneZ in the success state.
21178 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
21181 * Creates a new CResult_NoneNoneZ in the error state.
21183 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
21186 * Checks if the given object is currently in the success state
21188 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
21191 * Frees any resources used by the CResult_NoneNoneZ.
21193 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
21196 * Creates a new CResult_NoneNoneZ which has the same data as `orig`
21197 * but with all dynamically-allocated buffers duplicated in new buffers.
21199 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
21202 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21204 void CVec_ECDSASignatureZ_free(struct LDKCVec_ECDSASignatureZ _res);
21207 * Creates a new tuple which has the same data as `orig`
21208 * but with all dynamically-allocated buffers duplicated in new buffers.
21210 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone(const struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *NONNULL_PTR orig);
21213 * Creates a new C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ from the contained elements.
21215 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_new(struct LDKECDSASignature a, struct LDKCVec_ECDSASignatureZ b);
21218 * Frees any resources used by the C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ.
21220 void C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_free(struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ _res);
21223 * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the success state.
21225 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_ok(struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ o);
21228 * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the error state.
21230 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_err(void);
21233 * Checks if the given object is currently in the success state
21235 bool CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR o);
21238 * Frees any resources used by the CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ.
21240 void CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_free(struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ _res);
21243 * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ which has the same data as `orig`
21244 * but with all dynamically-allocated buffers duplicated in new buffers.
21246 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR orig);
21249 * Creates a new CResult_ECDSASignatureNoneZ in the success state.
21251 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_ok(struct LDKECDSASignature o);
21254 * Creates a new CResult_ECDSASignatureNoneZ in the error state.
21256 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_err(void);
21259 * Checks if the given object is currently in the success state
21261 bool CResult_ECDSASignatureNoneZ_is_ok(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR o);
21264 * Frees any resources used by the CResult_ECDSASignatureNoneZ.
21266 void CResult_ECDSASignatureNoneZ_free(struct LDKCResult_ECDSASignatureNoneZ _res);
21269 * Creates a new CResult_ECDSASignatureNoneZ which has the same data as `orig`
21270 * but with all dynamically-allocated buffers duplicated in new buffers.
21272 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_clone(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR orig);
21275 * Creates a new CResult_PublicKeyNoneZ in the success state.
21277 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_ok(struct LDKPublicKey o);
21280 * Creates a new CResult_PublicKeyNoneZ in the error state.
21282 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_err(void);
21285 * Checks if the given object is currently in the success state
21287 bool CResult_PublicKeyNoneZ_is_ok(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR o);
21290 * Frees any resources used by the CResult_PublicKeyNoneZ.
21292 void CResult_PublicKeyNoneZ_free(struct LDKCResult_PublicKeyNoneZ _res);
21295 * Creates a new CResult_PublicKeyNoneZ which has the same data as `orig`
21296 * but with all dynamically-allocated buffers duplicated in new buffers.
21298 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_clone(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR orig);
21301 * Constructs a new COption_BigEndianScalarZ containing a crate::c_types::BigEndianScalar
21303 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_some(struct LDKBigEndianScalar o);
21306 * Constructs a new COption_BigEndianScalarZ containing nothing
21308 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_none(void);
21311 * Frees any resources associated with the crate::c_types::BigEndianScalar, if we are in the Some state
21313 void COption_BigEndianScalarZ_free(struct LDKCOption_BigEndianScalarZ _res);
21316 * Creates a new COption_BigEndianScalarZ which has the same data as `orig`
21317 * but with all dynamically-allocated buffers duplicated in new buffers.
21319 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_clone(const struct LDKCOption_BigEndianScalarZ *NONNULL_PTR orig);
21322 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21324 void CVec_U5Z_free(struct LDKCVec_U5Z _res);
21327 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
21329 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
21332 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
21334 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
21337 * Checks if the given object is currently in the success state
21339 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
21342 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
21344 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
21347 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
21348 * but with all dynamically-allocated buffers duplicated in new buffers.
21350 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
21353 * Creates a new CResult_SchnorrSignatureNoneZ in the success state.
21355 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_ok(struct LDKSchnorrSignature o);
21358 * Creates a new CResult_SchnorrSignatureNoneZ in the error state.
21360 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_err(void);
21363 * Checks if the given object is currently in the success state
21365 bool CResult_SchnorrSignatureNoneZ_is_ok(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR o);
21368 * Frees any resources used by the CResult_SchnorrSignatureNoneZ.
21370 void CResult_SchnorrSignatureNoneZ_free(struct LDKCResult_SchnorrSignatureNoneZ _res);
21373 * Creates a new CResult_SchnorrSignatureNoneZ which has the same data as `orig`
21374 * but with all dynamically-allocated buffers duplicated in new buffers.
21376 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_clone(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR orig);
21379 * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the success state.
21381 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(struct LDKWriteableEcdsaChannelSigner o);
21384 * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the error state.
21386 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(struct LDKDecodeError e);
21389 * Checks if the given object is currently in the success state
21391 bool CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR o);
21394 * Frees any resources used by the CResult_WriteableEcdsaChannelSignerDecodeErrorZ.
21396 void CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res);
21399 * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ which has the same data as `orig`
21400 * but with all dynamically-allocated buffers duplicated in new buffers.
21402 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR orig);
21405 * Creates a new CResult_CVec_u8ZNoneZ in the success state.
21407 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_ok(struct LDKCVec_u8Z o);
21410 * Creates a new CResult_CVec_u8ZNoneZ in the error state.
21412 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_err(void);
21415 * Checks if the given object is currently in the success state
21417 bool CResult_CVec_u8ZNoneZ_is_ok(const struct LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR o);
21420 * Frees any resources used by the CResult_CVec_u8ZNoneZ.
21422 void CResult_CVec_u8ZNoneZ_free(struct LDKCResult_CVec_u8ZNoneZ _res);
21425 * Creates a new CResult_CVec_u8ZNoneZ which has the same data as `orig`
21426 * but with all dynamically-allocated buffers duplicated in new buffers.
21428 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_clone(const struct LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR orig);
21431 * Creates a new CResult_ShutdownScriptNoneZ in the success state.
21433 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_ok(struct LDKShutdownScript o);
21436 * Creates a new CResult_ShutdownScriptNoneZ in the error state.
21438 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_err(void);
21441 * Checks if the given object is currently in the success state
21443 bool CResult_ShutdownScriptNoneZ_is_ok(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR o);
21446 * Frees any resources used by the CResult_ShutdownScriptNoneZ.
21448 void CResult_ShutdownScriptNoneZ_free(struct LDKCResult_ShutdownScriptNoneZ _res);
21451 * Creates a new CResult_ShutdownScriptNoneZ which has the same data as `orig`
21452 * but with all dynamically-allocated buffers duplicated in new buffers.
21454 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_clone(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR orig);
21457 * Constructs a new COption_u16Z containing a u16
21459 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
21462 * Constructs a new COption_u16Z containing nothing
21464 struct LDKCOption_u16Z COption_u16Z_none(void);
21467 * Frees any resources associated with the u16, if we are in the Some state
21469 void COption_u16Z_free(struct LDKCOption_u16Z _res);
21472 * Creates a new COption_u16Z which has the same data as `orig`
21473 * but with all dynamically-allocated buffers duplicated in new buffers.
21475 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
21478 * Constructs a new COption_boolZ containing a bool
21480 struct LDKCOption_boolZ COption_boolZ_some(bool o);
21483 * Constructs a new COption_boolZ containing nothing
21485 struct LDKCOption_boolZ COption_boolZ_none(void);
21488 * Frees any resources associated with the bool, if we are in the Some state
21490 void COption_boolZ_free(struct LDKCOption_boolZ _res);
21493 * Creates a new COption_boolZ which has the same data as `orig`
21494 * but with all dynamically-allocated buffers duplicated in new buffers.
21496 struct LDKCOption_boolZ COption_boolZ_clone(const struct LDKCOption_boolZ *NONNULL_PTR orig);
21499 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21501 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
21504 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
21506 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
21509 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
21511 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
21514 * Checks if the given object is currently in the success state
21516 bool CResult_CVec_CVec_u8ZZNoneZ_is_ok(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR o);
21519 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
21521 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
21524 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
21525 * but with all dynamically-allocated buffers duplicated in new buffers.
21527 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
21530 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
21532 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
21535 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
21537 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
21540 * Checks if the given object is currently in the success state
21542 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
21545 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
21547 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
21550 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
21551 * but with all dynamically-allocated buffers duplicated in new buffers.
21553 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
21556 * Creates a new CResult_TransactionNoneZ in the success state.
21558 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
21561 * Creates a new CResult_TransactionNoneZ in the error state.
21563 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
21566 * Checks if the given object is currently in the success state
21568 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
21571 * Frees any resources used by the CResult_TransactionNoneZ.
21573 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
21576 * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
21577 * but with all dynamically-allocated buffers duplicated in new buffers.
21579 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
21582 * Constructs a new COption_WriteableScoreZ containing a crate::lightning::routing::scoring::WriteableScore
21584 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_some(struct LDKWriteableScore o);
21587 * Constructs a new COption_WriteableScoreZ containing nothing
21589 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_none(void);
21592 * Frees any resources associated with the crate::lightning::routing::scoring::WriteableScore, if we are in the Some state
21594 void COption_WriteableScoreZ_free(struct LDKCOption_WriteableScoreZ _res);
21597 * Creates a new CResult_NoneIOErrorZ in the success state.
21599 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_ok(void);
21602 * Creates a new CResult_NoneIOErrorZ in the error state.
21604 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_err(enum LDKIOError e);
21607 * Checks if the given object is currently in the success state
21609 bool CResult_NoneIOErrorZ_is_ok(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR o);
21612 * Frees any resources used by the CResult_NoneIOErrorZ.
21614 void CResult_NoneIOErrorZ_free(struct LDKCResult_NoneIOErrorZ _res);
21617 * Creates a new CResult_NoneIOErrorZ which has the same data as `orig`
21618 * but with all dynamically-allocated buffers duplicated in new buffers.
21620 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_clone(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR orig);
21623 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21625 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
21628 * Creates a new CResult_RouteLightningErrorZ in the success state.
21630 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
21633 * Creates a new CResult_RouteLightningErrorZ in the error state.
21635 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
21638 * Checks if the given object is currently in the success state
21640 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
21643 * Frees any resources used by the CResult_RouteLightningErrorZ.
21645 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
21648 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
21649 * but with all dynamically-allocated buffers duplicated in new buffers.
21651 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
21654 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the success state.
21656 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_ok(struct LDKInFlightHtlcs o);
21659 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the error state.
21661 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_err(struct LDKDecodeError e);
21664 * Checks if the given object is currently in the success state
21666 bool CResult_InFlightHtlcsDecodeErrorZ_is_ok(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR o);
21669 * Frees any resources used by the CResult_InFlightHtlcsDecodeErrorZ.
21671 void CResult_InFlightHtlcsDecodeErrorZ_free(struct LDKCResult_InFlightHtlcsDecodeErrorZ _res);
21674 * Creates a new CResult_InFlightHtlcsDecodeErrorZ which has the same data as `orig`
21675 * but with all dynamically-allocated buffers duplicated in new buffers.
21677 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_clone(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR orig);
21680 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
21682 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
21685 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
21687 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
21690 * Checks if the given object is currently in the success state
21692 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
21695 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
21697 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
21700 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
21701 * but with all dynamically-allocated buffers duplicated in new buffers.
21703 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
21706 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21708 void CVec_BlindedHopZ_free(struct LDKCVec_BlindedHopZ _res);
21711 * Creates a new CResult_BlindedTailDecodeErrorZ in the success state.
21713 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_ok(struct LDKBlindedTail o);
21716 * Creates a new CResult_BlindedTailDecodeErrorZ in the error state.
21718 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_err(struct LDKDecodeError e);
21721 * Checks if the given object is currently in the success state
21723 bool CResult_BlindedTailDecodeErrorZ_is_ok(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR o);
21726 * Frees any resources used by the CResult_BlindedTailDecodeErrorZ.
21728 void CResult_BlindedTailDecodeErrorZ_free(struct LDKCResult_BlindedTailDecodeErrorZ _res);
21731 * Creates a new CResult_BlindedTailDecodeErrorZ which has the same data as `orig`
21732 * but with all dynamically-allocated buffers duplicated in new buffers.
21734 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_clone(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR orig);
21737 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21739 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
21742 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21744 void CVec_PathZ_free(struct LDKCVec_PathZ _res);
21747 * Creates a new CResult_RouteDecodeErrorZ in the success state.
21749 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
21752 * Creates a new CResult_RouteDecodeErrorZ in the error state.
21754 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
21757 * Checks if the given object is currently in the success state
21759 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
21762 * Frees any resources used by the CResult_RouteDecodeErrorZ.
21764 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
21767 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
21768 * but with all dynamically-allocated buffers duplicated in new buffers.
21770 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
21773 * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
21775 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
21778 * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
21780 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
21783 * Checks if the given object is currently in the success state
21785 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
21788 * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
21790 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
21793 * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
21794 * but with all dynamically-allocated buffers duplicated in new buffers.
21796 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
21799 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21801 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
21804 * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
21806 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
21809 * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
21811 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
21814 * Checks if the given object is currently in the success state
21816 bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
21819 * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
21821 void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
21824 * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
21825 * but with all dynamically-allocated buffers duplicated in new buffers.
21827 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
21830 * Creates a new tuple which has the same data as `orig`
21831 * but with all dynamically-allocated buffers duplicated in new buffers.
21833 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_clone(const struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR orig);
21836 * Creates a new C2Tuple_BlindedPayInfoBlindedPathZ from the contained elements.
21838 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_new(struct LDKBlindedPayInfo a, struct LDKBlindedPath b);
21841 * Frees any resources used by the C2Tuple_BlindedPayInfoBlindedPathZ.
21843 void C2Tuple_BlindedPayInfoBlindedPathZ_free(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ _res);
21846 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21848 void CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res);
21851 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21853 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
21856 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21858 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
21861 * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
21863 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
21866 * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
21868 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
21871 * Checks if the given object is currently in the success state
21873 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
21876 * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
21878 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
21881 * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
21882 * but with all dynamically-allocated buffers duplicated in new buffers.
21884 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
21887 * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
21889 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
21892 * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
21894 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
21897 * Checks if the given object is currently in the success state
21899 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
21902 * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
21904 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
21907 * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
21908 * but with all dynamically-allocated buffers duplicated in new buffers.
21910 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
21913 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21915 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
21918 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
21920 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
21923 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
21925 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
21928 * Checks if the given object is currently in the success state
21930 bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
21933 * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
21935 void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
21938 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ which has the same data as `orig`
21939 * but with all dynamically-allocated buffers duplicated in new buffers.
21941 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig);
21944 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21946 void CVec_NodeIdZ_free(struct LDKCVec_NodeIdZ _res);
21949 * Creates a new tuple which has the same data as `orig`
21950 * but with all dynamically-allocated buffers duplicated in new buffers.
21952 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);
21955 * Creates a new C2Tuple_u64u64Z from the contained elements.
21957 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
21960 * Frees any resources used by the C2Tuple_u64u64Z.
21962 void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);
21965 * Constructs a new COption_C2Tuple_u64u64ZZ containing a crate::c_types::derived::C2Tuple_u64u64Z
21967 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_some(struct LDKC2Tuple_u64u64Z o);
21970 * Constructs a new COption_C2Tuple_u64u64ZZ containing nothing
21972 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_none(void);
21975 * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u64Z, if we are in the Some state
21977 void COption_C2Tuple_u64u64ZZ_free(struct LDKCOption_C2Tuple_u64u64ZZ _res);
21980 * Creates a new COption_C2Tuple_u64u64ZZ which has the same data as `orig`
21981 * but with all dynamically-allocated buffers duplicated in new buffers.
21983 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_clone(const struct LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR orig);
21986 * Creates a new C2Tuple_Z from the contained elements.
21988 struct LDKC2Tuple_Z C2Tuple_Z_new(struct LDKThirtyTwoU16s a, struct LDKThirtyTwoU16s b);
21991 * Frees any resources used by the C2Tuple_Z.
21993 void C2Tuple_Z_free(struct LDKC2Tuple_Z _res);
21996 * Creates a new C2Tuple__u1632_u1632Z from the contained elements.
21998 struct LDKC2Tuple__u1632_u1632Z C2Tuple__u1632_u1632Z_new(struct LDKThirtyTwoU16s a, struct LDKThirtyTwoU16s b);
22001 * Frees any resources used by the C2Tuple__u1632_u1632Z.
22003 void C2Tuple__u1632_u1632Z_free(struct LDKC2Tuple__u1632_u1632Z _res);
22006 * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing a crate::c_types::derived::C2Tuple__u1632_u1632Z
22008 struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_some(struct LDKC2Tuple__u1632_u1632Z o);
22011 * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing nothing
22013 struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_none(void);
22016 * Frees any resources associated with the crate::c_types::derived::C2Tuple__u1632_u1632Z, if we are in the Some state
22018 void COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_free(struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ _res);
22021 * Constructs a new COption_f64Z containing a f64
22023 struct LDKCOption_f64Z COption_f64Z_some(double o);
22026 * Constructs a new COption_f64Z containing nothing
22028 struct LDKCOption_f64Z COption_f64Z_none(void);
22031 * Frees any resources associated with the f64, if we are in the Some state
22033 void COption_f64Z_free(struct LDKCOption_f64Z _res);
22036 * Creates a new COption_f64Z which has the same data as `orig`
22037 * but with all dynamically-allocated buffers duplicated in new buffers.
22039 struct LDKCOption_f64Z COption_f64Z_clone(const struct LDKCOption_f64Z *NONNULL_PTR orig);
22042 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
22044 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
22047 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
22049 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
22052 * Checks if the given object is currently in the success state
22054 bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
22057 * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
22059 void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
22062 * Creates a new tuple which has the same data as `orig`
22063 * but with all dynamically-allocated buffers duplicated in new buffers.
22065 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
22068 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
22070 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
22073 * Frees any resources used by the C2Tuple_usizeTransactionZ.
22075 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
22078 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22080 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
22083 * Creates a new tuple which has the same data as `orig`
22084 * but with all dynamically-allocated buffers duplicated in new buffers.
22086 struct LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ *NONNULL_PTR orig);
22089 * Creates a new C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ from the contained elements.
22091 struct LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_new(struct LDKThirtyTwoBytes a, struct LDKCOption_ThirtyTwoBytesZ b);
22094 * Frees any resources used by the C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ.
22096 void C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ _res);
22099 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22101 void CVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ _res);
22104 * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ in the success state.
22106 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_ok(enum LDKChannelMonitorUpdateStatus o);
22109 * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ in the error state.
22111 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_err(void);
22114 * Checks if the given object is currently in the success state
22116 bool CResult_ChannelMonitorUpdateStatusNoneZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR o);
22119 * Frees any resources used by the CResult_ChannelMonitorUpdateStatusNoneZ.
22121 void CResult_ChannelMonitorUpdateStatusNoneZ_free(struct LDKCResult_ChannelMonitorUpdateStatusNoneZ _res);
22124 * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ which has the same data as `orig`
22125 * but with all dynamically-allocated buffers duplicated in new buffers.
22127 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_clone(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR orig);
22130 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22132 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
22135 * Creates a new tuple which has the same data as `orig`
22136 * but with all dynamically-allocated buffers duplicated in new buffers.
22138 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig);
22141 * Creates a new C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ from the contained elements.
22143 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorEventZ b, struct LDKPublicKey c);
22146 * Frees any resources used by the C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ.
22148 void C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res);
22151 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22153 void CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res);
22156 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
22158 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
22161 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
22163 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
22166 * Checks if the given object is currently in the success state
22168 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
22171 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
22173 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
22176 * Creates a new CResult_InitFeaturesDecodeErrorZ which has the same data as `orig`
22177 * but with all dynamically-allocated buffers duplicated in new buffers.
22179 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig);
22182 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
22184 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
22187 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
22189 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
22192 * Checks if the given object is currently in the success state
22194 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
22197 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
22199 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
22202 * Creates a new CResult_ChannelFeaturesDecodeErrorZ which has the same data as `orig`
22203 * but with all dynamically-allocated buffers duplicated in new buffers.
22205 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig);
22208 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
22210 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
22213 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
22215 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
22218 * Checks if the given object is currently in the success state
22220 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
22223 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
22225 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
22228 * Creates a new CResult_NodeFeaturesDecodeErrorZ which has the same data as `orig`
22229 * but with all dynamically-allocated buffers duplicated in new buffers.
22231 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig);
22234 * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the success state.
22236 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt11InvoiceFeatures o);
22239 * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the error state.
22241 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
22244 * Checks if the given object is currently in the success state
22246 bool CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
22249 * Frees any resources used by the CResult_Bolt11InvoiceFeaturesDecodeErrorZ.
22251 void CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ _res);
22254 * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
22255 * but with all dynamically-allocated buffers duplicated in new buffers.
22257 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
22260 * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the success state.
22262 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt12InvoiceFeatures o);
22265 * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the error state.
22267 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
22270 * Checks if the given object is currently in the success state
22272 bool CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
22275 * Frees any resources used by the CResult_Bolt12InvoiceFeaturesDecodeErrorZ.
22277 void CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ _res);
22280 * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
22281 * but with all dynamically-allocated buffers duplicated in new buffers.
22283 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
22286 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the success state.
22288 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_ok(struct LDKBlindedHopFeatures o);
22291 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the error state.
22293 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
22296 * Checks if the given object is currently in the success state
22298 bool CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR o);
22301 * Frees any resources used by the CResult_BlindedHopFeaturesDecodeErrorZ.
22303 void CResult_BlindedHopFeaturesDecodeErrorZ_free(struct LDKCResult_BlindedHopFeaturesDecodeErrorZ _res);
22306 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ which has the same data as `orig`
22307 * but with all dynamically-allocated buffers duplicated in new buffers.
22309 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_clone(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR orig);
22312 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
22314 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
22317 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
22319 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
22322 * Checks if the given object is currently in the success state
22324 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
22327 * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
22329 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
22332 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ which has the same data as `orig`
22333 * but with all dynamically-allocated buffers duplicated in new buffers.
22335 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig);
22338 * Creates a new CResult_OfferBolt12ParseErrorZ in the success state.
22340 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_ok(struct LDKOffer o);
22343 * Creates a new CResult_OfferBolt12ParseErrorZ in the error state.
22345 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
22348 * Checks if the given object is currently in the success state
22350 bool CResult_OfferBolt12ParseErrorZ_is_ok(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR o);
22353 * Frees any resources used by the CResult_OfferBolt12ParseErrorZ.
22355 void CResult_OfferBolt12ParseErrorZ_free(struct LDKCResult_OfferBolt12ParseErrorZ _res);
22358 * Creates a new CResult_OfferBolt12ParseErrorZ which has the same data as `orig`
22359 * but with all dynamically-allocated buffers duplicated in new buffers.
22361 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_clone(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR orig);
22364 * Creates a new CResult_PublicKeySecp256k1ErrorZ in the success state.
22366 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_ok(struct LDKPublicKey o);
22369 * Creates a new CResult_PublicKeySecp256k1ErrorZ in the error state.
22371 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
22374 * Checks if the given object is currently in the success state
22376 bool CResult_PublicKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR o);
22379 * Frees any resources used by the CResult_PublicKeySecp256k1ErrorZ.
22381 void CResult_PublicKeySecp256k1ErrorZ_free(struct LDKCResult_PublicKeySecp256k1ErrorZ _res);
22384 * Creates a new CResult_PublicKeySecp256k1ErrorZ which has the same data as `orig`
22385 * but with all dynamically-allocated buffers duplicated in new buffers.
22387 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_clone(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR orig);
22390 * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
22392 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
22395 * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
22397 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
22400 * Checks if the given object is currently in the success state
22402 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
22405 * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
22407 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
22410 * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
22411 * but with all dynamically-allocated buffers duplicated in new buffers.
22413 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
22416 * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate
22418 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
22421 * Constructs a new COption_NetworkUpdateZ containing nothing
22423 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
22426 * Frees any resources associated with the crate::lightning::routing::gossip::NetworkUpdate, if we are in the Some state
22428 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
22431 * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
22432 * but with all dynamically-allocated buffers duplicated in new buffers.
22434 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
22437 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
22439 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
22442 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
22444 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
22447 * Checks if the given object is currently in the success state
22449 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
22452 * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
22454 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
22457 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
22458 * but with all dynamically-allocated buffers duplicated in new buffers.
22460 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
22463 * Constructs a new COption_UtxoLookupZ containing a crate::lightning::routing::utxo::UtxoLookup
22465 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_some(struct LDKUtxoLookup o);
22468 * Constructs a new COption_UtxoLookupZ containing nothing
22470 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_none(void);
22473 * Frees any resources associated with the crate::lightning::routing::utxo::UtxoLookup, if we are in the Some state
22475 void COption_UtxoLookupZ_free(struct LDKCOption_UtxoLookupZ _res);
22478 * Creates a new CResult_NoneLightningErrorZ in the success state.
22480 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
22483 * Creates a new CResult_NoneLightningErrorZ in the error state.
22485 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
22488 * Checks if the given object is currently in the success state
22490 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
22493 * Frees any resources used by the CResult_NoneLightningErrorZ.
22495 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
22498 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
22499 * but with all dynamically-allocated buffers duplicated in new buffers.
22501 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
22504 * Creates a new CResult_boolLightningErrorZ in the success state.
22506 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
22509 * Creates a new CResult_boolLightningErrorZ in the error state.
22511 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
22514 * Checks if the given object is currently in the success state
22516 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
22519 * Frees any resources used by the CResult_boolLightningErrorZ.
22521 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
22524 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
22525 * but with all dynamically-allocated buffers duplicated in new buffers.
22527 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
22530 * Creates a new tuple which has the same data as `orig`
22531 * but with all dynamically-allocated buffers duplicated in new buffers.
22533 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
22536 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
22538 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
22541 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
22543 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
22546 * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
22548 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o);
22551 * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing nothing
22553 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none(void);
22556 * Frees any resources associated with the crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ, if we are in the Some state
22558 void COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
22561 * Creates a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ which has the same data as `orig`
22562 * but with all dynamically-allocated buffers duplicated in new buffers.
22564 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR orig);
22567 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22569 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
22572 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
22574 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
22577 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
22579 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
22582 * Checks if the given object is currently in the success state
22584 bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
22587 * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
22589 void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
22592 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
22593 * but with all dynamically-allocated buffers duplicated in new buffers.
22595 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
22598 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
22600 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
22603 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
22605 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
22608 * Checks if the given object is currently in the success state
22610 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
22613 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
22615 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
22618 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
22619 * but with all dynamically-allocated buffers duplicated in new buffers.
22621 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
22624 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
22626 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
22629 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
22631 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
22634 * Checks if the given object is currently in the success state
22636 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
22639 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
22641 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
22644 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
22645 * but with all dynamically-allocated buffers duplicated in new buffers.
22647 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
22650 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22652 void CVec_SocketAddressZ_free(struct LDKCVec_SocketAddressZ _res);
22655 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
22657 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
22660 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
22662 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
22665 * Checks if the given object is currently in the success state
22667 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
22670 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
22672 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
22675 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
22676 * but with all dynamically-allocated buffers duplicated in new buffers.
22678 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
22681 * Creates a new CResult_NodeAliasDecodeErrorZ in the success state.
22683 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_ok(struct LDKNodeAlias o);
22686 * Creates a new CResult_NodeAliasDecodeErrorZ in the error state.
22688 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_err(struct LDKDecodeError e);
22691 * Checks if the given object is currently in the success state
22693 bool CResult_NodeAliasDecodeErrorZ_is_ok(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR o);
22696 * Frees any resources used by the CResult_NodeAliasDecodeErrorZ.
22698 void CResult_NodeAliasDecodeErrorZ_free(struct LDKCResult_NodeAliasDecodeErrorZ _res);
22701 * Creates a new CResult_NodeAliasDecodeErrorZ which has the same data as `orig`
22702 * but with all dynamically-allocated buffers duplicated in new buffers.
22704 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig);
22707 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
22709 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
22712 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
22714 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
22717 * Checks if the given object is currently in the success state
22719 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
22722 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
22724 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
22727 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
22728 * but with all dynamically-allocated buffers duplicated in new buffers.
22730 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
22733 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
22735 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
22738 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
22740 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
22743 * Checks if the given object is currently in the success state
22745 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
22748 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
22750 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
22753 * Constructs a new COption_CVec_SocketAddressZZ containing a crate::c_types::derived::CVec_SocketAddressZ
22755 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_some(struct LDKCVec_SocketAddressZ o);
22758 * Constructs a new COption_CVec_SocketAddressZZ containing nothing
22760 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_none(void);
22763 * Frees any resources associated with the crate::c_types::derived::CVec_SocketAddressZ, if we are in the Some state
22765 void COption_CVec_SocketAddressZZ_free(struct LDKCOption_CVec_SocketAddressZZ _res);
22768 * Creates a new COption_CVec_SocketAddressZZ which has the same data as `orig`
22769 * but with all dynamically-allocated buffers duplicated in new buffers.
22771 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_clone(const struct LDKCOption_CVec_SocketAddressZZ *NONNULL_PTR orig);
22774 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22776 void CVec_HTLCOutputInCommitmentZ_free(struct LDKCVec_HTLCOutputInCommitmentZ _res);
22779 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22781 void CVec_HTLCDescriptorZ_free(struct LDKCVec_HTLCDescriptorZ _res);
22784 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22786 void CVec_UtxoZ_free(struct LDKCVec_UtxoZ _res);
22789 * Constructs a new COption_TxOutZ containing a crate::c_types::TxOut
22791 struct LDKCOption_TxOutZ COption_TxOutZ_some(struct LDKTxOut o);
22794 * Constructs a new COption_TxOutZ containing nothing
22796 struct LDKCOption_TxOutZ COption_TxOutZ_none(void);
22799 * Frees any resources associated with the crate::c_types::TxOut, if we are in the Some state
22801 void COption_TxOutZ_free(struct LDKCOption_TxOutZ _res);
22804 * Creates a new COption_TxOutZ which has the same data as `orig`
22805 * but with all dynamically-allocated buffers duplicated in new buffers.
22807 struct LDKCOption_TxOutZ COption_TxOutZ_clone(const struct LDKCOption_TxOutZ *NONNULL_PTR orig);
22810 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22812 void CVec_InputZ_free(struct LDKCVec_InputZ _res);
22815 * Creates a new CResult_CoinSelectionNoneZ in the success state.
22817 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_ok(struct LDKCoinSelection o);
22820 * Creates a new CResult_CoinSelectionNoneZ in the error state.
22822 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_err(void);
22825 * Checks if the given object is currently in the success state
22827 bool CResult_CoinSelectionNoneZ_is_ok(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR o);
22830 * Frees any resources used by the CResult_CoinSelectionNoneZ.
22832 void CResult_CoinSelectionNoneZ_free(struct LDKCResult_CoinSelectionNoneZ _res);
22835 * Creates a new CResult_CoinSelectionNoneZ which has the same data as `orig`
22836 * but with all dynamically-allocated buffers duplicated in new buffers.
22838 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_clone(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR orig);
22841 * Creates a new CResult_CVec_UtxoZNoneZ in the success state.
22843 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_ok(struct LDKCVec_UtxoZ o);
22846 * Creates a new CResult_CVec_UtxoZNoneZ in the error state.
22848 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_err(void);
22851 * Checks if the given object is currently in the success state
22853 bool CResult_CVec_UtxoZNoneZ_is_ok(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR o);
22856 * Frees any resources used by the CResult_CVec_UtxoZNoneZ.
22858 void CResult_CVec_UtxoZNoneZ_free(struct LDKCResult_CVec_UtxoZNoneZ _res);
22861 * Creates a new CResult_CVec_UtxoZNoneZ which has the same data as `orig`
22862 * but with all dynamically-allocated buffers duplicated in new buffers.
22864 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_clone(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR orig);
22867 * Creates a new tuple which has the same data as `orig`
22868 * but with all dynamically-allocated buffers duplicated in new buffers.
22870 struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_clone(const struct LDKC2Tuple_u64u16Z *NONNULL_PTR orig);
22873 * Creates a new C2Tuple_u64u16Z from the contained elements.
22875 struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_new(uint64_t a, uint16_t b);
22878 * Frees any resources used by the C2Tuple_u64u16Z.
22880 void C2Tuple_u64u16Z_free(struct LDKC2Tuple_u64u16Z _res);
22883 * Constructs a new COption_C2Tuple_u64u16ZZ containing a crate::c_types::derived::C2Tuple_u64u16Z
22885 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_some(struct LDKC2Tuple_u64u16Z o);
22888 * Constructs a new COption_C2Tuple_u64u16ZZ containing nothing
22890 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_none(void);
22893 * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u16Z, if we are in the Some state
22895 void COption_C2Tuple_u64u16ZZ_free(struct LDKCOption_C2Tuple_u64u16ZZ _res);
22898 * Creates a new COption_C2Tuple_u64u16ZZ which has the same data as `orig`
22899 * but with all dynamically-allocated buffers duplicated in new buffers.
22901 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_clone(const struct LDKCOption_C2Tuple_u64u16ZZ *NONNULL_PTR orig);
22904 * Constructs a new COption_ChannelShutdownStateZ containing a crate::lightning::ln::channelmanager::ChannelShutdownState
22906 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_some(enum LDKChannelShutdownState o);
22909 * Constructs a new COption_ChannelShutdownStateZ containing nothing
22911 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_none(void);
22914 * Frees any resources associated with the crate::lightning::ln::channelmanager::ChannelShutdownState, if we are in the Some state
22916 void COption_ChannelShutdownStateZ_free(struct LDKCOption_ChannelShutdownStateZ _res);
22919 * Creates a new COption_ChannelShutdownStateZ which has the same data as `orig`
22920 * but with all dynamically-allocated buffers duplicated in new buffers.
22922 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_clone(const struct LDKCOption_ChannelShutdownStateZ *NONNULL_PTR orig);
22925 * Creates a new CResult_ThirtyTwoBytesAPIErrorZ in the success state.
22927 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
22930 * Creates a new CResult_ThirtyTwoBytesAPIErrorZ in the error state.
22932 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_err(struct LDKAPIError e);
22935 * Checks if the given object is currently in the success state
22937 bool CResult_ThirtyTwoBytesAPIErrorZ_is_ok(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR o);
22940 * Frees any resources used by the CResult_ThirtyTwoBytesAPIErrorZ.
22942 void CResult_ThirtyTwoBytesAPIErrorZ_free(struct LDKCResult_ThirtyTwoBytesAPIErrorZ _res);
22945 * Creates a new CResult_ThirtyTwoBytesAPIErrorZ which has the same data as `orig`
22946 * but with all dynamically-allocated buffers duplicated in new buffers.
22948 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_clone(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR orig);
22951 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22953 void CVec_RecentPaymentDetailsZ_free(struct LDKCVec_RecentPaymentDetailsZ _res);
22956 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
22958 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
22961 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
22963 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
22966 * Checks if the given object is currently in the success state
22968 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
22971 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
22973 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
22976 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
22977 * but with all dynamically-allocated buffers duplicated in new buffers.
22979 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
22982 * Creates a new CResult_NoneRetryableSendFailureZ in the success state.
22984 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_ok(void);
22987 * Creates a new CResult_NoneRetryableSendFailureZ in the error state.
22989 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
22992 * Checks if the given object is currently in the success state
22994 bool CResult_NoneRetryableSendFailureZ_is_ok(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR o);
22997 * Frees any resources used by the CResult_NoneRetryableSendFailureZ.
22999 void CResult_NoneRetryableSendFailureZ_free(struct LDKCResult_NoneRetryableSendFailureZ _res);
23002 * Creates a new CResult_NoneRetryableSendFailureZ which has the same data as `orig`
23003 * but with all dynamically-allocated buffers duplicated in new buffers.
23005 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_clone(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR orig);
23008 * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the success state.
23010 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
23013 * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the error state.
23015 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
23018 * Checks if the given object is currently in the success state
23020 bool CResult_ThirtyTwoBytesPaymentSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR o);
23023 * Frees any resources used by the CResult_ThirtyTwoBytesPaymentSendFailureZ.
23025 void CResult_ThirtyTwoBytesPaymentSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ _res);
23028 * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ which has the same data as `orig`
23029 * but with all dynamically-allocated buffers duplicated in new buffers.
23031 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR orig);
23034 * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ in the success state.
23036 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_ok(struct LDKThirtyTwoBytes o);
23039 * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ in the error state.
23041 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
23044 * Checks if the given object is currently in the success state
23046 bool CResult_ThirtyTwoBytesRetryableSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR o);
23049 * Frees any resources used by the CResult_ThirtyTwoBytesRetryableSendFailureZ.
23051 void CResult_ThirtyTwoBytesRetryableSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ _res);
23054 * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ which has the same data as `orig`
23055 * but with all dynamically-allocated buffers duplicated in new buffers.
23057 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR orig);
23060 * Creates a new tuple which has the same data as `orig`
23061 * but with all dynamically-allocated buffers duplicated in new buffers.
23063 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *NONNULL_PTR orig);
23066 * Creates a new C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ from the contained elements.
23068 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
23071 * Frees any resources used by the C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ.
23073 void C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_free(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ _res);
23076 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the success state.
23078 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o);
23081 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the error state.
23083 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
23086 * Checks if the given object is currently in the success state
23088 bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR o);
23091 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.
23093 void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ _res);
23096 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ which has the same data as `orig`
23097 * but with all dynamically-allocated buffers duplicated in new buffers.
23099 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR orig);
23102 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23104 void CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ _res);
23107 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the success state.
23109 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ o);
23112 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the error state.
23114 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_err(struct LDKProbeSendFailure e);
23117 * Checks if the given object is currently in the success state
23119 bool CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR o);
23122 * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.
23124 void CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ _res);
23127 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ which has the same data as `orig`
23128 * but with all dynamically-allocated buffers duplicated in new buffers.
23130 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR orig);
23133 * Creates a new tuple which has the same data as `orig`
23134 * but with all dynamically-allocated buffers duplicated in new buffers.
23136 struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ C2Tuple_ThirtyTwoBytesPublicKeyZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ *NONNULL_PTR orig);
23139 * Creates a new C2Tuple_ThirtyTwoBytesPublicKeyZ from the contained elements.
23141 struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ C2Tuple_ThirtyTwoBytesPublicKeyZ_new(struct LDKThirtyTwoBytes a, struct LDKPublicKey b);
23144 * Frees any resources used by the C2Tuple_ThirtyTwoBytesPublicKeyZ.
23146 void C2Tuple_ThirtyTwoBytesPublicKeyZ_free(struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ _res);
23149 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23151 void CVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ _res);
23154 * Constructs a new COption_StrZ containing a crate::c_types::Str
23156 struct LDKCOption_StrZ COption_StrZ_some(struct LDKStr o);
23159 * Constructs a new COption_StrZ containing nothing
23161 struct LDKCOption_StrZ COption_StrZ_none(void);
23164 * Frees any resources associated with the crate::c_types::Str, if we are in the Some state
23166 void COption_StrZ_free(struct LDKCOption_StrZ _res);
23169 * Creates a new COption_StrZ which has the same data as `orig`
23170 * but with all dynamically-allocated buffers duplicated in new buffers.
23172 struct LDKCOption_StrZ COption_StrZ_clone(const struct LDKCOption_StrZ *NONNULL_PTR orig);
23175 * Creates a new CResult_NoneBolt12SemanticErrorZ in the success state.
23177 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_ok(void);
23180 * Creates a new CResult_NoneBolt12SemanticErrorZ in the error state.
23182 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
23185 * Checks if the given object is currently in the success state
23187 bool CResult_NoneBolt12SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR o);
23190 * Frees any resources used by the CResult_NoneBolt12SemanticErrorZ.
23192 void CResult_NoneBolt12SemanticErrorZ_free(struct LDKCResult_NoneBolt12SemanticErrorZ _res);
23195 * Creates a new CResult_NoneBolt12SemanticErrorZ which has the same data as `orig`
23196 * but with all dynamically-allocated buffers duplicated in new buffers.
23198 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_clone(const struct LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR orig);
23201 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the success state.
23203 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o);
23206 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the error state.
23208 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_err(void);
23211 * Checks if the given object is currently in the success state
23213 bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR o);
23216 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ.
23218 void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ _res);
23221 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ which has the same data as `orig`
23222 * but with all dynamically-allocated buffers duplicated in new buffers.
23224 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR orig);
23227 * Constructs a new COption_OffersMessageZ containing a crate::lightning::onion_message::offers::OffersMessage
23229 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_some(struct LDKOffersMessage o);
23232 * Constructs a new COption_OffersMessageZ containing nothing
23234 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_none(void);
23237 * Frees any resources associated with the crate::lightning::onion_message::offers::OffersMessage, if we are in the Some state
23239 void COption_OffersMessageZ_free(struct LDKCOption_OffersMessageZ _res);
23242 * Creates a new COption_OffersMessageZ which has the same data as `orig`
23243 * but with all dynamically-allocated buffers duplicated in new buffers.
23245 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_clone(const struct LDKCOption_OffersMessageZ *NONNULL_PTR orig);
23248 * Creates a new tuple which has the same data as `orig`
23249 * but with all dynamically-allocated buffers duplicated in new buffers.
23251 struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ C3Tuple_OffersMessageDestinationBlindedPathZ_clone(const struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR orig);
23254 * Creates a new C3Tuple_OffersMessageDestinationBlindedPathZ from the contained elements.
23256 struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ C3Tuple_OffersMessageDestinationBlindedPathZ_new(struct LDKOffersMessage a, struct LDKDestination b, struct LDKBlindedPath c);
23259 * Frees any resources used by the C3Tuple_OffersMessageDestinationBlindedPathZ.
23261 void C3Tuple_OffersMessageDestinationBlindedPathZ_free(struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ _res);
23264 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23266 void CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ _res);
23269 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
23271 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
23274 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
23276 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
23279 * Checks if the given object is currently in the success state
23281 bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
23284 * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
23286 void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
23289 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
23290 * but with all dynamically-allocated buffers duplicated in new buffers.
23292 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
23295 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
23297 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
23300 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
23302 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
23305 * Checks if the given object is currently in the success state
23307 bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
23310 * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
23312 void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
23315 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
23316 * but with all dynamically-allocated buffers duplicated in new buffers.
23318 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
23321 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
23323 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
23326 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
23328 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
23331 * Checks if the given object is currently in the success state
23333 bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
23336 * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
23338 void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
23341 * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
23342 * but with all dynamically-allocated buffers duplicated in new buffers.
23344 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
23347 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
23349 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
23352 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
23354 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
23357 * Checks if the given object is currently in the success state
23359 bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
23362 * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
23364 void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
23367 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ which has the same data as `orig`
23368 * but with all dynamically-allocated buffers duplicated in new buffers.
23370 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig);
23373 * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the success state.
23375 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_ok(enum LDKChannelShutdownState o);
23378 * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the error state.
23380 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_err(struct LDKDecodeError e);
23383 * Checks if the given object is currently in the success state
23385 bool CResult_ChannelShutdownStateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR o);
23388 * Frees any resources used by the CResult_ChannelShutdownStateDecodeErrorZ.
23390 void CResult_ChannelShutdownStateDecodeErrorZ_free(struct LDKCResult_ChannelShutdownStateDecodeErrorZ _res);
23393 * Creates a new CResult_ChannelShutdownStateDecodeErrorZ which has the same data as `orig`
23394 * but with all dynamically-allocated buffers duplicated in new buffers.
23396 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_clone(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR orig);
23399 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23401 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
23404 * Creates a new C2Tuple_ThirtyTwoBytesChannelManagerZ from the contained elements.
23406 struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ C2Tuple_ThirtyTwoBytesChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
23409 * Frees any resources used by the C2Tuple_ThirtyTwoBytesChannelManagerZ.
23411 void C2Tuple_ThirtyTwoBytesChannelManagerZ_free(struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ _res);
23414 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the success state.
23416 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ o);
23419 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the error state.
23421 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
23424 * Checks if the given object is currently in the success state
23426 bool CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ *NONNULL_PTR o);
23429 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.
23431 void CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ _res);
23434 * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the success state.
23436 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_ok(struct LDKMaxDustHTLCExposure o);
23439 * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the error state.
23441 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_err(struct LDKDecodeError e);
23444 * Checks if the given object is currently in the success state
23446 bool CResult_MaxDustHTLCExposureDecodeErrorZ_is_ok(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR o);
23449 * Frees any resources used by the CResult_MaxDustHTLCExposureDecodeErrorZ.
23451 void CResult_MaxDustHTLCExposureDecodeErrorZ_free(struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ _res);
23454 * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ which has the same data as `orig`
23455 * but with all dynamically-allocated buffers duplicated in new buffers.
23457 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_clone(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR orig);
23460 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
23462 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
23465 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
23467 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
23470 * Checks if the given object is currently in the success state
23472 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
23475 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
23477 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
23480 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
23481 * but with all dynamically-allocated buffers duplicated in new buffers.
23483 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
23486 * Constructs a new COption_MaxDustHTLCExposureZ containing a crate::lightning::util::config::MaxDustHTLCExposure
23488 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_some(struct LDKMaxDustHTLCExposure o);
23491 * Constructs a new COption_MaxDustHTLCExposureZ containing nothing
23493 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_none(void);
23496 * Frees any resources associated with the crate::lightning::util::config::MaxDustHTLCExposure, if we are in the Some state
23498 void COption_MaxDustHTLCExposureZ_free(struct LDKCOption_MaxDustHTLCExposureZ _res);
23501 * Creates a new COption_MaxDustHTLCExposureZ which has the same data as `orig`
23502 * but with all dynamically-allocated buffers duplicated in new buffers.
23504 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_clone(const struct LDKCOption_MaxDustHTLCExposureZ *NONNULL_PTR orig);
23507 * Constructs a new COption_APIErrorZ containing a crate::lightning::util::errors::APIError
23509 struct LDKCOption_APIErrorZ COption_APIErrorZ_some(struct LDKAPIError o);
23512 * Constructs a new COption_APIErrorZ containing nothing
23514 struct LDKCOption_APIErrorZ COption_APIErrorZ_none(void);
23517 * Frees any resources associated with the crate::lightning::util::errors::APIError, if we are in the Some state
23519 void COption_APIErrorZ_free(struct LDKCOption_APIErrorZ _res);
23522 * Creates a new COption_APIErrorZ which has the same data as `orig`
23523 * but with all dynamically-allocated buffers duplicated in new buffers.
23525 struct LDKCOption_APIErrorZ COption_APIErrorZ_clone(const struct LDKCOption_APIErrorZ *NONNULL_PTR orig);
23528 * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the success state.
23530 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_ok(struct LDKCOption_APIErrorZ o);
23533 * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the error state.
23535 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_err(struct LDKDecodeError e);
23538 * Checks if the given object is currently in the success state
23540 bool CResult_COption_APIErrorZDecodeErrorZ_is_ok(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR o);
23543 * Frees any resources used by the CResult_COption_APIErrorZDecodeErrorZ.
23545 void CResult_COption_APIErrorZDecodeErrorZ_free(struct LDKCResult_COption_APIErrorZDecodeErrorZ _res);
23548 * Creates a new CResult_COption_APIErrorZDecodeErrorZ which has the same data as `orig`
23549 * but with all dynamically-allocated buffers duplicated in new buffers.
23551 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_clone(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR orig);
23554 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
23556 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
23559 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
23561 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
23564 * Checks if the given object is currently in the success state
23566 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
23569 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
23571 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
23574 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
23575 * but with all dynamically-allocated buffers duplicated in new buffers.
23577 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
23580 * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
23582 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
23585 * Constructs a new COption_MonitorEventZ containing nothing
23587 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
23590 * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
23592 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
23595 * Creates a new COption_MonitorEventZ which has the same data as `orig`
23596 * but with all dynamically-allocated buffers duplicated in new buffers.
23598 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
23601 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
23603 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
23606 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
23608 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
23611 * Checks if the given object is currently in the success state
23613 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
23616 * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
23618 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
23621 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
23622 * but with all dynamically-allocated buffers duplicated in new buffers.
23624 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
23627 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
23629 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
23632 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
23634 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
23637 * Checks if the given object is currently in the success state
23639 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
23642 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
23644 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
23647 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
23648 * but with all dynamically-allocated buffers duplicated in new buffers.
23650 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
23653 * Creates a new tuple which has the same data as `orig`
23654 * but with all dynamically-allocated buffers duplicated in new buffers.
23656 struct LDKC2Tuple_OutPointCVec_u8ZZ C2Tuple_OutPointCVec_u8ZZ_clone(const struct LDKC2Tuple_OutPointCVec_u8ZZ *NONNULL_PTR orig);
23659 * Creates a new C2Tuple_OutPointCVec_u8ZZ from the contained elements.
23661 struct LDKC2Tuple_OutPointCVec_u8ZZ C2Tuple_OutPointCVec_u8ZZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
23664 * Frees any resources used by the C2Tuple_OutPointCVec_u8ZZ.
23666 void C2Tuple_OutPointCVec_u8ZZ_free(struct LDKC2Tuple_OutPointCVec_u8ZZ _res);
23669 * Creates a new tuple which has the same data as `orig`
23670 * but with all dynamically-allocated buffers duplicated in new buffers.
23672 struct LDKC2Tuple_u32CVec_u8ZZ C2Tuple_u32CVec_u8ZZ_clone(const struct LDKC2Tuple_u32CVec_u8ZZ *NONNULL_PTR orig);
23675 * Creates a new C2Tuple_u32CVec_u8ZZ from the contained elements.
23677 struct LDKC2Tuple_u32CVec_u8ZZ C2Tuple_u32CVec_u8ZZ_new(uint32_t a, struct LDKCVec_u8Z b);
23680 * Frees any resources used by the C2Tuple_u32CVec_u8ZZ.
23682 void C2Tuple_u32CVec_u8ZZ_free(struct LDKC2Tuple_u32CVec_u8ZZ _res);
23685 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23687 void CVec_C2Tuple_u32CVec_u8ZZZ_free(struct LDKCVec_C2Tuple_u32CVec_u8ZZZ _res);
23690 * Creates a new tuple which has the same data as `orig`
23691 * but with all dynamically-allocated buffers duplicated in new buffers.
23693 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *NONNULL_PTR orig);
23696 * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ from the contained elements.
23698 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32CVec_u8ZZZ b);
23701 * Frees any resources used by the C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ.
23703 void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ _res);
23706 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23708 void CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ _res);
23711 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23713 void CVec_CommitmentTransactionZ_free(struct LDKCVec_CommitmentTransactionZ _res);
23716 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23718 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
23721 * Creates a new tuple which has the same data as `orig`
23722 * but with all dynamically-allocated buffers duplicated in new buffers.
23724 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
23727 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
23729 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
23732 * Frees any resources used by the C2Tuple_u32TxOutZ.
23734 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
23737 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23739 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
23742 * Creates a new tuple which has the same data as `orig`
23743 * but with all dynamically-allocated buffers duplicated in new buffers.
23745 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
23748 * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ from the contained elements.
23750 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
23753 * Frees any resources used by the C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ.
23755 void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ _res);
23758 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23760 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
23763 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23765 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
23768 * Creates a new tuple which has the same data as `orig`
23769 * but with all dynamically-allocated buffers duplicated in new buffers.
23771 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *NONNULL_PTR orig);
23774 * Creates a new C2Tuple_ThirtyTwoBytesChannelMonitorZ from the contained elements.
23776 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
23779 * Frees any resources used by the C2Tuple_ThirtyTwoBytesChannelMonitorZ.
23781 void C2Tuple_ThirtyTwoBytesChannelMonitorZ_free(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ _res);
23784 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the success state.
23786 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ o);
23789 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the error state.
23791 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
23794 * Checks if the given object is currently in the success state
23796 bool CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
23799 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.
23801 void CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ _res);
23804 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ which has the same data as `orig`
23805 * but with all dynamically-allocated buffers duplicated in new buffers.
23807 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ *NONNULL_PTR orig);
23810 * Creates a new tuple which has the same data as `orig`
23811 * but with all dynamically-allocated buffers duplicated in new buffers.
23813 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_clone(const struct LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR orig);
23816 * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
23818 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
23821 * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
23823 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
23826 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23828 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
23831 * Constructs a new COption_OnionMessageContentsZ containing a crate::lightning::onion_message::packet::OnionMessageContents
23833 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_some(struct LDKOnionMessageContents o);
23836 * Constructs a new COption_OnionMessageContentsZ containing nothing
23838 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_none(void);
23841 * Frees any resources associated with the crate::lightning::onion_message::packet::OnionMessageContents, if we are in the Some state
23843 void COption_OnionMessageContentsZ_free(struct LDKCOption_OnionMessageContentsZ _res);
23846 * Creates a new COption_OnionMessageContentsZ which has the same data as `orig`
23847 * but with all dynamically-allocated buffers duplicated in new buffers.
23849 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_clone(const struct LDKCOption_OnionMessageContentsZ *NONNULL_PTR orig);
23852 * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ in the success state.
23854 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_ok(struct LDKCOption_OnionMessageContentsZ o);
23857 * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ in the error state.
23859 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_err(struct LDKDecodeError e);
23862 * Checks if the given object is currently in the success state
23864 bool CResult_COption_OnionMessageContentsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR o);
23867 * Frees any resources used by the CResult_COption_OnionMessageContentsZDecodeErrorZ.
23869 void CResult_COption_OnionMessageContentsZDecodeErrorZ_free(struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ _res);
23872 * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ which has the same data as `orig`
23873 * but with all dynamically-allocated buffers duplicated in new buffers.
23875 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_clone(const struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR orig);
23878 * Creates a new tuple which has the same data as `orig`
23879 * but with all dynamically-allocated buffers duplicated in new buffers.
23881 struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(const struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR orig);
23884 * Creates a new C3Tuple_OnionMessageContentsDestinationBlindedPathZ from the contained elements.
23886 struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(struct LDKOnionMessageContents a, struct LDKDestination b, struct LDKBlindedPath c);
23889 * Frees any resources used by the C3Tuple_OnionMessageContentsDestinationBlindedPathZ.
23891 void C3Tuple_OnionMessageContentsDestinationBlindedPathZ_free(struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ _res);
23894 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23896 void CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_free(struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ _res);
23899 * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
23901 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
23904 * Constructs a new COption_TypeZ containing nothing
23906 struct LDKCOption_TypeZ COption_TypeZ_none(void);
23909 * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
23911 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
23914 * Creates a new COption_TypeZ which has the same data as `orig`
23915 * but with all dynamically-allocated buffers duplicated in new buffers.
23917 struct LDKCOption_TypeZ COption_TypeZ_clone(const struct LDKCOption_TypeZ *NONNULL_PTR orig);
23920 * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
23922 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
23925 * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
23927 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
23930 * Checks if the given object is currently in the success state
23932 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
23935 * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
23937 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
23940 * Creates a new CResult_COption_TypeZDecodeErrorZ which has the same data as `orig`
23941 * but with all dynamically-allocated buffers duplicated in new buffers.
23943 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_clone(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR orig);
23946 * Constructs a new COption_SocketAddressZ containing a crate::lightning::ln::msgs::SocketAddress
23948 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_some(struct LDKSocketAddress o);
23951 * Constructs a new COption_SocketAddressZ containing nothing
23953 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_none(void);
23956 * Frees any resources associated with the crate::lightning::ln::msgs::SocketAddress, if we are in the Some state
23958 void COption_SocketAddressZ_free(struct LDKCOption_SocketAddressZ _res);
23961 * Creates a new COption_SocketAddressZ which has the same data as `orig`
23962 * but with all dynamically-allocated buffers duplicated in new buffers.
23964 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_clone(const struct LDKCOption_SocketAddressZ *NONNULL_PTR orig);
23967 * Creates a new tuple which has the same data as `orig`
23968 * but with all dynamically-allocated buffers duplicated in new buffers.
23970 struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ C2Tuple_PublicKeyCOption_SocketAddressZZ_clone(const struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ *NONNULL_PTR orig);
23973 * Creates a new C2Tuple_PublicKeyCOption_SocketAddressZZ from the contained elements.
23975 struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ C2Tuple_PublicKeyCOption_SocketAddressZZ_new(struct LDKPublicKey a, struct LDKCOption_SocketAddressZ b);
23978 * Frees any resources used by the C2Tuple_PublicKeyCOption_SocketAddressZZ.
23980 void C2Tuple_PublicKeyCOption_SocketAddressZZ_free(struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ _res);
23983 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23985 void CVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ_free(struct LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ _res);
23988 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
23990 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
23993 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
23995 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
23998 * Checks if the given object is currently in the success state
24000 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
24003 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
24005 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
24008 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
24009 * but with all dynamically-allocated buffers duplicated in new buffers.
24011 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
24014 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
24016 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
24019 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
24021 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
24024 * Checks if the given object is currently in the success state
24026 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
24029 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
24031 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
24034 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
24035 * but with all dynamically-allocated buffers duplicated in new buffers.
24037 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
24040 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
24042 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
24045 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
24047 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
24050 * Checks if the given object is currently in the success state
24052 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
24055 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
24057 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
24060 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
24061 * but with all dynamically-allocated buffers duplicated in new buffers.
24063 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
24066 * Creates a new CResult_u32GraphSyncErrorZ in the success state.
24068 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o);
24071 * Creates a new CResult_u32GraphSyncErrorZ in the error state.
24073 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e);
24076 * Checks if the given object is currently in the success state
24078 bool CResult_u32GraphSyncErrorZ_is_ok(const struct LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR o);
24081 * Frees any resources used by the CResult_u32GraphSyncErrorZ.
24083 void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res);
24086 * Creates a new CResult_CVec_u8ZIOErrorZ in the success state.
24088 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_ok(struct LDKCVec_u8Z o);
24091 * Creates a new CResult_CVec_u8ZIOErrorZ in the error state.
24093 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_err(enum LDKIOError e);
24096 * Checks if the given object is currently in the success state
24098 bool CResult_CVec_u8ZIOErrorZ_is_ok(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR o);
24101 * Frees any resources used by the CResult_CVec_u8ZIOErrorZ.
24103 void CResult_CVec_u8ZIOErrorZ_free(struct LDKCResult_CVec_u8ZIOErrorZ _res);
24106 * Creates a new CResult_CVec_u8ZIOErrorZ which has the same data as `orig`
24107 * but with all dynamically-allocated buffers duplicated in new buffers.
24109 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_clone(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR orig);
24112 * Frees the buffer pointed to by `data` if `datalen` is non-0.
24114 void CVec_StrZ_free(struct LDKCVec_StrZ _res);
24117 * Creates a new CResult_CVec_StrZIOErrorZ in the success state.
24119 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_ok(struct LDKCVec_StrZ o);
24122 * Creates a new CResult_CVec_StrZIOErrorZ in the error state.
24124 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_err(enum LDKIOError e);
24127 * Checks if the given object is currently in the success state
24129 bool CResult_CVec_StrZIOErrorZ_is_ok(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR o);
24132 * Frees any resources used by the CResult_CVec_StrZIOErrorZ.
24134 void CResult_CVec_StrZIOErrorZ_free(struct LDKCResult_CVec_StrZIOErrorZ _res);
24137 * Creates a new CResult_CVec_StrZIOErrorZ which has the same data as `orig`
24138 * but with all dynamically-allocated buffers duplicated in new buffers.
24140 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_clone(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR orig);
24143 * Frees the buffer pointed to by `data` if `datalen` is non-0.
24145 void CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ _res);
24148 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the success state.
24150 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ o);
24153 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the error state.
24155 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_err(enum LDKIOError e);
24158 * Checks if the given object is currently in the success state
24160 bool CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR o);
24163 * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ.
24165 void CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ _res);
24168 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ which has the same data as `orig`
24169 * but with all dynamically-allocated buffers duplicated in new buffers.
24171 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR orig);
24174 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the success state.
24176 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ o);
24179 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the error state.
24181 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_err(enum LDKIOError e);
24184 * Checks if the given object is currently in the success state
24186 bool CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR o);
24189 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ.
24191 void CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ _res);
24194 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ which has the same data as `orig`
24195 * but with all dynamically-allocated buffers duplicated in new buffers.
24197 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR orig);
24200 * Constructs a new COption_SecretKeyZ containing a crate::c_types::SecretKey
24202 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_some(struct LDKSecretKey o);
24205 * Constructs a new COption_SecretKeyZ containing nothing
24207 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_none(void);
24210 * Frees any resources associated with the crate::c_types::SecretKey, if we are in the Some state
24212 void COption_SecretKeyZ_free(struct LDKCOption_SecretKeyZ _res);
24215 * Creates a new COption_SecretKeyZ which has the same data as `orig`
24216 * but with all dynamically-allocated buffers duplicated in new buffers.
24218 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_clone(const struct LDKCOption_SecretKeyZ *NONNULL_PTR orig);
24221 * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the success state.
24223 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_ok(struct LDKVerifiedInvoiceRequest o);
24226 * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the error state.
24228 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_err(void);
24231 * Checks if the given object is currently in the success state
24233 bool CResult_VerifiedInvoiceRequestNoneZ_is_ok(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR o);
24236 * Frees any resources used by the CResult_VerifiedInvoiceRequestNoneZ.
24238 void CResult_VerifiedInvoiceRequestNoneZ_free(struct LDKCResult_VerifiedInvoiceRequestNoneZ _res);
24241 * Creates a new CResult_VerifiedInvoiceRequestNoneZ which has the same data as `orig`
24242 * but with all dynamically-allocated buffers duplicated in new buffers.
24244 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_clone(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR orig);
24247 * Constructs a new COption_NoneZ containing a
24249 enum LDKCOption_NoneZ COption_NoneZ_some(void);
24252 * Constructs a new COption_NoneZ containing nothing
24254 enum LDKCOption_NoneZ COption_NoneZ_none(void);
24257 * Frees any resources associated with the , if we are in the Some state
24259 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
24262 * Frees the buffer pointed to by `data` if `datalen` is non-0.
24264 void CVec_WitnessZ_free(struct LDKCVec_WitnessZ _res);
24267 * Constructs a new COption_i64Z containing a i64
24269 struct LDKCOption_i64Z COption_i64Z_some(int64_t o);
24272 * Constructs a new COption_i64Z containing nothing
24274 struct LDKCOption_i64Z COption_i64Z_none(void);
24277 * Frees any resources associated with the i64, if we are in the Some state
24279 void COption_i64Z_free(struct LDKCOption_i64Z _res);
24282 * Creates a new COption_i64Z which has the same data as `orig`
24283 * but with all dynamically-allocated buffers duplicated in new buffers.
24285 struct LDKCOption_i64Z COption_i64Z_clone(const struct LDKCOption_i64Z *NONNULL_PTR orig);
24288 * Creates a new CResult_SocketAddressDecodeErrorZ in the success state.
24290 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_ok(struct LDKSocketAddress o);
24293 * Creates a new CResult_SocketAddressDecodeErrorZ in the error state.
24295 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_err(struct LDKDecodeError e);
24298 * Checks if the given object is currently in the success state
24300 bool CResult_SocketAddressDecodeErrorZ_is_ok(const struct LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR o);
24303 * Frees any resources used by the CResult_SocketAddressDecodeErrorZ.
24305 void CResult_SocketAddressDecodeErrorZ_free(struct LDKCResult_SocketAddressDecodeErrorZ _res);
24308 * Creates a new CResult_SocketAddressDecodeErrorZ which has the same data as `orig`
24309 * but with all dynamically-allocated buffers duplicated in new buffers.
24311 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_clone(const struct LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR orig);
24314 * Creates a new CResult_SocketAddressSocketAddressParseErrorZ in the success state.
24316 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_ok(struct LDKSocketAddress o);
24319 * Creates a new CResult_SocketAddressSocketAddressParseErrorZ in the error state.
24321 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_err(enum LDKSocketAddressParseError e);
24324 * Checks if the given object is currently in the success state
24326 bool CResult_SocketAddressSocketAddressParseErrorZ_is_ok(const struct LDKCResult_SocketAddressSocketAddressParseErrorZ *NONNULL_PTR o);
24329 * Frees any resources used by the CResult_SocketAddressSocketAddressParseErrorZ.
24331 void CResult_SocketAddressSocketAddressParseErrorZ_free(struct LDKCResult_SocketAddressSocketAddressParseErrorZ _res);
24334 * Creates a new CResult_SocketAddressSocketAddressParseErrorZ which has the same data as `orig`
24335 * but with all dynamically-allocated buffers duplicated in new buffers.
24337 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_clone(const struct LDKCResult_SocketAddressSocketAddressParseErrorZ *NONNULL_PTR orig);
24340 * Frees the buffer pointed to by `data` if `datalen` is non-0.
24342 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
24345 * Frees the buffer pointed to by `data` if `datalen` is non-0.
24347 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
24350 * Frees the buffer pointed to by `data` if `datalen` is non-0.
24352 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
24355 * Frees the buffer pointed to by `data` if `datalen` is non-0.
24357 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
24360 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
24362 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
24365 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
24367 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
24370 * Checks if the given object is currently in the success state
24372 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
24375 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
24377 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
24380 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
24381 * but with all dynamically-allocated buffers duplicated in new buffers.
24383 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
24386 * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the success state.
24388 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_ok(struct LDKAcceptChannelV2 o);
24391 * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the error state.
24393 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
24396 * Checks if the given object is currently in the success state
24398 bool CResult_AcceptChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR o);
24401 * Frees any resources used by the CResult_AcceptChannelV2DecodeErrorZ.
24403 void CResult_AcceptChannelV2DecodeErrorZ_free(struct LDKCResult_AcceptChannelV2DecodeErrorZ _res);
24406 * Creates a new CResult_AcceptChannelV2DecodeErrorZ which has the same data as `orig`
24407 * but with all dynamically-allocated buffers duplicated in new buffers.
24409 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_clone(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR orig);
24412 * Creates a new CResult_TxAddInputDecodeErrorZ in the success state.
24414 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_ok(struct LDKTxAddInput o);
24417 * Creates a new CResult_TxAddInputDecodeErrorZ in the error state.
24419 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_err(struct LDKDecodeError e);
24422 * Checks if the given object is currently in the success state
24424 bool CResult_TxAddInputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR o);
24427 * Frees any resources used by the CResult_TxAddInputDecodeErrorZ.
24429 void CResult_TxAddInputDecodeErrorZ_free(struct LDKCResult_TxAddInputDecodeErrorZ _res);
24432 * Creates a new CResult_TxAddInputDecodeErrorZ which has the same data as `orig`
24433 * but with all dynamically-allocated buffers duplicated in new buffers.
24435 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_clone(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR orig);
24438 * Creates a new CResult_TxAddOutputDecodeErrorZ in the success state.
24440 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_ok(struct LDKTxAddOutput o);
24443 * Creates a new CResult_TxAddOutputDecodeErrorZ in the error state.
24445 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_err(struct LDKDecodeError e);
24448 * Checks if the given object is currently in the success state
24450 bool CResult_TxAddOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR o);
24453 * Frees any resources used by the CResult_TxAddOutputDecodeErrorZ.
24455 void CResult_TxAddOutputDecodeErrorZ_free(struct LDKCResult_TxAddOutputDecodeErrorZ _res);
24458 * Creates a new CResult_TxAddOutputDecodeErrorZ which has the same data as `orig`
24459 * but with all dynamically-allocated buffers duplicated in new buffers.
24461 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_clone(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR orig);
24464 * Creates a new CResult_TxRemoveInputDecodeErrorZ in the success state.
24466 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_ok(struct LDKTxRemoveInput o);
24469 * Creates a new CResult_TxRemoveInputDecodeErrorZ in the error state.
24471 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_err(struct LDKDecodeError e);
24474 * Checks if the given object is currently in the success state
24476 bool CResult_TxRemoveInputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR o);
24479 * Frees any resources used by the CResult_TxRemoveInputDecodeErrorZ.
24481 void CResult_TxRemoveInputDecodeErrorZ_free(struct LDKCResult_TxRemoveInputDecodeErrorZ _res);
24484 * Creates a new CResult_TxRemoveInputDecodeErrorZ which has the same data as `orig`
24485 * but with all dynamically-allocated buffers duplicated in new buffers.
24487 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR orig);
24490 * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the success state.
24492 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_ok(struct LDKTxRemoveOutput o);
24495 * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the error state.
24497 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_err(struct LDKDecodeError e);
24500 * Checks if the given object is currently in the success state
24502 bool CResult_TxRemoveOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR o);
24505 * Frees any resources used by the CResult_TxRemoveOutputDecodeErrorZ.
24507 void CResult_TxRemoveOutputDecodeErrorZ_free(struct LDKCResult_TxRemoveOutputDecodeErrorZ _res);
24510 * Creates a new CResult_TxRemoveOutputDecodeErrorZ which has the same data as `orig`
24511 * but with all dynamically-allocated buffers duplicated in new buffers.
24513 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR orig);
24516 * Creates a new CResult_TxCompleteDecodeErrorZ in the success state.
24518 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_ok(struct LDKTxComplete o);
24521 * Creates a new CResult_TxCompleteDecodeErrorZ in the error state.
24523 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_err(struct LDKDecodeError e);
24526 * Checks if the given object is currently in the success state
24528 bool CResult_TxCompleteDecodeErrorZ_is_ok(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR o);
24531 * Frees any resources used by the CResult_TxCompleteDecodeErrorZ.
24533 void CResult_TxCompleteDecodeErrorZ_free(struct LDKCResult_TxCompleteDecodeErrorZ _res);
24536 * Creates a new CResult_TxCompleteDecodeErrorZ which has the same data as `orig`
24537 * but with all dynamically-allocated buffers duplicated in new buffers.
24539 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_clone(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR orig);
24542 * Creates a new CResult_TxSignaturesDecodeErrorZ in the success state.
24544 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_ok(struct LDKTxSignatures o);
24547 * Creates a new CResult_TxSignaturesDecodeErrorZ in the error state.
24549 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
24552 * Checks if the given object is currently in the success state
24554 bool CResult_TxSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR o);
24557 * Frees any resources used by the CResult_TxSignaturesDecodeErrorZ.
24559 void CResult_TxSignaturesDecodeErrorZ_free(struct LDKCResult_TxSignaturesDecodeErrorZ _res);
24562 * Creates a new CResult_TxSignaturesDecodeErrorZ which has the same data as `orig`
24563 * but with all dynamically-allocated buffers duplicated in new buffers.
24565 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_clone(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR orig);
24568 * Creates a new CResult_TxInitRbfDecodeErrorZ in the success state.
24570 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_ok(struct LDKTxInitRbf o);
24573 * Creates a new CResult_TxInitRbfDecodeErrorZ in the error state.
24575 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_err(struct LDKDecodeError e);
24578 * Checks if the given object is currently in the success state
24580 bool CResult_TxInitRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR o);
24583 * Frees any resources used by the CResult_TxInitRbfDecodeErrorZ.
24585 void CResult_TxInitRbfDecodeErrorZ_free(struct LDKCResult_TxInitRbfDecodeErrorZ _res);
24588 * Creates a new CResult_TxInitRbfDecodeErrorZ which has the same data as `orig`
24589 * but with all dynamically-allocated buffers duplicated in new buffers.
24591 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_clone(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR orig);
24594 * Creates a new CResult_TxAckRbfDecodeErrorZ in the success state.
24596 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_ok(struct LDKTxAckRbf o);
24599 * Creates a new CResult_TxAckRbfDecodeErrorZ in the error state.
24601 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_err(struct LDKDecodeError e);
24604 * Checks if the given object is currently in the success state
24606 bool CResult_TxAckRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR o);
24609 * Frees any resources used by the CResult_TxAckRbfDecodeErrorZ.
24611 void CResult_TxAckRbfDecodeErrorZ_free(struct LDKCResult_TxAckRbfDecodeErrorZ _res);
24614 * Creates a new CResult_TxAckRbfDecodeErrorZ which has the same data as `orig`
24615 * but with all dynamically-allocated buffers duplicated in new buffers.
24617 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_clone(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR orig);
24620 * Creates a new CResult_TxAbortDecodeErrorZ in the success state.
24622 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_ok(struct LDKTxAbort o);
24625 * Creates a new CResult_TxAbortDecodeErrorZ in the error state.
24627 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_err(struct LDKDecodeError e);
24630 * Checks if the given object is currently in the success state
24632 bool CResult_TxAbortDecodeErrorZ_is_ok(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR o);
24635 * Frees any resources used by the CResult_TxAbortDecodeErrorZ.
24637 void CResult_TxAbortDecodeErrorZ_free(struct LDKCResult_TxAbortDecodeErrorZ _res);
24640 * Creates a new CResult_TxAbortDecodeErrorZ which has the same data as `orig`
24641 * but with all dynamically-allocated buffers duplicated in new buffers.
24643 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_clone(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR orig);
24646 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
24648 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
24651 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
24653 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
24656 * Checks if the given object is currently in the success state
24658 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
24661 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
24663 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
24666 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
24667 * but with all dynamically-allocated buffers duplicated in new buffers.
24669 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
24672 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
24674 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
24677 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
24679 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
24682 * Checks if the given object is currently in the success state
24684 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
24687 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
24689 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
24692 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
24693 * but with all dynamically-allocated buffers duplicated in new buffers.
24695 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
24698 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
24700 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
24703 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
24705 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
24708 * Checks if the given object is currently in the success state
24710 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
24713 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
24715 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
24718 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
24719 * but with all dynamically-allocated buffers duplicated in new buffers.
24721 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
24724 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
24726 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
24729 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
24731 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
24734 * Checks if the given object is currently in the success state
24736 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
24739 * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
24741 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
24744 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
24745 * but with all dynamically-allocated buffers duplicated in new buffers.
24747 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
24750 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
24752 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
24755 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
24757 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
24760 * Checks if the given object is currently in the success state
24762 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
24765 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
24767 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
24770 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
24771 * but with all dynamically-allocated buffers duplicated in new buffers.
24773 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
24776 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
24778 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
24781 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
24783 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
24786 * Checks if the given object is currently in the success state
24788 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
24791 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
24793 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
24796 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
24797 * but with all dynamically-allocated buffers duplicated in new buffers.
24799 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
24802 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
24804 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
24807 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
24809 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
24812 * Checks if the given object is currently in the success state
24814 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
24817 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
24819 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
24822 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
24823 * but with all dynamically-allocated buffers duplicated in new buffers.
24825 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
24828 * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state.
24830 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_ok(struct LDKChannelReady o);
24833 * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state.
24835 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_err(struct LDKDecodeError e);
24838 * Checks if the given object is currently in the success state
24840 bool CResult_ChannelReadyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR o);
24843 * Frees any resources used by the CResult_ChannelReadyDecodeErrorZ.
24845 void CResult_ChannelReadyDecodeErrorZ_free(struct LDKCResult_ChannelReadyDecodeErrorZ _res);
24848 * Creates a new CResult_ChannelReadyDecodeErrorZ which has the same data as `orig`
24849 * but with all dynamically-allocated buffers duplicated in new buffers.
24851 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_clone(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR orig);
24854 * Creates a new CResult_InitDecodeErrorZ in the success state.
24856 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
24859 * Creates a new CResult_InitDecodeErrorZ in the error state.
24861 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
24864 * Checks if the given object is currently in the success state
24866 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
24869 * Frees any resources used by the CResult_InitDecodeErrorZ.
24871 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
24874 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
24875 * but with all dynamically-allocated buffers duplicated in new buffers.
24877 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
24880 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
24882 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
24885 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
24887 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
24890 * Checks if the given object is currently in the success state
24892 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
24895 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
24897 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
24900 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
24901 * but with all dynamically-allocated buffers duplicated in new buffers.
24903 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
24906 * Creates a new CResult_OpenChannelV2DecodeErrorZ in the success state.
24908 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_ok(struct LDKOpenChannelV2 o);
24911 * Creates a new CResult_OpenChannelV2DecodeErrorZ in the error state.
24913 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
24916 * Checks if the given object is currently in the success state
24918 bool CResult_OpenChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR o);
24921 * Frees any resources used by the CResult_OpenChannelV2DecodeErrorZ.
24923 void CResult_OpenChannelV2DecodeErrorZ_free(struct LDKCResult_OpenChannelV2DecodeErrorZ _res);
24926 * Creates a new CResult_OpenChannelV2DecodeErrorZ which has the same data as `orig`
24927 * but with all dynamically-allocated buffers duplicated in new buffers.
24929 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_clone(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR orig);
24932 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
24934 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
24937 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
24939 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
24942 * Checks if the given object is currently in the success state
24944 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
24947 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
24949 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
24952 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
24953 * but with all dynamically-allocated buffers duplicated in new buffers.
24955 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
24958 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
24960 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
24963 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
24965 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
24968 * Checks if the given object is currently in the success state
24970 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
24973 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
24975 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
24978 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
24979 * but with all dynamically-allocated buffers duplicated in new buffers.
24981 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
24984 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
24986 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
24989 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
24991 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
24994 * Checks if the given object is currently in the success state
24996 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
24999 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
25001 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
25004 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
25005 * but with all dynamically-allocated buffers duplicated in new buffers.
25007 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
25010 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
25012 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
25015 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
25017 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
25020 * Checks if the given object is currently in the success state
25022 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
25025 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
25027 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
25030 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
25031 * but with all dynamically-allocated buffers duplicated in new buffers.
25033 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
25036 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
25038 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
25041 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
25043 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
25046 * Checks if the given object is currently in the success state
25048 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
25051 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
25053 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
25056 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
25057 * but with all dynamically-allocated buffers duplicated in new buffers.
25059 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
25062 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
25064 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
25067 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
25069 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
25072 * Checks if the given object is currently in the success state
25074 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
25077 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
25079 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
25082 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
25083 * but with all dynamically-allocated buffers duplicated in new buffers.
25085 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
25088 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
25090 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
25093 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
25095 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
25098 * Checks if the given object is currently in the success state
25100 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
25103 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
25105 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
25108 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
25109 * but with all dynamically-allocated buffers duplicated in new buffers.
25111 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
25114 * Creates a new CResult_OnionMessageDecodeErrorZ in the success state.
25116 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_ok(struct LDKOnionMessage o);
25119 * Creates a new CResult_OnionMessageDecodeErrorZ in the error state.
25121 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_err(struct LDKDecodeError e);
25124 * Checks if the given object is currently in the success state
25126 bool CResult_OnionMessageDecodeErrorZ_is_ok(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR o);
25129 * Frees any resources used by the CResult_OnionMessageDecodeErrorZ.
25131 void CResult_OnionMessageDecodeErrorZ_free(struct LDKCResult_OnionMessageDecodeErrorZ _res);
25134 * Creates a new CResult_OnionMessageDecodeErrorZ which has the same data as `orig`
25135 * but with all dynamically-allocated buffers duplicated in new buffers.
25137 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_clone(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR orig);
25140 * Creates a new CResult_PingDecodeErrorZ in the success state.
25142 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
25145 * Creates a new CResult_PingDecodeErrorZ in the error state.
25147 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
25150 * Checks if the given object is currently in the success state
25152 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
25155 * Frees any resources used by the CResult_PingDecodeErrorZ.
25157 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
25160 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
25161 * but with all dynamically-allocated buffers duplicated in new buffers.
25163 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
25166 * Creates a new CResult_PongDecodeErrorZ in the success state.
25168 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
25171 * Creates a new CResult_PongDecodeErrorZ in the error state.
25173 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
25176 * Checks if the given object is currently in the success state
25178 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
25181 * Frees any resources used by the CResult_PongDecodeErrorZ.
25183 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
25186 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
25187 * but with all dynamically-allocated buffers duplicated in new buffers.
25189 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
25192 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
25194 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
25197 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
25199 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
25202 * Checks if the given object is currently in the success state
25204 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
25207 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
25209 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
25212 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
25213 * but with all dynamically-allocated buffers duplicated in new buffers.
25215 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
25218 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
25220 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
25223 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
25225 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
25228 * Checks if the given object is currently in the success state
25230 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
25233 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
25235 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
25238 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
25239 * but with all dynamically-allocated buffers duplicated in new buffers.
25241 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
25244 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
25246 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
25249 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
25251 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
25254 * Checks if the given object is currently in the success state
25256 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
25259 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
25261 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
25264 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
25265 * but with all dynamically-allocated buffers duplicated in new buffers.
25267 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
25270 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
25272 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
25275 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
25277 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
25280 * Checks if the given object is currently in the success state
25282 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
25285 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
25287 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
25290 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
25291 * but with all dynamically-allocated buffers duplicated in new buffers.
25293 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
25296 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
25298 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
25301 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
25303 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
25306 * Checks if the given object is currently in the success state
25308 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
25311 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
25313 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
25316 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
25317 * but with all dynamically-allocated buffers duplicated in new buffers.
25319 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
25322 * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
25324 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
25327 * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
25329 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
25332 * Checks if the given object is currently in the success state
25334 bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
25337 * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
25339 void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
25342 * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
25343 * but with all dynamically-allocated buffers duplicated in new buffers.
25345 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
25348 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
25350 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
25353 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
25355 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
25358 * Checks if the given object is currently in the success state
25360 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
25363 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
25365 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
25368 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
25369 * but with all dynamically-allocated buffers duplicated in new buffers.
25371 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
25374 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
25376 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
25379 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
25381 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
25384 * Checks if the given object is currently in the success state
25386 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
25389 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
25391 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
25394 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
25395 * but with all dynamically-allocated buffers duplicated in new buffers.
25397 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
25400 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
25402 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
25405 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
25407 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
25410 * Checks if the given object is currently in the success state
25412 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
25415 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
25417 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
25420 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
25421 * but with all dynamically-allocated buffers duplicated in new buffers.
25423 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
25426 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
25428 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
25431 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
25433 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
25436 * Checks if the given object is currently in the success state
25438 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
25441 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
25443 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
25446 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
25447 * but with all dynamically-allocated buffers duplicated in new buffers.
25449 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
25452 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
25454 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
25457 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
25459 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
25462 * Checks if the given object is currently in the success state
25464 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
25467 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
25469 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
25472 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
25473 * but with all dynamically-allocated buffers duplicated in new buffers.
25475 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
25478 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
25480 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
25483 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
25485 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
25488 * Checks if the given object is currently in the success state
25490 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
25493 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
25495 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
25498 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
25499 * but with all dynamically-allocated buffers duplicated in new buffers.
25501 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
25504 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
25506 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
25509 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
25511 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
25514 * Checks if the given object is currently in the success state
25516 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
25519 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
25521 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
25524 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
25525 * but with all dynamically-allocated buffers duplicated in new buffers.
25527 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
25530 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25532 void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
25535 * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the success state.
25537 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(struct LDKBolt11Invoice o);
25540 * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the error state.
25542 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
25545 * Checks if the given object is currently in the success state
25547 bool CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
25550 * Frees any resources used by the CResult_Bolt11InvoiceSignOrCreationErrorZ.
25552 void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res);
25555 * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ which has the same data as `orig`
25556 * but with all dynamically-allocated buffers duplicated in new buffers.
25558 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
25561 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25563 void CVec_FutureZ_free(struct LDKCVec_FutureZ _res);
25566 * Creates a new CResult_OffersMessageDecodeErrorZ in the success state.
25568 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_ok(struct LDKOffersMessage o);
25571 * Creates a new CResult_OffersMessageDecodeErrorZ in the error state.
25573 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_err(struct LDKDecodeError e);
25576 * Checks if the given object is currently in the success state
25578 bool CResult_OffersMessageDecodeErrorZ_is_ok(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR o);
25581 * Frees any resources used by the CResult_OffersMessageDecodeErrorZ.
25583 void CResult_OffersMessageDecodeErrorZ_free(struct LDKCResult_OffersMessageDecodeErrorZ _res);
25586 * Creates a new CResult_OffersMessageDecodeErrorZ which has the same data as `orig`
25587 * but with all dynamically-allocated buffers duplicated in new buffers.
25589 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_clone(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR orig);
25592 * Constructs a new COption_HTLCClaimZ containing a crate::lightning::ln::chan_utils::HTLCClaim
25594 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_some(enum LDKHTLCClaim o);
25597 * Constructs a new COption_HTLCClaimZ containing nothing
25599 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_none(void);
25602 * Frees any resources associated with the crate::lightning::ln::chan_utils::HTLCClaim, if we are in the Some state
25604 void COption_HTLCClaimZ_free(struct LDKCOption_HTLCClaimZ _res);
25607 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
25609 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
25612 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
25614 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
25617 * Checks if the given object is currently in the success state
25619 bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
25622 * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
25624 void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
25627 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
25628 * but with all dynamically-allocated buffers duplicated in new buffers.
25630 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
25633 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
25635 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
25638 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
25640 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
25643 * Checks if the given object is currently in the success state
25645 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
25648 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
25650 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
25653 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
25654 * but with all dynamically-allocated buffers duplicated in new buffers.
25656 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
25659 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
25661 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
25664 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
25666 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
25669 * Checks if the given object is currently in the success state
25671 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
25674 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
25676 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
25679 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
25680 * but with all dynamically-allocated buffers duplicated in new buffers.
25682 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
25685 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
25687 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
25690 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
25692 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
25695 * Checks if the given object is currently in the success state
25697 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
25700 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
25702 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
25705 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
25706 * but with all dynamically-allocated buffers duplicated in new buffers.
25708 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
25711 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
25713 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
25716 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
25718 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
25721 * Checks if the given object is currently in the success state
25723 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
25726 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
25728 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
25731 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
25732 * but with all dynamically-allocated buffers duplicated in new buffers.
25734 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
25737 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
25739 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
25742 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
25744 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
25747 * Checks if the given object is currently in the success state
25749 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
25752 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
25754 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
25757 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
25758 * but with all dynamically-allocated buffers duplicated in new buffers.
25760 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
25763 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
25765 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
25768 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
25770 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
25773 * Checks if the given object is currently in the success state
25775 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
25778 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
25780 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
25783 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
25784 * but with all dynamically-allocated buffers duplicated in new buffers.
25786 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
25789 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
25791 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
25794 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
25796 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
25799 * Checks if the given object is currently in the success state
25801 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
25804 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
25806 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
25809 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
25810 * but with all dynamically-allocated buffers duplicated in new buffers.
25812 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
25815 * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
25817 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
25820 * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
25822 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
25825 * Checks if the given object is currently in the success state
25827 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
25830 * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
25832 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
25835 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
25837 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
25840 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
25842 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
25845 * Checks if the given object is currently in the success state
25847 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
25850 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
25852 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
25855 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
25856 * but with all dynamically-allocated buffers duplicated in new buffers.
25858 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
25861 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
25863 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
25866 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
25868 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
25871 * Checks if the given object is currently in the success state
25873 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
25876 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
25878 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
25881 * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the success state.
25883 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_ok(struct LDKCVec_ECDSASignatureZ o);
25886 * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the error state.
25888 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_err(void);
25891 * Checks if the given object is currently in the success state
25893 bool CResult_CVec_ECDSASignatureZNoneZ_is_ok(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR o);
25896 * Frees any resources used by the CResult_CVec_ECDSASignatureZNoneZ.
25898 void CResult_CVec_ECDSASignatureZNoneZ_free(struct LDKCResult_CVec_ECDSASignatureZNoneZ _res);
25901 * Creates a new CResult_CVec_ECDSASignatureZNoneZ which has the same data as `orig`
25902 * but with all dynamically-allocated buffers duplicated in new buffers.
25904 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_clone(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR orig);
25907 * Constructs a new COption_usizeZ containing a usize
25909 struct LDKCOption_usizeZ COption_usizeZ_some(uintptr_t o);
25912 * Constructs a new COption_usizeZ containing nothing
25914 struct LDKCOption_usizeZ COption_usizeZ_none(void);
25917 * Frees any resources associated with the usize, if we are in the Some state
25919 void COption_usizeZ_free(struct LDKCOption_usizeZ _res);
25922 * Creates a new COption_usizeZ which has the same data as `orig`
25923 * but with all dynamically-allocated buffers duplicated in new buffers.
25925 struct LDKCOption_usizeZ COption_usizeZ_clone(const struct LDKCOption_usizeZ *NONNULL_PTR orig);
25928 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
25930 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
25933 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
25935 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
25938 * Checks if the given object is currently in the success state
25940 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
25943 * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
25945 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
25948 * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
25949 * but with all dynamically-allocated buffers duplicated in new buffers.
25951 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
25954 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
25956 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
25959 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
25961 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
25964 * Checks if the given object is currently in the success state
25966 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
25969 * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
25971 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
25974 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
25975 * but with all dynamically-allocated buffers duplicated in new buffers.
25977 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
25980 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state.
25982 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o);
25985 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state.
25987 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e);
25990 * Checks if the given object is currently in the success state
25992 bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o);
25995 * Frees any resources used by the CResult_PaymentPurposeDecodeErrorZ.
25997 void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res);
26000 * Creates a new CResult_PaymentPurposeDecodeErrorZ which has the same data as `orig`
26001 * but with all dynamically-allocated buffers duplicated in new buffers.
26003 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig);
26006 * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the success state.
26008 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_ok(struct LDKClaimedHTLC o);
26011 * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the error state.
26013 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
26016 * Checks if the given object is currently in the success state
26018 bool CResult_ClaimedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR o);
26021 * Frees any resources used by the CResult_ClaimedHTLCDecodeErrorZ.
26023 void CResult_ClaimedHTLCDecodeErrorZ_free(struct LDKCResult_ClaimedHTLCDecodeErrorZ _res);
26026 * Creates a new CResult_ClaimedHTLCDecodeErrorZ which has the same data as `orig`
26027 * but with all dynamically-allocated buffers duplicated in new buffers.
26029 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_clone(const struct LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR orig);
26032 * Constructs a new COption_PathFailureZ containing a crate::lightning::events::PathFailure
26034 struct LDKCOption_PathFailureZ COption_PathFailureZ_some(struct LDKPathFailure o);
26037 * Constructs a new COption_PathFailureZ containing nothing
26039 struct LDKCOption_PathFailureZ COption_PathFailureZ_none(void);
26042 * Frees any resources associated with the crate::lightning::events::PathFailure, if we are in the Some state
26044 void COption_PathFailureZ_free(struct LDKCOption_PathFailureZ _res);
26047 * Creates a new COption_PathFailureZ which has the same data as `orig`
26048 * but with all dynamically-allocated buffers duplicated in new buffers.
26050 struct LDKCOption_PathFailureZ COption_PathFailureZ_clone(const struct LDKCOption_PathFailureZ *NONNULL_PTR orig);
26053 * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the success state.
26055 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_ok(struct LDKCOption_PathFailureZ o);
26058 * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the error state.
26060 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_err(struct LDKDecodeError e);
26063 * Checks if the given object is currently in the success state
26065 bool CResult_COption_PathFailureZDecodeErrorZ_is_ok(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR o);
26068 * Frees any resources used by the CResult_COption_PathFailureZDecodeErrorZ.
26070 void CResult_COption_PathFailureZDecodeErrorZ_free(struct LDKCResult_COption_PathFailureZDecodeErrorZ _res);
26073 * Creates a new CResult_COption_PathFailureZDecodeErrorZ which has the same data as `orig`
26074 * but with all dynamically-allocated buffers duplicated in new buffers.
26076 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_clone(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR orig);
26079 * Constructs a new COption_ClosureReasonZ containing a crate::lightning::events::ClosureReason
26081 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
26084 * Constructs a new COption_ClosureReasonZ containing nothing
26086 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
26089 * Frees any resources associated with the crate::lightning::events::ClosureReason, if we are in the Some state
26091 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
26094 * Creates a new COption_ClosureReasonZ which has the same data as `orig`
26095 * but with all dynamically-allocated buffers duplicated in new buffers.
26097 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
26100 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
26102 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
26105 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
26107 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
26110 * Checks if the given object is currently in the success state
26112 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
26115 * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
26117 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
26120 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
26121 * but with all dynamically-allocated buffers duplicated in new buffers.
26123 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
26126 * Constructs a new COption_HTLCDestinationZ containing a crate::lightning::events::HTLCDestination
26128 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_some(struct LDKHTLCDestination o);
26131 * Constructs a new COption_HTLCDestinationZ containing nothing
26133 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_none(void);
26136 * Frees any resources associated with the crate::lightning::events::HTLCDestination, if we are in the Some state
26138 void COption_HTLCDestinationZ_free(struct LDKCOption_HTLCDestinationZ _res);
26141 * Creates a new COption_HTLCDestinationZ which has the same data as `orig`
26142 * but with all dynamically-allocated buffers duplicated in new buffers.
26144 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_clone(const struct LDKCOption_HTLCDestinationZ *NONNULL_PTR orig);
26147 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the success state.
26149 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_ok(struct LDKCOption_HTLCDestinationZ o);
26152 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the error state.
26154 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_err(struct LDKDecodeError e);
26157 * Checks if the given object is currently in the success state
26159 bool CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR o);
26162 * Frees any resources used by the CResult_COption_HTLCDestinationZDecodeErrorZ.
26164 void CResult_COption_HTLCDestinationZDecodeErrorZ_free(struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res);
26167 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ which has the same data as `orig`
26168 * but with all dynamically-allocated buffers duplicated in new buffers.
26170 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig);
26173 * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the success state.
26175 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_ok(enum LDKPaymentFailureReason o);
26178 * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the error state.
26180 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_err(struct LDKDecodeError e);
26183 * Checks if the given object is currently in the success state
26185 bool CResult_PaymentFailureReasonDecodeErrorZ_is_ok(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR o);
26188 * Frees any resources used by the CResult_PaymentFailureReasonDecodeErrorZ.
26190 void CResult_PaymentFailureReasonDecodeErrorZ_free(struct LDKCResult_PaymentFailureReasonDecodeErrorZ _res);
26193 * Creates a new CResult_PaymentFailureReasonDecodeErrorZ which has the same data as `orig`
26194 * but with all dynamically-allocated buffers duplicated in new buffers.
26196 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_clone(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR orig);
26199 * Constructs a new COption_U128Z containing a crate::c_types::U128
26201 struct LDKCOption_U128Z COption_U128Z_some(struct LDKU128 o);
26204 * Constructs a new COption_U128Z containing nothing
26206 struct LDKCOption_U128Z COption_U128Z_none(void);
26209 * Frees any resources associated with the crate::c_types::U128, if we are in the Some state
26211 void COption_U128Z_free(struct LDKCOption_U128Z _res);
26214 * Creates a new COption_U128Z which has the same data as `orig`
26215 * but with all dynamically-allocated buffers duplicated in new buffers.
26217 struct LDKCOption_U128Z COption_U128Z_clone(const struct LDKCOption_U128Z *NONNULL_PTR orig);
26220 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26222 void CVec_ClaimedHTLCZ_free(struct LDKCVec_ClaimedHTLCZ _res);
26225 * Constructs a new COption_PaymentFailureReasonZ containing a crate::lightning::events::PaymentFailureReason
26227 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_some(enum LDKPaymentFailureReason o);
26230 * Constructs a new COption_PaymentFailureReasonZ containing nothing
26232 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_none(void);
26235 * Frees any resources associated with the crate::lightning::events::PaymentFailureReason, if we are in the Some state
26237 void COption_PaymentFailureReasonZ_free(struct LDKCOption_PaymentFailureReasonZ _res);
26240 * Creates a new COption_PaymentFailureReasonZ which has the same data as `orig`
26241 * but with all dynamically-allocated buffers duplicated in new buffers.
26243 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_clone(const struct LDKCOption_PaymentFailureReasonZ *NONNULL_PTR orig);
26246 * Constructs a new COption_EventZ containing a crate::lightning::events::Event
26248 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
26251 * Constructs a new COption_EventZ containing nothing
26253 struct LDKCOption_EventZ COption_EventZ_none(void);
26256 * Frees any resources associated with the crate::lightning::events::Event, if we are in the Some state
26258 void COption_EventZ_free(struct LDKCOption_EventZ _res);
26261 * Creates a new COption_EventZ which has the same data as `orig`
26262 * but with all dynamically-allocated buffers duplicated in new buffers.
26264 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
26267 * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
26269 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
26272 * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
26274 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
26277 * Checks if the given object is currently in the success state
26279 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
26282 * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
26284 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
26287 * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
26288 * but with all dynamically-allocated buffers duplicated in new buffers.
26290 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
26293 * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the success state.
26295 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_ok(enum LDKSiPrefix o);
26298 * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the error state.
26300 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
26303 * Checks if the given object is currently in the success state
26305 bool CResult_SiPrefixBolt11ParseErrorZ_is_ok(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR o);
26308 * Frees any resources used by the CResult_SiPrefixBolt11ParseErrorZ.
26310 void CResult_SiPrefixBolt11ParseErrorZ_free(struct LDKCResult_SiPrefixBolt11ParseErrorZ _res);
26313 * Creates a new CResult_SiPrefixBolt11ParseErrorZ which has the same data as `orig`
26314 * but with all dynamically-allocated buffers duplicated in new buffers.
26316 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_clone(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR orig);
26319 * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the success state.
26321 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(struct LDKBolt11Invoice o);
26324 * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the error state.
26326 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e);
26329 * Checks if the given object is currently in the success state
26331 bool CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR o);
26334 * Frees any resources used by the CResult_Bolt11InvoiceParseOrSemanticErrorZ.
26336 void CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ _res);
26339 * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ which has the same data as `orig`
26340 * but with all dynamically-allocated buffers duplicated in new buffers.
26342 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig);
26345 * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the success state.
26347 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(struct LDKSignedRawBolt11Invoice o);
26350 * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the error state.
26352 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
26355 * Checks if the given object is currently in the success state
26357 bool CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR o);
26360 * Frees any resources used by the CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ.
26362 void CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ _res);
26365 * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ which has the same data as `orig`
26366 * but with all dynamically-allocated buffers duplicated in new buffers.
26368 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR orig);
26371 * Creates a new tuple which has the same data as `orig`
26372 * but with all dynamically-allocated buffers duplicated in new buffers.
26374 struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ *NONNULL_PTR orig);
26377 * Creates a new C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ from the contained elements.
26379 struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(struct LDKRawBolt11Invoice a, struct LDKThirtyTwoBytes b, struct LDKBolt11InvoiceSignature c);
26382 * Frees any resources used by the C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.
26384 void C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ _res);
26387 * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the success state.
26389 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_ok(struct LDKPayeePubKey o);
26392 * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the error state.
26394 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
26397 * Checks if the given object is currently in the success state
26399 bool CResult_PayeePubKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR o);
26402 * Frees any resources used by the CResult_PayeePubKeySecp256k1ErrorZ.
26404 void CResult_PayeePubKeySecp256k1ErrorZ_free(struct LDKCResult_PayeePubKeySecp256k1ErrorZ _res);
26407 * Creates a new CResult_PayeePubKeySecp256k1ErrorZ which has the same data as `orig`
26408 * but with all dynamically-allocated buffers duplicated in new buffers.
26410 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_clone(const struct LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR orig);
26413 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26415 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
26418 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
26420 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
26423 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
26425 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
26428 * Checks if the given object is currently in the success state
26430 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
26433 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
26435 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
26438 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
26439 * but with all dynamically-allocated buffers duplicated in new buffers.
26441 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
26444 * Creates a new CResult_NoneBolt11SemanticErrorZ in the success state.
26446 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_ok(void);
26449 * Creates a new CResult_NoneBolt11SemanticErrorZ in the error state.
26451 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
26454 * Checks if the given object is currently in the success state
26456 bool CResult_NoneBolt11SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR o);
26459 * Frees any resources used by the CResult_NoneBolt11SemanticErrorZ.
26461 void CResult_NoneBolt11SemanticErrorZ_free(struct LDKCResult_NoneBolt11SemanticErrorZ _res);
26464 * Creates a new CResult_NoneBolt11SemanticErrorZ which has the same data as `orig`
26465 * but with all dynamically-allocated buffers duplicated in new buffers.
26467 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_clone(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR orig);
26470 * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the success state.
26472 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(struct LDKBolt11Invoice o);
26475 * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the error state.
26477 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
26480 * Checks if the given object is currently in the success state
26482 bool CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR o);
26485 * Frees any resources used by the CResult_Bolt11InvoiceBolt11SemanticErrorZ.
26487 void CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ _res);
26490 * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ which has the same data as `orig`
26491 * but with all dynamically-allocated buffers duplicated in new buffers.
26493 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR orig);
26496 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
26498 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
26501 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
26503 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
26506 * Checks if the given object is currently in the success state
26508 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
26511 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
26513 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
26516 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
26517 * but with all dynamically-allocated buffers duplicated in new buffers.
26519 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
26522 * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
26524 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
26527 * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
26529 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
26532 * Checks if the given object is currently in the success state
26534 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
26537 * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
26539 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
26542 * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
26543 * but with all dynamically-allocated buffers duplicated in new buffers.
26545 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
26548 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
26550 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
26553 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
26555 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
26558 * Checks if the given object is currently in the success state
26560 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
26563 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
26565 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
26568 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
26569 * but with all dynamically-allocated buffers duplicated in new buffers.
26571 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
26574 * Creates a new CResult_BigSizeDecodeErrorZ in the success state.
26576 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_ok(struct LDKBigSize o);
26579 * Creates a new CResult_BigSizeDecodeErrorZ in the error state.
26581 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_err(struct LDKDecodeError e);
26584 * Checks if the given object is currently in the success state
26586 bool CResult_BigSizeDecodeErrorZ_is_ok(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR o);
26589 * Frees any resources used by the CResult_BigSizeDecodeErrorZ.
26591 void CResult_BigSizeDecodeErrorZ_free(struct LDKCResult_BigSizeDecodeErrorZ _res);
26594 * Creates a new CResult_BigSizeDecodeErrorZ which has the same data as `orig`
26595 * but with all dynamically-allocated buffers duplicated in new buffers.
26597 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_clone(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR orig);
26600 * Creates a new CResult_HostnameDecodeErrorZ in the success state.
26602 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_ok(struct LDKHostname o);
26605 * Creates a new CResult_HostnameDecodeErrorZ in the error state.
26607 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_err(struct LDKDecodeError e);
26610 * Checks if the given object is currently in the success state
26612 bool CResult_HostnameDecodeErrorZ_is_ok(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR o);
26615 * Frees any resources used by the CResult_HostnameDecodeErrorZ.
26617 void CResult_HostnameDecodeErrorZ_free(struct LDKCResult_HostnameDecodeErrorZ _res);
26620 * Creates a new CResult_HostnameDecodeErrorZ which has the same data as `orig`
26621 * but with all dynamically-allocated buffers duplicated in new buffers.
26623 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_clone(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR orig);
26626 * Creates a new CResult_TransactionU16LenLimitedNoneZ in the success state.
26628 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_ok(struct LDKTransactionU16LenLimited o);
26631 * Creates a new CResult_TransactionU16LenLimitedNoneZ in the error state.
26633 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_err(void);
26636 * Checks if the given object is currently in the success state
26638 bool CResult_TransactionU16LenLimitedNoneZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR o);
26641 * Frees any resources used by the CResult_TransactionU16LenLimitedNoneZ.
26643 void CResult_TransactionU16LenLimitedNoneZ_free(struct LDKCResult_TransactionU16LenLimitedNoneZ _res);
26646 * Creates a new CResult_TransactionU16LenLimitedNoneZ which has the same data as `orig`
26647 * but with all dynamically-allocated buffers duplicated in new buffers.
26649 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_clone(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR orig);
26652 * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the success state.
26654 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_ok(struct LDKTransactionU16LenLimited o);
26657 * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the error state.
26659 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_err(struct LDKDecodeError e);
26662 * Checks if the given object is currently in the success state
26664 bool CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR o);
26667 * Frees any resources used by the CResult_TransactionU16LenLimitedDecodeErrorZ.
26669 void CResult_TransactionU16LenLimitedDecodeErrorZ_free(struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ _res);
26672 * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ which has the same data as `orig`
26673 * but with all dynamically-allocated buffers duplicated in new buffers.
26675 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_clone(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR orig);
26678 * Creates a new CResult_UntrustedStringDecodeErrorZ in the success state.
26680 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_ok(struct LDKUntrustedString o);
26683 * Creates a new CResult_UntrustedStringDecodeErrorZ in the error state.
26685 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_err(struct LDKDecodeError e);
26688 * Checks if the given object is currently in the success state
26690 bool CResult_UntrustedStringDecodeErrorZ_is_ok(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR o);
26693 * Frees any resources used by the CResult_UntrustedStringDecodeErrorZ.
26695 void CResult_UntrustedStringDecodeErrorZ_free(struct LDKCResult_UntrustedStringDecodeErrorZ _res);
26698 * Creates a new CResult_UntrustedStringDecodeErrorZ which has the same data as `orig`
26699 * but with all dynamically-allocated buffers duplicated in new buffers.
26701 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_clone(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR orig);
26704 * Creates a new CResult_ReceiveTlvsDecodeErrorZ in the success state.
26706 struct LDKCResult_ReceiveTlvsDecodeErrorZ CResult_ReceiveTlvsDecodeErrorZ_ok(struct LDKReceiveTlvs o);
26709 * Creates a new CResult_ReceiveTlvsDecodeErrorZ in the error state.
26711 struct LDKCResult_ReceiveTlvsDecodeErrorZ CResult_ReceiveTlvsDecodeErrorZ_err(struct LDKDecodeError e);
26714 * Checks if the given object is currently in the success state
26716 bool CResult_ReceiveTlvsDecodeErrorZ_is_ok(const struct LDKCResult_ReceiveTlvsDecodeErrorZ *NONNULL_PTR o);
26719 * Frees any resources used by the CResult_ReceiveTlvsDecodeErrorZ.
26721 void CResult_ReceiveTlvsDecodeErrorZ_free(struct LDKCResult_ReceiveTlvsDecodeErrorZ _res);
26724 * Creates a new CResult_ReceiveTlvsDecodeErrorZ which has the same data as `orig`
26725 * but with all dynamically-allocated buffers duplicated in new buffers.
26727 struct LDKCResult_ReceiveTlvsDecodeErrorZ CResult_ReceiveTlvsDecodeErrorZ_clone(const struct LDKCResult_ReceiveTlvsDecodeErrorZ *NONNULL_PTR orig);
26730 * Creates a new CResult_PaymentRelayDecodeErrorZ in the success state.
26732 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_ok(struct LDKPaymentRelay o);
26735 * Creates a new CResult_PaymentRelayDecodeErrorZ in the error state.
26737 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_err(struct LDKDecodeError e);
26740 * Checks if the given object is currently in the success state
26742 bool CResult_PaymentRelayDecodeErrorZ_is_ok(const struct LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR o);
26745 * Frees any resources used by the CResult_PaymentRelayDecodeErrorZ.
26747 void CResult_PaymentRelayDecodeErrorZ_free(struct LDKCResult_PaymentRelayDecodeErrorZ _res);
26750 * Creates a new CResult_PaymentRelayDecodeErrorZ which has the same data as `orig`
26751 * but with all dynamically-allocated buffers duplicated in new buffers.
26753 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_clone(const struct LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR orig);
26756 * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the success state.
26758 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_ok(struct LDKPaymentConstraints o);
26761 * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the error state.
26763 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_err(struct LDKDecodeError e);
26766 * Checks if the given object is currently in the success state
26768 bool CResult_PaymentConstraintsDecodeErrorZ_is_ok(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR o);
26771 * Frees any resources used by the CResult_PaymentConstraintsDecodeErrorZ.
26773 void CResult_PaymentConstraintsDecodeErrorZ_free(struct LDKCResult_PaymentConstraintsDecodeErrorZ _res);
26776 * Creates a new CResult_PaymentConstraintsDecodeErrorZ which has the same data as `orig`
26777 * but with all dynamically-allocated buffers duplicated in new buffers.
26779 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_clone(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR orig);
26782 * Creates a new CResult_ThirtyTwoBytesPaymentErrorZ in the success state.
26784 struct LDKCResult_ThirtyTwoBytesPaymentErrorZ CResult_ThirtyTwoBytesPaymentErrorZ_ok(struct LDKThirtyTwoBytes o);
26787 * Creates a new CResult_ThirtyTwoBytesPaymentErrorZ in the error state.
26789 struct LDKCResult_ThirtyTwoBytesPaymentErrorZ CResult_ThirtyTwoBytesPaymentErrorZ_err(struct LDKPaymentError e);
26792 * Checks if the given object is currently in the success state
26794 bool CResult_ThirtyTwoBytesPaymentErrorZ_is_ok(const struct LDKCResult_ThirtyTwoBytesPaymentErrorZ *NONNULL_PTR o);
26797 * Frees any resources used by the CResult_ThirtyTwoBytesPaymentErrorZ.
26799 void CResult_ThirtyTwoBytesPaymentErrorZ_free(struct LDKCResult_ThirtyTwoBytesPaymentErrorZ _res);
26802 * Creates a new CResult_ThirtyTwoBytesPaymentErrorZ which has the same data as `orig`
26803 * but with all dynamically-allocated buffers duplicated in new buffers.
26805 struct LDKCResult_ThirtyTwoBytesPaymentErrorZ CResult_ThirtyTwoBytesPaymentErrorZ_clone(const struct LDKCResult_ThirtyTwoBytesPaymentErrorZ *NONNULL_PTR orig);
26808 * Creates a new CResult_NonePaymentErrorZ in the success state.
26810 struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_ok(void);
26813 * Creates a new CResult_NonePaymentErrorZ in the error state.
26815 struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_err(struct LDKPaymentError e);
26818 * Checks if the given object is currently in the success state
26820 bool CResult_NonePaymentErrorZ_is_ok(const struct LDKCResult_NonePaymentErrorZ *NONNULL_PTR o);
26823 * Frees any resources used by the CResult_NonePaymentErrorZ.
26825 void CResult_NonePaymentErrorZ_free(struct LDKCResult_NonePaymentErrorZ _res);
26828 * Creates a new CResult_NonePaymentErrorZ which has the same data as `orig`
26829 * but with all dynamically-allocated buffers duplicated in new buffers.
26831 struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_clone(const struct LDKCResult_NonePaymentErrorZ *NONNULL_PTR orig);
26834 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ in the success state.
26836 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ o);
26839 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ in the error state.
26841 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_err(struct LDKProbingError e);
26844 * Checks if the given object is currently in the success state
26846 bool CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ *NONNULL_PTR o);
26849 * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ.
26851 void CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ _res);
26854 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ which has the same data as `orig`
26855 * but with all dynamically-allocated buffers duplicated in new buffers.
26857 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ *NONNULL_PTR orig);
26860 * Creates a new CResult_StrSecp256k1ErrorZ in the success state.
26862 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_ok(struct LDKStr o);
26865 * Creates a new CResult_StrSecp256k1ErrorZ in the error state.
26867 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
26870 * Checks if the given object is currently in the success state
26872 bool CResult_StrSecp256k1ErrorZ_is_ok(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR o);
26875 * Frees any resources used by the CResult_StrSecp256k1ErrorZ.
26877 void CResult_StrSecp256k1ErrorZ_free(struct LDKCResult_StrSecp256k1ErrorZ _res);
26880 * Creates a new CResult_StrSecp256k1ErrorZ which has the same data as `orig`
26881 * but with all dynamically-allocated buffers duplicated in new buffers.
26883 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_clone(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR orig);
26886 * Creates a new CResult_TxOutUtxoLookupErrorZ in the success state.
26888 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_ok(struct LDKTxOut o);
26891 * Creates a new CResult_TxOutUtxoLookupErrorZ in the error state.
26893 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_err(enum LDKUtxoLookupError e);
26896 * Checks if the given object is currently in the success state
26898 bool CResult_TxOutUtxoLookupErrorZ_is_ok(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR o);
26901 * Frees any resources used by the CResult_TxOutUtxoLookupErrorZ.
26903 void CResult_TxOutUtxoLookupErrorZ_free(struct LDKCResult_TxOutUtxoLookupErrorZ _res);
26906 * Creates a new CResult_TxOutUtxoLookupErrorZ which has the same data as `orig`
26907 * but with all dynamically-allocated buffers duplicated in new buffers.
26909 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_clone(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR orig);
26912 * Creates a new CResult_OnionMessagePathNoneZ in the success state.
26914 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_ok(struct LDKOnionMessagePath o);
26917 * Creates a new CResult_OnionMessagePathNoneZ in the error state.
26919 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_err(void);
26922 * Checks if the given object is currently in the success state
26924 bool CResult_OnionMessagePathNoneZ_is_ok(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR o);
26927 * Frees any resources used by the CResult_OnionMessagePathNoneZ.
26929 void CResult_OnionMessagePathNoneZ_free(struct LDKCResult_OnionMessagePathNoneZ _res);
26932 * Creates a new CResult_OnionMessagePathNoneZ which has the same data as `orig`
26933 * but with all dynamically-allocated buffers duplicated in new buffers.
26935 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_clone(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR orig);
26938 * Creates a new tuple which has the same data as `orig`
26939 * but with all dynamically-allocated buffers duplicated in new buffers.
26941 struct LDKC2Tuple_PublicKeyOnionMessageZ C2Tuple_PublicKeyOnionMessageZ_clone(const struct LDKC2Tuple_PublicKeyOnionMessageZ *NONNULL_PTR orig);
26944 * Creates a new C2Tuple_PublicKeyOnionMessageZ from the contained elements.
26946 struct LDKC2Tuple_PublicKeyOnionMessageZ C2Tuple_PublicKeyOnionMessageZ_new(struct LDKPublicKey a, struct LDKOnionMessage b);
26949 * Frees any resources used by the C2Tuple_PublicKeyOnionMessageZ.
26951 void C2Tuple_PublicKeyOnionMessageZ_free(struct LDKC2Tuple_PublicKeyOnionMessageZ _res);
26954 * Creates a new CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ in the success state.
26956 struct LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_ok(struct LDKC2Tuple_PublicKeyOnionMessageZ o);
26959 * Creates a new CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ in the error state.
26961 struct LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_err(struct LDKSendError e);
26964 * Checks if the given object is currently in the success state
26966 bool CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_is_ok(const struct LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ *NONNULL_PTR o);
26969 * Frees any resources used by the CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ.
26971 void CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_free(struct LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ _res);
26974 * Creates a new CResult_PeeledOnionNoneZ in the success state.
26976 struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_ok(struct LDKPeeledOnion o);
26979 * Creates a new CResult_PeeledOnionNoneZ in the error state.
26981 struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_err(void);
26984 * Checks if the given object is currently in the success state
26986 bool CResult_PeeledOnionNoneZ_is_ok(const struct LDKCResult_PeeledOnionNoneZ *NONNULL_PTR o);
26989 * Frees any resources used by the CResult_PeeledOnionNoneZ.
26991 void CResult_PeeledOnionNoneZ_free(struct LDKCResult_PeeledOnionNoneZ _res);
26994 * Creates a new CResult_NoneSendErrorZ in the success state.
26996 struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_ok(void);
26999 * Creates a new CResult_NoneSendErrorZ in the error state.
27001 struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_err(struct LDKSendError e);
27004 * Checks if the given object is currently in the success state
27006 bool CResult_NoneSendErrorZ_is_ok(const struct LDKCResult_NoneSendErrorZ *NONNULL_PTR o);
27009 * Frees any resources used by the CResult_NoneSendErrorZ.
27011 void CResult_NoneSendErrorZ_free(struct LDKCResult_NoneSendErrorZ _res);
27014 * Creates a new CResult_BlindedPathNoneZ in the success state.
27016 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_ok(struct LDKBlindedPath o);
27019 * Creates a new CResult_BlindedPathNoneZ in the error state.
27021 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_err(void);
27024 * Checks if the given object is currently in the success state
27026 bool CResult_BlindedPathNoneZ_is_ok(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR o);
27029 * Frees any resources used by the CResult_BlindedPathNoneZ.
27031 void CResult_BlindedPathNoneZ_free(struct LDKCResult_BlindedPathNoneZ _res);
27034 * Creates a new CResult_BlindedPathNoneZ which has the same data as `orig`
27035 * but with all dynamically-allocated buffers duplicated in new buffers.
27037 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_clone(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR orig);
27040 * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the success state.
27042 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ o);
27045 * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the error state.
27047 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err(void);
27050 * Checks if the given object is currently in the success state
27052 bool CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR o);
27055 * Frees any resources used by the CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.
27057 void CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ _res);
27060 * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ which has the same data as `orig`
27061 * but with all dynamically-allocated buffers duplicated in new buffers.
27063 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR orig);
27066 * Creates a new CResult_BlindedPathDecodeErrorZ in the success state.
27068 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_ok(struct LDKBlindedPath o);
27071 * Creates a new CResult_BlindedPathDecodeErrorZ in the error state.
27073 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_err(struct LDKDecodeError e);
27076 * Checks if the given object is currently in the success state
27078 bool CResult_BlindedPathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR o);
27081 * Frees any resources used by the CResult_BlindedPathDecodeErrorZ.
27083 void CResult_BlindedPathDecodeErrorZ_free(struct LDKCResult_BlindedPathDecodeErrorZ _res);
27086 * Creates a new CResult_BlindedPathDecodeErrorZ which has the same data as `orig`
27087 * but with all dynamically-allocated buffers duplicated in new buffers.
27089 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_clone(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR orig);
27092 * Creates a new CResult_BlindedHopDecodeErrorZ in the success state.
27094 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o);
27097 * Creates a new CResult_BlindedHopDecodeErrorZ in the error state.
27099 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e);
27102 * Checks if the given object is currently in the success state
27104 bool CResult_BlindedHopDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR o);
27107 * Frees any resources used by the CResult_BlindedHopDecodeErrorZ.
27109 void CResult_BlindedHopDecodeErrorZ_free(struct LDKCResult_BlindedHopDecodeErrorZ _res);
27112 * Creates a new CResult_BlindedHopDecodeErrorZ which has the same data as `orig`
27113 * but with all dynamically-allocated buffers duplicated in new buffers.
27115 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_clone(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR orig);
27118 * Creates a new CResult_InvoiceErrorDecodeErrorZ in the success state.
27120 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_ok(struct LDKInvoiceError o);
27123 * Creates a new CResult_InvoiceErrorDecodeErrorZ in the error state.
27125 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_err(struct LDKDecodeError e);
27128 * Checks if the given object is currently in the success state
27130 bool CResult_InvoiceErrorDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR o);
27133 * Frees any resources used by the CResult_InvoiceErrorDecodeErrorZ.
27135 void CResult_InvoiceErrorDecodeErrorZ_free(struct LDKCResult_InvoiceErrorDecodeErrorZ _res);
27138 * Creates a new CResult_InvoiceErrorDecodeErrorZ which has the same data as `orig`
27139 * but with all dynamically-allocated buffers duplicated in new buffers.
27141 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_clone(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR orig);
27144 * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
27146 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
27149 * Constructs a new COption_FilterZ containing nothing
27151 struct LDKCOption_FilterZ COption_FilterZ_none(void);
27154 * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
27156 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
27159 * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
27161 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
27164 * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
27166 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
27169 * Checks if the given object is currently in the success state
27171 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
27174 * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
27176 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
27179 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27181 void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res);
27184 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27186 void CVec_MonitorUpdateIdZ_free(struct LDKCVec_MonitorUpdateIdZ _res);
27189 * Creates a new tuple which has the same data as `orig`
27190 * but with all dynamically-allocated buffers duplicated in new buffers.
27192 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR orig);
27195 * Creates a new C2Tuple_OutPointCVec_MonitorUpdateIdZZ from the contained elements.
27197 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorUpdateIdZ b);
27200 * Frees any resources used by the C2Tuple_OutPointCVec_MonitorUpdateIdZZ.
27202 void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res);
27205 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27207 void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res);
27210 * Frees any resources used by the APIError
27212 void APIError_free(struct LDKAPIError this_ptr);
27215 * Creates a copy of the APIError
27217 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
27220 * Utility method to constructs a new APIMisuseError-variant APIError
27222 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
27225 * Utility method to constructs a new FeeRateTooHigh-variant APIError
27227 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
27230 * Utility method to constructs a new InvalidRoute-variant APIError
27232 struct LDKAPIError APIError_invalid_route(struct LDKStr err);
27235 * Utility method to constructs a new ChannelUnavailable-variant APIError
27237 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
27240 * Utility method to constructs a new MonitorUpdateInProgress-variant APIError
27242 struct LDKAPIError APIError_monitor_update_in_progress(void);
27245 * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
27247 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
27250 * Checks if two APIErrors contain equal inner contents.
27251 * This ignores pointers and is_owned flags and looks at the values in fields.
27253 bool APIError_eq(const struct LDKAPIError *NONNULL_PTR a, const struct LDKAPIError *NONNULL_PTR b);
27256 * Serialize the APIError object into a byte array which can be read by APIError_read
27258 struct LDKCVec_u8Z APIError_write(const struct LDKAPIError *NONNULL_PTR obj);
27261 * Read a APIError from a byte array, created by APIError_write
27263 struct LDKCResult_COption_APIErrorZDecodeErrorZ APIError_read(struct LDKu8slice ser);
27266 * Frees any resources used by the BigSize, if is_owned is set and inner is non-NULL.
27268 void BigSize_free(struct LDKBigSize this_obj);
27270 uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr);
27272 void BigSize_set_a(struct LDKBigSize *NONNULL_PTR this_ptr, uint64_t val);
27275 * Constructs a new BigSize given each field
27277 MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg);
27280 * Creates a copy of the BigSize
27282 struct LDKBigSize BigSize_clone(const struct LDKBigSize *NONNULL_PTR orig);
27285 * Generates a non-cryptographic 64-bit hash of the BigSize.
27287 uint64_t BigSize_hash(const struct LDKBigSize *NONNULL_PTR o);
27290 * Checks if two BigSizes contain equal inner contents.
27291 * This ignores pointers and is_owned flags and looks at the values in fields.
27292 * Two objects with NULL inner values will be considered "equal" here.
27294 bool BigSize_eq(const struct LDKBigSize *NONNULL_PTR a, const struct LDKBigSize *NONNULL_PTR b);
27297 * Serialize the BigSize object into a byte array which can be read by BigSize_read
27299 struct LDKCVec_u8Z BigSize_write(const struct LDKBigSize *NONNULL_PTR obj);
27302 * Read a BigSize from a byte array, created by BigSize_write
27304 struct LDKCResult_BigSizeDecodeErrorZ BigSize_read(struct LDKu8slice ser);
27307 * Frees any resources used by the Hostname, if is_owned is set and inner is non-NULL.
27309 void Hostname_free(struct LDKHostname this_obj);
27312 * Creates a copy of the Hostname
27314 struct LDKHostname Hostname_clone(const struct LDKHostname *NONNULL_PTR orig);
27317 * Checks if two Hostnames contain equal inner contents.
27318 * This ignores pointers and is_owned flags and looks at the values in fields.
27319 * Two objects with NULL inner values will be considered "equal" here.
27321 bool Hostname_eq(const struct LDKHostname *NONNULL_PTR a, const struct LDKHostname *NONNULL_PTR b);
27324 * Returns the length of the hostname.
27326 MUST_USE_RES uint8_t Hostname_len(const struct LDKHostname *NONNULL_PTR this_arg);
27329 * Serialize the Hostname object into a byte array which can be read by Hostname_read
27331 struct LDKCVec_u8Z Hostname_write(const struct LDKHostname *NONNULL_PTR obj);
27334 * Read a Hostname from a byte array, created by Hostname_write
27336 struct LDKCResult_HostnameDecodeErrorZ Hostname_read(struct LDKu8slice ser);
27339 * Frees any resources used by the TransactionU16LenLimited, if is_owned is set and inner is non-NULL.
27341 void TransactionU16LenLimited_free(struct LDKTransactionU16LenLimited this_obj);
27344 * Creates a copy of the TransactionU16LenLimited
27346 struct LDKTransactionU16LenLimited TransactionU16LenLimited_clone(const struct LDKTransactionU16LenLimited *NONNULL_PTR orig);
27349 * Checks if two TransactionU16LenLimiteds contain equal inner contents.
27350 * This ignores pointers and is_owned flags and looks at the values in fields.
27351 * Two objects with NULL inner values will be considered "equal" here.
27353 bool TransactionU16LenLimited_eq(const struct LDKTransactionU16LenLimited *NONNULL_PTR a, const struct LDKTransactionU16LenLimited *NONNULL_PTR b);
27356 * Constructs a new `TransactionU16LenLimited` from a `Transaction` only if it's consensus-
27357 * serialized length is <= u16::MAX.
27359 MUST_USE_RES struct LDKCResult_TransactionU16LenLimitedNoneZ TransactionU16LenLimited_new(struct LDKTransaction transaction);
27362 * Consumes this `TransactionU16LenLimited` and returns its contained `Transaction`.
27364 MUST_USE_RES struct LDKTransaction TransactionU16LenLimited_into_transaction(struct LDKTransactionU16LenLimited this_arg);
27367 * Serialize the TransactionU16LenLimited object into a byte array which can be read by TransactionU16LenLimited_read
27369 struct LDKCVec_u8Z TransactionU16LenLimited_write(const struct LDKTransactionU16LenLimited *NONNULL_PTR obj);
27372 * Read a TransactionU16LenLimited from a byte array, created by TransactionU16LenLimited_write
27374 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ TransactionU16LenLimited_read(struct LDKu8slice ser);
27377 * Creates a digital signature of a message given a SecretKey, like the node's secret.
27378 * 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.
27379 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
27381 struct LDKCResult_StrSecp256k1ErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
27384 * Recovers the PublicKey of the signer of the message given the message and the signature.
27386 struct LDKCResult_PublicKeySecp256k1ErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
27389 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
27390 * and the PublicKey.
27392 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
27395 * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
27397 struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z data_without_signature);
27400 * Calls the free function if one is set
27402 void KVStore_free(struct LDKKVStore this_ptr);
27405 * Calls the free function if one is set
27407 void Persister_free(struct LDKPersister this_ptr);
27410 * Read previously persisted [`ChannelMonitor`]s from the store.
27412 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ read_channel_monitors(struct LDKKVStore kv_store, struct LDKEntropySource entropy_source, struct LDKSignerProvider signer_provider);
27415 * Frees any resources used by the MonitorUpdatingPersister, if is_owned is set and inner is non-NULL.
27417 void MonitorUpdatingPersister_free(struct LDKMonitorUpdatingPersister this_obj);
27420 * Constructs a new [`MonitorUpdatingPersister`].
27422 * The `maximum_pending_updates` parameter controls how many updates may be stored before a
27423 * [`MonitorUpdatingPersister`] consolidates updates by writing a full monitor. Note that
27424 * consolidation will frequently occur with fewer updates than what you set here; this number
27425 * is merely the maximum that may be stored. When setting this value, consider that for higher
27426 * values of `maximum_pending_updates`:
27428 * - [`MonitorUpdatingPersister`] will tend to write more [`ChannelMonitorUpdate`]s than
27429 * [`ChannelMonitor`]s, approaching one [`ChannelMonitor`] write for every
27430 * `maximum_pending_updates` [`ChannelMonitorUpdate`]s.
27431 * - [`MonitorUpdatingPersister`] will issue deletes differently. Lazy deletes will come in
27432 * \"waves\" for each [`ChannelMonitor`] write. A larger `maximum_pending_updates` means bigger,
27433 * less frequent \"waves.\"
27434 * - [`MonitorUpdatingPersister`] will potentially have more listing to do if you need to run
27435 * [`MonitorUpdatingPersister::cleanup_stale_updates`].
27437 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);
27440 * Reads all stored channel monitors, along with any stored updates for them.
27442 * It is extremely important that your [`KVStore::read`] implementation uses the
27443 * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
27444 * documentation for [`MonitorUpdatingPersister`].
27446 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);
27449 * Read a single channel monitor, along with any stored updates for it.
27451 * It is extremely important that your [`KVStore::read`] implementation uses the
27452 * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
27453 * documentation for [`MonitorUpdatingPersister`].
27455 * For `monitor_key`, channel storage keys be the channel's transaction ID and index, or
27456 * [`OutPoint`], with an underscore `_` between them. For example, given:
27458 * - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
27461 * The correct `monitor_key` would be:
27462 * `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
27464 * Loading a large number of monitors will be faster if done in parallel. You can use this
27465 * function to accomplish this. Take care to limit the number of parallel readers.
27467 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);
27470 * Cleans up stale updates for all monitors.
27472 * This function works by first listing all monitors, and then for each of them, listing all
27473 * updates. The updates that have an `update_id` less than or equal to than the stored monitor
27474 * are deleted. The deletion can either be lazy or non-lazy based on the `lazy` flag; this will
27475 * be passed to [`KVStore::remove`].
27477 MUST_USE_RES struct LDKCResult_NoneIOErrorZ MonitorUpdatingPersister_cleanup_stale_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, bool lazy);
27480 * Constructs a new Persist which calls the relevant methods on this_arg.
27481 * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
27483 struct LDKPersist MonitorUpdatingPersister_as_Persist(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg);
27486 * Frees any resources used by the UntrustedString, if is_owned is set and inner is non-NULL.
27488 void UntrustedString_free(struct LDKUntrustedString this_obj);
27490 struct LDKStr UntrustedString_get_a(const struct LDKUntrustedString *NONNULL_PTR this_ptr);
27492 void UntrustedString_set_a(struct LDKUntrustedString *NONNULL_PTR this_ptr, struct LDKStr val);
27495 * Constructs a new UntrustedString given each field
27497 MUST_USE_RES struct LDKUntrustedString UntrustedString_new(struct LDKStr a_arg);
27500 * Creates a copy of the UntrustedString
27502 struct LDKUntrustedString UntrustedString_clone(const struct LDKUntrustedString *NONNULL_PTR orig);
27505 * Checks if two UntrustedStrings contain equal inner contents.
27506 * This ignores pointers and is_owned flags and looks at the values in fields.
27507 * Two objects with NULL inner values will be considered "equal" here.
27509 bool UntrustedString_eq(const struct LDKUntrustedString *NONNULL_PTR a, const struct LDKUntrustedString *NONNULL_PTR b);
27512 * Serialize the UntrustedString object into a byte array which can be read by UntrustedString_read
27514 struct LDKCVec_u8Z UntrustedString_write(const struct LDKUntrustedString *NONNULL_PTR obj);
27517 * Read a UntrustedString from a byte array, created by UntrustedString_write
27519 struct LDKCResult_UntrustedStringDecodeErrorZ UntrustedString_read(struct LDKu8slice ser);
27522 * Frees any resources used by the PrintableString, if is_owned is set and inner is non-NULL.
27524 void PrintableString_free(struct LDKPrintableString this_obj);
27526 struct LDKStr PrintableString_get_a(const struct LDKPrintableString *NONNULL_PTR this_ptr);
27528 void PrintableString_set_a(struct LDKPrintableString *NONNULL_PTR this_ptr, struct LDKStr val);
27531 * Constructs a new PrintableString given each field
27533 MUST_USE_RES struct LDKPrintableString PrintableString_new(struct LDKStr a_arg);
27536 * Calls the free function if one is set
27538 void FutureCallback_free(struct LDKFutureCallback this_ptr);
27541 * Frees any resources used by the Future, if is_owned is set and inner is non-NULL.
27543 void Future_free(struct LDKFuture this_obj);
27546 * Creates a copy of the Future
27548 struct LDKFuture Future_clone(const struct LDKFuture *NONNULL_PTR orig);
27551 * Registers a callback to be called upon completion of this future. If the future has already
27552 * completed, the callback will be called immediately.
27554 void Future_register_callback_fn(const struct LDKFuture *NONNULL_PTR this_arg, struct LDKFutureCallback callback);
27557 * Waits until this [`Future`] completes.
27559 void Future_wait(struct LDKFuture this_arg);
27562 * Waits until this [`Future`] completes or the given amount of time has elapsed.
27564 * Returns true if the [`Future`] completed, false if the time elapsed.
27566 MUST_USE_RES bool Future_wait_timeout(struct LDKFuture this_arg, uint64_t max_wait);
27569 * Frees any resources used by the Sleeper, if is_owned is set and inner is non-NULL.
27571 void Sleeper_free(struct LDKSleeper this_obj);
27574 * Constructs a new sleeper from one future, allowing blocking on it.
27576 MUST_USE_RES struct LDKSleeper Sleeper_from_single_future(struct LDKFuture future);
27579 * Constructs a new sleeper from two futures, allowing blocking on both at once.
27581 MUST_USE_RES struct LDKSleeper Sleeper_from_two_futures(struct LDKFuture fut_a, struct LDKFuture fut_b);
27584 * Constructs a new sleeper on many futures, allowing blocking on all at once.
27586 MUST_USE_RES struct LDKSleeper Sleeper_new(struct LDKCVec_FutureZ futures);
27589 * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed.
27591 void Sleeper_wait(const struct LDKSleeper *NONNULL_PTR this_arg);
27594 * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed or the
27595 * given amount of time has elapsed. Returns true if a [`Future`] completed, false if the time
27598 MUST_USE_RES bool Sleeper_wait_timeout(const struct LDKSleeper *NONNULL_PTR this_arg, uint64_t max_wait);
27601 * Creates a copy of the Level
27603 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
27606 * Utility method to constructs a new Gossip-variant Level
27608 enum LDKLevel Level_gossip(void);
27611 * Utility method to constructs a new Trace-variant Level
27613 enum LDKLevel Level_trace(void);
27616 * Utility method to constructs a new Debug-variant Level
27618 enum LDKLevel Level_debug(void);
27621 * Utility method to constructs a new Info-variant Level
27623 enum LDKLevel Level_info(void);
27626 * Utility method to constructs a new Warn-variant Level
27628 enum LDKLevel Level_warn(void);
27631 * Utility method to constructs a new Error-variant Level
27633 enum LDKLevel Level_error(void);
27636 * Checks if two Levels contain equal inner contents.
27637 * This ignores pointers and is_owned flags and looks at the values in fields.
27639 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
27642 * Generates a non-cryptographic 64-bit hash of the Level.
27644 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
27647 * Returns the most verbose logging level.
27649 MUST_USE_RES enum LDKLevel Level_max(void);
27652 * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
27654 void Record_free(struct LDKRecord this_obj);
27657 * The verbosity level of the message.
27659 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
27662 * The verbosity level of the message.
27664 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
27667 * The message body.
27669 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
27672 * The message body.
27674 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
27677 * The module path of the message.
27679 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
27682 * The module path of the message.
27684 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
27687 * The source file containing the message.
27689 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
27692 * The source file containing the message.
27694 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
27697 * The line containing the message.
27699 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
27702 * The line containing the message.
27704 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
27707 * Creates a copy of the Record
27709 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
27712 * Calls the free function if one is set
27714 void Logger_free(struct LDKLogger this_ptr);
27717 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
27719 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
27722 * Confirmations we will wait for before considering the channel locked in.
27723 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
27724 * equivalent limit applied to outbound channels).
27726 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
27727 * transaction before operation. If you wish to accept channels with zero confirmations, see
27728 * [`UserConfig::manually_accept_inbound_channels`] and
27729 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
27731 * Default value: 6.
27733 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
27734 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
27736 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27739 * Confirmations we will wait for before considering the channel locked in.
27740 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
27741 * equivalent limit applied to outbound channels).
27743 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
27744 * transaction before operation. If you wish to accept channels with zero confirmations, see
27745 * [`UserConfig::manually_accept_inbound_channels`] and
27746 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
27748 * Default value: 6.
27750 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
27751 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
27753 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
27756 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
27757 * the number of blocks we have to punish our counterparty if they broadcast a revoked
27760 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
27761 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
27762 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
27763 * possibly with time in between to RBF the spending transaction).
27765 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
27766 * case of an honest unilateral channel close, which implicitly decrease the economic value of
27769 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
27770 * can tweak config to ask for more security, not less.
27772 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27775 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
27776 * the number of blocks we have to punish our counterparty if they broadcast a revoked
27779 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
27780 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
27781 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
27782 * possibly with time in between to RBF the spending transaction).
27784 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
27785 * case of an honest unilateral channel close, which implicitly decrease the economic value of
27788 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
27789 * can tweak config to ask for more security, not less.
27791 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
27794 * Set to the smallest value HTLC we will accept to process.
27796 * This value is sent to our counterparty on channel-open and we close the channel any time
27797 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
27799 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
27802 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27805 * Set to the smallest value HTLC we will accept to process.
27807 * This value is sent to our counterparty on channel-open and we close the channel any time
27808 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
27810 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
27813 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
27816 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
27819 * This can be set to a value between 1-100, where the value corresponds to the percent of the
27820 * channel value in whole percentages.
27823 * * If configured to another value than the default value 10, any new channels created with
27824 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
27825 * `ChannelManager`.
27827 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
27828 * no way to configure the cap for the total value of outbound HTLCs in-flight.
27830 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
27831 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
27832 * restrict exposure to loss due to being offline for too long.
27833 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
27834 * for more information.
27836 * Default value: 10.
27837 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
27838 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
27840 uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27843 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
27846 * This can be set to a value between 1-100, where the value corresponds to the percent of the
27847 * channel value in whole percentages.
27850 * * If configured to another value than the default value 10, any new channels created with
27851 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
27852 * `ChannelManager`.
27854 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
27855 * no way to configure the cap for the total value of outbound HTLCs in-flight.
27857 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
27858 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
27859 * restrict exposure to loss due to being offline for too long.
27860 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
27861 * for more information.
27863 * Default value: 10.
27864 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
27865 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
27867 void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val);
27870 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
27871 * BOLTs) option for outbound private channels. This provides better privacy by not including
27872 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
27873 * relay HTLCs to us using the channel's SCID alias.
27875 * If this option is set, channels may be created that will not be readable by LDK versions
27876 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
27877 * [`DecodeError::InvalidValue`].
27879 * Note that setting this to true does *not* prevent us from opening channels with
27880 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
27881 * private channel without that option.
27883 * Ignored if the channel is negotiated to be announced, see
27884 * [`ChannelHandshakeConfig::announced_channel`] and
27885 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
27887 * Default value: false. This value is likely to change to true in the future.
27889 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
27890 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
27892 bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27895 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
27896 * BOLTs) option for outbound private channels. This provides better privacy by not including
27897 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
27898 * relay HTLCs to us using the channel's SCID alias.
27900 * If this option is set, channels may be created that will not be readable by LDK versions
27901 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
27902 * [`DecodeError::InvalidValue`].
27904 * Note that setting this to true does *not* prevent us from opening channels with
27905 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
27906 * private channel without that option.
27908 * Ignored if the channel is negotiated to be announced, see
27909 * [`ChannelHandshakeConfig::announced_channel`] and
27910 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
27912 * Default value: false. This value is likely to change to true in the future.
27914 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
27915 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
27917 void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
27920 * Set to announce the channel publicly and notify all nodes that they can route via this
27923 * This should only be set to true for nodes which expect to be online reliably.
27925 * As the node which funds a channel picks this value this will only apply for new outbound
27926 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
27928 * Default value: false.
27930 bool ChannelHandshakeConfig_get_announced_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27933 * Set to announce the channel publicly and notify all nodes that they can route via this
27936 * This should only be set to true for nodes which expect to be online reliably.
27938 * As the node which funds a channel picks this value this will only apply for new outbound
27939 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
27941 * Default value: false.
27943 void ChannelHandshakeConfig_set_announced_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
27946 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
27947 * supports it, they will then enforce the mutual-close output to us matches what we provided
27948 * at intialization, preventing us from closing to an alternate pubkey.
27950 * This is set to true by default to provide a slight increase in security, though ultimately
27951 * any attacker who is able to take control of a channel can just as easily send the funds via
27952 * lightning payments, so we never require that our counterparties support this option.
27954 * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
27956 * Default value: true.
27958 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
27960 bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27963 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
27964 * supports it, they will then enforce the mutual-close output to us matches what we provided
27965 * at intialization, preventing us from closing to an alternate pubkey.
27967 * This is set to true by default to provide a slight increase in security, though ultimately
27968 * any attacker who is able to take control of a channel can just as easily send the funds via
27969 * lightning payments, so we never require that our counterparties support this option.
27971 * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
27973 * Default value: true.
27975 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
27977 void ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
27980 * The Proportion of the channel value to configure as counterparty's channel reserve,
27981 * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
27983 * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
27984 * on their side, at all times.
27985 * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
27986 * claiming at least this value on chain.
27988 * Channel reserve values greater than 30% could be considered highly unreasonable, since that
27989 * amount can never be used for payments.
27990 * Also, if our selected channel reserve for counterparty and counterparty's selected
27991 * channel reserve for us sum up to equal or greater than channel value, channel negotiations
27994 * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
27995 * other than the default value.
27997 * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
27998 * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
27999 * as 1000 sats instead, which is a safe implementation-specific lower bound.
28000 * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
28001 * instead, although channel negotiations will fail in that case.
28003 uint32_t ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
28006 * The Proportion of the channel value to configure as counterparty's channel reserve,
28007 * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
28009 * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
28010 * on their side, at all times.
28011 * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
28012 * claiming at least this value on chain.
28014 * Channel reserve values greater than 30% could be considered highly unreasonable, since that
28015 * amount can never be used for payments.
28016 * Also, if our selected channel reserve for counterparty and counterparty's selected
28017 * channel reserve for us sum up to equal or greater than channel value, channel negotiations
28020 * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
28021 * other than the default value.
28023 * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
28024 * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
28025 * as 1000 sats instead, which is a safe implementation-specific lower bound.
28026 * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
28027 * instead, although channel negotiations will fail in that case.
28029 void ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
28032 * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
28033 * channels. This feature requires having a reserve of onchain funds readily available to bump
28034 * transactions in the event of a channel force close to avoid the possibility of losing funds.
28036 * Note that if you wish accept inbound channels with anchor outputs, you must enable
28037 * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
28038 * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
28039 * whether your reserve of onchain funds is enough to cover the fees for all existing and new
28040 * channels featuring anchor outputs in the event of a force close.
28042 * If this option is set, channels may be created that will not be readable by LDK versions
28043 * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
28044 * [`DecodeError::InvalidValue`].
28046 * Note that setting this to true does *not* prevent us from opening channels with
28047 * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
28048 * fall back to a `static_remote_key` channel.
28050 * LDK will not support the legacy `option_anchors` commitment version due to a discovered
28051 * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
28052 * Considered Harmful`] mailing list post.
28054 * Default value: false. This value is likely to change to true in the future.
28056 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
28057 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
28058 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
28059 * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
28061 bool ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
28064 * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
28065 * channels. This feature requires having a reserve of onchain funds readily available to bump
28066 * transactions in the event of a channel force close to avoid the possibility of losing funds.
28068 * Note that if you wish accept inbound channels with anchor outputs, you must enable
28069 * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
28070 * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
28071 * whether your reserve of onchain funds is enough to cover the fees for all existing and new
28072 * channels featuring anchor outputs in the event of a force close.
28074 * If this option is set, channels may be created that will not be readable by LDK versions
28075 * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
28076 * [`DecodeError::InvalidValue`].
28078 * Note that setting this to true does *not* prevent us from opening channels with
28079 * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
28080 * fall back to a `static_remote_key` channel.
28082 * LDK will not support the legacy `option_anchors` commitment version due to a discovered
28083 * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
28084 * Considered Harmful`] mailing list post.
28086 * Default value: false. This value is likely to change to true in the future.
28088 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
28089 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
28090 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
28091 * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
28093 void ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
28096 * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
28098 * Increasing the value can help improve liquidity and stability in
28099 * routing at the cost of higher long term disk / DB usage.
28101 * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
28102 * other than the default value.
28104 * Default value: 50
28105 * Maximum value: 483, any values larger will be treated as 483.
28106 * This is the BOLT #2 spec limit on `max_accepted_htlcs`.
28108 uint16_t ChannelHandshakeConfig_get_our_max_accepted_htlcs(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
28111 * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
28113 * Increasing the value can help improve liquidity and stability in
28114 * routing at the cost of higher long term disk / DB usage.
28116 * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
28117 * other than the default value.
28119 * Default value: 50
28120 * Maximum value: 483, any values larger will be treated as 483.
28121 * This is the BOLT #2 spec limit on `max_accepted_htlcs`.
28123 void ChannelHandshakeConfig_set_our_max_accepted_htlcs(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
28126 * Constructs a new ChannelHandshakeConfig given each field
28128 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);
28131 * Creates a copy of the ChannelHandshakeConfig
28133 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
28136 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
28138 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
28141 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
28143 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
28146 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
28147 * only applies to inbound channels.
28149 * Default value: 0.
28151 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
28154 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
28155 * only applies to inbound channels.
28157 * Default value: 0.
28159 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
28162 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
28163 * only applies to inbound channels.
28165 * Default value: 2^24 - 1.
28167 uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
28170 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
28171 * only applies to inbound channels.
28173 * Default value: 2^24 - 1.
28175 void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
28178 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
28179 * you to limit the maximum minimum-size they can require.
28181 * Default value: u64::max_value.
28183 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
28186 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
28187 * you to limit the maximum minimum-size they can require.
28189 * Default value: u64::max_value.
28191 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
28194 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
28195 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
28197 * Default value: 0.
28199 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
28202 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
28203 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
28205 * Default value: 0.
28207 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
28210 * The remote node will require we keep a certain amount in direct payment to ourselves at all
28211 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
28212 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
28214 * Default value: u64::max_value.
28216 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
28219 * The remote node will require we keep a certain amount in direct payment to ourselves at all
28220 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
28221 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
28223 * Default value: u64::max_value.
28225 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
28228 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
28229 * time. This allows you to set a minimum such value.
28231 * Default value: 0.
28233 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
28236 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
28237 * time. This allows you to set a minimum such value.
28239 * Default value: 0.
28241 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
28244 * Before a channel is usable the funding transaction will need to be confirmed by at least a
28245 * certain number of blocks, specified by the node which is not the funder (as the funder can
28246 * assume they aren't going to double-spend themselves).
28247 * This config allows you to set a limit on the maximum amount of time to wait.
28249 * Default value: 144, or roughly one day and only applies to outbound channels.
28251 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
28254 * Before a channel is usable the funding transaction will need to be confirmed by at least a
28255 * certain number of blocks, specified by the node which is not the funder (as the funder can
28256 * assume they aren't going to double-spend themselves).
28257 * This config allows you to set a limit on the maximum amount of time to wait.
28259 * Default value: 144, or roughly one day and only applies to outbound channels.
28261 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
28264 * Whether we implicitly trust funding transactions generated by us for our own outbound
28265 * channels to not be double-spent.
28267 * If this is set, we assume that our own funding transactions are *never* double-spent, and
28268 * thus we can trust them without any confirmations. This is generally a reasonable
28269 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
28270 * control of the signing keys).
28272 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
28273 * double-spend the funding transaction to RBF with an alternative channel open.
28275 * This only applies if our counterparty set their confirmations-required value to 0, and we
28276 * always trust our own funding transaction at 1 confirmation irrespective of this value.
28277 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
28278 * `true` (0) and `false` (1).
28280 * Default value: true
28282 bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
28285 * Whether we implicitly trust funding transactions generated by us for our own outbound
28286 * channels to not be double-spent.
28288 * If this is set, we assume that our own funding transactions are *never* double-spent, and
28289 * thus we can trust them without any confirmations. This is generally a reasonable
28290 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
28291 * control of the signing keys).
28293 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
28294 * double-spend the funding transaction to RBF with an alternative channel open.
28296 * This only applies if our counterparty set their confirmations-required value to 0, and we
28297 * always trust our own funding transaction at 1 confirmation irrespective of this value.
28298 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
28299 * `true` (0) and `false` (1).
28301 * Default value: true
28303 void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
28306 * Set to force an incoming channel to match our announced channel preference in
28307 * [`ChannelHandshakeConfig::announced_channel`].
28309 * For a node which is not online reliably, this should be set to true and
28310 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
28311 * channels will ever be opened.
28313 * Default value: true.
28315 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
28318 * Set to force an incoming channel to match our announced channel preference in
28319 * [`ChannelHandshakeConfig::announced_channel`].
28321 * For a node which is not online reliably, this should be set to true and
28322 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
28323 * channels will ever be opened.
28325 * Default value: true.
28327 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
28330 * Set to the amount of time we're willing to wait to claim money back to us.
28332 * Not checking this value would be a security issue, as our peer would be able to set it to
28333 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
28335 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
28336 * reduce the loss of having useless locked funds (if your peer accepts)
28338 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
28341 * Set to the amount of time we're willing to wait to claim money back to us.
28343 * Not checking this value would be a security issue, as our peer would be able to set it to
28344 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
28346 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
28347 * reduce the loss of having useless locked funds (if your peer accepts)
28349 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
28352 * Constructs a new ChannelHandshakeLimits given each field
28354 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);
28357 * Creates a copy of the ChannelHandshakeLimits
28359 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
28362 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
28364 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
28367 * Frees any resources used by the MaxDustHTLCExposure
28369 void MaxDustHTLCExposure_free(struct LDKMaxDustHTLCExposure this_ptr);
28372 * Creates a copy of the MaxDustHTLCExposure
28374 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_clone(const struct LDKMaxDustHTLCExposure *NONNULL_PTR orig);
28377 * Utility method to constructs a new FixedLimitMsat-variant MaxDustHTLCExposure
28379 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fixed_limit_msat(uint64_t a);
28382 * Utility method to constructs a new FeeRateMultiplier-variant MaxDustHTLCExposure
28384 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fee_rate_multiplier(uint64_t a);
28387 * Checks if two MaxDustHTLCExposures contain equal inner contents.
28388 * This ignores pointers and is_owned flags and looks at the values in fields.
28390 bool MaxDustHTLCExposure_eq(const struct LDKMaxDustHTLCExposure *NONNULL_PTR a, const struct LDKMaxDustHTLCExposure *NONNULL_PTR b);
28393 * Serialize the MaxDustHTLCExposure object into a byte array which can be read by MaxDustHTLCExposure_read
28395 struct LDKCVec_u8Z MaxDustHTLCExposure_write(const struct LDKMaxDustHTLCExposure *NONNULL_PTR obj);
28398 * Read a MaxDustHTLCExposure from a byte array, created by MaxDustHTLCExposure_write
28400 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ MaxDustHTLCExposure_read(struct LDKu8slice ser);
28403 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
28405 void ChannelConfig_free(struct LDKChannelConfig this_obj);
28408 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
28409 * over the channel.
28410 * This may be allowed to change at runtime in a later update, however doing so must result in
28411 * update messages sent to notify all nodes of our updated relay fee.
28413 * Default value: 0.
28415 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
28418 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
28419 * over the channel.
28420 * This may be allowed to change at runtime in a later update, however doing so must result in
28421 * update messages sent to notify all nodes of our updated relay fee.
28423 * Default value: 0.
28425 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
28428 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
28429 * excess of [`forwarding_fee_proportional_millionths`].
28430 * This may be allowed to change at runtime in a later update, however doing so must result in
28431 * update messages sent to notify all nodes of our updated relay fee.
28433 * The default value of a single satoshi roughly matches the market rate on many routing nodes
28434 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
28437 * Default value: 1000.
28439 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
28441 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
28444 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
28445 * excess of [`forwarding_fee_proportional_millionths`].
28446 * This may be allowed to change at runtime in a later update, however doing so must result in
28447 * update messages sent to notify all nodes of our updated relay fee.
28449 * The default value of a single satoshi roughly matches the market rate on many routing nodes
28450 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
28453 * Default value: 1000.
28455 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
28457 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
28460 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
28461 * the channel this config applies to.
28463 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
28464 * HTLC balance when a channel appears on-chain whereas
28465 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
28466 * (non-HTLC-encumbered) balance.
28468 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
28469 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
28470 * commitment transaction at least once per this many blocks (minus some margin to allow us
28471 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
28472 * the spending transaction).
28474 * Default value: 72 (12 hours at an average of 6 blocks/hour).
28475 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
28476 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
28478 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
28480 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
28483 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
28484 * the channel this config applies to.
28486 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
28487 * HTLC balance when a channel appears on-chain whereas
28488 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
28489 * (non-HTLC-encumbered) balance.
28491 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
28492 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
28493 * commitment transaction at least once per this many blocks (minus some margin to allow us
28494 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
28495 * the spending transaction).
28497 * Default value: 72 (12 hours at an average of 6 blocks/hour).
28498 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
28499 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
28501 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
28503 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
28506 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
28507 * small to claim on-chain.
28509 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
28510 * not be claimable on-chain, instead being turned into additional miner fees if either
28511 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
28512 * to such payments may be sustantial if there are many dust HTLCs present when the
28513 * channel is force-closed.
28515 * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
28516 * channel negotiated throughout the channel open process, along with the fees required to have
28517 * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
28518 * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
28519 * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
28520 * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
28521 * variant is primarily intended for use with pre-anchor channels.
28523 * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
28524 * exposure across all three types per-channel.
28526 * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 5000.
28528 struct LDKMaxDustHTLCExposure ChannelConfig_get_max_dust_htlc_exposure(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
28531 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
28532 * small to claim on-chain.
28534 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
28535 * not be claimable on-chain, instead being turned into additional miner fees if either
28536 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
28537 * to such payments may be sustantial if there are many dust HTLCs present when the
28538 * channel is force-closed.
28540 * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
28541 * channel negotiated throughout the channel open process, along with the fees required to have
28542 * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
28543 * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
28544 * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
28545 * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
28546 * variant is primarily intended for use with pre-anchor channels.
28548 * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
28549 * exposure across all three types per-channel.
28551 * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 5000.
28553 void ChannelConfig_set_max_dust_htlc_exposure(struct LDKChannelConfig *NONNULL_PTR this_ptr, struct LDKMaxDustHTLCExposure val);
28556 * The additional fee we're willing to pay to avoid waiting for the counterparty's
28557 * `to_self_delay` to reclaim funds.
28559 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
28560 * closing transaction which both sides find acceptable, ultimately paid by the channel
28561 * funder/initiator.
28563 * When we are the funder, because we have to pay the channel closing fee, we bound the
28564 * acceptable fee by our [`ChannelCloseMinimum`] and [`NonAnchorChannelFee`] fees, with the upper bound increased by
28565 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
28566 * [`NonAnchorChannelFee`] feerate during normal operation, this value represents the additional fee we're
28567 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
28570 * When we are not the funder, we require the closing transaction fee pay at least our
28571 * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like.
28572 * Thus, this value is ignored when we are not the funder.
28574 * Default value: 1000 satoshis.
28576 * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
28577 * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
28579 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
28582 * The additional fee we're willing to pay to avoid waiting for the counterparty's
28583 * `to_self_delay` to reclaim funds.
28585 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
28586 * closing transaction which both sides find acceptable, ultimately paid by the channel
28587 * funder/initiator.
28589 * When we are the funder, because we have to pay the channel closing fee, we bound the
28590 * acceptable fee by our [`ChannelCloseMinimum`] and [`NonAnchorChannelFee`] fees, with the upper bound increased by
28591 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
28592 * [`NonAnchorChannelFee`] feerate during normal operation, this value represents the additional fee we're
28593 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
28596 * When we are not the funder, we require the closing transaction fee pay at least our
28597 * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like.
28598 * Thus, this value is ignored when we are not the funder.
28600 * Default value: 1000 satoshis.
28602 * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
28603 * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
28605 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
28608 * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
28609 * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
28612 * - The payee will set this option and set its invoice route hints to use [intercept scids]
28613 * generated by this channel's counterparty.
28614 * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
28615 * [`forward_intercepted_htlc`] with less than the amount provided in
28616 * [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
28617 * actual forward amounts is their fee.
28620 * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
28621 * as-expected if this feature is activated, otherwise they may lose money!
28622 * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
28626 * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
28627 * Unsetting this flag between restarts may lead to payment receive failures.
28629 * Default value: false.
28631 * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
28632 * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
28633 * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
28634 * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
28635 * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
28636 * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
28638 bool ChannelConfig_get_accept_underpaying_htlcs(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
28641 * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
28642 * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
28645 * - The payee will set this option and set its invoice route hints to use [intercept scids]
28646 * generated by this channel's counterparty.
28647 * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
28648 * [`forward_intercepted_htlc`] with less than the amount provided in
28649 * [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
28650 * actual forward amounts is their fee.
28653 * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
28654 * as-expected if this feature is activated, otherwise they may lose money!
28655 * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
28659 * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
28660 * Unsetting this flag between restarts may lead to payment receive failures.
28662 * Default value: false.
28664 * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
28665 * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
28666 * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
28667 * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
28668 * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
28669 * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
28671 void ChannelConfig_set_accept_underpaying_htlcs(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
28674 * Constructs a new ChannelConfig given each field
28676 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);
28679 * Creates a copy of the ChannelConfig
28681 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
28684 * Checks if two ChannelConfigs contain equal inner contents.
28685 * This ignores pointers and is_owned flags and looks at the values in fields.
28686 * Two objects with NULL inner values will be considered "equal" here.
28688 bool ChannelConfig_eq(const struct LDKChannelConfig *NONNULL_PTR a, const struct LDKChannelConfig *NONNULL_PTR b);
28691 * Applies the given [`ChannelConfigUpdate`] as a partial update to the [`ChannelConfig`].
28693 void ChannelConfig_apply(struct LDKChannelConfig *NONNULL_PTR this_arg, const struct LDKChannelConfigUpdate *NONNULL_PTR update);
28696 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
28698 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
28701 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
28703 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
28706 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
28708 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
28711 * Frees any resources used by the ChannelConfigUpdate, if is_owned is set and inner is non-NULL.
28713 void ChannelConfigUpdate_free(struct LDKChannelConfigUpdate this_obj);
28715 struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
28717 void ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
28719 struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_base_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
28721 void ChannelConfigUpdate_set_forwarding_fee_base_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
28723 struct LDKCOption_u16Z ChannelConfigUpdate_get_cltv_expiry_delta(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
28725 void ChannelConfigUpdate_set_cltv_expiry_delta(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
28729 * Returns a copy of the field.
28731 struct LDKCOption_MaxDustHTLCExposureZ ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
28733 void ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_MaxDustHTLCExposureZ val);
28735 struct LDKCOption_u64Z ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
28737 void ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
28740 * Constructs a new ChannelConfigUpdate given each field
28742 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);
28745 * Creates a "default" ChannelConfigUpdate. See struct and individual field documentaiton for details on which values are used.
28747 MUST_USE_RES struct LDKChannelConfigUpdate ChannelConfigUpdate_default(void);
28750 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
28752 void UserConfig_free(struct LDKUserConfig this_obj);
28755 * Channel handshake config that we propose to our counterparty.
28757 struct LDKChannelHandshakeConfig UserConfig_get_channel_handshake_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28760 * Channel handshake config that we propose to our counterparty.
28762 void UserConfig_set_channel_handshake_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
28765 * Limits applied to our counterparty's proposed channel handshake config settings.
28767 struct LDKChannelHandshakeLimits UserConfig_get_channel_handshake_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28770 * Limits applied to our counterparty's proposed channel handshake config settings.
28772 void UserConfig_set_channel_handshake_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
28775 * Channel config which affects behavior during channel lifetime.
28777 struct LDKChannelConfig UserConfig_get_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28780 * Channel config which affects behavior during channel lifetime.
28782 void UserConfig_set_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
28785 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
28786 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
28787 * node which is not online reliably.
28789 * For nodes which are not online reliably, you should set all channels to *not* be announced
28790 * (using [`ChannelHandshakeConfig::announced_channel`] and
28791 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
28792 * ensure you are not exposed to any forwarding risk.
28794 * Note that because you cannot change a channel's announced state after creation, there is no
28795 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
28796 * from a publicly-announced forwarding node to a private non-forwarding node you must close
28797 * all your channels and open new ones. For privacy, you should also change your node_id
28798 * (swapping all private and public key material for new ones) at that time.
28800 * Default value: false.
28802 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28805 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
28806 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
28807 * node which is not online reliably.
28809 * For nodes which are not online reliably, you should set all channels to *not* be announced
28810 * (using [`ChannelHandshakeConfig::announced_channel`] and
28811 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
28812 * ensure you are not exposed to any forwarding risk.
28814 * Note that because you cannot change a channel's announced state after creation, there is no
28815 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
28816 * from a publicly-announced forwarding node to a private non-forwarding node you must close
28817 * all your channels and open new ones. For privacy, you should also change your node_id
28818 * (swapping all private and public key material for new ones) at that time.
28820 * Default value: false.
28822 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
28825 * If this is set to false, we do not accept inbound requests to open a new channel.
28826 * Default value: true.
28828 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28831 * If this is set to false, we do not accept inbound requests to open a new channel.
28832 * Default value: true.
28834 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
28837 * If this is set to true, the user needs to manually accept inbound requests to open a new
28840 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
28841 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
28842 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
28843 * user explicitly chooses to accept the request.
28845 * Default value: false.
28847 * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
28848 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
28849 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
28851 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28854 * If this is set to true, the user needs to manually accept inbound requests to open a new
28857 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
28858 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
28859 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
28860 * user explicitly chooses to accept the request.
28862 * Default value: false.
28864 * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
28865 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
28866 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
28868 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
28871 * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
28872 * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
28873 * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
28875 * Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
28877 * Default value: false.
28879 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
28880 * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
28882 bool UserConfig_get_accept_intercept_htlcs(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28885 * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
28886 * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
28887 * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
28889 * Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
28891 * Default value: false.
28893 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
28894 * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
28896 void UserConfig_set_accept_intercept_htlcs(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
28899 * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
28900 * parts. If this is set to true, we'll accept the payment.
28902 * Setting this to true will break backwards compatibility upon downgrading to an LDK
28903 * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
28904 * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
28906 * Default value: false.
28908 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
28910 bool UserConfig_get_accept_mpp_keysend(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28913 * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
28914 * parts. If this is set to true, we'll accept the payment.
28916 * Setting this to true will break backwards compatibility upon downgrading to an LDK
28917 * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
28918 * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
28920 * Default value: false.
28922 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
28924 void UserConfig_set_accept_mpp_keysend(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
28927 * Constructs a new UserConfig given each field
28929 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);
28932 * Creates a copy of the UserConfig
28934 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
28937 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
28939 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
28942 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
28944 void BestBlock_free(struct LDKBestBlock this_obj);
28947 * Creates a copy of the BestBlock
28949 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
28952 * Checks if two BestBlocks contain equal inner contents.
28953 * This ignores pointers and is_owned flags and looks at the values in fields.
28954 * Two objects with NULL inner values will be considered "equal" here.
28956 bool BestBlock_eq(const struct LDKBestBlock *NONNULL_PTR a, const struct LDKBestBlock *NONNULL_PTR b);
28959 * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
28962 MUST_USE_RES struct LDKBestBlock BestBlock_from_network(enum LDKNetwork network);
28965 * Returns a `BestBlock` as identified by the given block hash and height.
28967 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
28970 * Returns the best block hash.
28972 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
28975 * Returns the best block height.
28977 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
28980 * Calls the free function if one is set
28982 void Listen_free(struct LDKListen this_ptr);
28985 * Calls the free function if one is set
28987 void Confirm_free(struct LDKConfirm this_ptr);
28990 * Creates a copy of the ChannelMonitorUpdateStatus
28992 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_clone(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR orig);
28995 * Utility method to constructs a new Completed-variant ChannelMonitorUpdateStatus
28997 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_completed(void);
29000 * Utility method to constructs a new InProgress-variant ChannelMonitorUpdateStatus
29002 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_in_progress(void);
29005 * Utility method to constructs a new UnrecoverableError-variant ChannelMonitorUpdateStatus
29007 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_unrecoverable_error(void);
29010 * Checks if two ChannelMonitorUpdateStatuss contain equal inner contents.
29011 * This ignores pointers and is_owned flags and looks at the values in fields.
29013 bool ChannelMonitorUpdateStatus_eq(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR a, const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR b);
29016 * Calls the free function if one is set
29018 void Watch_free(struct LDKWatch this_ptr);
29021 * Calls the free function if one is set
29023 void Filter_free(struct LDKFilter this_ptr);
29026 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
29028 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
29031 * First block where the transaction output may have been spent.
29033 struct LDKCOption_ThirtyTwoBytesZ WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
29036 * First block where the transaction output may have been spent.
29038 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
29041 * Outpoint identifying the transaction output.
29043 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
29046 * Outpoint identifying the transaction output.
29048 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
29051 * Spending condition of the transaction output.
29053 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
29056 * Spending condition of the transaction output.
29058 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
29061 * Constructs a new WatchedOutput given each field
29063 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKCOption_ThirtyTwoBytesZ block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
29066 * Creates a copy of the WatchedOutput
29068 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
29071 * Checks if two WatchedOutputs contain equal inner contents.
29072 * This ignores pointers and is_owned flags and looks at the values in fields.
29073 * Two objects with NULL inner values will be considered "equal" here.
29075 bool WatchedOutput_eq(const struct LDKWatchedOutput *NONNULL_PTR a, const struct LDKWatchedOutput *NONNULL_PTR b);
29078 * Generates a non-cryptographic 64-bit hash of the WatchedOutput.
29080 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
29083 * Calls the free function if one is set
29085 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
29088 * Creates a copy of the ConfirmationTarget
29090 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
29093 * Utility method to constructs a new OnChainSweep-variant ConfirmationTarget
29095 enum LDKConfirmationTarget ConfirmationTarget_on_chain_sweep(void);
29098 * Utility method to constructs a new MaxAllowedNonAnchorChannelRemoteFee-variant ConfirmationTarget
29100 enum LDKConfirmationTarget ConfirmationTarget_max_allowed_non_anchor_channel_remote_fee(void);
29103 * Utility method to constructs a new MinAllowedAnchorChannelRemoteFee-variant ConfirmationTarget
29105 enum LDKConfirmationTarget ConfirmationTarget_min_allowed_anchor_channel_remote_fee(void);
29108 * Utility method to constructs a new MinAllowedNonAnchorChannelRemoteFee-variant ConfirmationTarget
29110 enum LDKConfirmationTarget ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee(void);
29113 * Utility method to constructs a new AnchorChannelFee-variant ConfirmationTarget
29115 enum LDKConfirmationTarget ConfirmationTarget_anchor_channel_fee(void);
29118 * Utility method to constructs a new NonAnchorChannelFee-variant ConfirmationTarget
29120 enum LDKConfirmationTarget ConfirmationTarget_non_anchor_channel_fee(void);
29123 * Utility method to constructs a new ChannelCloseMinimum-variant ConfirmationTarget
29125 enum LDKConfirmationTarget ConfirmationTarget_channel_close_minimum(void);
29128 * Generates a non-cryptographic 64-bit hash of the ConfirmationTarget.
29130 uint64_t ConfirmationTarget_hash(const enum LDKConfirmationTarget *NONNULL_PTR o);
29133 * Checks if two ConfirmationTargets contain equal inner contents.
29134 * This ignores pointers and is_owned flags and looks at the values in fields.
29136 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
29139 * Calls the free function if one is set
29141 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
29144 * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
29146 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
29149 * Creates a copy of the MonitorUpdateId
29151 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
29154 * Generates a non-cryptographic 64-bit hash of the MonitorUpdateId.
29156 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
29159 * Checks if two MonitorUpdateIds contain equal inner contents.
29160 * This ignores pointers and is_owned flags and looks at the values in fields.
29161 * Two objects with NULL inner values will be considered "equal" here.
29163 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
29166 * Calls the free function if one is set
29168 void Persist_free(struct LDKPersist this_ptr);
29171 * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
29173 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
29176 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
29178 void ChainMonitor_free(struct LDKChainMonitor this_obj);
29181 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
29183 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
29184 * will call back to it indicating transactions and outputs of interest. This allows clients to
29185 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
29186 * always need to fetch full blocks absent another means for determining which blocks contain
29187 * transactions relevant to the watched channels.
29189 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
29192 * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
29193 * claims which are awaiting confirmation.
29195 * Includes the balances from each [`ChannelMonitor`] *except* those included in
29196 * `ignored_channels`, allowing you to filter out balances from channels which are still open
29197 * (and whose balance should likely be pulled from the [`ChannelDetails`]).
29199 * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
29200 * inclusion in the return value.
29202 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
29205 * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
29206 * such [`ChannelMonitor`] is currently being monitored for.
29208 * Note that the result holds a mutex over our monitor set, and should not be held
29211 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
29214 * Lists the funding outpoint of each [`ChannelMonitor`] being monitored.
29216 * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
29217 * monitoring for on-chain state resolutions.
29219 MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
29222 * Lists the pending updates for each [`ChannelMonitor`] (by `OutPoint` being monitored).
29224 MUST_USE_RES struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ChainMonitor_list_pending_monitor_updates(const struct LDKChainMonitor *NONNULL_PTR this_arg);
29227 * Indicates the persistence of a [`ChannelMonitor`] has completed after
29228 * [`ChannelMonitorUpdateStatus::InProgress`] was returned from an update operation.
29230 * Thus, the anticipated use is, at a high level:
29231 * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
29232 * update to disk and begins updating any remote (e.g. watchtower/backup) copies,
29233 * returning [`ChannelMonitorUpdateStatus::InProgress`],
29234 * 2) once all remote copies are updated, you call this function with the
29235 * `completed_update_id` that completed, and once all pending updates have completed the
29236 * channel will be re-enabled.
29238 * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
29239 * registered [`ChannelMonitor`]s.
29241 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);
29244 * Gets a [`Future`] that completes when an event is available either via
29245 * [`chain::Watch::release_pending_monitor_events`] or
29246 * [`EventsProvider::process_pending_events`].
29248 * Note that callbacks registered on the [`Future`] MUST NOT call back into this
29249 * [`ChainMonitor`] and should instead register actions to be taken later.
29251 * [`EventsProvider::process_pending_events`]: crate::events::EventsProvider::process_pending_events
29253 MUST_USE_RES struct LDKFuture ChainMonitor_get_update_future(const struct LDKChainMonitor *NONNULL_PTR this_arg);
29256 * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
29257 * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
29258 * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
29259 * invoking this every 30 seconds, or lower if running in an environment with spotty
29260 * connections, like on mobile.
29262 void ChainMonitor_rebroadcast_pending_claims(const struct LDKChainMonitor *NONNULL_PTR this_arg);
29265 * Constructs a new Listen which calls the relevant methods on this_arg.
29266 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
29268 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
29271 * Constructs a new Confirm which calls the relevant methods on this_arg.
29272 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
29274 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
29277 * Constructs a new Watch which calls the relevant methods on this_arg.
29278 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
29280 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
29283 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
29284 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
29286 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
29289 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
29291 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
29294 * The sequence number of this update. Updates *must* be replayed in-order according to this
29295 * sequence number (and updates may panic if they are not). The update_id values are strictly
29296 * increasing and increase by one for each new update, with two exceptions specified below.
29298 * This sequence number is also used to track up to which points updates which returned
29299 * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
29300 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
29302 * The only instances we allow where update_id values are not strictly increasing have a
29303 * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
29304 * will force close the channel by broadcasting the latest commitment transaction or
29305 * special post-force-close updates, like providing preimages necessary to claim outputs on the
29306 * broadcast commitment transaction. See its docs for more details.
29308 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
29310 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
29313 * The sequence number of this update. Updates *must* be replayed in-order according to this
29314 * sequence number (and updates may panic if they are not). The update_id values are strictly
29315 * increasing and increase by one for each new update, with two exceptions specified below.
29317 * This sequence number is also used to track up to which points updates which returned
29318 * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
29319 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
29321 * The only instances we allow where update_id values are not strictly increasing have a
29322 * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
29323 * will force close the channel by broadcasting the latest commitment transaction or
29324 * special post-force-close updates, like providing preimages necessary to claim outputs on the
29325 * broadcast commitment transaction. See its docs for more details.
29327 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
29329 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
29332 * Creates a copy of the ChannelMonitorUpdate
29334 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
29337 * Checks if two ChannelMonitorUpdates contain equal inner contents.
29338 * This ignores pointers and is_owned flags and looks at the values in fields.
29339 * Two objects with NULL inner values will be considered "equal" here.
29341 bool ChannelMonitorUpdate_eq(const struct LDKChannelMonitorUpdate *NONNULL_PTR a, const struct LDKChannelMonitorUpdate *NONNULL_PTR b);
29344 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
29346 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
29349 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
29351 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
29354 * Frees any resources used by the MonitorEvent
29356 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
29359 * Creates a copy of the MonitorEvent
29361 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
29364 * Utility method to constructs a new HTLCEvent-variant MonitorEvent
29366 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
29369 * Utility method to constructs a new HolderForceClosed-variant MonitorEvent
29371 struct LDKMonitorEvent MonitorEvent_holder_force_closed(struct LDKOutPoint a);
29374 * Utility method to constructs a new Completed-variant MonitorEvent
29376 struct LDKMonitorEvent MonitorEvent_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
29379 * Checks if two MonitorEvents contain equal inner contents.
29380 * This ignores pointers and is_owned flags and looks at the values in fields.
29382 bool MonitorEvent_eq(const struct LDKMonitorEvent *NONNULL_PTR a, const struct LDKMonitorEvent *NONNULL_PTR b);
29385 * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
29387 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
29390 * Read a MonitorEvent from a byte array, created by MonitorEvent_write
29392 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
29395 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
29397 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
29400 * Creates a copy of the HTLCUpdate
29402 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
29405 * Checks if two HTLCUpdates contain equal inner contents.
29406 * This ignores pointers and is_owned flags and looks at the values in fields.
29407 * Two objects with NULL inner values will be considered "equal" here.
29409 bool HTLCUpdate_eq(const struct LDKHTLCUpdate *NONNULL_PTR a, const struct LDKHTLCUpdate *NONNULL_PTR b);
29412 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
29414 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
29417 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
29419 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
29422 * Frees any resources used by the Balance
29424 void Balance_free(struct LDKBalance this_ptr);
29427 * Creates a copy of the Balance
29429 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
29432 * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
29434 struct LDKBalance Balance_claimable_on_channel_close(uint64_t amount_satoshis);
29437 * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
29439 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t amount_satoshis, uint32_t confirmation_height);
29442 * Utility method to constructs a new ContentiousClaimable-variant Balance
29444 struct LDKBalance Balance_contentious_claimable(uint64_t amount_satoshis, uint32_t timeout_height, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_preimage);
29447 * Utility method to constructs a new MaybeTimeoutClaimableHTLC-variant Balance
29449 struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t amount_satoshis, uint32_t claimable_height, struct LDKThirtyTwoBytes payment_hash);
29452 * Utility method to constructs a new MaybePreimageClaimableHTLC-variant Balance
29454 struct LDKBalance Balance_maybe_preimage_claimable_htlc(uint64_t amount_satoshis, uint32_t expiry_height, struct LDKThirtyTwoBytes payment_hash);
29457 * Utility method to constructs a new CounterpartyRevokedOutputClaimable-variant Balance
29459 struct LDKBalance Balance_counterparty_revoked_output_claimable(uint64_t amount_satoshis);
29462 * Checks if two Balances contain equal inner contents.
29463 * This ignores pointers and is_owned flags and looks at the values in fields.
29465 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
29468 * The amount claimable, in satoshis. This excludes balances that we are unsure if we are able
29469 * to claim, this is because we are waiting for a preimage or for a timeout to expire. For more
29470 * information on these balances see [`Balance::MaybeTimeoutClaimableHTLC`] and
29471 * [`Balance::MaybePreimageClaimableHTLC`].
29473 * On-chain fees required to claim the balance are not included in this amount.
29475 MUST_USE_RES uint64_t Balance_claimable_amount_satoshis(const struct LDKBalance *NONNULL_PTR this_arg);
29478 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
29480 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
29483 * Creates a copy of the ChannelMonitor
29485 struct LDKChannelMonitor ChannelMonitor_clone(const struct LDKChannelMonitor *NONNULL_PTR orig);
29488 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
29490 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
29493 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
29496 * panics if the given update is not the next update by update_id.
29498 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);
29501 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
29504 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29507 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
29509 MUST_USE_RES struct LDKC2Tuple_OutPointCVec_u8ZZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29512 * Gets a list of txids, with their output scripts (in the order they appear in the
29513 * transaction), which we must learn about spends of via block_connected().
29515 MUST_USE_RES struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29518 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
29519 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
29520 * have been registered.
29522 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
29525 * Get the list of HTLCs who's status has been updated on chain. This should be called by
29526 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
29528 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29531 * Processes [`SpendableOutputs`] events produced from each [`ChannelMonitor`] upon maturity.
29533 * For channels featuring anchor outputs, this method will also process [`BumpTransaction`]
29534 * events produced from each [`ChannelMonitor`] while there is a balance to claim onchain
29535 * within each channel. As the confirmation of a commitment transaction may be critical to the
29536 * safety of funds, we recommend invoking this every 30 seconds, or lower if running in an
29537 * environment with spotty connections, like on mobile.
29539 * An [`EventHandler`] may safely call back to the provider, though this shouldn't be needed in
29540 * order to handle these events.
29542 * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
29543 * [`BumpTransaction`]: crate::events::Event::BumpTransaction
29545 void ChannelMonitor_process_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKEventHandler *NONNULL_PTR handler);
29548 * Gets the counterparty's initial commitment transaction. The returned commitment
29549 * transaction is unsigned. This is intended to be called during the initial persistence of
29550 * the monitor (inside an implementation of [`Persist::persist_new_channel`]), to allow for
29551 * watchtowers in the persistence pipeline to have enough data to form justice transactions.
29553 * This is similar to [`Self::counterparty_commitment_txs_from_update`], except
29554 * that for the initial commitment transaction, we don't have a corresponding update.
29556 * This will only return `Some` for channel monitors that have been created after upgrading
29559 * [`Persist::persist_new_channel`]: crate::chain::chainmonitor::Persist::persist_new_channel
29561 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29563 MUST_USE_RES struct LDKCommitmentTransaction ChannelMonitor_initial_counterparty_commitment_tx(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29566 * Gets all of the counterparty commitment transactions provided by the given update. This
29567 * may be empty if the update doesn't include any new counterparty commitments. Returned
29568 * commitment transactions are unsigned.
29570 * This is provided so that watchtower clients in the persistence pipeline are able to build
29571 * justice transactions for each counterparty commitment upon each update. It's intended to be
29572 * used within an implementation of [`Persist::update_persisted_channel`], which is provided
29573 * with a monitor and an update. Once revoked, signing a justice transaction can be done using
29574 * [`Self::sign_to_local_justice_tx`].
29576 * It is expected that a watchtower client may use this method to retrieve the latest counterparty
29577 * commitment transaction(s), and then hold the necessary data until a later update in which
29578 * the monitor has been updated with the corresponding revocation data, at which point the
29579 * monitor can sign the justice transaction.
29581 * This will only return a non-empty list for monitor updates that have been created after
29582 * upgrading to LDK 0.0.117+. Note that no restriction lies on the monitors themselves, which
29583 * may have been created prior to upgrading.
29585 * [`Persist::update_persisted_channel`]: crate::chain::chainmonitor::Persist::update_persisted_channel
29587 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);
29590 * Wrapper around [`EcdsaChannelSigner::sign_justice_revoked_output`] to make
29591 * signing the justice transaction easier for implementors of
29592 * [`chain::chainmonitor::Persist`]. On success this method returns the provided transaction
29593 * signing the input at `input_idx`. This method will only produce a valid signature for
29594 * a transaction spending the `to_local` output of a commitment transaction, i.e. this cannot
29595 * be used for revoked HTLC outputs.
29597 * `Value` is the value of the output being spent by the input at `input_idx`, committed
29598 * in the BIP 143 signature.
29600 * This method will only succeed if this monitor has received the revocation secret for the
29601 * provided `commitment_number`. If a commitment number is provided that does not correspond
29602 * to the commitment transaction being revoked, this will return a signed transaction, but
29603 * the signature will not be valid.
29605 * [`EcdsaChannelSigner::sign_justice_revoked_output`]: crate::sign::EcdsaChannelSigner::sign_justice_revoked_output
29606 * [`Persist`]: crate::chain::chainmonitor::Persist
29608 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);
29611 * Gets the `node_id` of the counterparty for this channel.
29613 * Will be `None` for channels constructed on LDK versions prior to 0.0.110 and always `Some`
29616 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29618 MUST_USE_RES struct LDKPublicKey ChannelMonitor_get_counterparty_node_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29621 * Used by [`ChannelManager`] deserialization to broadcast the latest holder state if its copy
29622 * of the channel state was out-of-date.
29624 * You may also use this to broadcast the latest local commitment transaction, either because
29625 * a monitor update failed or because we've fallen behind (i.e. we've received proof that our
29626 * counterparty side knows a revocation secret we gave them that they shouldn't know).
29628 * Broadcasting these transactions in the second case is UNSAFE, as they allow counterparty
29629 * side to punish you. Nevertheless you may want to broadcast them if counterparty doesn't
29630 * close channel with their commitment transaction after a substantial amount of time. Best
29631 * may be to contact the other node operator out-of-band to coordinate other options available
29634 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
29636 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);
29639 * Processes transactions in a newly connected block, which may result in any of the following:
29640 * - update the monitor's state against resolved HTLCs
29641 * - punish the counterparty in the case of seeing a revoked commitment transaction
29642 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
29643 * - detect settled outputs for later spending
29644 * - schedule and bump any in-flight claims
29646 * Returns any new outputs to watch from `txdata`; after called, these are also included in
29647 * [`get_outputs_to_watch`].
29649 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
29651 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_block_connected(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
29654 * Determines if the disconnected block contained any transactions of interest and updates
29657 void ChannelMonitor_block_disconnected(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
29660 * Processes transactions confirmed in a block with the given header and height, returning new
29661 * outputs to watch. See [`block_connected`] for details.
29663 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
29664 * blocks. See [`chain::Confirm`] for calling expectations.
29666 * [`block_connected`]: Self::block_connected
29668 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_transactions_confirmed(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
29671 * Processes a transaction that was reorganized out of the chain.
29673 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
29674 * than blocks. See [`chain::Confirm`] for calling expectations.
29676 * [`block_disconnected`]: Self::block_disconnected
29678 void ChannelMonitor_transaction_unconfirmed(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*txid)[32], struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
29681 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
29682 * [`block_connected`] for details.
29684 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
29685 * blocks. See [`chain::Confirm`] for calling expectations.
29687 * [`block_connected`]: Self::block_connected
29689 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_best_block_updated(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
29692 * Returns the set of txids that should be monitored for re-organization out of the chain.
29694 MUST_USE_RES struct LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29697 * Gets the latest best block which was connected either via the [`chain::Listen`] or
29698 * [`chain::Confirm`] interfaces.
29700 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29703 * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
29704 * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
29705 * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
29706 * invoking this every 30 seconds, or lower if running in an environment with spotty
29707 * connections, like on mobile.
29709 void ChannelMonitor_rebroadcast_pending_claims(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
29712 * Returns the descriptors for relevant outputs (i.e., those that we can spend) within the
29713 * transaction if they exist and the transaction has at least [`ANTI_REORG_DELAY`]
29714 * confirmations. For [`SpendableOutputDescriptor::DelayedPaymentOutput`] descriptors to be
29715 * returned, the transaction must have at least `max(ANTI_REORG_DELAY, to_self_delay)`
29718 * Descriptors returned by this method are primarily exposed via [`Event::SpendableOutputs`]
29719 * once they are no longer under reorg risk. This method serves as a way to retrieve these
29720 * descriptors at a later time, either for historical purposes, or to replay any
29721 * missed/unhandled descriptors. For the purpose of gathering historical records, if the
29722 * channel close has fully resolved (i.e., [`ChannelMonitor::get_claimable_balances`] returns
29723 * an empty set), you can retrieve all spendable outputs by providing all descendant spending
29724 * transactions starting from the channel's funding transaction and going down three levels.
29726 * `tx` is a transaction we'll scan the outputs of. Any transaction can be provided. If any
29727 * outputs which can be spent by us are found, at least one descriptor is returned.
29729 * `confirmation_height` must be the height of the block in which `tx` was included in.
29731 MUST_USE_RES struct LDKCVec_SpendableOutputDescriptorZ ChannelMonitor_get_spendable_outputs(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKTransaction tx, uint32_t confirmation_height);
29734 * Gets the balances in this channel which are either claimable by us if we were to
29735 * force-close the channel now or which are claimable on-chain (possibly awaiting
29738 * Any balances in the channel which are available on-chain (excluding on-chain fees) are
29739 * included here until an [`Event::SpendableOutputs`] event has been generated for the
29740 * balance, or until our counterparty has claimed the balance and accrued several
29741 * confirmations on the claim transaction.
29743 * Note that for `ChannelMonitors` which track a channel which went on-chain with versions of
29744 * LDK prior to 0.0.111, not all or excess balances may be included.
29746 * See [`Balance`] for additional details on the types of claimable balances which
29747 * may be returned here and their meanings.
29749 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29752 * Read a C2Tuple_ThirtyTwoBytesChannelMonitorZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelMonitorZ_write
29754 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKEntropySource *NONNULL_PTR arg_a, const struct LDKSignerProvider *NONNULL_PTR arg_b);
29757 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
29759 void OutPoint_free(struct LDKOutPoint this_obj);
29762 * The referenced transaction's txid.
29764 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
29767 * The referenced transaction's txid.
29769 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
29772 * The index of the referenced output in its transaction's vout.
29774 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
29777 * The index of the referenced output in its transaction's vout.
29779 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
29782 * Constructs a new OutPoint given each field
29784 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
29787 * Creates a copy of the OutPoint
29789 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
29792 * Checks if two OutPoints contain equal inner contents.
29793 * This ignores pointers and is_owned flags and looks at the values in fields.
29794 * Two objects with NULL inner values will be considered "equal" here.
29796 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
29799 * Generates a non-cryptographic 64-bit hash of the OutPoint.
29801 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
29804 * Convert an `OutPoint` to a lightning channel id.
29806 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
29809 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
29811 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
29814 * Read a OutPoint from a byte array, created by OutPoint_write
29816 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
29819 * Frees any resources used by the FailureCode
29821 void FailureCode_free(struct LDKFailureCode this_ptr);
29824 * Creates a copy of the FailureCode
29826 struct LDKFailureCode FailureCode_clone(const struct LDKFailureCode *NONNULL_PTR orig);
29829 * Utility method to constructs a new TemporaryNodeFailure-variant FailureCode
29831 struct LDKFailureCode FailureCode_temporary_node_failure(void);
29834 * Utility method to constructs a new RequiredNodeFeatureMissing-variant FailureCode
29836 struct LDKFailureCode FailureCode_required_node_feature_missing(void);
29839 * Utility method to constructs a new IncorrectOrUnknownPaymentDetails-variant FailureCode
29841 struct LDKFailureCode FailureCode_incorrect_or_unknown_payment_details(void);
29844 * Utility method to constructs a new InvalidOnionPayload-variant FailureCode
29846 struct LDKFailureCode FailureCode_invalid_onion_payload(struct LDKCOption_C2Tuple_u64u16ZZ a);
29849 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
29851 void ChannelManager_free(struct LDKChannelManager this_obj);
29854 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
29856 void ChainParameters_free(struct LDKChainParameters this_obj);
29859 * The network for determining the `chain_hash` in Lightning messages.
29861 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
29864 * The network for determining the `chain_hash` in Lightning messages.
29866 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
29869 * The hash and height of the latest block successfully connected.
29871 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
29873 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
29876 * The hash and height of the latest block successfully connected.
29878 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
29880 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
29883 * Constructs a new ChainParameters given each field
29885 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
29888 * Creates a copy of the ChainParameters
29890 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
29893 * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
29895 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
29898 * Base routing fee in millisatoshis.
29900 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
29903 * Base routing fee in millisatoshis.
29905 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
29908 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
29910 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
29913 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
29915 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
29918 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
29919 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
29920 * `cltv_expiry_delta` for more details.
29922 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
29925 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
29926 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
29927 * `cltv_expiry_delta` for more details.
29929 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
29932 * Constructs a new CounterpartyForwardingInfo given each field
29934 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);
29937 * Creates a copy of the CounterpartyForwardingInfo
29939 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
29942 * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
29944 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
29947 * The node_id of our counterparty
29949 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
29952 * The node_id of our counterparty
29954 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
29957 * The Features the channel counterparty provided upon last connection.
29958 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
29959 * many routing-relevant features are present in the init context.
29961 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
29964 * The Features the channel counterparty provided upon last connection.
29965 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
29966 * many routing-relevant features are present in the init context.
29968 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
29971 * The value, in satoshis, that must always be held in the channel for our counterparty. This
29972 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
29973 * claiming at least this value on chain.
29975 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
29977 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
29979 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
29982 * The value, in satoshis, that must always be held in the channel for our counterparty. This
29983 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
29984 * claiming at least this value on chain.
29986 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
29988 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
29990 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
29993 * Information on the fees and requirements that the counterparty requires when forwarding
29994 * payments to us through this channel.
29996 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29998 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
30001 * Information on the fees and requirements that the counterparty requires when forwarding
30002 * payments to us through this channel.
30004 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
30006 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
30009 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
30010 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
30011 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
30013 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
30016 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
30017 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
30018 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
30020 void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30023 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
30025 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
30028 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
30030 void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30033 * Constructs a new ChannelCounterparty given each field
30035 * Note that forwarding_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
30037 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);
30040 * Creates a copy of the ChannelCounterparty
30042 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
30045 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
30047 void ChannelDetails_free(struct LDKChannelDetails this_obj);
30050 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
30051 * thereafter this is the txid of the funding transaction xor the funding transaction output).
30052 * Note that this means this value is *not* persistent - it can change once during the
30053 * lifetime of the channel.
30055 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
30058 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
30059 * thereafter this is the txid of the funding transaction xor the funding transaction output).
30060 * Note that this means this value is *not* persistent - it can change once during the
30061 * lifetime of the channel.
30063 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
30066 * Parameters which apply to our counterparty. See individual fields for more information.
30068 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30071 * Parameters which apply to our counterparty. See individual fields for more information.
30073 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
30076 * The Channel's funding transaction output, if we've negotiated the funding transaction with
30077 * our counterparty already.
30079 * Note that, if this has been set, `channel_id` will be equivalent to
30080 * `funding_txo.unwrap().to_channel_id()`.
30082 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30084 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30087 * The Channel's funding transaction output, if we've negotiated the funding transaction with
30088 * our counterparty already.
30090 * Note that, if this has been set, `channel_id` will be equivalent to
30091 * `funding_txo.unwrap().to_channel_id()`.
30093 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
30095 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
30098 * The features which this channel operates with. See individual features for more info.
30100 * `None` until negotiation completes and the channel type is finalized.
30102 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30104 struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30107 * The features which this channel operates with. See individual features for more info.
30109 * `None` until negotiation completes and the channel type is finalized.
30111 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
30113 void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
30116 * The position of the funding transaction in the chain. None if the funding transaction has
30117 * not yet been confirmed and the channel fully opened.
30119 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
30120 * payments instead of this. See [`get_inbound_payment_scid`].
30122 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
30123 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
30125 * [`inbound_scid_alias`]: Self::inbound_scid_alias
30126 * [`outbound_scid_alias`]: Self::outbound_scid_alias
30127 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
30128 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
30129 * [`confirmations_required`]: Self::confirmations_required
30131 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30134 * The position of the funding transaction in the chain. None if the funding transaction has
30135 * not yet been confirmed and the channel fully opened.
30137 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
30138 * payments instead of this. See [`get_inbound_payment_scid`].
30140 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
30141 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
30143 * [`inbound_scid_alias`]: Self::inbound_scid_alias
30144 * [`outbound_scid_alias`]: Self::outbound_scid_alias
30145 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
30146 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
30147 * [`confirmations_required`]: Self::confirmations_required
30149 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30152 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
30153 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
30154 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
30157 * This will be `None` as long as the channel is not available for routing outbound payments.
30159 * [`short_channel_id`]: Self::short_channel_id
30160 * [`confirmations_required`]: Self::confirmations_required
30162 struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30165 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
30166 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
30167 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
30170 * This will be `None` as long as the channel is not available for routing outbound payments.
30172 * [`short_channel_id`]: Self::short_channel_id
30173 * [`confirmations_required`]: Self::confirmations_required
30175 void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30178 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
30179 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
30180 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
30181 * when they see a payment to be routed to us.
30183 * Our counterparty may choose to rotate this value at any time, though will always recognize
30184 * previous values for inbound payment forwarding.
30186 * [`short_channel_id`]: Self::short_channel_id
30188 struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30191 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
30192 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
30193 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
30194 * when they see a payment to be routed to us.
30196 * Our counterparty may choose to rotate this value at any time, though will always recognize
30197 * previous values for inbound payment forwarding.
30199 * [`short_channel_id`]: Self::short_channel_id
30201 void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30204 * The value, in satoshis, of this channel as appears in the funding output
30206 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30209 * The value, in satoshis, of this channel as appears in the funding output
30211 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
30214 * The value, in satoshis, that must always be held in the channel for us. This value ensures
30215 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
30216 * this value on chain.
30218 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
30220 * This value will be `None` for outbound channels until the counterparty accepts the channel.
30222 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
30224 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30227 * The value, in satoshis, that must always be held in the channel for us. This value ensures
30228 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
30229 * this value on chain.
30231 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
30233 * This value will be `None` for outbound channels until the counterparty accepts the channel.
30235 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
30237 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30240 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
30241 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
30242 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
30243 * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
30244 * serialized with LDK versions prior to 0.0.113.
30246 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
30247 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
30248 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
30250 struct LDKU128 ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30253 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
30254 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
30255 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
30256 * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
30257 * serialized with LDK versions prior to 0.0.113.
30259 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
30260 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
30261 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
30263 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKU128 val);
30266 * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
30267 * which is applied to commitment and HTLC transactions.
30269 * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
30271 struct LDKCOption_u32Z ChannelDetails_get_feerate_sat_per_1000_weight(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30274 * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
30275 * which is applied to commitment and HTLC transactions.
30277 * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
30279 void ChannelDetails_set_feerate_sat_per_1000_weight(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
30282 * Our total balance. This is the amount we would get if we close the channel.
30283 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
30284 * amount is not likely to be recoverable on close.
30286 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
30287 * balance is not available for inclusion in new outbound HTLCs). This further does not include
30288 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
30289 * This does not consider any on-chain fees.
30291 * See also [`ChannelDetails::outbound_capacity_msat`]
30293 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30296 * Our total balance. This is the amount we would get if we close the channel.
30297 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
30298 * amount is not likely to be recoverable on close.
30300 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
30301 * balance is not available for inclusion in new outbound HTLCs). This further does not include
30302 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
30303 * This does not consider any on-chain fees.
30305 * See also [`ChannelDetails::outbound_capacity_msat`]
30307 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
30310 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
30311 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
30312 * available for inclusion in new outbound HTLCs). This further does not include any pending
30313 * outgoing HTLCs which are awaiting some other resolution to be sent.
30315 * See also [`ChannelDetails::balance_msat`]
30317 * This value is not exact. Due to various in-flight changes, feerate changes, and our
30318 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
30319 * should be able to spend nearly this amount.
30321 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30324 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
30325 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
30326 * available for inclusion in new outbound HTLCs). This further does not include any pending
30327 * outgoing HTLCs which are awaiting some other resolution to be sent.
30329 * See also [`ChannelDetails::balance_msat`]
30331 * This value is not exact. Due to various in-flight changes, feerate changes, and our
30332 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
30333 * should be able to spend nearly this amount.
30335 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
30338 * The available outbound capacity for sending a single HTLC to the remote peer. This is
30339 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
30340 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
30341 * to use a limit as close as possible to the HTLC limit we can currently send.
30343 * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
30344 * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
30346 uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30349 * The available outbound capacity for sending a single HTLC to the remote peer. This is
30350 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
30351 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
30352 * to use a limit as close as possible to the HTLC limit we can currently send.
30354 * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
30355 * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
30357 void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
30360 * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
30361 * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
30362 * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
30363 * route which is valid.
30365 uint64_t ChannelDetails_get_next_outbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30368 * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
30369 * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
30370 * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
30371 * route which is valid.
30373 void ChannelDetails_set_next_outbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
30376 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
30377 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
30378 * available for inclusion in new inbound HTLCs).
30379 * Note that there are some corner cases not fully handled here, so the actual available
30380 * inbound capacity may be slightly higher than this.
30382 * This value is not exact. Due to various in-flight changes, feerate changes, and our
30383 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
30384 * However, our counterparty should be able to spend nearly this amount.
30386 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30389 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
30390 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
30391 * available for inclusion in new inbound HTLCs).
30392 * Note that there are some corner cases not fully handled here, so the actual available
30393 * inbound capacity may be slightly higher than this.
30395 * This value is not exact. Due to various in-flight changes, feerate changes, and our
30396 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
30397 * However, our counterparty should be able to spend nearly this amount.
30399 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
30402 * The number of required confirmations on the funding transaction before the funding will be
30403 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
30404 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
30405 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
30406 * [`ChannelHandshakeLimits::max_minimum_depth`].
30408 * This value will be `None` for outbound channels until the counterparty accepts the channel.
30410 * [`is_outbound`]: ChannelDetails::is_outbound
30411 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
30412 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
30414 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30417 * The number of required confirmations on the funding transaction before the funding will be
30418 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
30419 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
30420 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
30421 * [`ChannelHandshakeLimits::max_minimum_depth`].
30423 * This value will be `None` for outbound channels until the counterparty accepts the channel.
30425 * [`is_outbound`]: ChannelDetails::is_outbound
30426 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
30427 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
30429 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
30432 * The current number of confirmations on the funding transaction.
30434 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
30436 struct LDKCOption_u32Z ChannelDetails_get_confirmations(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30439 * The current number of confirmations on the funding transaction.
30441 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
30443 void ChannelDetails_set_confirmations(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
30446 * The number of blocks (after our commitment transaction confirms) that we will need to wait
30447 * until we can claim our funds after we force-close the channel. During this time our
30448 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
30449 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
30450 * time to claim our non-HTLC-encumbered funds.
30452 * This value will be `None` for outbound channels until the counterparty accepts the channel.
30454 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30457 * The number of blocks (after our commitment transaction confirms) that we will need to wait
30458 * until we can claim our funds after we force-close the channel. During this time our
30459 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
30460 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
30461 * time to claim our non-HTLC-encumbered funds.
30463 * This value will be `None` for outbound channels until the counterparty accepts the channel.
30465 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
30468 * True if the channel was initiated (and thus funded) by us.
30470 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30473 * True if the channel was initiated (and thus funded) by us.
30475 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
30478 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
30479 * channel is not currently being shut down. `channel_ready` message exchange implies the
30480 * required confirmation count has been reached (and we were connected to the peer at some
30481 * point after the funding transaction received enough confirmations). The required
30482 * confirmation count is provided in [`confirmations_required`].
30484 * [`confirmations_required`]: ChannelDetails::confirmations_required
30486 bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30489 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
30490 * channel is not currently being shut down. `channel_ready` message exchange implies the
30491 * required confirmation count has been reached (and we were connected to the peer at some
30492 * point after the funding transaction received enough confirmations). The required
30493 * confirmation count is provided in [`confirmations_required`].
30495 * [`confirmations_required`]: ChannelDetails::confirmations_required
30497 void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
30500 * The stage of the channel's shutdown.
30501 * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
30503 * Returns a copy of the field.
30505 struct LDKCOption_ChannelShutdownStateZ ChannelDetails_get_channel_shutdown_state(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30508 * The stage of the channel's shutdown.
30509 * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
30511 void ChannelDetails_set_channel_shutdown_state(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_ChannelShutdownStateZ val);
30514 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
30515 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
30517 * This is a strict superset of `is_channel_ready`.
30519 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30522 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
30523 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
30525 * This is a strict superset of `is_channel_ready`.
30527 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
30530 * True if this channel is (or will be) publicly-announced.
30532 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30535 * True if this channel is (or will be) publicly-announced.
30537 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
30540 * The smallest value HTLC (in msat) we will accept, for this channel. This field
30541 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
30543 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30546 * The smallest value HTLC (in msat) we will accept, for this channel. This field
30547 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
30549 void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30552 * The largest value HTLC (in msat) we currently will accept, for this channel.
30554 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30557 * The largest value HTLC (in msat) we currently will accept, for this channel.
30559 void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30562 * Set of configurable parameters that affect channel operation.
30564 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
30566 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30568 struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30571 * Set of configurable parameters that affect channel operation.
30573 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
30575 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
30577 void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
30580 * Constructs a new ChannelDetails given each field
30582 * Note that funding_txo_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
30583 * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
30584 * Note that config_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
30586 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);
30589 * Creates a copy of the ChannelDetails
30591 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
30594 * Gets the current SCID which should be used to identify this channel for inbound payments.
30595 * This should be used for providing invoice hints or in any other context where our
30596 * counterparty will forward a payment to us.
30598 * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
30599 * [`ChannelDetails::short_channel_id`]. See those for more information.
30601 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
30604 * Gets the current SCID which should be used to identify this channel for outbound payments.
30605 * This should be used in [`Route`]s to describe the first hop or in other contexts where
30606 * we're sending or forwarding a payment outbound over this channel.
30608 * This is either the [`ChannelDetails::short_channel_id`], if set, or the
30609 * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
30611 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
30614 * Creates a copy of the ChannelShutdownState
30616 enum LDKChannelShutdownState ChannelShutdownState_clone(const enum LDKChannelShutdownState *NONNULL_PTR orig);
30619 * Utility method to constructs a new NotShuttingDown-variant ChannelShutdownState
30621 enum LDKChannelShutdownState ChannelShutdownState_not_shutting_down(void);
30624 * Utility method to constructs a new ShutdownInitiated-variant ChannelShutdownState
30626 enum LDKChannelShutdownState ChannelShutdownState_shutdown_initiated(void);
30629 * Utility method to constructs a new ResolvingHTLCs-variant ChannelShutdownState
30631 enum LDKChannelShutdownState ChannelShutdownState_resolving_htlcs(void);
30634 * Utility method to constructs a new NegotiatingClosingFee-variant ChannelShutdownState
30636 enum LDKChannelShutdownState ChannelShutdownState_negotiating_closing_fee(void);
30639 * Utility method to constructs a new ShutdownComplete-variant ChannelShutdownState
30641 enum LDKChannelShutdownState ChannelShutdownState_shutdown_complete(void);
30644 * Checks if two ChannelShutdownStates contain equal inner contents.
30645 * This ignores pointers and is_owned flags and looks at the values in fields.
30647 bool ChannelShutdownState_eq(const enum LDKChannelShutdownState *NONNULL_PTR a, const enum LDKChannelShutdownState *NONNULL_PTR b);
30650 * Frees any resources used by the RecentPaymentDetails
30652 void RecentPaymentDetails_free(struct LDKRecentPaymentDetails this_ptr);
30655 * Creates a copy of the RecentPaymentDetails
30657 struct LDKRecentPaymentDetails RecentPaymentDetails_clone(const struct LDKRecentPaymentDetails *NONNULL_PTR orig);
30660 * Utility method to constructs a new AwaitingInvoice-variant RecentPaymentDetails
30662 struct LDKRecentPaymentDetails RecentPaymentDetails_awaiting_invoice(struct LDKThirtyTwoBytes payment_id);
30665 * Utility method to constructs a new Pending-variant RecentPaymentDetails
30667 struct LDKRecentPaymentDetails RecentPaymentDetails_pending(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, uint64_t total_msat);
30670 * Utility method to constructs a new Fulfilled-variant RecentPaymentDetails
30672 struct LDKRecentPaymentDetails RecentPaymentDetails_fulfilled(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash);
30675 * Utility method to constructs a new Abandoned-variant RecentPaymentDetails
30677 struct LDKRecentPaymentDetails RecentPaymentDetails_abandoned(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
30680 * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
30682 void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
30685 * The list of channels to be included in the invoice route hints.
30687 struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
30690 * The list of channels to be included in the invoice route hints.
30692 void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
30695 * A fake scid used for representing the phantom node's fake channel in generating the invoice
30698 uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
30701 * A fake scid used for representing the phantom node's fake channel in generating the invoice
30704 void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
30707 * The pubkey of the real backing node that would ultimately receive the payment.
30709 struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
30712 * The pubkey of the real backing node that would ultimately receive the payment.
30714 void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30717 * Constructs a new PhantomRouteHints given each field
30719 MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
30722 * Creates a copy of the PhantomRouteHints
30724 struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
30727 * Constructs a new `ChannelManager` to hold several channels and route between them.
30729 * The current time or latest block header time can be provided as the `current_timestamp`.
30731 * This is the main \"logic hub\" for all channel-related actions, and implements
30732 * [`ChannelMessageHandler`].
30734 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
30736 * Users need to notify the new `ChannelManager` when a new block is connected or
30737 * disconnected using its [`block_connected`] and [`block_disconnected`] methods, starting
30738 * from after [`params.best_block.block_hash`]. See [`chain::Listen`] and [`chain::Confirm`] for
30741 * [`block_connected`]: chain::Listen::block_connected
30742 * [`block_disconnected`]: chain::Listen::block_disconnected
30743 * [`params.best_block.block_hash`]: chain::BestBlock::block_hash
30745 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);
30748 * Gets the current configuration applied to all new channels.
30750 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
30753 * Creates a new outbound channel to the given remote node and with the given value.
30755 * `user_channel_id` will be provided back as in
30756 * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
30757 * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to a
30758 * randomized value for inbound channels. `user_channel_id` has no meaning inside of LDK, it
30759 * is simply copied to events and otherwise ignored.
30761 * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
30762 * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
30764 * Raises [`APIError::ChannelUnavailable`] if the channel cannot be opened due to failing to
30765 * generate a shutdown scriptpubkey or destination script set by
30766 * [`SignerProvider::get_shutdown_scriptpubkey`] or [`SignerProvider::get_destination_script`].
30768 * Note that we do not check if you are currently connected to the given peer. If no
30769 * connection is available, the outbound `open_channel` message may fail to send, resulting in
30770 * the channel eventually being silently forgotten (dropped on reload).
30772 * Returns the new Channel's temporary `channel_id`. This ID will appear as
30773 * [`Event::FundingGenerationReady::temporary_channel_id`] and in
30774 * [`ChannelDetails::channel_id`] until after
30775 * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
30776 * one derived from the funding transaction's TXID. If the counterparty rejects the channel
30777 * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
30779 * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
30780 * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
30781 * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
30783 * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
30785 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 LDKUserConfig override_config);
30788 * Gets the list of open channels, in random order. See [`ChannelDetails`] field documentation for
30789 * more information.
30791 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
30794 * Gets the list of usable channels, in random order. Useful as an argument to
30795 * [`Router::find_route`] to ensure non-announced channels are used.
30797 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
30798 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
30801 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
30804 * Gets the list of channels we have with a given counterparty, in random order.
30806 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels_with_counterparty(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id);
30809 * Returns in an undefined order recent payments that -- if not fulfilled -- have yet to find a
30810 * successful path, or have unresolved HTLCs.
30812 * This can be useful for payments that may have been prepared, but ultimately not sent, as a
30813 * result of a crash. If such a payment exists, is not listed here, and an
30814 * [`Event::PaymentSent`] has not been received, you may consider resending the payment.
30816 * [`Event::PaymentSent`]: events::Event::PaymentSent
30818 MUST_USE_RES struct LDKCVec_RecentPaymentDetailsZ ChannelManager_list_recent_payments(const struct LDKChannelManager *NONNULL_PTR this_arg);
30821 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
30822 * will be accepted on the given channel, and after additional timeout/the closing of all
30823 * pending HTLCs, the channel will be closed on chain.
30825 * * If we are the channel initiator, we will pay between our [`ChannelCloseMinimum`] and
30826 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
30828 * * If our counterparty is the channel initiator, we will require a channel closing
30829 * transaction feerate of at least our [`ChannelCloseMinimum`] feerate or the feerate which
30830 * would appear on a force-closure transaction, whichever is lower. We will allow our
30831 * counterparty to pay as much fee as they'd like, however.
30833 * May generate a [`SendShutdown`] message event on success, which should be relayed.
30835 * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
30836 * generate a shutdown scriptpubkey or destination script set by
30837 * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
30840 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
30841 * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
30842 * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
30843 * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
30845 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);
30848 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
30849 * will be accepted on the given channel, and after additional timeout/the closing of all
30850 * pending HTLCs, the channel will be closed on chain.
30852 * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
30853 * the channel being closed or not:
30854 * * If we are the channel initiator, we will pay at least this feerate on the closing
30855 * transaction. The upper-bound is set by
30856 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
30857 * fee estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
30858 * * If our counterparty is the channel initiator, we will refuse to accept a channel closure
30859 * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
30860 * will appear on a force-closure transaction, whichever is lower).
30862 * The `shutdown_script` provided will be used as the `scriptPubKey` for the closing transaction.
30863 * Will fail if a shutdown script has already been set for this channel by
30864 * ['ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must
30865 * also be compatible with our and the counterparty's features.
30867 * May generate a [`SendShutdown`] message event on success, which should be relayed.
30869 * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
30870 * generate a shutdown scriptpubkey or destination script set by
30871 * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
30874 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
30875 * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
30876 * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
30878 * Note that shutdown_script (or a relevant inner pointer) may be NULL or all-0s to represent None
30880 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);
30883 * Force closes a channel, immediately broadcasting the latest local transaction(s) and
30884 * rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to
30885 * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding
30888 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);
30891 * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting
30892 * the latest local transaction(s). Fails if `channel_id` is unknown to the manager, or if the
30893 * `counterparty_node_id` isn't the counterparty of the corresponding channel.
30895 * You can always get the latest local transaction(s) to broadcast from
30896 * [`ChannelMonitor::get_latest_holder_commitment_txn`].
30898 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);
30901 * Force close all channels, immediately broadcasting the latest local commitment transaction
30902 * for each to the chain and rejecting new HTLCs on each.
30904 void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
30907 * Force close all channels rejecting new HTLCs on each but without broadcasting the latest
30908 * local transaction(s).
30910 void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
30913 * Sends a payment along a given route.
30915 * Value parameters are provided via the last hop in route, see documentation for [`RouteHop`]
30916 * fields for more info.
30918 * May generate [`UpdateHTLCs`] message(s) event on success, which should be relayed (e.g. via
30919 * [`PeerManager::process_events`]).
30921 * # Avoiding Duplicate Payments
30923 * If a pending payment is currently in-flight with the same [`PaymentId`] provided, this
30924 * method will error with an [`APIError::InvalidRoute`]. Note, however, that once a payment
30925 * is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of an
30926 * [`Event::PaymentSent`] or [`Event::PaymentFailed`]) LDK will not stop you from sending a
30927 * second payment with the same [`PaymentId`].
30929 * Thus, in order to ensure duplicate payments are not sent, you should implement your own
30930 * tracking of payments, including state to indicate once a payment has completed. Because you
30931 * should also ensure that [`PaymentHash`]es are not re-used, for simplicity, you should
30932 * consider using the [`PaymentHash`] as the key for tracking payments. In that case, the
30933 * [`PaymentId`] should be a copy of the [`PaymentHash`] bytes.
30935 * Additionally, in the scenario where we begin the process of sending a payment, but crash
30936 * before `send_payment` returns (or prior to [`ChannelMonitorUpdate`] persistence if you're
30937 * using [`ChannelMonitorUpdateStatus::InProgress`]), the payment may be lost on restart. See
30938 * [`ChannelManager::list_recent_payments`] for more information.
30940 * # Possible Error States on [`PaymentSendFailure`]
30942 * Each path may have a different return value, and [`PaymentSendFailure`] may return a `Vec` with
30943 * each entry matching the corresponding-index entry in the route paths, see
30944 * [`PaymentSendFailure`] for more info.
30946 * In general, a path may raise:
30947 * * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee,
30948 * node public key) is specified.
30949 * * [`APIError::ChannelUnavailable`] if the next-hop channel is not available as it has been
30950 * closed, doesn't exist, or the peer is currently disconnected.
30951 * * [`APIError::MonitorUpdateInProgress`] if a new monitor update failure prevented sending the
30952 * relevant updates.
30954 * Note that depending on the type of the [`PaymentSendFailure`] the HTLC may have been
30955 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
30956 * different route unless you intend to pay twice!
30958 * [`RouteHop`]: crate::routing::router::RouteHop
30959 * [`Event::PaymentSent`]: events::Event::PaymentSent
30960 * [`Event::PaymentFailed`]: events::Event::PaymentFailed
30961 * [`UpdateHTLCs`]: events::MessageSendEvent::UpdateHTLCs
30962 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
30963 * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
30965 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);
30968 * Similar to [`ChannelManager::send_payment_with_route`], but will automatically find a route based on
30969 * `route_params` and retry failed payment paths based on `retry_strategy`.
30971 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);
30974 * Signals that no further attempts for the given payment should occur. Useful if you have a
30975 * pending outbound payment with retries remaining, but wish to stop retrying the payment before
30976 * retries are exhausted.
30978 * # Event Generation
30980 * If no [`Event::PaymentFailed`] event had been generated before, one will be generated as soon
30981 * as there are no remaining pending HTLCs for this payment.
30983 * Note that calling this method does *not* prevent a payment from succeeding. You must still
30984 * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
30985 * determine the ultimate status of a payment.
30987 * # Requested Invoices
30989 * In the case of paying a [`Bolt12Invoice`] via [`ChannelManager::pay_for_offer`], abandoning
30990 * the payment prior to receiving the invoice will result in an [`Event::InvoiceRequestFailed`]
30991 * and prevent any attempts at paying it once received. The other events may only be generated
30992 * once the invoice has been received.
30994 * # Restart Behavior
30996 * If an [`Event::PaymentFailed`] is generated and we restart without first persisting the
30997 * [`ChannelManager`], another [`Event::PaymentFailed`] may be generated; likewise for
30998 * [`Event::InvoiceRequestFailed`].
31000 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
31002 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
31005 * Send a spontaneous payment, which is a payment that does not require the recipient to have
31006 * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
31007 * the preimage, it must be a cryptographically secure random value that no intermediate node
31008 * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
31009 * never reach the recipient.
31011 * See [`send_payment`] documentation for more details on the return value of this function
31012 * and idempotency guarantees provided by the [`PaymentId`] key.
31014 * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
31015 * [`send_payment`] for more information about the risks of duplicate preimage usage.
31017 * [`send_payment`]: Self::send_payment
31019 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);
31022 * Similar to [`ChannelManager::send_spontaneous_payment`], but will automatically find a route
31023 * based on `route_params` and retry failed payment paths based on `retry_strategy`.
31025 * See [`PaymentParameters::for_keysend`] for help in constructing `route_params` for spontaneous
31028 * [`PaymentParameters::for_keysend`]: crate::routing::router::PaymentParameters::for_keysend
31030 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);
31033 * Send a payment that is probing the given route for liquidity. We calculate the
31034 * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows
31035 * us to easily discern them from real payments.
31037 MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPath path);
31040 * Sends payment probes over all paths of a route that would be used to pay the given
31041 * amount to the given `node_id`.
31043 * See [`ChannelManager::send_preflight_probes`] for more information.
31045 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);
31048 * Sends payment probes over all paths of a route that would be used to pay a route found
31049 * according to the given [`RouteParameters`].
31051 * This may be used to send \"pre-flight\" probes, i.e., to train our scorer before conducting
31052 * the actual payment. Note this is only useful if there likely is sufficient time for the
31053 * probe to settle before sending out the actual payment, e.g., when waiting for user
31054 * confirmation in a wallet UI.
31056 * Otherwise, there is a chance the probe could take up some liquidity needed to complete the
31057 * actual payment. Users should therefore be cautious and might avoid sending probes if
31058 * liquidity is scarce and/or they don't expect the probe to return before they send the
31059 * payment. To mitigate this issue, channels with available liquidity less than the required
31060 * amount times the given `liquidity_limit_multiplier` won't be used to send pre-flight
31061 * probes. If `None` is given as `liquidity_limit_multiplier`, it defaults to `3`.
31063 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);
31066 * Call this upon creation of a funding transaction for the given channel.
31068 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
31069 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
31071 * Returns [`APIError::APIMisuseError`] if the funding transaction is not final for propagation
31072 * across the p2p network.
31074 * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
31075 * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
31077 * May panic if the output found in the funding transaction is duplicative with some other
31078 * channel (note that this should be trivially prevented by using unique funding transaction
31079 * keys per-channel).
31081 * Do NOT broadcast the funding transaction yourself. When we have safely received our
31082 * counterparty's signature the funding transaction will automatically be broadcast via the
31083 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
31085 * Note that this includes RBF or similar transaction replacement strategies - lightning does
31086 * not currently support replacing a funding transaction on an existing channel. Instead,
31087 * create a new channel with a conflicting funding transaction.
31089 * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
31090 * the wallet software generating the funding transaction to apply anti-fee sniping as
31091 * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/>
31092 * for more details.
31094 * [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady
31095 * [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed
31097 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);
31100 * Call this upon creation of a batch funding transaction for the given channels.
31102 * Return values are identical to [`Self::funding_transaction_generated`], respective to
31103 * each individual channel and transaction output.
31105 * Do NOT broadcast the funding transaction yourself. This batch funding transcaction
31106 * will only be broadcast when we have safely received and persisted the counterparty's
31107 * signature for each channel.
31109 * If there is an error, all channels in the batch are to be considered closed.
31111 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);
31114 * Atomically applies partial updates to the [`ChannelConfig`] of the given channels.
31116 * Once the updates are applied, each eligible channel (advertised with a known short channel
31117 * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
31118 * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
31119 * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
31121 * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
31122 * `counterparty_node_id` is provided.
31124 * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
31125 * below [`MIN_CLTV_EXPIRY_DELTA`].
31127 * If an error is returned, none of the updates should be considered applied.
31129 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
31130 * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
31131 * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
31132 * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
31133 * [`ChannelUpdate`]: msgs::ChannelUpdate
31134 * [`ChannelUnavailable`]: APIError::ChannelUnavailable
31135 * [`APIMisuseError`]: APIError::APIMisuseError
31137 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);
31140 * Atomically updates the [`ChannelConfig`] for the given channels.
31142 * Once the updates are applied, each eligible channel (advertised with a known short channel
31143 * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
31144 * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
31145 * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
31147 * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
31148 * `counterparty_node_id` is provided.
31150 * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
31151 * below [`MIN_CLTV_EXPIRY_DELTA`].
31153 * If an error is returned, none of the updates should be considered applied.
31155 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
31156 * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
31157 * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
31158 * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
31159 * [`ChannelUpdate`]: msgs::ChannelUpdate
31160 * [`ChannelUnavailable`]: APIError::ChannelUnavailable
31161 * [`APIMisuseError`]: APIError::APIMisuseError
31163 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);
31166 * Attempts to forward an intercepted HTLC over the provided channel id and with the provided
31167 * amount to forward. Should only be called in response to an [`HTLCIntercepted`] event.
31169 * Intercepted HTLCs can be useful for Lightning Service Providers (LSPs) to open a just-in-time
31170 * channel to a receiving node if the node lacks sufficient inbound liquidity.
31172 * To make use of intercepted HTLCs, set [`UserConfig::accept_intercept_htlcs`] and use
31173 * [`ChannelManager::get_intercept_scid`] to generate short channel id(s) to put in the
31174 * receiver's invoice route hints. These route hints will signal to LDK to generate an
31175 * [`HTLCIntercepted`] event when it receives the forwarded HTLC, and this method or
31176 * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event.
31178 * Note that LDK does not enforce fee requirements in `amt_to_forward_msat`, and will not stop
31179 * you from forwarding more than you received. See
31180 * [`HTLCIntercepted::expected_outbound_amount_msat`] for more on forwarding a different amount
31183 * Errors if the event was not handled in time, in which case the HTLC was automatically failed
31186 * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
31187 * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
31188 * [`HTLCIntercepted::expected_outbound_amount_msat`]: events::Event::HTLCIntercepted::expected_outbound_amount_msat
31190 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);
31193 * Fails the intercepted HTLC indicated by intercept_id. Should only be called in response to
31194 * an [`HTLCIntercepted`] event. See [`ChannelManager::forward_intercepted_htlc`].
31196 * Errors if the event was not handled in time, in which case the HTLC was automatically failed
31199 * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
31201 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_fail_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id);
31204 * Processes HTLCs which are pending waiting on random forward delay.
31206 * Should only really ever be called in response to a PendingHTLCsForwardable event.
31207 * Will likely generate further events.
31209 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
31212 * Performs actions which should happen on startup and roughly once per minute thereafter.
31214 * This currently includes:
31215 * * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
31216 * * Broadcasting [`ChannelUpdate`] messages if we've been disconnected from our peer for more
31217 * than a minute, informing the network that they should no longer attempt to route over
31219 * * Expiring a channel's previous [`ChannelConfig`] if necessary to only allow forwarding HTLCs
31220 * with the current [`ChannelConfig`].
31221 * * Removing peers which have disconnected but and no longer have any channels.
31222 * * Force-closing and removing channels which have not completed establishment in a timely manner.
31223 * * Forgetting about stale outbound payments, either those that have already been fulfilled
31224 * or those awaiting an invoice that hasn't been delivered in the necessary amount of time.
31225 * The latter is determined using the system clock in `std` and the highest seen block time
31226 * minus two hours in `no-std`.
31228 * Note that this may cause reentrancy through [`chain::Watch::update_channel`] calls or feerate
31229 * estimate fetches.
31231 * [`ChannelUpdate`]: msgs::ChannelUpdate
31232 * [`ChannelConfig`]: crate::util::config::ChannelConfig
31234 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
31237 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
31238 * after a PaymentClaimable event, failing the HTLC back to its origin and freeing resources
31239 * along the path (including in our own channel on which we received it).
31241 * Note that in some cases around unclean shutdown, it is possible the payment may have
31242 * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
31243 * second copy of) the [`events::Event::PaymentClaimable`] event. Alternatively, the payment
31244 * may have already been failed automatically by LDK if it was nearing its expiration time.
31246 * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
31247 * [`ChannelManager::claim_funds`]), you should still monitor for
31248 * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
31249 * startup during which time claims that were in-progress at shutdown may be replayed.
31251 void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
31254 * This is a variant of [`ChannelManager::fail_htlc_backwards`] that allows you to specify the
31255 * reason for the failure.
31257 * See [`FailureCode`] for valid failure codes.
31259 void ChannelManager_fail_htlc_backwards_with_reason(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32], struct LDKFailureCode failure_code);
31262 * Provides a payment preimage in response to [`Event::PaymentClaimable`], generating any
31263 * [`MessageSendEvent`]s needed to claim the payment.
31265 * This method is guaranteed to ensure the payment has been claimed but only if the current
31266 * height is strictly below [`Event::PaymentClaimable::claim_deadline`]. To avoid race
31267 * conditions, you should wait for an [`Event::PaymentClaimed`] before considering the payment
31268 * successful. It will generally be available in the next [`process_pending_events`] call.
31270 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
31271 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentClaimable`
31272 * event matches your expectation. If you fail to do so and call this method, you may provide
31273 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
31275 * This function will fail the payment if it has custom TLVs with even type numbers, as we
31276 * will assume they are unknown. If you intend to accept even custom TLVs, you should use
31277 * [`claim_funds_with_known_custom_tlvs`].
31279 * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
31280 * [`Event::PaymentClaimable::claim_deadline`]: crate::events::Event::PaymentClaimable::claim_deadline
31281 * [`Event::PaymentClaimed`]: crate::events::Event::PaymentClaimed
31282 * [`process_pending_events`]: EventsProvider::process_pending_events
31283 * [`create_inbound_payment`]: Self::create_inbound_payment
31284 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
31285 * [`claim_funds_with_known_custom_tlvs`]: Self::claim_funds_with_known_custom_tlvs
31287 void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
31290 * This is a variant of [`claim_funds`] that allows accepting a payment with custom TLVs with
31291 * even type numbers.
31295 * You MUST check you've understood all even TLVs before using this to
31296 * claim, otherwise you may unintentionally agree to some protocol you do not understand.
31298 * [`claim_funds`]: Self::claim_funds
31300 void ChannelManager_claim_funds_with_known_custom_tlvs(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
31303 * Gets the node_id held by this ChannelManager
31305 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
31308 * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
31310 * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
31311 * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
31314 * The `user_channel_id` parameter will be provided back in
31315 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
31316 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
31318 * Note that this method will return an error and reject the channel, if it requires support
31319 * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
31320 * used to accept such channels.
31322 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
31323 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
31325 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);
31328 * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
31329 * it as confirmed immediately.
31331 * The `user_channel_id` parameter will be provided back in
31332 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
31333 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
31335 * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
31336 * and (if the counterparty agrees), enables forwarding of payments immediately.
31338 * This fully trusts that the counterparty has honestly and correctly constructed the funding
31339 * transaction and blindly assumes that it will eventually confirm.
31341 * If it does not confirm before we decide to close the channel, or if the funding transaction
31342 * does not pay to the correct script the correct amount, *you will lose funds*.
31344 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
31345 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
31347 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);
31350 * Pays for an [`Offer`] using the given parameters by creating an [`InvoiceRequest`] and
31351 * enqueuing it to be sent via an onion message. [`ChannelManager`] will pay the actual
31352 * [`Bolt12Invoice`] once it is received.
31354 * Uses [`InvoiceRequestBuilder`] such that the [`InvoiceRequest`] it builds is recognized by
31355 * the [`ChannelManager`] when handling a [`Bolt12Invoice`] message in response to the request.
31356 * The optional parameters are used in the builder, if `Some`:
31357 * - `quantity` for [`InvoiceRequest::quantity`] which must be set if
31358 * [`Offer::expects_quantity`] is `true`.
31359 * - `amount_msats` if overpaying what is required for the given `quantity` is desired, and
31360 * - `payer_note` for [`InvoiceRequest::payer_note`].
31362 * If `max_total_routing_fee_msat` is not specified, The default from
31363 * [`RouteParameters::from_payment_params_and_value`] is applied.
31367 * The provided `payment_id` is used to ensure that only one invoice is paid for the request
31368 * when received. See [Avoiding Duplicate Payments] for other requirements once the payment has
31371 * To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving the
31372 * invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the
31373 * payment will fail with an [`Event::InvoiceRequestFailed`].
31377 * Uses a one-hop [`BlindedPath`] for the reply path with [`ChannelManager::get_our_node_id`]
31378 * as the introduction node and a derived payer id for payer privacy. As such, currently, the
31379 * node must be announced. Otherwise, there is no way to find a path to the introduction node
31380 * in order to send the [`Bolt12Invoice`].
31384 * Requires a direct connection to an introduction node in [`Offer::paths`] or to
31385 * [`Offer::signing_pubkey`], if empty. A similar restriction applies to the responding
31386 * [`Bolt12Invoice::payment_paths`].
31390 * Errors if a duplicate `payment_id` is provided given the caveats in the aforementioned link
31391 * or if the provided parameters are invalid for the offer.
31393 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
31394 * [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
31395 * [`InvoiceRequest::payer_note`]: crate::offers::invoice_request::InvoiceRequest::payer_note
31396 * [`InvoiceRequestBuilder`]: crate::offers::invoice_request::InvoiceRequestBuilder
31397 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
31398 * [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
31399 * [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
31401 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);
31404 * Creates a [`Bolt12Invoice`] for a [`Refund`] and enqueues it to be sent via an onion
31407 * The resulting invoice uses a [`PaymentHash`] recognized by the [`ChannelManager`] and a
31408 * [`BlindedPath`] containing the [`PaymentSecret`] needed to reconstruct the corresponding
31409 * [`PaymentPreimage`].
31413 * Requires a direct connection to an introduction node in [`Refund::paths`] or to
31414 * [`Refund::payer_id`], if empty. This request is best effort; an invoice will be sent to each
31415 * node meeting the aforementioned criteria, but there's no guarantee that they will be
31416 * received and no retries will be made.
31418 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
31420 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ ChannelManager_request_refund_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRefund *NONNULL_PTR refund);
31423 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
31426 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
31427 * [`PaymentHash`] and [`PaymentPreimage`] for you.
31429 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`], which
31430 * will have the [`PaymentClaimable::purpose`] be [`PaymentPurpose::InvoicePayment`] with
31431 * its [`PaymentPurpose::InvoicePayment::payment_preimage`] field filled in. That should then be
31432 * passed directly to [`claim_funds`].
31434 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
31436 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
31437 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
31441 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
31442 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
31444 * Errors if `min_value_msat` is greater than total bitcoin supply.
31446 * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
31447 * on versions of LDK prior to 0.0.114.
31449 * [`claim_funds`]: Self::claim_funds
31450 * [`PaymentClaimable`]: events::Event::PaymentClaimable
31451 * [`PaymentClaimable::purpose`]: events::Event::PaymentClaimable::purpose
31452 * [`PaymentPurpose::InvoicePayment`]: events::PaymentPurpose::InvoicePayment
31453 * [`PaymentPurpose::InvoicePayment::payment_preimage`]: events::PaymentPurpose::InvoicePayment::payment_preimage
31454 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
31456 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);
31459 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
31460 * stored external to LDK.
31462 * A [`PaymentClaimable`] event will only be generated if the [`PaymentSecret`] matches a
31463 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
31464 * the `min_value_msat` provided here, if one is provided.
31466 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
31467 * note that LDK will not stop you from registering duplicate payment hashes for inbound
31470 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
31471 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
31472 * before a [`PaymentClaimable`] event will be generated, ensuring that we do not provide the
31473 * sender \"proof-of-payment\" unless they have paid the required amount.
31475 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
31476 * in excess of the current time. This should roughly match the expiry time set in the invoice.
31477 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
31478 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
31479 * invoices when no timeout is set.
31481 * Note that we use block header time to time-out pending inbound payments (with some margin
31482 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
31483 * accept a payment and generate a [`PaymentClaimable`] event for some time after the expiry.
31484 * If you need exact expiry semantics, you should enforce them upon receipt of
31485 * [`PaymentClaimable`].
31487 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry_delta`
31488 * set to at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
31490 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
31491 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
31495 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
31496 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
31498 * Errors if `min_value_msat` is greater than total bitcoin supply.
31500 * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
31501 * on versions of LDK prior to 0.0.114.
31503 * [`create_inbound_payment`]: Self::create_inbound_payment
31504 * [`PaymentClaimable`]: events::Event::PaymentClaimable
31506 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);
31509 * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
31510 * previously returned from [`create_inbound_payment`].
31512 * [`create_inbound_payment`]: Self::create_inbound_payment
31514 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);
31517 * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
31518 * are used when constructing the phantom invoice's route hints.
31520 * [phantom node payments]: crate::sign::PhantomKeysManager
31522 MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
31525 * Gets route hints for use in receiving [phantom node payments].
31527 * [phantom node payments]: crate::sign::PhantomKeysManager
31529 MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
31532 * Gets a fake short channel id for use in receiving intercepted payments. These fake scids are
31533 * used when constructing the route hints for HTLCs intended to be intercepted. See
31534 * [`ChannelManager::forward_intercepted_htlc`].
31536 * Note that this method is not guaranteed to return unique values, you may need to call it a few
31537 * times to get a unique scid.
31539 MUST_USE_RES uint64_t ChannelManager_get_intercept_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
31542 * Gets inflight HTLC information by processing pending outbound payments that are in
31543 * our channels. May be used during pathfinding to account for in-use channel liquidity.
31545 MUST_USE_RES struct LDKInFlightHtlcs ChannelManager_compute_inflight_htlcs(const struct LDKChannelManager *NONNULL_PTR this_arg);
31548 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
31549 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
31551 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
31554 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
31555 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
31557 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
31560 * Constructs a new Listen which calls the relevant methods on this_arg.
31561 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
31563 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
31566 * Constructs a new Confirm which calls the relevant methods on this_arg.
31567 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
31569 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
31572 * Gets a [`Future`] that completes when this [`ChannelManager`] may need to be persisted or
31573 * may have events that need processing.
31575 * In order to check if this [`ChannelManager`] needs persisting, call
31576 * [`Self::get_and_clear_needs_persistence`].
31578 * Note that callbacks registered on the [`Future`] MUST NOT call back into this
31579 * [`ChannelManager`] and should instead register actions to be taken later.
31581 MUST_USE_RES struct LDKFuture ChannelManager_get_event_or_persistence_needed_future(const struct LDKChannelManager *NONNULL_PTR this_arg);
31584 * Returns true if this [`ChannelManager`] needs to be persisted.
31586 MUST_USE_RES bool ChannelManager_get_and_clear_needs_persistence(const struct LDKChannelManager *NONNULL_PTR this_arg);
31589 * Gets the latest best block which was connected either via the [`chain::Listen`] or
31590 * [`chain::Confirm`] interfaces.
31592 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
31595 * Fetches the set of [`NodeFeatures`] flags that are provided by or required by
31596 * [`ChannelManager`].
31598 MUST_USE_RES struct LDKNodeFeatures ChannelManager_node_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
31601 * Fetches the set of [`ChannelFeatures`] flags that are provided by or required by
31602 * [`ChannelManager`].
31604 MUST_USE_RES struct LDKChannelFeatures ChannelManager_channel_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
31607 * Fetches the set of [`ChannelTypeFeatures`] flags that are provided by or required by
31608 * [`ChannelManager`].
31610 MUST_USE_RES struct LDKChannelTypeFeatures ChannelManager_channel_type_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
31613 * Fetches the set of [`InitFeatures`] flags that are provided by or required by
31614 * [`ChannelManager`].
31616 MUST_USE_RES struct LDKInitFeatures ChannelManager_init_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
31619 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
31620 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
31622 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
31625 * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
31626 * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
31628 struct LDKOffersMessageHandler ChannelManager_as_OffersMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
31631 * Fetches the set of [`InitFeatures`] flags that are provided by or required by
31632 * [`ChannelManager`].
31634 struct LDKInitFeatures provided_init_features(const struct LDKUserConfig *NONNULL_PTR config);
31637 * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
31639 struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
31642 * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
31644 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
31647 * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
31649 struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
31652 * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
31654 struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
31657 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
31659 struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
31662 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
31664 struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
31667 * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
31669 struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
31672 * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
31674 struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
31677 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
31679 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
31682 * Serialize the ChannelShutdownState object into a byte array which can be read by ChannelShutdownState_read
31684 struct LDKCVec_u8Z ChannelShutdownState_write(const enum LDKChannelShutdownState *NONNULL_PTR obj);
31687 * Read a ChannelShutdownState from a byte array, created by ChannelShutdownState_write
31689 struct LDKCResult_ChannelShutdownStateDecodeErrorZ ChannelShutdownState_read(struct LDKu8slice ser);
31692 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
31694 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
31697 * A cryptographically secure source of entropy.
31699 const struct LDKEntropySource *ChannelManagerReadArgs_get_entropy_source(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31702 * A cryptographically secure source of entropy.
31704 void ChannelManagerReadArgs_set_entropy_source(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKEntropySource val);
31707 * A signer that is able to perform node-scoped cryptographic operations.
31709 const struct LDKNodeSigner *ChannelManagerReadArgs_get_node_signer(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31712 * A signer that is able to perform node-scoped cryptographic operations.
31714 void ChannelManagerReadArgs_set_node_signer(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKNodeSigner val);
31717 * The keys provider which will give us relevant keys. Some keys will be loaded during
31718 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
31721 const struct LDKSignerProvider *ChannelManagerReadArgs_get_signer_provider(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31724 * The keys provider which will give us relevant keys. Some keys will be loaded during
31725 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
31728 void ChannelManagerReadArgs_set_signer_provider(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKSignerProvider val);
31731 * The fee_estimator for use in the ChannelManager in the future.
31733 * No calls to the FeeEstimator will be made during deserialization.
31735 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31738 * The fee_estimator for use in the ChannelManager in the future.
31740 * No calls to the FeeEstimator will be made during deserialization.
31742 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
31745 * The chain::Watch for use in the ChannelManager in the future.
31747 * No calls to the chain::Watch will be made during deserialization. It is assumed that
31748 * you have deserialized ChannelMonitors separately and will add them to your
31749 * chain::Watch after deserializing this ChannelManager.
31751 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31754 * The chain::Watch for use in the ChannelManager in the future.
31756 * No calls to the chain::Watch will be made during deserialization. It is assumed that
31757 * you have deserialized ChannelMonitors separately and will add them to your
31758 * chain::Watch after deserializing this ChannelManager.
31760 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
31763 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
31764 * used to broadcast the latest local commitment transactions of channels which must be
31765 * force-closed during deserialization.
31767 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31770 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
31771 * used to broadcast the latest local commitment transactions of channels which must be
31772 * force-closed during deserialization.
31774 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
31777 * The router which will be used in the ChannelManager in the future for finding routes
31778 * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
31780 * No calls to the router will be made during deserialization.
31782 const struct LDKRouter *ChannelManagerReadArgs_get_router(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31785 * The router which will be used in the ChannelManager in the future for finding routes
31786 * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
31788 * No calls to the router will be made during deserialization.
31790 void ChannelManagerReadArgs_set_router(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKRouter val);
31793 * The Logger for use in the ChannelManager and which may be used to log information during
31796 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31799 * The Logger for use in the ChannelManager and which may be used to log information during
31802 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
31805 * Default settings used for new channels. Any existing channels will continue to use the
31806 * runtime settings which were stored when the ChannelManager was serialized.
31808 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31811 * Default settings used for new channels. Any existing channels will continue to use the
31812 * runtime settings which were stored when the ChannelManager was serialized.
31814 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
31817 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
31818 * HashMap for you. This is primarily useful for C bindings where it is not practical to
31819 * populate a HashMap directly from C.
31821 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);
31824 * Read a C2Tuple_ThirtyTwoBytesChannelManagerZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelManagerZ_write
31826 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
31829 * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
31831 void ExpandedKey_free(struct LDKExpandedKey this_obj);
31834 * Create a new [`ExpandedKey`] for generating an inbound payment hash and secret.
31836 * It is recommended to cache this value and not regenerate it for each new inbound payment.
31838 MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
31841 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
31842 * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
31843 * a `ChannelManager`.
31845 * `keys` is generated by calling [`NodeSigner::get_inbound_payment_key_material`] and then
31846 * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
31847 * regenerate it for each new inbound payment.
31849 * `current_time` is a Unix timestamp representing the current time.
31851 * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
31852 * on versions of LDK prior to 0.0.114.
31854 * [phantom node payments]: crate::sign::PhantomKeysManager
31855 * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
31857 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);
31860 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
31861 * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
31862 * without a `ChannelManager`.
31864 * See [`create`] for information on the `keys` and `current_time` parameters.
31866 * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
31867 * on versions of LDK prior to 0.0.114.
31869 * [phantom node payments]: crate::sign::PhantomKeysManager
31871 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);
31874 * Frees any resources used by the DecodeError
31876 void DecodeError_free(struct LDKDecodeError this_ptr);
31879 * Creates a copy of the DecodeError
31881 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
31884 * Utility method to constructs a new UnknownVersion-variant DecodeError
31886 struct LDKDecodeError DecodeError_unknown_version(void);
31889 * Utility method to constructs a new UnknownRequiredFeature-variant DecodeError
31891 struct LDKDecodeError DecodeError_unknown_required_feature(void);
31894 * Utility method to constructs a new InvalidValue-variant DecodeError
31896 struct LDKDecodeError DecodeError_invalid_value(void);
31899 * Utility method to constructs a new ShortRead-variant DecodeError
31901 struct LDKDecodeError DecodeError_short_read(void);
31904 * Utility method to constructs a new BadLengthDescriptor-variant DecodeError
31906 struct LDKDecodeError DecodeError_bad_length_descriptor(void);
31909 * Utility method to constructs a new Io-variant DecodeError
31911 struct LDKDecodeError DecodeError_io(enum LDKIOError a);
31914 * Utility method to constructs a new UnsupportedCompression-variant DecodeError
31916 struct LDKDecodeError DecodeError_unsupported_compression(void);
31919 * Checks if two DecodeErrors contain equal inner contents.
31920 * This ignores pointers and is_owned flags and looks at the values in fields.
31922 bool DecodeError_eq(const struct LDKDecodeError *NONNULL_PTR a, const struct LDKDecodeError *NONNULL_PTR b);
31925 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
31927 void Init_free(struct LDKInit this_obj);
31930 * The relevant features which the sender supports.
31932 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
31935 * The relevant features which the sender supports.
31937 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
31940 * Indicates chains the sender is interested in.
31942 * If there are no common chains, the connection will be closed.
31944 * Returns a copy of the field.
31946 struct LDKCOption_CVec_ThirtyTwoBytesZZ Init_get_networks(const struct LDKInit *NONNULL_PTR this_ptr);
31949 * Indicates chains the sender is interested in.
31951 * If there are no common chains, the connection will be closed.
31953 void Init_set_networks(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_CVec_ThirtyTwoBytesZZ val);
31956 * The receipient's network address.
31958 * This adds the option to report a remote IP address back to a connecting peer using the init
31959 * message. A node can decide to use that information to discover a potential update to its
31960 * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
31963 struct LDKCOption_SocketAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
31966 * The receipient's network address.
31968 * This adds the option to report a remote IP address back to a connecting peer using the init
31969 * message. A node can decide to use that information to discover a potential update to its
31970 * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
31973 void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_SocketAddressZ val);
31976 * Constructs a new Init given each field
31978 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_CVec_ThirtyTwoBytesZZ networks_arg, struct LDKCOption_SocketAddressZ remote_network_address_arg);
31981 * Creates a copy of the Init
31983 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
31986 * Checks if two Inits contain equal inner contents.
31987 * This ignores pointers and is_owned flags and looks at the values in fields.
31988 * Two objects with NULL inner values will be considered "equal" here.
31990 bool Init_eq(const struct LDKInit *NONNULL_PTR a, const struct LDKInit *NONNULL_PTR b);
31993 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
31995 void ErrorMessage_free(struct LDKErrorMessage this_obj);
31998 * The channel ID involved in the error.
32000 * All-0s indicates a general error unrelated to a specific channel, after which all channels
32001 * with the sending peer should be closed.
32003 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
32006 * The channel ID involved in the error.
32008 * All-0s indicates a general error unrelated to a specific channel, after which all channels
32009 * with the sending peer should be closed.
32011 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32014 * A possibly human-readable error description.
32016 * The string should be sanitized before it is used (e.g., emitted to logs or printed to
32017 * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
32018 * the terminal emulator or the logging subsystem.
32020 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
32023 * A possibly human-readable error description.
32025 * The string should be sanitized before it is used (e.g., emitted to logs or printed to
32026 * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
32027 * the terminal emulator or the logging subsystem.
32029 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
32032 * Constructs a new ErrorMessage given each field
32034 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
32037 * Creates a copy of the ErrorMessage
32039 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
32042 * Checks if two ErrorMessages contain equal inner contents.
32043 * This ignores pointers and is_owned flags and looks at the values in fields.
32044 * Two objects with NULL inner values will be considered "equal" here.
32046 bool ErrorMessage_eq(const struct LDKErrorMessage *NONNULL_PTR a, const struct LDKErrorMessage *NONNULL_PTR b);
32049 * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
32051 void WarningMessage_free(struct LDKWarningMessage this_obj);
32054 * The channel ID involved in the warning.
32056 * All-0s indicates a warning unrelated to a specific channel.
32058 const uint8_t (*WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr))[32];
32061 * The channel ID involved in the warning.
32063 * All-0s indicates a warning unrelated to a specific channel.
32065 void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32068 * A possibly human-readable warning description.
32070 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
32071 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
32072 * the terminal emulator or the logging subsystem.
32074 struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
32077 * A possibly human-readable warning description.
32079 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
32080 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
32081 * the terminal emulator or the logging subsystem.
32083 void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
32086 * Constructs a new WarningMessage given each field
32088 MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
32091 * Creates a copy of the WarningMessage
32093 struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
32096 * Checks if two WarningMessages contain equal inner contents.
32097 * This ignores pointers and is_owned flags and looks at the values in fields.
32098 * Two objects with NULL inner values will be considered "equal" here.
32100 bool WarningMessage_eq(const struct LDKWarningMessage *NONNULL_PTR a, const struct LDKWarningMessage *NONNULL_PTR b);
32103 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
32105 void Ping_free(struct LDKPing this_obj);
32108 * The desired response length.
32110 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
32113 * The desired response length.
32115 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
32118 * The ping packet size.
32120 * This field is not sent on the wire. byteslen zeros are sent.
32122 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
32125 * The ping packet size.
32127 * This field is not sent on the wire. byteslen zeros are sent.
32129 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
32132 * Constructs a new Ping given each field
32134 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
32137 * Creates a copy of the Ping
32139 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
32142 * Checks if two Pings contain equal inner contents.
32143 * This ignores pointers and is_owned flags and looks at the values in fields.
32144 * Two objects with NULL inner values will be considered "equal" here.
32146 bool Ping_eq(const struct LDKPing *NONNULL_PTR a, const struct LDKPing *NONNULL_PTR b);
32149 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
32151 void Pong_free(struct LDKPong this_obj);
32154 * The pong packet size.
32156 * This field is not sent on the wire. byteslen zeros are sent.
32158 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
32161 * The pong packet size.
32163 * This field is not sent on the wire. byteslen zeros are sent.
32165 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
32168 * Constructs a new Pong given each field
32170 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
32173 * Creates a copy of the Pong
32175 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
32178 * Checks if two Pongs contain equal inner contents.
32179 * This ignores pointers and is_owned flags and looks at the values in fields.
32180 * Two objects with NULL inner values will be considered "equal" here.
32182 bool Pong_eq(const struct LDKPong *NONNULL_PTR a, const struct LDKPong *NONNULL_PTR b);
32185 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
32187 void OpenChannel_free(struct LDKOpenChannel this_obj);
32190 * The genesis hash of the blockchain where the channel is to be opened
32192 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
32195 * The genesis hash of the blockchain where the channel is to be opened
32197 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32200 * A temporary channel ID, until the funding outpoint is announced
32202 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
32205 * A temporary channel ID, until the funding outpoint is announced
32207 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32210 * The channel value
32212 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32215 * The channel value
32217 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
32220 * The amount to push to the counterparty as part of the open, in milli-satoshi
32222 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32225 * The amount to push to the counterparty as part of the open, in milli-satoshi
32227 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
32230 * The threshold below which outputs on transactions broadcast by sender will be omitted
32232 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32235 * The threshold below which outputs on transactions broadcast by sender will be omitted
32237 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
32240 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
32242 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32245 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
32247 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
32250 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
32252 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32255 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
32257 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
32260 * The minimum HTLC size incoming to sender, in milli-satoshi
32262 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32265 * The minimum HTLC size incoming to sender, in milli-satoshi
32267 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
32270 * The feerate per 1000-weight of sender generated transactions, until updated by
32273 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32276 * The feerate per 1000-weight of sender generated transactions, until updated by
32279 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
32282 * The number of blocks which the counterparty will have to wait to claim on-chain funds if
32283 * they broadcast a commitment transaction
32285 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32288 * The number of blocks which the counterparty will have to wait to claim on-chain funds if
32289 * they broadcast a commitment transaction
32291 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
32294 * The maximum number of inbound HTLCs towards sender
32296 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32299 * The maximum number of inbound HTLCs towards sender
32301 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
32304 * The sender's key controlling the funding transaction
32306 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32309 * The sender's key controlling the funding transaction
32311 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32314 * Used to derive a revocation key for transactions broadcast by counterparty
32316 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32319 * Used to derive a revocation key for transactions broadcast by counterparty
32321 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32324 * A payment key to sender for transactions broadcast by counterparty
32326 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32329 * A payment key to sender for transactions broadcast by counterparty
32331 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32334 * Used to derive a payment key to sender for transactions broadcast by sender
32336 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32339 * Used to derive a payment key to sender for transactions broadcast by sender
32341 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32344 * Used to derive an HTLC payment key to sender
32346 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32349 * Used to derive an HTLC payment key to sender
32351 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32354 * The first to-be-broadcast-by-sender transaction's per commitment point
32356 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32359 * The first to-be-broadcast-by-sender transaction's per commitment point
32361 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32364 * The channel flags to be used
32366 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32369 * The channel flags to be used
32371 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
32374 * A request to pre-set the to-sender output's `scriptPubkey` for when we collaboratively close
32376 struct LDKCOption_CVec_u8ZZ OpenChannel_get_shutdown_scriptpubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32379 * A request to pre-set the to-sender output's `scriptPubkey` for when we collaboratively close
32381 void OpenChannel_set_shutdown_scriptpubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
32384 * The channel type that this channel will represent
32386 * If this is `None`, we derive the channel type from the intersection of our
32387 * feature bits with our counterparty's feature bits from the [`Init`] message.
32389 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32391 struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
32394 * The channel type that this channel will represent
32396 * If this is `None`, we derive the channel type from the intersection of our
32397 * feature bits with our counterparty's feature bits from the [`Init`] message.
32399 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32401 void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
32404 * Constructs a new OpenChannel given each field
32406 * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
32408 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);
32411 * Creates a copy of the OpenChannel
32413 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
32416 * Checks if two OpenChannels contain equal inner contents.
32417 * This ignores pointers and is_owned flags and looks at the values in fields.
32418 * Two objects with NULL inner values will be considered "equal" here.
32420 bool OpenChannel_eq(const struct LDKOpenChannel *NONNULL_PTR a, const struct LDKOpenChannel *NONNULL_PTR b);
32423 * Frees any resources used by the OpenChannelV2, if is_owned is set and inner is non-NULL.
32425 void OpenChannelV2_free(struct LDKOpenChannelV2 this_obj);
32428 * The genesis hash of the blockchain where the channel is to be opened
32430 const uint8_t (*OpenChannelV2_get_chain_hash(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr))[32];
32433 * The genesis hash of the blockchain where the channel is to be opened
32435 void OpenChannelV2_set_chain_hash(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32438 * A temporary channel ID derived using a zeroed out value for the channel acceptor's revocation basepoint
32440 const uint8_t (*OpenChannelV2_get_temporary_channel_id(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr))[32];
32443 * A temporary channel ID derived using a zeroed out value for the channel acceptor's revocation basepoint
32445 void OpenChannelV2_set_temporary_channel_id(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32448 * The feerate for the funding transaction set by the channel initiator
32450 uint32_t OpenChannelV2_get_funding_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32453 * The feerate for the funding transaction set by the channel initiator
32455 void OpenChannelV2_set_funding_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
32458 * The feerate for the commitment transaction set by the channel initiator
32460 uint32_t OpenChannelV2_get_commitment_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32463 * The feerate for the commitment transaction set by the channel initiator
32465 void OpenChannelV2_set_commitment_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
32468 * Part of the channel value contributed by the channel initiator
32470 uint64_t OpenChannelV2_get_funding_satoshis(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32473 * Part of the channel value contributed by the channel initiator
32475 void OpenChannelV2_set_funding_satoshis(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
32478 * The threshold below which outputs on transactions broadcast by the channel initiator will be
32481 uint64_t OpenChannelV2_get_dust_limit_satoshis(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32484 * The threshold below which outputs on transactions broadcast by the channel initiator will be
32487 void OpenChannelV2_set_dust_limit_satoshis(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
32490 * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
32492 uint64_t OpenChannelV2_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32495 * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
32497 void OpenChannelV2_set_max_htlc_value_in_flight_msat(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
32500 * The minimum HTLC size incoming to channel initiator, in milli-satoshi
32502 uint64_t OpenChannelV2_get_htlc_minimum_msat(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32505 * The minimum HTLC size incoming to channel initiator, in milli-satoshi
32507 void OpenChannelV2_set_htlc_minimum_msat(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
32510 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
32511 * broadcast a commitment transaction
32513 uint16_t OpenChannelV2_get_to_self_delay(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32516 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
32517 * broadcast a commitment transaction
32519 void OpenChannelV2_set_to_self_delay(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
32522 * The maximum number of inbound HTLCs towards channel initiator
32524 uint16_t OpenChannelV2_get_max_accepted_htlcs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32527 * The maximum number of inbound HTLCs towards channel initiator
32529 void OpenChannelV2_set_max_accepted_htlcs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
32532 * The locktime for the funding transaction
32534 uint32_t OpenChannelV2_get_locktime(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32537 * The locktime for the funding transaction
32539 void OpenChannelV2_set_locktime(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
32542 * The channel initiator's key controlling the funding transaction
32544 struct LDKPublicKey OpenChannelV2_get_funding_pubkey(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32547 * The channel initiator's key controlling the funding transaction
32549 void OpenChannelV2_set_funding_pubkey(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32552 * Used to derive a revocation key for transactions broadcast by counterparty
32554 struct LDKPublicKey OpenChannelV2_get_revocation_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32557 * Used to derive a revocation key for transactions broadcast by counterparty
32559 void OpenChannelV2_set_revocation_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32562 * A payment key to channel initiator for transactions broadcast by counterparty
32564 struct LDKPublicKey OpenChannelV2_get_payment_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32567 * A payment key to channel initiator for transactions broadcast by counterparty
32569 void OpenChannelV2_set_payment_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32572 * Used to derive a payment key to channel initiator for transactions broadcast by channel
32575 struct LDKPublicKey OpenChannelV2_get_delayed_payment_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32578 * Used to derive a payment key to channel initiator for transactions broadcast by channel
32581 void OpenChannelV2_set_delayed_payment_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32584 * Used to derive an HTLC payment key to channel initiator
32586 struct LDKPublicKey OpenChannelV2_get_htlc_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32589 * Used to derive an HTLC payment key to channel initiator
32591 void OpenChannelV2_set_htlc_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32594 * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
32596 struct LDKPublicKey OpenChannelV2_get_first_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32599 * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
32601 void OpenChannelV2_set_first_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32604 * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
32606 struct LDKPublicKey OpenChannelV2_get_second_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32609 * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
32611 void OpenChannelV2_set_second_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32616 uint8_t OpenChannelV2_get_channel_flags(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32621 void OpenChannelV2_set_channel_flags(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint8_t val);
32624 * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
32625 * collaboratively close
32627 struct LDKCOption_CVec_u8ZZ OpenChannelV2_get_shutdown_scriptpubkey(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32630 * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
32631 * collaboratively close
32633 void OpenChannelV2_set_shutdown_scriptpubkey(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
32636 * The channel type that this channel will represent. If none is set, we derive the channel
32637 * type from the intersection of our feature bits with our counterparty's feature bits from
32638 * the Init message.
32640 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32642 struct LDKChannelTypeFeatures OpenChannelV2_get_channel_type(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32645 * The channel type that this channel will represent. If none is set, we derive the channel
32646 * type from the intersection of our feature bits with our counterparty's feature bits from
32647 * the Init message.
32649 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32651 void OpenChannelV2_set_channel_type(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
32654 * Optionally, a requirement that only confirmed inputs can be added
32656 enum LDKCOption_NoneZ OpenChannelV2_get_require_confirmed_inputs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32659 * Optionally, a requirement that only confirmed inputs can be added
32661 void OpenChannelV2_set_require_confirmed_inputs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
32664 * Constructs a new OpenChannelV2 given each field
32666 * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
32668 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);
32671 * Creates a copy of the OpenChannelV2
32673 struct LDKOpenChannelV2 OpenChannelV2_clone(const struct LDKOpenChannelV2 *NONNULL_PTR orig);
32676 * Checks if two OpenChannelV2s contain equal inner contents.
32677 * This ignores pointers and is_owned flags and looks at the values in fields.
32678 * Two objects with NULL inner values will be considered "equal" here.
32680 bool OpenChannelV2_eq(const struct LDKOpenChannelV2 *NONNULL_PTR a, const struct LDKOpenChannelV2 *NONNULL_PTR b);
32683 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
32685 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
32688 * A temporary channel ID, until the funding outpoint is announced
32690 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
32693 * A temporary channel ID, until the funding outpoint is announced
32695 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32698 * The threshold below which outputs on transactions broadcast by sender will be omitted
32700 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32703 * The threshold below which outputs on transactions broadcast by sender will be omitted
32705 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
32708 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
32710 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32713 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
32715 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
32718 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
32720 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32723 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
32725 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
32728 * The minimum HTLC size incoming to sender, in milli-satoshi
32730 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32733 * The minimum HTLC size incoming to sender, in milli-satoshi
32735 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
32738 * Minimum depth of the funding transaction before the channel is considered open
32740 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32743 * Minimum depth of the funding transaction before the channel is considered open
32745 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
32748 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
32750 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32753 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
32755 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
32758 * The maximum number of inbound HTLCs towards sender
32760 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32763 * The maximum number of inbound HTLCs towards sender
32765 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
32768 * The sender's key controlling the funding transaction
32770 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32773 * The sender's key controlling the funding transaction
32775 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32778 * Used to derive a revocation key for transactions broadcast by counterparty
32780 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32783 * Used to derive a revocation key for transactions broadcast by counterparty
32785 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32788 * A payment key to sender for transactions broadcast by counterparty
32790 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32793 * A payment key to sender for transactions broadcast by counterparty
32795 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32798 * Used to derive a payment key to sender for transactions broadcast by sender
32800 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32803 * Used to derive a payment key to sender for transactions broadcast by sender
32805 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32808 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
32810 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32813 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
32815 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32818 * The first to-be-broadcast-by-sender transaction's per commitment point
32820 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32823 * The first to-be-broadcast-by-sender transaction's per commitment point
32825 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32828 * A request to pre-set the to-sender output's scriptPubkey for when we collaboratively close
32830 struct LDKCOption_CVec_u8ZZ AcceptChannel_get_shutdown_scriptpubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32833 * A request to pre-set the to-sender output's scriptPubkey for when we collaboratively close
32835 void AcceptChannel_set_shutdown_scriptpubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
32838 * The channel type that this channel will represent.
32840 * If this is `None`, we derive the channel type from the intersection of
32841 * our feature bits with our counterparty's feature bits from the [`Init`] message.
32842 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
32844 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32846 struct LDKChannelTypeFeatures AcceptChannel_get_channel_type(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32849 * The channel type that this channel will represent.
32851 * If this is `None`, we derive the channel type from the intersection of
32852 * our feature bits with our counterparty's feature bits from the [`Init`] message.
32853 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
32855 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32857 void AcceptChannel_set_channel_type(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
32860 * Constructs a new AcceptChannel given each field
32862 * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
32864 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);
32867 * Creates a copy of the AcceptChannel
32869 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
32872 * Checks if two AcceptChannels contain equal inner contents.
32873 * This ignores pointers and is_owned flags and looks at the values in fields.
32874 * Two objects with NULL inner values will be considered "equal" here.
32876 bool AcceptChannel_eq(const struct LDKAcceptChannel *NONNULL_PTR a, const struct LDKAcceptChannel *NONNULL_PTR b);
32879 * Frees any resources used by the AcceptChannelV2, if is_owned is set and inner is non-NULL.
32881 void AcceptChannelV2_free(struct LDKAcceptChannelV2 this_obj);
32884 * The same `temporary_channel_id` received from the initiator's `open_channel2` message.
32886 const uint8_t (*AcceptChannelV2_get_temporary_channel_id(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr))[32];
32889 * The same `temporary_channel_id` received from the initiator's `open_channel2` message.
32891 void AcceptChannelV2_set_temporary_channel_id(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32894 * Part of the channel value contributed by the channel acceptor
32896 uint64_t AcceptChannelV2_get_funding_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32899 * Part of the channel value contributed by the channel acceptor
32901 void AcceptChannelV2_set_funding_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
32904 * The threshold below which outputs on transactions broadcast by the channel acceptor will be
32907 uint64_t AcceptChannelV2_get_dust_limit_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32910 * The threshold below which outputs on transactions broadcast by the channel acceptor will be
32913 void AcceptChannelV2_set_dust_limit_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
32916 * The maximum inbound HTLC value in flight towards channel acceptor, in milli-satoshi
32918 uint64_t AcceptChannelV2_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32921 * The maximum inbound HTLC value in flight towards channel acceptor, in milli-satoshi
32923 void AcceptChannelV2_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
32926 * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
32928 uint64_t AcceptChannelV2_get_htlc_minimum_msat(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32931 * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
32933 void AcceptChannelV2_set_htlc_minimum_msat(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
32936 * Minimum depth of the funding transaction before the channel is considered open
32938 uint32_t AcceptChannelV2_get_minimum_depth(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32941 * Minimum depth of the funding transaction before the channel is considered open
32943 void AcceptChannelV2_set_minimum_depth(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
32946 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
32947 * broadcast a commitment transaction
32949 uint16_t AcceptChannelV2_get_to_self_delay(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32952 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
32953 * broadcast a commitment transaction
32955 void AcceptChannelV2_set_to_self_delay(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
32958 * The maximum number of inbound HTLCs towards channel acceptor
32960 uint16_t AcceptChannelV2_get_max_accepted_htlcs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32963 * The maximum number of inbound HTLCs towards channel acceptor
32965 void AcceptChannelV2_set_max_accepted_htlcs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
32968 * The channel acceptor's key controlling the funding transaction
32970 struct LDKPublicKey AcceptChannelV2_get_funding_pubkey(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32973 * The channel acceptor's key controlling the funding transaction
32975 void AcceptChannelV2_set_funding_pubkey(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32978 * Used to derive a revocation key for transactions broadcast by counterparty
32980 struct LDKPublicKey AcceptChannelV2_get_revocation_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32983 * Used to derive a revocation key for transactions broadcast by counterparty
32985 void AcceptChannelV2_set_revocation_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32988 * A payment key to channel acceptor for transactions broadcast by counterparty
32990 struct LDKPublicKey AcceptChannelV2_get_payment_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32993 * A payment key to channel acceptor for transactions broadcast by counterparty
32995 void AcceptChannelV2_set_payment_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32998 * Used to derive a payment key to channel acceptor for transactions broadcast by channel
33001 struct LDKPublicKey AcceptChannelV2_get_delayed_payment_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
33004 * Used to derive a payment key to channel acceptor for transactions broadcast by channel
33007 void AcceptChannelV2_set_delayed_payment_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33010 * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
33012 struct LDKPublicKey AcceptChannelV2_get_htlc_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
33015 * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
33017 void AcceptChannelV2_set_htlc_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33020 * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
33022 struct LDKPublicKey AcceptChannelV2_get_first_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
33025 * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
33027 void AcceptChannelV2_set_first_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33030 * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
33032 struct LDKPublicKey AcceptChannelV2_get_second_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
33035 * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
33037 void AcceptChannelV2_set_second_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33040 * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
33041 * collaboratively close
33043 struct LDKCOption_CVec_u8ZZ AcceptChannelV2_get_shutdown_scriptpubkey(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
33046 * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
33047 * collaboratively close
33049 void AcceptChannelV2_set_shutdown_scriptpubkey(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
33052 * The channel type that this channel will represent. If none is set, we derive the channel
33053 * type from the intersection of our feature bits with our counterparty's feature bits from
33054 * the Init message.
33056 * This is required to match the equivalent field in [`OpenChannelV2::channel_type`].
33058 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33060 struct LDKChannelTypeFeatures AcceptChannelV2_get_channel_type(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
33063 * The channel type that this channel will represent. If none is set, we derive the channel
33064 * type from the intersection of our feature bits with our counterparty's feature bits from
33065 * the Init message.
33067 * This is required to match the equivalent field in [`OpenChannelV2::channel_type`].
33069 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
33071 void AcceptChannelV2_set_channel_type(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
33074 * Optionally, a requirement that only confirmed inputs can be added
33076 enum LDKCOption_NoneZ AcceptChannelV2_get_require_confirmed_inputs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
33079 * Optionally, a requirement that only confirmed inputs can be added
33081 void AcceptChannelV2_set_require_confirmed_inputs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
33084 * Constructs a new AcceptChannelV2 given each field
33086 * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
33088 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);
33091 * Creates a copy of the AcceptChannelV2
33093 struct LDKAcceptChannelV2 AcceptChannelV2_clone(const struct LDKAcceptChannelV2 *NONNULL_PTR orig);
33096 * Checks if two AcceptChannelV2s contain equal inner contents.
33097 * This ignores pointers and is_owned flags and looks at the values in fields.
33098 * Two objects with NULL inner values will be considered "equal" here.
33100 bool AcceptChannelV2_eq(const struct LDKAcceptChannelV2 *NONNULL_PTR a, const struct LDKAcceptChannelV2 *NONNULL_PTR b);
33103 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
33105 void FundingCreated_free(struct LDKFundingCreated this_obj);
33108 * A temporary channel ID, until the funding is established
33110 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
33113 * A temporary channel ID, until the funding is established
33115 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33118 * The funding transaction ID
33120 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
33123 * The funding transaction ID
33125 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33128 * The specific output index funding this channel
33130 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
33133 * The specific output index funding this channel
33135 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
33138 * The signature of the channel initiator (funder) on the initial commitment transaction
33140 struct LDKECDSASignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
33143 * The signature of the channel initiator (funder) on the initial commitment transaction
33145 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
33148 * Constructs a new FundingCreated given each field
33150 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);
33153 * Creates a copy of the FundingCreated
33155 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
33158 * Checks if two FundingCreateds contain equal inner contents.
33159 * This ignores pointers and is_owned flags and looks at the values in fields.
33160 * Two objects with NULL inner values will be considered "equal" here.
33162 bool FundingCreated_eq(const struct LDKFundingCreated *NONNULL_PTR a, const struct LDKFundingCreated *NONNULL_PTR b);
33165 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
33167 void FundingSigned_free(struct LDKFundingSigned this_obj);
33172 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
33177 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33180 * The signature of the channel acceptor (fundee) on the initial commitment transaction
33182 struct LDKECDSASignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
33185 * The signature of the channel acceptor (fundee) on the initial commitment transaction
33187 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
33190 * Constructs a new FundingSigned given each field
33192 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKECDSASignature signature_arg);
33195 * Creates a copy of the FundingSigned
33197 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
33200 * Checks if two FundingSigneds contain equal inner contents.
33201 * This ignores pointers and is_owned flags and looks at the values in fields.
33202 * Two objects with NULL inner values will be considered "equal" here.
33204 bool FundingSigned_eq(const struct LDKFundingSigned *NONNULL_PTR a, const struct LDKFundingSigned *NONNULL_PTR b);
33207 * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
33209 void ChannelReady_free(struct LDKChannelReady this_obj);
33214 const uint8_t (*ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr))[32];
33219 void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33222 * The per-commitment point of the second commitment transaction
33224 struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
33227 * The per-commitment point of the second commitment transaction
33229 void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33232 * If set, provides a `short_channel_id` alias for this channel.
33234 * The sender will accept payments to be forwarded over this SCID and forward them to this
33235 * messages' recipient.
33237 struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
33240 * If set, provides a `short_channel_id` alias for this channel.
33242 * The sender will accept payments to be forwarded over this SCID and forward them to this
33243 * messages' recipient.
33245 void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
33248 * Constructs a new ChannelReady given each field
33250 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);
33253 * Creates a copy of the ChannelReady
33255 struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
33258 * Checks if two ChannelReadys contain equal inner contents.
33259 * This ignores pointers and is_owned flags and looks at the values in fields.
33260 * Two objects with NULL inner values will be considered "equal" here.
33262 bool ChannelReady_eq(const struct LDKChannelReady *NONNULL_PTR a, const struct LDKChannelReady *NONNULL_PTR b);
33265 * Frees any resources used by the TxAddInput, if is_owned is set and inner is non-NULL.
33267 void TxAddInput_free(struct LDKTxAddInput this_obj);
33272 const uint8_t (*TxAddInput_get_channel_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr))[32];
33277 void TxAddInput_set_channel_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33280 * A randomly chosen unique identifier for this input, which is even for initiators and odd for
33283 uint64_t TxAddInput_get_serial_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
33286 * A randomly chosen unique identifier for this input, which is even for initiators and odd for
33289 void TxAddInput_set_serial_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint64_t val);
33292 * Serialized transaction that contains the output this input spends to verify that it is non
33295 struct LDKTransactionU16LenLimited TxAddInput_get_prevtx(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
33298 * Serialized transaction that contains the output this input spends to verify that it is non
33301 void TxAddInput_set_prevtx(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKTransactionU16LenLimited val);
33304 * The index of the output being spent
33306 uint32_t TxAddInput_get_prevtx_out(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
33309 * The index of the output being spent
33311 void TxAddInput_set_prevtx_out(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
33314 * The sequence number of this input
33316 uint32_t TxAddInput_get_sequence(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
33319 * The sequence number of this input
33321 void TxAddInput_set_sequence(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
33324 * Constructs a new TxAddInput given each field
33326 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);
33329 * Creates a copy of the TxAddInput
33331 struct LDKTxAddInput TxAddInput_clone(const struct LDKTxAddInput *NONNULL_PTR orig);
33334 * Checks if two TxAddInputs contain equal inner contents.
33335 * This ignores pointers and is_owned flags and looks at the values in fields.
33336 * Two objects with NULL inner values will be considered "equal" here.
33338 bool TxAddInput_eq(const struct LDKTxAddInput *NONNULL_PTR a, const struct LDKTxAddInput *NONNULL_PTR b);
33341 * Frees any resources used by the TxAddOutput, if is_owned is set and inner is non-NULL.
33343 void TxAddOutput_free(struct LDKTxAddOutput this_obj);
33348 const uint8_t (*TxAddOutput_get_channel_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr))[32];
33353 void TxAddOutput_set_channel_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33356 * A randomly chosen unique identifier for this output, which is even for initiators and odd for
33359 uint64_t TxAddOutput_get_serial_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
33362 * A randomly chosen unique identifier for this output, which is even for initiators and odd for
33365 void TxAddOutput_set_serial_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
33368 * The satoshi value of the output
33370 uint64_t TxAddOutput_get_sats(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
33373 * The satoshi value of the output
33375 void TxAddOutput_set_sats(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
33378 * The scriptPubKey for the output
33380 struct LDKu8slice TxAddOutput_get_script(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
33383 * The scriptPubKey for the output
33385 void TxAddOutput_set_script(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
33388 * Constructs a new TxAddOutput given each field
33390 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);
33393 * Creates a copy of the TxAddOutput
33395 struct LDKTxAddOutput TxAddOutput_clone(const struct LDKTxAddOutput *NONNULL_PTR orig);
33398 * Checks if two TxAddOutputs contain equal inner contents.
33399 * This ignores pointers and is_owned flags and looks at the values in fields.
33400 * Two objects with NULL inner values will be considered "equal" here.
33402 bool TxAddOutput_eq(const struct LDKTxAddOutput *NONNULL_PTR a, const struct LDKTxAddOutput *NONNULL_PTR b);
33405 * Frees any resources used by the TxRemoveInput, if is_owned is set and inner is non-NULL.
33407 void TxRemoveInput_free(struct LDKTxRemoveInput this_obj);
33412 const uint8_t (*TxRemoveInput_get_channel_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr))[32];
33417 void TxRemoveInput_set_channel_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33420 * The serial ID of the input to be removed
33422 uint64_t TxRemoveInput_get_serial_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr);
33425 * The serial ID of the input to be removed
33427 void TxRemoveInput_set_serial_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, uint64_t val);
33430 * Constructs a new TxRemoveInput given each field
33432 MUST_USE_RES struct LDKTxRemoveInput TxRemoveInput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg);
33435 * Creates a copy of the TxRemoveInput
33437 struct LDKTxRemoveInput TxRemoveInput_clone(const struct LDKTxRemoveInput *NONNULL_PTR orig);
33440 * Checks if two TxRemoveInputs contain equal inner contents.
33441 * This ignores pointers and is_owned flags and looks at the values in fields.
33442 * Two objects with NULL inner values will be considered "equal" here.
33444 bool TxRemoveInput_eq(const struct LDKTxRemoveInput *NONNULL_PTR a, const struct LDKTxRemoveInput *NONNULL_PTR b);
33447 * Frees any resources used by the TxRemoveOutput, if is_owned is set and inner is non-NULL.
33449 void TxRemoveOutput_free(struct LDKTxRemoveOutput this_obj);
33454 const uint8_t (*TxRemoveOutput_get_channel_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr))[32];
33459 void TxRemoveOutput_set_channel_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33462 * The serial ID of the output to be removed
33464 uint64_t TxRemoveOutput_get_serial_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr);
33467 * The serial ID of the output to be removed
33469 void TxRemoveOutput_set_serial_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, uint64_t val);
33472 * Constructs a new TxRemoveOutput given each field
33474 MUST_USE_RES struct LDKTxRemoveOutput TxRemoveOutput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg);
33477 * Creates a copy of the TxRemoveOutput
33479 struct LDKTxRemoveOutput TxRemoveOutput_clone(const struct LDKTxRemoveOutput *NONNULL_PTR orig);
33482 * Checks if two TxRemoveOutputs contain equal inner contents.
33483 * This ignores pointers and is_owned flags and looks at the values in fields.
33484 * Two objects with NULL inner values will be considered "equal" here.
33486 bool TxRemoveOutput_eq(const struct LDKTxRemoveOutput *NONNULL_PTR a, const struct LDKTxRemoveOutput *NONNULL_PTR b);
33489 * Frees any resources used by the TxComplete, if is_owned is set and inner is non-NULL.
33491 void TxComplete_free(struct LDKTxComplete this_obj);
33496 const uint8_t (*TxComplete_get_channel_id(const struct LDKTxComplete *NONNULL_PTR this_ptr))[32];
33501 void TxComplete_set_channel_id(struct LDKTxComplete *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33504 * Constructs a new TxComplete given each field
33506 MUST_USE_RES struct LDKTxComplete TxComplete_new(struct LDKThirtyTwoBytes channel_id_arg);
33509 * Creates a copy of the TxComplete
33511 struct LDKTxComplete TxComplete_clone(const struct LDKTxComplete *NONNULL_PTR orig);
33514 * Checks if two TxCompletes contain equal inner contents.
33515 * This ignores pointers and is_owned flags and looks at the values in fields.
33516 * Two objects with NULL inner values will be considered "equal" here.
33518 bool TxComplete_eq(const struct LDKTxComplete *NONNULL_PTR a, const struct LDKTxComplete *NONNULL_PTR b);
33521 * Frees any resources used by the TxSignatures, if is_owned is set and inner is non-NULL.
33523 void TxSignatures_free(struct LDKTxSignatures this_obj);
33528 const uint8_t (*TxSignatures_get_channel_id(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32];
33533 void TxSignatures_set_channel_id(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33538 const uint8_t (*TxSignatures_get_tx_hash(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32];
33543 void TxSignatures_set_tx_hash(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33546 * The list of witnesses
33548 * Returns a copy of the field.
33550 struct LDKCVec_WitnessZ TxSignatures_get_witnesses(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
33553 * The list of witnesses
33555 void TxSignatures_set_witnesses(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCVec_WitnessZ val);
33558 * Constructs a new TxSignatures given each field
33560 MUST_USE_RES struct LDKTxSignatures TxSignatures_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes tx_hash_arg, struct LDKCVec_WitnessZ witnesses_arg);
33563 * Creates a copy of the TxSignatures
33565 struct LDKTxSignatures TxSignatures_clone(const struct LDKTxSignatures *NONNULL_PTR orig);
33568 * Checks if two TxSignaturess contain equal inner contents.
33569 * This ignores pointers and is_owned flags and looks at the values in fields.
33570 * Two objects with NULL inner values will be considered "equal" here.
33572 bool TxSignatures_eq(const struct LDKTxSignatures *NONNULL_PTR a, const struct LDKTxSignatures *NONNULL_PTR b);
33575 * Frees any resources used by the TxInitRbf, if is_owned is set and inner is non-NULL.
33577 void TxInitRbf_free(struct LDKTxInitRbf this_obj);
33582 const uint8_t (*TxInitRbf_get_channel_id(const struct LDKTxInitRbf *NONNULL_PTR this_ptr))[32];
33587 void TxInitRbf_set_channel_id(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33590 * The locktime of the transaction
33592 uint32_t TxInitRbf_get_locktime(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
33595 * The locktime of the transaction
33597 void TxInitRbf_set_locktime(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
33600 * The feerate of the transaction
33602 uint32_t TxInitRbf_get_feerate_sat_per_1000_weight(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
33605 * The feerate of the transaction
33607 void TxInitRbf_set_feerate_sat_per_1000_weight(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
33610 * The number of satoshis the sender will contribute to or, if negative, remove from
33611 * (e.g. splice-out) the funding output of the transaction
33613 struct LDKCOption_i64Z TxInitRbf_get_funding_output_contribution(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
33616 * The number of satoshis the sender will contribute to or, if negative, remove from
33617 * (e.g. splice-out) the funding output of the transaction
33619 void TxInitRbf_set_funding_output_contribution(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
33622 * Constructs a new TxInitRbf given each field
33624 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);
33627 * Creates a copy of the TxInitRbf
33629 struct LDKTxInitRbf TxInitRbf_clone(const struct LDKTxInitRbf *NONNULL_PTR orig);
33632 * Checks if two TxInitRbfs contain equal inner contents.
33633 * This ignores pointers and is_owned flags and looks at the values in fields.
33634 * Two objects with NULL inner values will be considered "equal" here.
33636 bool TxInitRbf_eq(const struct LDKTxInitRbf *NONNULL_PTR a, const struct LDKTxInitRbf *NONNULL_PTR b);
33639 * Frees any resources used by the TxAckRbf, if is_owned is set and inner is non-NULL.
33641 void TxAckRbf_free(struct LDKTxAckRbf this_obj);
33646 const uint8_t (*TxAckRbf_get_channel_id(const struct LDKTxAckRbf *NONNULL_PTR this_ptr))[32];
33651 void TxAckRbf_set_channel_id(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33654 * The number of satoshis the sender will contribute to or, if negative, remove from
33655 * (e.g. splice-out) the funding output of the transaction
33657 struct LDKCOption_i64Z TxAckRbf_get_funding_output_contribution(const struct LDKTxAckRbf *NONNULL_PTR this_ptr);
33660 * The number of satoshis the sender will contribute to or, if negative, remove from
33661 * (e.g. splice-out) the funding output of the transaction
33663 void TxAckRbf_set_funding_output_contribution(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
33666 * Constructs a new TxAckRbf given each field
33668 MUST_USE_RES struct LDKTxAckRbf TxAckRbf_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
33671 * Creates a copy of the TxAckRbf
33673 struct LDKTxAckRbf TxAckRbf_clone(const struct LDKTxAckRbf *NONNULL_PTR orig);
33676 * Checks if two TxAckRbfs contain equal inner contents.
33677 * This ignores pointers and is_owned flags and looks at the values in fields.
33678 * Two objects with NULL inner values will be considered "equal" here.
33680 bool TxAckRbf_eq(const struct LDKTxAckRbf *NONNULL_PTR a, const struct LDKTxAckRbf *NONNULL_PTR b);
33683 * Frees any resources used by the TxAbort, if is_owned is set and inner is non-NULL.
33685 void TxAbort_free(struct LDKTxAbort this_obj);
33690 const uint8_t (*TxAbort_get_channel_id(const struct LDKTxAbort *NONNULL_PTR this_ptr))[32];
33695 void TxAbort_set_channel_id(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33700 * Returns a copy of the field.
33702 struct LDKCVec_u8Z TxAbort_get_data(const struct LDKTxAbort *NONNULL_PTR this_ptr);
33707 void TxAbort_set_data(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
33710 * Constructs a new TxAbort given each field
33712 MUST_USE_RES struct LDKTxAbort TxAbort_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z data_arg);
33715 * Creates a copy of the TxAbort
33717 struct LDKTxAbort TxAbort_clone(const struct LDKTxAbort *NONNULL_PTR orig);
33720 * Checks if two TxAborts contain equal inner contents.
33721 * This ignores pointers and is_owned flags and looks at the values in fields.
33722 * Two objects with NULL inner values will be considered "equal" here.
33724 bool TxAbort_eq(const struct LDKTxAbort *NONNULL_PTR a, const struct LDKTxAbort *NONNULL_PTR b);
33727 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
33729 void Shutdown_free(struct LDKShutdown this_obj);
33734 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
33739 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33742 * The destination of this peer's funds on closing.
33744 * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
33746 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
33749 * The destination of this peer's funds on closing.
33751 * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
33753 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
33756 * Constructs a new Shutdown given each field
33758 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
33761 * Creates a copy of the Shutdown
33763 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
33766 * Checks if two Shutdowns contain equal inner contents.
33767 * This ignores pointers and is_owned flags and looks at the values in fields.
33768 * Two objects with NULL inner values will be considered "equal" here.
33770 bool Shutdown_eq(const struct LDKShutdown *NONNULL_PTR a, const struct LDKShutdown *NONNULL_PTR b);
33773 * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
33775 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
33778 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
33781 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
33784 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
33787 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
33790 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
33793 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
33796 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
33799 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
33802 * Constructs a new ClosingSignedFeeRange given each field
33804 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
33807 * Creates a copy of the ClosingSignedFeeRange
33809 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
33812 * Checks if two ClosingSignedFeeRanges contain equal inner contents.
33813 * This ignores pointers and is_owned flags and looks at the values in fields.
33814 * Two objects with NULL inner values will be considered "equal" here.
33816 bool ClosingSignedFeeRange_eq(const struct LDKClosingSignedFeeRange *NONNULL_PTR a, const struct LDKClosingSignedFeeRange *NONNULL_PTR b);
33819 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
33821 void ClosingSigned_free(struct LDKClosingSigned this_obj);
33826 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
33831 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33834 * The proposed total fee for the closing transaction
33836 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
33839 * The proposed total fee for the closing transaction
33841 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
33844 * A signature on the closing transaction
33846 struct LDKECDSASignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
33849 * A signature on the closing transaction
33851 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
33854 * The minimum and maximum fees which the sender is willing to accept, provided only by new
33857 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33859 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
33862 * The minimum and maximum fees which the sender is willing to accept, provided only by new
33865 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
33867 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
33870 * Constructs a new ClosingSigned given each field
33872 * Note that fee_range_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
33874 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);
33877 * Creates a copy of the ClosingSigned
33879 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
33882 * Checks if two ClosingSigneds contain equal inner contents.
33883 * This ignores pointers and is_owned flags and looks at the values in fields.
33884 * Two objects with NULL inner values will be considered "equal" here.
33886 bool ClosingSigned_eq(const struct LDKClosingSigned *NONNULL_PTR a, const struct LDKClosingSigned *NONNULL_PTR b);
33889 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
33891 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
33896 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
33901 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33906 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
33911 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
33914 * The HTLC value in milli-satoshi
33916 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
33919 * The HTLC value in milli-satoshi
33921 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
33924 * The payment hash, the pre-image of which controls HTLC redemption
33926 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
33929 * The payment hash, the pre-image of which controls HTLC redemption
33931 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33934 * The expiry height of the HTLC
33936 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
33939 * The expiry height of the HTLC
33941 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
33944 * The extra fee skimmed by the sender of this message. See
33945 * [`ChannelConfig::accept_underpaying_htlcs`].
33947 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
33949 struct LDKCOption_u64Z UpdateAddHTLC_get_skimmed_fee_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
33952 * The extra fee skimmed by the sender of this message. See
33953 * [`ChannelConfig::accept_underpaying_htlcs`].
33955 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
33957 void UpdateAddHTLC_set_skimmed_fee_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
33960 * Creates a copy of the UpdateAddHTLC
33962 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
33965 * Checks if two UpdateAddHTLCs contain equal inner contents.
33966 * This ignores pointers and is_owned flags and looks at the values in fields.
33967 * Two objects with NULL inner values will be considered "equal" here.
33969 bool UpdateAddHTLC_eq(const struct LDKUpdateAddHTLC *NONNULL_PTR a, const struct LDKUpdateAddHTLC *NONNULL_PTR b);
33972 * Frees any resources used by the OnionMessage, if is_owned is set and inner is non-NULL.
33974 void OnionMessage_free(struct LDKOnionMessage this_obj);
33977 * Used in decrypting the onion packet's payload.
33979 struct LDKPublicKey OnionMessage_get_blinding_point(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
33982 * Used in decrypting the onion packet's payload.
33984 void OnionMessage_set_blinding_point(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33987 * The full onion packet including hop data, pubkey, and hmac
33989 struct LDKPacket OnionMessage_get_onion_routing_packet(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
33992 * The full onion packet including hop data, pubkey, and hmac
33994 void OnionMessage_set_onion_routing_packet(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPacket val);
33997 * Constructs a new OnionMessage given each field
33999 MUST_USE_RES struct LDKOnionMessage OnionMessage_new(struct LDKPublicKey blinding_point_arg, struct LDKPacket onion_routing_packet_arg);
34002 * Creates a copy of the OnionMessage
34004 struct LDKOnionMessage OnionMessage_clone(const struct LDKOnionMessage *NONNULL_PTR orig);
34007 * Checks if two OnionMessages contain equal inner contents.
34008 * This ignores pointers and is_owned flags and looks at the values in fields.
34009 * Two objects with NULL inner values will be considered "equal" here.
34011 bool OnionMessage_eq(const struct LDKOnionMessage *NONNULL_PTR a, const struct LDKOnionMessage *NONNULL_PTR b);
34014 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
34016 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
34021 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
34026 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34031 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
34036 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
34039 * The pre-image of the payment hash, allowing HTLC redemption
34041 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
34044 * The pre-image of the payment hash, allowing HTLC redemption
34046 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34049 * Constructs a new UpdateFulfillHTLC given each field
34051 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
34054 * Creates a copy of the UpdateFulfillHTLC
34056 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
34059 * Checks if two UpdateFulfillHTLCs contain equal inner contents.
34060 * This ignores pointers and is_owned flags and looks at the values in fields.
34061 * Two objects with NULL inner values will be considered "equal" here.
34063 bool UpdateFulfillHTLC_eq(const struct LDKUpdateFulfillHTLC *NONNULL_PTR a, const struct LDKUpdateFulfillHTLC *NONNULL_PTR b);
34066 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
34068 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
34073 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
34078 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34083 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
34088 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
34091 * Creates a copy of the UpdateFailHTLC
34093 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
34096 * Checks if two UpdateFailHTLCs contain equal inner contents.
34097 * This ignores pointers and is_owned flags and looks at the values in fields.
34098 * Two objects with NULL inner values will be considered "equal" here.
34100 bool UpdateFailHTLC_eq(const struct LDKUpdateFailHTLC *NONNULL_PTR a, const struct LDKUpdateFailHTLC *NONNULL_PTR b);
34103 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
34105 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
34110 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
34115 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34120 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
34125 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
34130 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
34135 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
34138 * Creates a copy of the UpdateFailMalformedHTLC
34140 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
34143 * Checks if two UpdateFailMalformedHTLCs contain equal inner contents.
34144 * This ignores pointers and is_owned flags and looks at the values in fields.
34145 * Two objects with NULL inner values will be considered "equal" here.
34147 bool UpdateFailMalformedHTLC_eq(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR a, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR b);
34150 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
34152 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
34157 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
34162 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34165 * A signature on the commitment transaction
34167 struct LDKECDSASignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
34170 * A signature on the commitment transaction
34172 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34175 * Signatures on the HTLC transactions
34177 * Returns a copy of the field.
34179 struct LDKCVec_ECDSASignatureZ CommitmentSigned_get_htlc_signatures(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
34182 * Signatures on the HTLC transactions
34184 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
34187 * Constructs a new CommitmentSigned given each field
34189 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKECDSASignature signature_arg, struct LDKCVec_ECDSASignatureZ htlc_signatures_arg);
34192 * Creates a copy of the CommitmentSigned
34194 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
34197 * Checks if two CommitmentSigneds contain equal inner contents.
34198 * This ignores pointers and is_owned flags and looks at the values in fields.
34199 * Two objects with NULL inner values will be considered "equal" here.
34201 bool CommitmentSigned_eq(const struct LDKCommitmentSigned *NONNULL_PTR a, const struct LDKCommitmentSigned *NONNULL_PTR b);
34204 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
34206 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
34211 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
34216 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34219 * The secret corresponding to the per-commitment point
34221 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
34224 * The secret corresponding to the per-commitment point
34226 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34229 * The next sender-broadcast commitment transaction's per-commitment point
34231 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
34234 * The next sender-broadcast commitment transaction's per-commitment point
34236 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34239 * Constructs a new RevokeAndACK given each field
34241 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);
34244 * Creates a copy of the RevokeAndACK
34246 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
34249 * Checks if two RevokeAndACKs contain equal inner contents.
34250 * This ignores pointers and is_owned flags and looks at the values in fields.
34251 * Two objects with NULL inner values will be considered "equal" here.
34253 bool RevokeAndACK_eq(const struct LDKRevokeAndACK *NONNULL_PTR a, const struct LDKRevokeAndACK *NONNULL_PTR b);
34256 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
34258 void UpdateFee_free(struct LDKUpdateFee this_obj);
34263 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
34268 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34271 * Fee rate per 1000-weight of the transaction
34273 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
34276 * Fee rate per 1000-weight of the transaction
34278 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
34281 * Constructs a new UpdateFee given each field
34283 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
34286 * Creates a copy of the UpdateFee
34288 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
34291 * Checks if two UpdateFees contain equal inner contents.
34292 * This ignores pointers and is_owned flags and looks at the values in fields.
34293 * Two objects with NULL inner values will be considered "equal" here.
34295 bool UpdateFee_eq(const struct LDKUpdateFee *NONNULL_PTR a, const struct LDKUpdateFee *NONNULL_PTR b);
34298 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
34300 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
34305 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
34310 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34313 * The next commitment number for the sender
34315 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
34318 * The next commitment number for the sender
34320 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
34323 * The next commitment number for the recipient
34325 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
34328 * The next commitment number for the recipient
34330 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
34333 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
34334 * belonging to the recipient
34336 const uint8_t (*ChannelReestablish_get_your_last_per_commitment_secret(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
34339 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
34340 * belonging to the recipient
34342 void ChannelReestablish_set_your_last_per_commitment_secret(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34345 * The sender's per-commitment point for their current commitment transaction
34347 struct LDKPublicKey ChannelReestablish_get_my_current_per_commitment_point(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
34350 * The sender's per-commitment point for their current commitment transaction
34352 void ChannelReestablish_set_my_current_per_commitment_point(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34355 * The next funding transaction ID
34357 struct LDKCOption_ThirtyTwoBytesZ ChannelReestablish_get_next_funding_txid(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
34360 * The next funding transaction ID
34362 void ChannelReestablish_set_next_funding_txid(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
34365 * Constructs a new ChannelReestablish given each field
34367 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);
34370 * Creates a copy of the ChannelReestablish
34372 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
34375 * Checks if two ChannelReestablishs contain equal inner contents.
34376 * This ignores pointers and is_owned flags and looks at the values in fields.
34377 * Two objects with NULL inner values will be considered "equal" here.
34379 bool ChannelReestablish_eq(const struct LDKChannelReestablish *NONNULL_PTR a, const struct LDKChannelReestablish *NONNULL_PTR b);
34382 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
34384 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
34389 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
34394 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34397 * The short channel ID
34399 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
34402 * The short channel ID
34404 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
34407 * A signature by the node key
34409 struct LDKECDSASignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
34412 * A signature by the node key
34414 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34417 * A signature by the funding key
34419 struct LDKECDSASignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
34422 * A signature by the funding key
34424 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34427 * Constructs a new AnnouncementSignatures given each field
34429 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);
34432 * Creates a copy of the AnnouncementSignatures
34434 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
34437 * Checks if two AnnouncementSignaturess contain equal inner contents.
34438 * This ignores pointers and is_owned flags and looks at the values in fields.
34439 * Two objects with NULL inner values will be considered "equal" here.
34441 bool AnnouncementSignatures_eq(const struct LDKAnnouncementSignatures *NONNULL_PTR a, const struct LDKAnnouncementSignatures *NONNULL_PTR b);
34444 * Frees any resources used by the SocketAddress
34446 void SocketAddress_free(struct LDKSocketAddress this_ptr);
34449 * Creates a copy of the SocketAddress
34451 struct LDKSocketAddress SocketAddress_clone(const struct LDKSocketAddress *NONNULL_PTR orig);
34454 * Utility method to constructs a new TcpIpV4-variant SocketAddress
34456 struct LDKSocketAddress SocketAddress_tcp_ip_v4(struct LDKFourBytes addr, uint16_t port);
34459 * Utility method to constructs a new TcpIpV6-variant SocketAddress
34461 struct LDKSocketAddress SocketAddress_tcp_ip_v6(struct LDKSixteenBytes addr, uint16_t port);
34464 * Utility method to constructs a new OnionV2-variant SocketAddress
34466 struct LDKSocketAddress SocketAddress_onion_v2(struct LDKTwelveBytes a);
34469 * Utility method to constructs a new OnionV3-variant SocketAddress
34471 struct LDKSocketAddress SocketAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
34474 * Utility method to constructs a new Hostname-variant SocketAddress
34476 struct LDKSocketAddress SocketAddress_hostname(struct LDKHostname hostname, uint16_t port);
34479 * Checks if two SocketAddresss contain equal inner contents.
34480 * This ignores pointers and is_owned flags and looks at the values in fields.
34482 bool SocketAddress_eq(const struct LDKSocketAddress *NONNULL_PTR a, const struct LDKSocketAddress *NONNULL_PTR b);
34485 * Serialize the SocketAddress object into a byte array which can be read by SocketAddress_read
34487 struct LDKCVec_u8Z SocketAddress_write(const struct LDKSocketAddress *NONNULL_PTR obj);
34490 * Read a SocketAddress from a byte array, created by SocketAddress_write
34492 struct LDKCResult_SocketAddressDecodeErrorZ SocketAddress_read(struct LDKu8slice ser);
34495 * Creates a copy of the SocketAddressParseError
34497 enum LDKSocketAddressParseError SocketAddressParseError_clone(const enum LDKSocketAddressParseError *NONNULL_PTR orig);
34500 * Utility method to constructs a new SocketAddrParse-variant SocketAddressParseError
34502 enum LDKSocketAddressParseError SocketAddressParseError_socket_addr_parse(void);
34505 * Utility method to constructs a new InvalidInput-variant SocketAddressParseError
34507 enum LDKSocketAddressParseError SocketAddressParseError_invalid_input(void);
34510 * Utility method to constructs a new InvalidPort-variant SocketAddressParseError
34512 enum LDKSocketAddressParseError SocketAddressParseError_invalid_port(void);
34515 * Utility method to constructs a new InvalidOnionV3-variant SocketAddressParseError
34517 enum LDKSocketAddressParseError SocketAddressParseError_invalid_onion_v3(void);
34520 * Checks if two SocketAddressParseErrors contain equal inner contents.
34521 * This ignores pointers and is_owned flags and looks at the values in fields.
34523 bool SocketAddressParseError_eq(const enum LDKSocketAddressParseError *NONNULL_PTR a, const enum LDKSocketAddressParseError *NONNULL_PTR b);
34526 * Parses an OnionV3 host and port into a [`SocketAddress::OnionV3`].
34528 * The host part must end with \".onion\".
34530 struct LDKCResult_SocketAddressSocketAddressParseErrorZ parse_onion_address(struct LDKStr host, uint16_t port);
34533 * Get the string representation of a SocketAddress object
34535 struct LDKStr SocketAddress_to_str(const struct LDKSocketAddress *NONNULL_PTR o);
34538 * Read a SocketAddress object from a string
34540 struct LDKCResult_SocketAddressSocketAddressParseErrorZ SocketAddress_from_str(struct LDKStr s);
34543 * Frees any resources used by the UnsignedGossipMessage
34545 void UnsignedGossipMessage_free(struct LDKUnsignedGossipMessage this_ptr);
34548 * Creates a copy of the UnsignedGossipMessage
34550 struct LDKUnsignedGossipMessage UnsignedGossipMessage_clone(const struct LDKUnsignedGossipMessage *NONNULL_PTR orig);
34553 * Utility method to constructs a new ChannelAnnouncement-variant UnsignedGossipMessage
34555 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_announcement(struct LDKUnsignedChannelAnnouncement a);
34558 * Utility method to constructs a new ChannelUpdate-variant UnsignedGossipMessage
34560 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_update(struct LDKUnsignedChannelUpdate a);
34563 * Utility method to constructs a new NodeAnnouncement-variant UnsignedGossipMessage
34565 struct LDKUnsignedGossipMessage UnsignedGossipMessage_node_announcement(struct LDKUnsignedNodeAnnouncement a);
34568 * Serialize the UnsignedGossipMessage object into a byte array which can be read by UnsignedGossipMessage_read
34570 struct LDKCVec_u8Z UnsignedGossipMessage_write(const struct LDKUnsignedGossipMessage *NONNULL_PTR obj);
34573 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
34575 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
34578 * The advertised features
34580 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
34583 * The advertised features
34585 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
34588 * A strictly monotonic announcement counter, with gaps allowed
34590 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
34593 * A strictly monotonic announcement counter, with gaps allowed
34595 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
34598 * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
34601 struct LDKNodeId UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
34604 * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
34607 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
34610 * An RGB color for UI purposes
34612 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
34615 * An RGB color for UI purposes
34617 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
34620 * An alias, for UI purposes.
34622 * This should be sanitized before use. There is no guarantee of uniqueness.
34624 struct LDKNodeAlias UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
34627 * An alias, for UI purposes.
34629 * This should be sanitized before use. There is no guarantee of uniqueness.
34631 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
34634 * List of addresses on which this node is reachable
34636 * Returns a copy of the field.
34638 struct LDKCVec_SocketAddressZ UnsignedNodeAnnouncement_get_addresses(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
34641 * List of addresses on which this node is reachable
34643 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_SocketAddressZ val);
34646 * Creates a copy of the UnsignedNodeAnnouncement
34648 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
34651 * Checks if two UnsignedNodeAnnouncements contain equal inner contents.
34652 * This ignores pointers and is_owned flags and looks at the values in fields.
34653 * Two objects with NULL inner values will be considered "equal" here.
34655 bool UnsignedNodeAnnouncement_eq(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR a, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR b);
34658 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
34660 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
34663 * The signature by the node key
34665 struct LDKECDSASignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
34668 * The signature by the node key
34670 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34673 * The actual content of the announcement
34675 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
34678 * The actual content of the announcement
34680 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
34683 * Constructs a new NodeAnnouncement given each field
34685 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
34688 * Creates a copy of the NodeAnnouncement
34690 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
34693 * Checks if two NodeAnnouncements contain equal inner contents.
34694 * This ignores pointers and is_owned flags and looks at the values in fields.
34695 * Two objects with NULL inner values will be considered "equal" here.
34697 bool NodeAnnouncement_eq(const struct LDKNodeAnnouncement *NONNULL_PTR a, const struct LDKNodeAnnouncement *NONNULL_PTR b);
34700 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
34702 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
34705 * The advertised channel features
34707 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34710 * The advertised channel features
34712 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
34715 * The genesis hash of the blockchain where the channel is to be opened
34717 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
34720 * The genesis hash of the blockchain where the channel is to be opened
34722 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34725 * The short channel ID
34727 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34730 * The short channel ID
34732 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
34735 * One of the two `node_id`s which are endpoints of this channel
34737 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34740 * One of the two `node_id`s which are endpoints of this channel
34742 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
34745 * The other of the two `node_id`s which are endpoints of this channel
34747 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34750 * The other of the two `node_id`s which are endpoints of this channel
34752 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
34755 * The funding key for the first node
34757 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34760 * The funding key for the first node
34762 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
34765 * The funding key for the second node
34767 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34770 * The funding key for the second node
34772 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
34775 * Excess data which was signed as a part of the message which we do not (yet) understand how
34778 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
34780 * Returns a copy of the field.
34782 struct LDKCVec_u8Z UnsignedChannelAnnouncement_get_excess_data(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34785 * Excess data which was signed as a part of the message which we do not (yet) understand how
34788 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
34790 void UnsignedChannelAnnouncement_set_excess_data(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
34793 * Constructs a new UnsignedChannelAnnouncement given each field
34795 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);
34798 * Creates a copy of the UnsignedChannelAnnouncement
34800 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
34803 * Checks if two UnsignedChannelAnnouncements contain equal inner contents.
34804 * This ignores pointers and is_owned flags and looks at the values in fields.
34805 * Two objects with NULL inner values will be considered "equal" here.
34807 bool UnsignedChannelAnnouncement_eq(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR a, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR b);
34810 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
34812 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
34815 * Authentication of the announcement by the first public node
34817 struct LDKECDSASignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
34820 * Authentication of the announcement by the first public node
34822 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34825 * Authentication of the announcement by the second public node
34827 struct LDKECDSASignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
34830 * Authentication of the announcement by the second public node
34832 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34835 * Proof of funding UTXO ownership by the first public node
34837 struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
34840 * Proof of funding UTXO ownership by the first public node
34842 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34845 * Proof of funding UTXO ownership by the second public node
34847 struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
34850 * Proof of funding UTXO ownership by the second public node
34852 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34855 * The actual announcement
34857 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
34860 * The actual announcement
34862 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
34865 * Constructs a new ChannelAnnouncement given each field
34867 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);
34870 * Creates a copy of the ChannelAnnouncement
34872 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
34875 * Checks if two ChannelAnnouncements contain equal inner contents.
34876 * This ignores pointers and is_owned flags and looks at the values in fields.
34877 * Two objects with NULL inner values will be considered "equal" here.
34879 bool ChannelAnnouncement_eq(const struct LDKChannelAnnouncement *NONNULL_PTR a, const struct LDKChannelAnnouncement *NONNULL_PTR b);
34882 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
34884 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
34887 * The genesis hash of the blockchain where the channel is to be opened
34889 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
34892 * The genesis hash of the blockchain where the channel is to be opened
34894 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34897 * The short channel ID
34899 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34902 * The short channel ID
34904 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
34907 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
34909 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34912 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
34914 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
34919 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34924 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
34927 * The number of blocks such that if:
34928 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
34929 * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
34930 * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
34931 * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
34932 * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
34933 * forwarding. Note that the HTLC sender is the one who originally sets this value when
34934 * constructing the route.
34936 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34939 * The number of blocks such that if:
34940 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
34941 * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
34942 * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
34943 * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
34944 * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
34945 * forwarding. Note that the HTLC sender is the one who originally sets this value when
34946 * constructing the route.
34948 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
34951 * The minimum HTLC size incoming to sender, in milli-satoshi
34953 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34956 * The minimum HTLC size incoming to sender, in milli-satoshi
34958 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
34961 * The maximum HTLC value incoming to sender, in milli-satoshi.
34963 * This used to be optional.
34965 uint64_t UnsignedChannelUpdate_get_htlc_maximum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34968 * The maximum HTLC value incoming to sender, in milli-satoshi.
34970 * This used to be optional.
34972 void UnsignedChannelUpdate_set_htlc_maximum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
34975 * The base HTLC fee charged by sender, in milli-satoshi
34977 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34980 * The base HTLC fee charged by sender, in milli-satoshi
34982 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
34985 * The amount to fee multiplier, in micro-satoshi
34987 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34990 * The amount to fee multiplier, in micro-satoshi
34992 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
34995 * Excess data which was signed as a part of the message which we do not (yet) understand how
34998 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
35000 * Returns a copy of the field.
35002 struct LDKCVec_u8Z UnsignedChannelUpdate_get_excess_data(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
35005 * Excess data which was signed as a part of the message which we do not (yet) understand how
35008 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
35010 void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
35013 * Constructs a new UnsignedChannelUpdate given each field
35015 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);
35018 * Creates a copy of the UnsignedChannelUpdate
35020 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
35023 * Checks if two UnsignedChannelUpdates contain equal inner contents.
35024 * This ignores pointers and is_owned flags and looks at the values in fields.
35025 * Two objects with NULL inner values will be considered "equal" here.
35027 bool UnsignedChannelUpdate_eq(const struct LDKUnsignedChannelUpdate *NONNULL_PTR a, const struct LDKUnsignedChannelUpdate *NONNULL_PTR b);
35030 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
35032 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
35035 * A signature of the channel update
35037 struct LDKECDSASignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
35040 * A signature of the channel update
35042 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
35045 * The actual channel update
35047 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
35050 * The actual channel update
35052 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
35055 * Constructs a new ChannelUpdate given each field
35057 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
35060 * Creates a copy of the ChannelUpdate
35062 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
35065 * Checks if two ChannelUpdates contain equal inner contents.
35066 * This ignores pointers and is_owned flags and looks at the values in fields.
35067 * Two objects with NULL inner values will be considered "equal" here.
35069 bool ChannelUpdate_eq(const struct LDKChannelUpdate *NONNULL_PTR a, const struct LDKChannelUpdate *NONNULL_PTR b);
35072 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
35074 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
35077 * The genesis hash of the blockchain being queried
35079 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
35082 * The genesis hash of the blockchain being queried
35084 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35087 * The height of the first block for the channel UTXOs being queried
35089 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
35092 * The height of the first block for the channel UTXOs being queried
35094 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
35097 * The number of blocks to include in the query results
35099 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
35102 * The number of blocks to include in the query results
35104 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
35107 * Constructs a new QueryChannelRange given each field
35109 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
35112 * Creates a copy of the QueryChannelRange
35114 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
35117 * Checks if two QueryChannelRanges contain equal inner contents.
35118 * This ignores pointers and is_owned flags and looks at the values in fields.
35119 * Two objects with NULL inner values will be considered "equal" here.
35121 bool QueryChannelRange_eq(const struct LDKQueryChannelRange *NONNULL_PTR a, const struct LDKQueryChannelRange *NONNULL_PTR b);
35124 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
35126 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
35129 * The genesis hash of the blockchain being queried
35131 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
35134 * The genesis hash of the blockchain being queried
35136 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35139 * The height of the first block in the range of the reply
35141 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
35144 * The height of the first block in the range of the reply
35146 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
35149 * The number of blocks included in the range of the reply
35151 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
35154 * The number of blocks included in the range of the reply
35156 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
35159 * True when this is the final reply for a query
35161 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
35164 * True when this is the final reply for a query
35166 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
35169 * The `short_channel_id`s in the channel range
35171 * Returns a copy of the field.
35173 struct LDKCVec_u64Z ReplyChannelRange_get_short_channel_ids(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
35176 * The `short_channel_id`s in the channel range
35178 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
35181 * Constructs a new ReplyChannelRange given each field
35183 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);
35186 * Creates a copy of the ReplyChannelRange
35188 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
35191 * Checks if two ReplyChannelRanges contain equal inner contents.
35192 * This ignores pointers and is_owned flags and looks at the values in fields.
35193 * Two objects with NULL inner values will be considered "equal" here.
35195 bool ReplyChannelRange_eq(const struct LDKReplyChannelRange *NONNULL_PTR a, const struct LDKReplyChannelRange *NONNULL_PTR b);
35198 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
35200 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
35203 * The genesis hash of the blockchain being queried
35205 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
35208 * The genesis hash of the blockchain being queried
35210 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35213 * The short_channel_ids that are being queried
35215 * Returns a copy of the field.
35217 struct LDKCVec_u64Z QueryShortChannelIds_get_short_channel_ids(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr);
35220 * The short_channel_ids that are being queried
35222 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
35225 * Constructs a new QueryShortChannelIds given each field
35227 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
35230 * Creates a copy of the QueryShortChannelIds
35232 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
35235 * Checks if two QueryShortChannelIdss contain equal inner contents.
35236 * This ignores pointers and is_owned flags and looks at the values in fields.
35237 * Two objects with NULL inner values will be considered "equal" here.
35239 bool QueryShortChannelIds_eq(const struct LDKQueryShortChannelIds *NONNULL_PTR a, const struct LDKQueryShortChannelIds *NONNULL_PTR b);
35242 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
35244 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
35247 * The genesis hash of the blockchain that was queried
35249 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
35252 * The genesis hash of the blockchain that was queried
35254 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35257 * Indicates if the query recipient maintains up-to-date channel
35258 * information for the `chain_hash`
35260 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
35263 * Indicates if the query recipient maintains up-to-date channel
35264 * information for the `chain_hash`
35266 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
35269 * Constructs a new ReplyShortChannelIdsEnd given each field
35271 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
35274 * Creates a copy of the ReplyShortChannelIdsEnd
35276 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
35279 * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
35280 * This ignores pointers and is_owned flags and looks at the values in fields.
35281 * Two objects with NULL inner values will be considered "equal" here.
35283 bool ReplyShortChannelIdsEnd_eq(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR a, const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR b);
35286 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
35288 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
35291 * The genesis hash of the blockchain for channel and node information
35293 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
35296 * The genesis hash of the blockchain for channel and node information
35298 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35301 * The starting unix timestamp
35303 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
35306 * The starting unix timestamp
35308 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
35311 * The range of information in seconds
35313 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
35316 * The range of information in seconds
35318 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
35321 * Constructs a new GossipTimestampFilter given each field
35323 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
35326 * Creates a copy of the GossipTimestampFilter
35328 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
35331 * Checks if two GossipTimestampFilters contain equal inner contents.
35332 * This ignores pointers and is_owned flags and looks at the values in fields.
35333 * Two objects with NULL inner values will be considered "equal" here.
35335 bool GossipTimestampFilter_eq(const struct LDKGossipTimestampFilter *NONNULL_PTR a, const struct LDKGossipTimestampFilter *NONNULL_PTR b);
35338 * Frees any resources used by the ErrorAction
35340 void ErrorAction_free(struct LDKErrorAction this_ptr);
35343 * Creates a copy of the ErrorAction
35345 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
35348 * Utility method to constructs a new DisconnectPeer-variant ErrorAction
35350 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
35353 * Utility method to constructs a new DisconnectPeerWithWarning-variant ErrorAction
35355 struct LDKErrorAction ErrorAction_disconnect_peer_with_warning(struct LDKWarningMessage msg);
35358 * Utility method to constructs a new IgnoreError-variant ErrorAction
35360 struct LDKErrorAction ErrorAction_ignore_error(void);
35363 * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
35365 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
35368 * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
35370 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
35373 * Utility method to constructs a new SendErrorMessage-variant ErrorAction
35375 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
35378 * Utility method to constructs a new SendWarningMessage-variant ErrorAction
35380 struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
35383 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
35385 void LightningError_free(struct LDKLightningError this_obj);
35388 * A human-readable message describing the error
35390 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
35393 * A human-readable message describing the error
35395 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
35398 * The action which should be taken against the offending peer.
35400 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
35403 * The action which should be taken against the offending peer.
35405 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
35408 * Constructs a new LightningError given each field
35410 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
35413 * Creates a copy of the LightningError
35415 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
35418 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
35420 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
35423 * `update_add_htlc` messages which should be sent
35425 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
35428 * `update_add_htlc` messages which should be sent
35430 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
35433 * `update_fulfill_htlc` messages which should be sent
35435 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
35438 * `update_fulfill_htlc` messages which should be sent
35440 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
35443 * `update_fail_htlc` messages which should be sent
35445 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
35448 * `update_fail_htlc` messages which should be sent
35450 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
35453 * `update_fail_malformed_htlc` messages which should be sent
35455 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
35458 * `update_fail_malformed_htlc` messages which should be sent
35460 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
35463 * An `update_fee` message which should be sent
35465 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35467 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
35470 * An `update_fee` message which should be sent
35472 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
35474 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
35477 * A `commitment_signed` message which should be sent
35479 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
35482 * A `commitment_signed` message which should be sent
35484 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
35487 * Constructs a new CommitmentUpdate given each field
35489 * Note that update_fee_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
35491 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);
35494 * Creates a copy of the CommitmentUpdate
35496 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
35499 * Checks if two CommitmentUpdates contain equal inner contents.
35500 * This ignores pointers and is_owned flags and looks at the values in fields.
35501 * Two objects with NULL inner values will be considered "equal" here.
35503 bool CommitmentUpdate_eq(const struct LDKCommitmentUpdate *NONNULL_PTR a, const struct LDKCommitmentUpdate *NONNULL_PTR b);
35506 * Calls the free function if one is set
35508 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
35511 * Calls the free function if one is set
35513 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
35516 * Calls the free function if one is set
35518 void OnionMessageHandler_free(struct LDKOnionMessageHandler this_ptr);
35521 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
35523 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
35526 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
35528 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
35531 * Serialize the AcceptChannelV2 object into a byte array which can be read by AcceptChannelV2_read
35533 struct LDKCVec_u8Z AcceptChannelV2_write(const struct LDKAcceptChannelV2 *NONNULL_PTR obj);
35536 * Read a AcceptChannelV2 from a byte array, created by AcceptChannelV2_write
35538 struct LDKCResult_AcceptChannelV2DecodeErrorZ AcceptChannelV2_read(struct LDKu8slice ser);
35541 * Serialize the TxAddInput object into a byte array which can be read by TxAddInput_read
35543 struct LDKCVec_u8Z TxAddInput_write(const struct LDKTxAddInput *NONNULL_PTR obj);
35546 * Read a TxAddInput from a byte array, created by TxAddInput_write
35548 struct LDKCResult_TxAddInputDecodeErrorZ TxAddInput_read(struct LDKu8slice ser);
35551 * Serialize the TxAddOutput object into a byte array which can be read by TxAddOutput_read
35553 struct LDKCVec_u8Z TxAddOutput_write(const struct LDKTxAddOutput *NONNULL_PTR obj);
35556 * Read a TxAddOutput from a byte array, created by TxAddOutput_write
35558 struct LDKCResult_TxAddOutputDecodeErrorZ TxAddOutput_read(struct LDKu8slice ser);
35561 * Serialize the TxRemoveInput object into a byte array which can be read by TxRemoveInput_read
35563 struct LDKCVec_u8Z TxRemoveInput_write(const struct LDKTxRemoveInput *NONNULL_PTR obj);
35566 * Read a TxRemoveInput from a byte array, created by TxRemoveInput_write
35568 struct LDKCResult_TxRemoveInputDecodeErrorZ TxRemoveInput_read(struct LDKu8slice ser);
35571 * Serialize the TxRemoveOutput object into a byte array which can be read by TxRemoveOutput_read
35573 struct LDKCVec_u8Z TxRemoveOutput_write(const struct LDKTxRemoveOutput *NONNULL_PTR obj);
35576 * Read a TxRemoveOutput from a byte array, created by TxRemoveOutput_write
35578 struct LDKCResult_TxRemoveOutputDecodeErrorZ TxRemoveOutput_read(struct LDKu8slice ser);
35581 * Serialize the TxComplete object into a byte array which can be read by TxComplete_read
35583 struct LDKCVec_u8Z TxComplete_write(const struct LDKTxComplete *NONNULL_PTR obj);
35586 * Read a TxComplete from a byte array, created by TxComplete_write
35588 struct LDKCResult_TxCompleteDecodeErrorZ TxComplete_read(struct LDKu8slice ser);
35591 * Serialize the TxSignatures object into a byte array which can be read by TxSignatures_read
35593 struct LDKCVec_u8Z TxSignatures_write(const struct LDKTxSignatures *NONNULL_PTR obj);
35596 * Read a TxSignatures from a byte array, created by TxSignatures_write
35598 struct LDKCResult_TxSignaturesDecodeErrorZ TxSignatures_read(struct LDKu8slice ser);
35601 * Serialize the TxInitRbf object into a byte array which can be read by TxInitRbf_read
35603 struct LDKCVec_u8Z TxInitRbf_write(const struct LDKTxInitRbf *NONNULL_PTR obj);
35606 * Read a TxInitRbf from a byte array, created by TxInitRbf_write
35608 struct LDKCResult_TxInitRbfDecodeErrorZ TxInitRbf_read(struct LDKu8slice ser);
35611 * Serialize the TxAckRbf object into a byte array which can be read by TxAckRbf_read
35613 struct LDKCVec_u8Z TxAckRbf_write(const struct LDKTxAckRbf *NONNULL_PTR obj);
35616 * Read a TxAckRbf from a byte array, created by TxAckRbf_write
35618 struct LDKCResult_TxAckRbfDecodeErrorZ TxAckRbf_read(struct LDKu8slice ser);
35621 * Serialize the TxAbort object into a byte array which can be read by TxAbort_read
35623 struct LDKCVec_u8Z TxAbort_write(const struct LDKTxAbort *NONNULL_PTR obj);
35626 * Read a TxAbort from a byte array, created by TxAbort_write
35628 struct LDKCResult_TxAbortDecodeErrorZ TxAbort_read(struct LDKu8slice ser);
35631 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
35633 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
35636 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
35638 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
35641 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
35643 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
35646 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
35648 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
35651 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
35653 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
35656 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
35658 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
35661 * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
35663 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
35666 * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
35668 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
35671 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
35673 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
35676 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
35678 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
35681 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
35683 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
35686 * Read a FundingCreated from a byte array, created by FundingCreated_write
35688 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
35691 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
35693 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
35696 * Read a FundingSigned from a byte array, created by FundingSigned_write
35698 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
35701 * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
35703 struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj);
35706 * Read a ChannelReady from a byte array, created by ChannelReady_write
35708 struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser);
35711 * Serialize the Init object into a byte array which can be read by Init_read
35713 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
35716 * Read a Init from a byte array, created by Init_write
35718 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
35721 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
35723 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
35726 * Read a OpenChannel from a byte array, created by OpenChannel_write
35728 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
35731 * Serialize the OpenChannelV2 object into a byte array which can be read by OpenChannelV2_read
35733 struct LDKCVec_u8Z OpenChannelV2_write(const struct LDKOpenChannelV2 *NONNULL_PTR obj);
35736 * Read a OpenChannelV2 from a byte array, created by OpenChannelV2_write
35738 struct LDKCResult_OpenChannelV2DecodeErrorZ OpenChannelV2_read(struct LDKu8slice ser);
35741 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
35743 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
35746 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
35748 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
35751 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
35753 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
35756 * Read a Shutdown from a byte array, created by Shutdown_write
35758 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
35761 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
35763 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
35766 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
35768 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
35771 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
35773 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
35776 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
35778 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
35781 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
35783 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
35786 * Read a UpdateFee from a byte array, created by UpdateFee_write
35788 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
35791 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
35793 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
35796 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
35798 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
35801 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
35803 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
35806 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
35808 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
35811 * Read a OnionMessage from a byte array, created by OnionMessage_write
35813 struct LDKCResult_OnionMessageDecodeErrorZ OnionMessage_read(struct LDKu8slice ser);
35816 * Serialize the OnionMessage object into a byte array which can be read by OnionMessage_read
35818 struct LDKCVec_u8Z OnionMessage_write(const struct LDKOnionMessage *NONNULL_PTR obj);
35821 * Serialize the Ping object into a byte array which can be read by Ping_read
35823 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
35826 * Read a Ping from a byte array, created by Ping_write
35828 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
35831 * Serialize the Pong object into a byte array which can be read by Pong_read
35833 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
35836 * Read a Pong from a byte array, created by Pong_write
35838 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
35841 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
35843 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
35846 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
35848 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
35851 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
35853 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
35856 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
35858 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
35861 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
35863 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
35866 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
35868 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
35871 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
35873 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
35876 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
35878 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
35881 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
35883 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
35886 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
35888 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
35891 * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
35893 struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
35896 * Read a WarningMessage from a byte array, created by WarningMessage_write
35898 struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
35901 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
35903 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
35906 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
35908 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
35911 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
35913 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
35916 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
35918 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
35921 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
35923 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
35926 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
35928 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
35931 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
35933 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
35936 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
35938 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
35941 * Calculates the overflow safe ending block height for the query.
35943 * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`.
35945 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
35948 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
35950 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
35953 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
35955 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
35958 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
35960 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
35963 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
35965 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
35968 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
35970 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
35973 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
35975 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
35978 * Calls the free function if one is set
35980 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
35983 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
35985 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
35988 * Constructs a new IgnoringMessageHandler given each field
35990 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
35993 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
35994 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
35996 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
35999 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
36000 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
36002 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
36005 * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
36006 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
36008 struct LDKOnionMessageHandler IgnoringMessageHandler_as_OnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
36011 * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
36012 * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
36014 struct LDKOffersMessageHandler IgnoringMessageHandler_as_OffersMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
36017 * Constructs a new CustomOnionMessageHandler which calls the relevant methods on this_arg.
36018 * This copies the `inner` pointer in this_arg and thus the returned CustomOnionMessageHandler must be freed before this_arg is
36020 struct LDKCustomOnionMessageHandler IgnoringMessageHandler_as_CustomOnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
36023 * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
36024 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
36026 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
36029 * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
36030 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
36032 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
36035 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
36037 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
36040 * Constructs a new ErroringMessageHandler
36042 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
36045 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
36046 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
36048 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
36051 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
36052 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
36054 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
36057 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
36059 void MessageHandler_free(struct LDKMessageHandler this_obj);
36062 * A message handler which handles messages specific to channels. Usually this is just a
36063 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
36065 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
36067 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
36070 * A message handler which handles messages specific to channels. Usually this is just a
36071 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
36073 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
36075 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
36078 * A message handler which handles messages updating our knowledge of the network channel
36079 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
36081 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
36083 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
36086 * A message handler which handles messages updating our knowledge of the network channel
36087 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
36089 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
36091 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
36094 * A message handler which handles onion messages. This should generally be an
36095 * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
36097 * [`OnionMessenger`]: crate::onion_message::OnionMessenger
36099 const struct LDKOnionMessageHandler *MessageHandler_get_onion_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
36102 * A message handler which handles onion messages. This should generally be an
36103 * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
36105 * [`OnionMessenger`]: crate::onion_message::OnionMessenger
36107 void MessageHandler_set_onion_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKOnionMessageHandler val);
36110 * A message handler which handles custom messages. The only LDK-provided implementation is
36111 * [`IgnoringMessageHandler`].
36113 const struct LDKCustomMessageHandler *MessageHandler_get_custom_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
36116 * A message handler which handles custom messages. The only LDK-provided implementation is
36117 * [`IgnoringMessageHandler`].
36119 void MessageHandler_set_custom_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKCustomMessageHandler val);
36122 * Constructs a new MessageHandler given each field
36124 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);
36127 * Creates a copy of a SocketDescriptor
36129 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
36132 * Calls the free function if one is set
36134 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
36137 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
36139 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
36142 * Constructs a new PeerHandleError given each field
36144 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(void);
36147 * Creates a copy of the PeerHandleError
36149 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
36152 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
36154 void PeerManager_free(struct LDKPeerManager this_obj);
36157 * Constructs a new `PeerManager` with the given message handlers.
36159 * `ephemeral_random_data` is used to derive per-connection ephemeral keys and must be
36160 * cryptographically secure random bytes.
36162 * `current_time` is used as an always-increasing counter that survives across restarts and is
36163 * incremented irregularly internally. In general it is best to simply use the current UNIX
36164 * timestamp, however if it is not available a persistent counter that increases once per
36165 * minute should suffice.
36167 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);
36170 * Get a list of tuples mapping from node id to network addresses for peers which have
36171 * completed the initial handshake.
36173 * For outbound connections, the [`PublicKey`] will be the same as the `their_node_id` parameter
36174 * passed in to [`Self::new_outbound_connection`], however entries will only appear once the initial
36175 * handshake has completed and we are sure the remote peer has the private key for the given
36178 * The returned `Option`s will only be `Some` if an address had been previously given via
36179 * [`Self::new_outbound_connection`] or [`Self::new_inbound_connection`].
36181 MUST_USE_RES struct LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
36184 * Indicates a new outbound connection has been established to a node with the given `node_id`
36185 * and an optional remote network address.
36187 * The remote network address adds the option to report a remote IP address back to a connecting
36188 * peer using the init message.
36189 * The user should pass the remote network address of the host they are connected to.
36191 * If an `Err` is returned here you must disconnect the connection immediately.
36193 * Returns a small number of bytes to send to the remote node (currently always 50).
36195 * Panics if descriptor is duplicative with some other descriptor which has not yet been
36196 * [`socket_disconnected`].
36198 * [`socket_disconnected`]: PeerManager::socket_disconnected
36200 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);
36203 * Indicates a new inbound connection has been established to a node with an optional remote
36206 * The remote network address adds the option to report a remote IP address back to a connecting
36207 * peer using the init message.
36208 * The user should pass the remote network address of the host they are connected to.
36210 * May refuse the connection by returning an Err, but will never write bytes to the remote end
36211 * (outbound connector always speaks first). If an `Err` is returned here you must disconnect
36212 * the connection immediately.
36214 * Panics if descriptor is duplicative with some other descriptor which has not yet been
36215 * [`socket_disconnected`].
36217 * [`socket_disconnected`]: PeerManager::socket_disconnected
36219 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);
36222 * Indicates that there is room to write data to the given socket descriptor.
36224 * May return an Err to indicate that the connection should be closed.
36226 * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
36227 * returning. Thus, be very careful with reentrancy issues! The invariants around calling
36228 * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
36229 * ready to call [`write_buffer_space_avail`] again if a write call generated here isn't
36232 * [`send_data`]: SocketDescriptor::send_data
36233 * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
36235 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
36238 * Indicates that data was read from the given socket descriptor.
36240 * May return an Err to indicate that the connection should be closed.
36242 * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
36243 * Thus, however, you should call [`process_events`] after any `read_event` to generate
36244 * [`send_data`] calls to handle responses.
36246 * If `Ok(true)` is returned, further read_events should not be triggered until a
36247 * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
36250 * In order to avoid processing too many messages at once per peer, `data` should be on the
36253 * [`send_data`]: SocketDescriptor::send_data
36254 * [`process_events`]: PeerManager::process_events
36256 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);
36259 * Checks for any events generated by our handlers and processes them. Includes sending most
36260 * response messages as well as messages generated by calls to handler functions directly (eg
36261 * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
36263 * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
36266 * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
36267 * or one of the other clients provided in our language bindings.
36269 * Note that if there are any other calls to this function waiting on lock(s) this may return
36270 * without doing any work. All available events that need handling will be handled before the
36271 * other calls return.
36273 * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
36274 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
36275 * [`send_data`]: SocketDescriptor::send_data
36277 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
36280 * Indicates that the given socket descriptor's connection is now closed.
36282 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
36285 * Disconnect a peer given its node id.
36287 * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
36288 * peer. Thus, be very careful about reentrancy issues.
36290 * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
36292 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
36295 * Disconnects all currently-connected peers. This is useful on platforms where there may be
36296 * an indication that TCP sockets have stalled even if we weren't around to time them out
36297 * using regular ping/pongs.
36299 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
36302 * Send pings to each peer and disconnect those which did not respond to the last round of
36305 * This may be called on any timescale you want, however, roughly once every ten seconds is
36306 * preferred. The call rate determines both how often we send a ping to our peers and how much
36307 * time they have to respond before we disconnect them.
36309 * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
36312 * [`send_data`]: SocketDescriptor::send_data
36314 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
36317 * Generates a signed node_announcement from the given arguments, sending it to all connected
36318 * peers. Note that peers will likely ignore this message unless we have at least one public
36319 * channel which has at least six confirmations on-chain.
36321 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
36322 * node to humans. They carry no in-protocol meaning.
36324 * `addresses` represent the set (possibly empty) of socket addresses on which this node
36325 * accepts incoming connections. These will be included in the node_announcement, publicly
36326 * tying these addresses together and to this node. If you wish to preserve user privacy,
36327 * addresses should likely contain only Tor Onion addresses.
36329 * Panics if `addresses` is absurdly large (more than 100).
36331 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
36333 void PeerManager_broadcast_node_announcement(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_SocketAddressZ addresses);
36336 * Gets the weight for an HTLC-Success transaction.
36338 uint64_t htlc_success_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
36341 * Gets the weight for an HTLC-Timeout transaction.
36343 uint64_t htlc_timeout_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
36346 * Creates a copy of the HTLCClaim
36348 enum LDKHTLCClaim HTLCClaim_clone(const enum LDKHTLCClaim *NONNULL_PTR orig);
36351 * Utility method to constructs a new OfferedTimeout-variant HTLCClaim
36353 enum LDKHTLCClaim HTLCClaim_offered_timeout(void);
36356 * Utility method to constructs a new OfferedPreimage-variant HTLCClaim
36358 enum LDKHTLCClaim HTLCClaim_offered_preimage(void);
36361 * Utility method to constructs a new AcceptedTimeout-variant HTLCClaim
36363 enum LDKHTLCClaim HTLCClaim_accepted_timeout(void);
36366 * Utility method to constructs a new AcceptedPreimage-variant HTLCClaim
36368 enum LDKHTLCClaim HTLCClaim_accepted_preimage(void);
36371 * Utility method to constructs a new Revocation-variant HTLCClaim
36373 enum LDKHTLCClaim HTLCClaim_revocation(void);
36376 * Checks if two HTLCClaims contain equal inner contents.
36377 * This ignores pointers and is_owned flags and looks at the values in fields.
36379 bool HTLCClaim_eq(const enum LDKHTLCClaim *NONNULL_PTR a, const enum LDKHTLCClaim *NONNULL_PTR b);
36382 * Check if a given input witness attempts to claim a HTLC.
36384 MUST_USE_RES struct LDKCOption_HTLCClaimZ HTLCClaim_from_witness(struct LDKWitness witness);
36387 * Build the commitment secret from the seed and the commitment number
36389 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
36392 * Build a closing transaction
36394 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);
36397 * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
36399 void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
36402 * Creates a copy of the CounterpartyCommitmentSecrets
36404 struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
36407 * Creates a new empty `CounterpartyCommitmentSecrets` structure.
36409 MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
36412 * Returns the minimum index of all stored secrets. Note that indexes start
36413 * at 1 << 48 and get decremented by one for each new secret.
36415 MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
36418 * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
36419 * was generated in accordance with BOLT 3 and is consistent with previous secrets.
36421 MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
36424 * Returns the secret at `idx`.
36425 * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
36427 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36429 MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
36432 * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
36434 struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
36437 * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
36439 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
36442 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
36443 * from the base secret and the per_commitment_point.
36445 struct LDKSecretKey derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
36448 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
36449 * from the base point and the per_commitment_key. This is the public equivalent of
36450 * derive_private_key - using only public keys to derive a public key instead of private keys.
36452 struct LDKPublicKey derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
36455 * Derives a per-commitment-transaction revocation key from its constituent parts.
36457 * Only the cheating participant owns a valid witness to propagate a revoked
36458 * commitment transaction, thus per_commitment_secret always come from cheater
36459 * and revocation_base_secret always come from punisher, which is the broadcaster
36460 * of the transaction spending with this key knowledge.
36462 struct LDKSecretKey derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
36465 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
36466 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
36467 * public key instead of private keys.
36469 * Only the cheating participant owns a valid witness to propagate a revoked
36470 * commitment transaction, thus per_commitment_point always come from cheater
36471 * and revocation_base_point always come from punisher, which is the broadcaster
36472 * of the transaction spending with this key knowledge.
36474 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
36475 * generated (ie our own).
36477 struct LDKPublicKey derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
36480 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
36482 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
36485 * The broadcaster's per-commitment public key which was used to derive the other keys.
36487 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
36490 * The broadcaster's per-commitment public key which was used to derive the other keys.
36492 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36495 * The revocation key which is used to allow the broadcaster of the commitment
36496 * transaction to provide their counterparty the ability to punish them if they broadcast
36499 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
36502 * The revocation key which is used to allow the broadcaster of the commitment
36503 * transaction to provide their counterparty the ability to punish them if they broadcast
36506 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36509 * Broadcaster's HTLC Key
36511 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
36514 * Broadcaster's HTLC Key
36516 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36519 * Countersignatory's HTLC Key
36521 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
36524 * Countersignatory's HTLC Key
36526 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36529 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
36531 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
36534 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
36536 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36539 * Constructs a new TxCreationKeys given each field
36541 MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_new(struct LDKPublicKey per_commitment_point_arg, struct LDKPublicKey revocation_key_arg, struct LDKPublicKey broadcaster_htlc_key_arg, struct LDKPublicKey countersignatory_htlc_key_arg, struct LDKPublicKey broadcaster_delayed_payment_key_arg);
36544 * Checks if two TxCreationKeyss contain equal inner contents.
36545 * This ignores pointers and is_owned flags and looks at the values in fields.
36546 * Two objects with NULL inner values will be considered "equal" here.
36548 bool TxCreationKeys_eq(const struct LDKTxCreationKeys *NONNULL_PTR a, const struct LDKTxCreationKeys *NONNULL_PTR b);
36551 * Creates a copy of the TxCreationKeys
36553 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
36556 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
36558 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
36561 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
36563 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
36566 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
36568 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
36571 * The public key which is used to sign all commitment transactions, as it appears in the
36572 * on-chain channel lock-in 2-of-2 multisig output.
36574 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
36577 * The public key which is used to sign all commitment transactions, as it appears in the
36578 * on-chain channel lock-in 2-of-2 multisig output.
36580 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36583 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
36584 * revocation keys. This is combined with the per-commitment-secret generated by the
36585 * counterparty to create a secret which the counterparty can reveal to revoke previous
36588 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
36591 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
36592 * revocation keys. This is combined with the per-commitment-secret generated by the
36593 * counterparty to create a secret which the counterparty can reveal to revoke previous
36596 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36599 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
36600 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
36601 * static across every commitment transaction.
36603 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
36606 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
36607 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
36608 * static across every commitment transaction.
36610 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36613 * The base point which is used (with derive_public_key) to derive a per-commitment payment
36614 * public key which receives non-HTLC-encumbered funds which are only available for spending
36615 * after some delay (or can be claimed via the revocation path).
36617 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
36620 * The base point which is used (with derive_public_key) to derive a per-commitment payment
36621 * public key which receives non-HTLC-encumbered funds which are only available for spending
36622 * after some delay (or can be claimed via the revocation path).
36624 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36627 * The base point which is used (with derive_public_key) to derive a per-commitment public key
36628 * which is used to encumber HTLC-in-flight outputs.
36630 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
36633 * The base point which is used (with derive_public_key) to derive a per-commitment public key
36634 * which is used to encumber HTLC-in-flight outputs.
36636 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36639 * Constructs a new ChannelPublicKeys given each field
36641 MUST_USE_RES struct LDKChannelPublicKeys ChannelPublicKeys_new(struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg);
36644 * Creates a copy of the ChannelPublicKeys
36646 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
36649 * Generates a non-cryptographic 64-bit hash of the ChannelPublicKeys.
36651 uint64_t ChannelPublicKeys_hash(const struct LDKChannelPublicKeys *NONNULL_PTR o);
36654 * Checks if two ChannelPublicKeyss contain equal inner contents.
36655 * This ignores pointers and is_owned flags and looks at the values in fields.
36656 * Two objects with NULL inner values will be considered "equal" here.
36658 bool ChannelPublicKeys_eq(const struct LDKChannelPublicKeys *NONNULL_PTR a, const struct LDKChannelPublicKeys *NONNULL_PTR b);
36661 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
36663 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
36666 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
36668 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
36671 * Create per-state keys from channel base points and the per-commitment point.
36672 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
36674 MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_derive_new(struct LDKPublicKey per_commitment_point, struct LDKPublicKey broadcaster_delayed_payment_base, struct LDKPublicKey broadcaster_htlc_base, struct LDKPublicKey countersignatory_revocation_base, struct LDKPublicKey countersignatory_htlc_base);
36677 * Generate per-state keys from channel static keys.
36678 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
36680 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);
36683 * A script either spendable by the revocation
36684 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
36685 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
36687 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
36690 * Returns the script for the counterparty's output on a holder's commitment transaction based on
36691 * the channel type.
36693 struct LDKCVec_u8Z get_counterparty_payment_script(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, struct LDKPublicKey payment_key);
36696 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
36698 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
36701 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
36702 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
36703 * need to compare this value to whether the commitment transaction in question is that of
36704 * the counterparty or our own.
36706 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
36709 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
36710 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
36711 * need to compare this value to whether the commitment transaction in question is that of
36712 * the counterparty or our own.
36714 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
36717 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
36718 * this divided by 1000.
36720 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
36723 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
36724 * this divided by 1000.
36726 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
36729 * The CLTV lock-time at which this HTLC expires.
36731 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
36734 * The CLTV lock-time at which this HTLC expires.
36736 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
36739 * The hash of the preimage which unlocks this HTLC.
36741 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
36744 * The hash of the preimage which unlocks this HTLC.
36746 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36749 * The position within the commitment transactions' outputs. This may be None if the value is
36750 * below the dust limit (in which case no output appears in the commitment transaction and the
36751 * value is spent to additional transaction fees).
36753 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
36756 * The position within the commitment transactions' outputs. This may be None if the value is
36757 * below the dust limit (in which case no output appears in the commitment transaction and the
36758 * value is spent to additional transaction fees).
36760 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
36763 * Constructs a new HTLCOutputInCommitment given each field
36765 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);
36768 * Creates a copy of the HTLCOutputInCommitment
36770 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
36773 * Checks if two HTLCOutputInCommitments contain equal inner contents.
36774 * This ignores pointers and is_owned flags and looks at the values in fields.
36775 * Two objects with NULL inner values will be considered "equal" here.
36777 bool HTLCOutputInCommitment_eq(const struct LDKHTLCOutputInCommitment *NONNULL_PTR a, const struct LDKHTLCOutputInCommitment *NONNULL_PTR b);
36780 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
36782 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
36785 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
36787 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
36790 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
36791 * does not need to have its previous_output_index filled.
36793 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);
36796 * Gets the redeemscript for a funding output from the two funding public keys.
36797 * Note that the order of funding public keys does not matter.
36799 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
36802 * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
36803 * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
36804 * transaction which needs signing, and can be used to construct an HTLC transaction which is
36805 * broadcastable given a counterparty HTLC signature.
36807 * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
36808 * commitment transaction).
36810 struct LDKTransaction build_htlc_transaction(const uint8_t (*commitment_txid)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key);
36813 * Returns the witness required to satisfy and spend a HTLC input.
36815 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);
36818 * Gets the witnessScript for the to_remote output when anchors are enabled.
36820 struct LDKCVec_u8Z get_to_countersignatory_with_anchors_redeemscript(struct LDKPublicKey payment_point);
36823 * Gets the witnessScript for an anchor output from the funding public key.
36824 * The witness in the spending input must be:
36825 * <BIP 143 funding_signature>
36826 * After 16 blocks of confirmation, an alternative satisfying witness could be:
36828 * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
36830 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
36833 * Returns the witness required to satisfy and spend an anchor input.
36835 struct LDKWitness build_anchor_input_witness(struct LDKPublicKey funding_key, struct LDKECDSASignature funding_sig);
36838 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
36840 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
36843 * Holder public keys
36845 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
36848 * Holder public keys
36850 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
36853 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
36855 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
36858 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
36860 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
36863 * Whether the holder is the initiator of this channel.
36864 * This is an input to the commitment number obscure factor computation.
36866 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
36869 * Whether the holder is the initiator of this channel.
36870 * This is an input to the commitment number obscure factor computation.
36872 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
36875 * The late-bound counterparty channel transaction parameters.
36876 * These parameters are populated at the point in the protocol where the counterparty provides them.
36878 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36880 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
36883 * The late-bound counterparty channel transaction parameters.
36884 * These parameters are populated at the point in the protocol where the counterparty provides them.
36886 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36888 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
36891 * The late-bound funding outpoint
36893 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36895 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
36898 * The late-bound funding outpoint
36900 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36902 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
36905 * This channel's type, as negotiated during channel open. For old objects where this field
36906 * wasn't serialized, it will default to static_remote_key at deserialization.
36908 struct LDKChannelTypeFeatures ChannelTransactionParameters_get_channel_type_features(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
36911 * This channel's type, as negotiated during channel open. For old objects where this field
36912 * wasn't serialized, it will default to static_remote_key at deserialization.
36914 void ChannelTransactionParameters_set_channel_type_features(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
36917 * Constructs a new ChannelTransactionParameters given each field
36919 * Note that counterparty_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
36920 * Note that funding_outpoint_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
36922 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);
36925 * Creates a copy of the ChannelTransactionParameters
36927 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
36930 * Generates a non-cryptographic 64-bit hash of the ChannelTransactionParameters.
36932 uint64_t ChannelTransactionParameters_hash(const struct LDKChannelTransactionParameters *NONNULL_PTR o);
36935 * Checks if two ChannelTransactionParameterss contain equal inner contents.
36936 * This ignores pointers and is_owned flags and looks at the values in fields.
36937 * Two objects with NULL inner values will be considered "equal" here.
36939 bool ChannelTransactionParameters_eq(const struct LDKChannelTransactionParameters *NONNULL_PTR a, const struct LDKChannelTransactionParameters *NONNULL_PTR b);
36942 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
36944 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
36947 * Counter-party public keys
36949 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
36952 * Counter-party public keys
36954 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
36957 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
36959 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
36962 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
36964 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
36967 * Constructs a new CounterpartyChannelTransactionParameters given each field
36969 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
36972 * Creates a copy of the CounterpartyChannelTransactionParameters
36974 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
36977 * Generates a non-cryptographic 64-bit hash of the CounterpartyChannelTransactionParameters.
36979 uint64_t CounterpartyChannelTransactionParameters_hash(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR o);
36982 * Checks if two CounterpartyChannelTransactionParameterss contain equal inner contents.
36983 * This ignores pointers and is_owned flags and looks at the values in fields.
36984 * Two objects with NULL inner values will be considered "equal" here.
36986 bool CounterpartyChannelTransactionParameters_eq(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR a, const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR b);
36989 * Whether the late bound parameters are populated.
36991 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
36994 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
36995 * given that the holder is the broadcaster.
36997 * self.is_populated() must be true before calling this function.
36999 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
37002 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
37003 * given that the counterparty is the broadcaster.
37005 * self.is_populated() must be true before calling this function.
37007 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
37010 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
37012 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
37015 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
37017 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
37020 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
37022 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
37025 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
37027 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
37030 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
37032 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
37035 * Get the channel pubkeys for the broadcaster
37037 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
37040 * Get the channel pubkeys for the countersignatory
37042 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
37045 * Get the contest delay applicable to the transactions.
37046 * Note that the contest delay was selected by the countersignatory.
37048 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
37051 * Whether the channel is outbound from the broadcaster.
37053 * The boolean representing the side that initiated the channel is
37054 * an input to the commitment number obscure factor computation.
37056 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
37059 * The funding outpoint
37061 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
37064 * Whether to use anchors for this channel
37066 MUST_USE_RES struct LDKChannelTypeFeatures DirectedChannelTransactionParameters_channel_type_features(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
37069 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
37071 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
37074 * Our counterparty's signature for the transaction
37076 struct LDKECDSASignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
37079 * Our counterparty's signature for the transaction
37081 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
37084 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
37086 * Returns a copy of the field.
37088 struct LDKCVec_ECDSASignatureZ HolderCommitmentTransaction_get_counterparty_htlc_sigs(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
37091 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
37093 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
37096 * Creates a copy of the HolderCommitmentTransaction
37098 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
37101 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
37103 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
37106 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
37108 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
37111 * Create a new holder transaction with the given counterparty signatures.
37112 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
37114 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);
37117 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
37119 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
37122 * The commitment transaction
37124 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
37127 * The commitment transaction
37129 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
37132 * The txid for the commitment transaction.
37134 * This is provided as a performance optimization, instead of calling transaction.txid()
37137 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
37140 * The txid for the commitment transaction.
37142 * This is provided as a performance optimization, instead of calling transaction.txid()
37145 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37148 * Constructs a new BuiltCommitmentTransaction given each field
37150 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
37153 * Creates a copy of the BuiltCommitmentTransaction
37155 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
37158 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
37160 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
37163 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
37165 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
37168 * Get the SIGHASH_ALL sighash value of the transaction.
37170 * This can be used to verify a signature.
37172 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);
37175 * Signs the counterparty's commitment transaction.
37177 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);
37180 * Signs the holder commitment transaction because we are about to broadcast it.
37182 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);
37185 * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
37187 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
37190 * Creates a copy of the ClosingTransaction
37192 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
37195 * Generates a non-cryptographic 64-bit hash of the ClosingTransaction.
37197 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
37200 * Checks if two ClosingTransactions contain equal inner contents.
37201 * This ignores pointers and is_owned flags and looks at the values in fields.
37202 * Two objects with NULL inner values will be considered "equal" here.
37204 bool ClosingTransaction_eq(const struct LDKClosingTransaction *NONNULL_PTR a, const struct LDKClosingTransaction *NONNULL_PTR b);
37207 * Construct an object of the class
37209 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);
37212 * Trust our pre-built transaction.
37214 * Applies a wrapper which allows access to the transaction.
37216 * This should only be used if you fully trust the builder of this object. It should not
37217 * be used by an external signer - instead use the verify function.
37219 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
37222 * Verify our pre-built transaction.
37224 * Applies a wrapper which allows access to the transaction.
37226 * An external validating signer must call this method before signing
37227 * or using the built transaction.
37229 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
37232 * The value to be sent to the holder, or zero if the output will be omitted
37234 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
37237 * The value to be sent to the counterparty, or zero if the output will be omitted
37239 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
37242 * The destination of the holder's output
37244 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
37247 * The destination of the counterparty's output
37249 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
37252 * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
37254 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
37257 * The pre-built Bitcoin commitment transaction
37259 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
37262 * Get the SIGHASH_ALL sighash value of the transaction.
37264 * This can be used to verify a signature.
37266 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);
37269 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
37270 * because we are about to broadcast a holder transaction.
37272 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);
37275 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
37277 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
37280 * Creates a copy of the CommitmentTransaction
37282 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
37285 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
37287 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
37290 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
37292 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
37295 * The backwards-counting commitment number
37297 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
37300 * The per commitment point used by the broadcaster.
37302 MUST_USE_RES struct LDKPublicKey CommitmentTransaction_per_commitment_point(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
37305 * The value to be sent to the broadcaster
37307 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
37310 * The value to be sent to the counterparty
37312 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
37315 * The feerate paid per 1000-weight-unit in this commitment transaction.
37317 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
37320 * Trust our pre-built transaction and derived transaction creation public keys.
37322 * Applies a wrapper which allows access to these fields.
37324 * This should only be used if you fully trust the builder of this object. It should not
37325 * be used by an external signer - instead use the verify function.
37327 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
37330 * Verify our pre-built transaction and derived transaction creation public keys.
37332 * Applies a wrapper which allows access to these fields.
37334 * An external validating signer must call this method before signing
37335 * or using the built transaction.
37337 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);
37340 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
37342 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
37345 * The transaction ID of the built Bitcoin transaction
37347 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
37350 * The pre-built Bitcoin commitment transaction
37352 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
37355 * The pre-calculated transaction creation public keys.
37357 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
37360 * Should anchors be used.
37362 MUST_USE_RES struct LDKChannelTypeFeatures TrustedCommitmentTransaction_channel_type_features(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
37365 * Get a signature for each HTLC which was included in the commitment transaction (ie for
37366 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
37368 * The returned Vec has one entry for each HTLC, and in the same order.
37370 * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
37372 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);
37375 * Returns the index of the revokeable output, i.e. the `to_local` output sending funds to
37376 * the broadcaster, in the built transaction, if any exists.
37378 * There are two cases where this may return `None`:
37379 * - The balance of the revokeable output is below the dust limit (only found on commitments
37380 * early in the channel's lifetime, i.e. before the channel reserve is met).
37381 * - This commitment was created before LDK 0.0.117. In this case, the
37382 * commitment transaction previously didn't contain enough information to locate the
37383 * revokeable output.
37385 MUST_USE_RES struct LDKCOption_usizeZ TrustedCommitmentTransaction_revokeable_output_index(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
37388 * Helper method to build an unsigned justice transaction spending the revokeable
37389 * `to_local` output to a destination script. Fee estimation accounts for the expected
37390 * revocation witness data that will be added when signed.
37392 * This method will error if the given fee rate results in a fee greater than the value
37393 * of the output being spent, or if there exists no revokeable `to_local` output on this
37394 * commitment transaction. See [`Self::revokeable_output_index`] for more details.
37396 * The built transaction will allow fee bumping with RBF, and this method takes
37397 * `feerate_per_kw` as an input such that multiple copies of a justice transaction at different
37398 * fee rates may be built.
37400 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);
37403 * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
37404 * shared secret first. This prevents on-chain observers from discovering how many commitment
37405 * transactions occurred in a channel before it was closed.
37407 * This function gets the shared secret from relevant channel public keys and can be used to
37408 * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
37410 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
37413 * Checks if two InitFeaturess contain equal inner contents.
37414 * This ignores pointers and is_owned flags and looks at the values in fields.
37415 * Two objects with NULL inner values will be considered "equal" here.
37417 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
37420 * Checks if two NodeFeaturess contain equal inner contents.
37421 * This ignores pointers and is_owned flags and looks at the values in fields.
37422 * Two objects with NULL inner values will be considered "equal" here.
37424 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
37427 * Checks if two ChannelFeaturess contain equal inner contents.
37428 * This ignores pointers and is_owned flags and looks at the values in fields.
37429 * Two objects with NULL inner values will be considered "equal" here.
37431 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
37434 * Checks if two Bolt11InvoiceFeaturess contain equal inner contents.
37435 * This ignores pointers and is_owned flags and looks at the values in fields.
37436 * Two objects with NULL inner values will be considered "equal" here.
37438 bool Bolt11InvoiceFeatures_eq(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR b);
37441 * Checks if two OfferFeaturess contain equal inner contents.
37442 * This ignores pointers and is_owned flags and looks at the values in fields.
37443 * Two objects with NULL inner values will be considered "equal" here.
37445 bool OfferFeatures_eq(const struct LDKOfferFeatures *NONNULL_PTR a, const struct LDKOfferFeatures *NONNULL_PTR b);
37448 * Checks if two InvoiceRequestFeaturess contain equal inner contents.
37449 * This ignores pointers and is_owned flags and looks at the values in fields.
37450 * Two objects with NULL inner values will be considered "equal" here.
37452 bool InvoiceRequestFeatures_eq(const struct LDKInvoiceRequestFeatures *NONNULL_PTR a, const struct LDKInvoiceRequestFeatures *NONNULL_PTR b);
37455 * Checks if two Bolt12InvoiceFeaturess contain equal inner contents.
37456 * This ignores pointers and is_owned flags and looks at the values in fields.
37457 * Two objects with NULL inner values will be considered "equal" here.
37459 bool Bolt12InvoiceFeatures_eq(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR b);
37462 * Checks if two BlindedHopFeaturess contain equal inner contents.
37463 * This ignores pointers and is_owned flags and looks at the values in fields.
37464 * Two objects with NULL inner values will be considered "equal" here.
37466 bool BlindedHopFeatures_eq(const struct LDKBlindedHopFeatures *NONNULL_PTR a, const struct LDKBlindedHopFeatures *NONNULL_PTR b);
37469 * Checks if two ChannelTypeFeaturess contain equal inner contents.
37470 * This ignores pointers and is_owned flags and looks at the values in fields.
37471 * Two objects with NULL inner values will be considered "equal" here.
37473 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
37476 * Creates a copy of the InitFeatures
37478 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
37481 * Creates a copy of the NodeFeatures
37483 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
37486 * Creates a copy of the ChannelFeatures
37488 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
37491 * Creates a copy of the Bolt11InvoiceFeatures
37493 struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_clone(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR orig);
37496 * Creates a copy of the OfferFeatures
37498 struct LDKOfferFeatures OfferFeatures_clone(const struct LDKOfferFeatures *NONNULL_PTR orig);
37501 * Creates a copy of the InvoiceRequestFeatures
37503 struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_clone(const struct LDKInvoiceRequestFeatures *NONNULL_PTR orig);
37506 * Creates a copy of the Bolt12InvoiceFeatures
37508 struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_clone(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR orig);
37511 * Creates a copy of the BlindedHopFeatures
37513 struct LDKBlindedHopFeatures BlindedHopFeatures_clone(const struct LDKBlindedHopFeatures *NONNULL_PTR orig);
37516 * Creates a copy of the ChannelTypeFeatures
37518 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
37521 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
37523 void InitFeatures_free(struct LDKInitFeatures this_obj);
37526 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
37528 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
37531 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
37533 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
37536 * Frees any resources used by the Bolt11InvoiceFeatures, if is_owned is set and inner is non-NULL.
37538 void Bolt11InvoiceFeatures_free(struct LDKBolt11InvoiceFeatures this_obj);
37541 * Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
37543 void OfferFeatures_free(struct LDKOfferFeatures this_obj);
37546 * Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
37548 void InvoiceRequestFeatures_free(struct LDKInvoiceRequestFeatures this_obj);
37551 * Frees any resources used by the Bolt12InvoiceFeatures, if is_owned is set and inner is non-NULL.
37553 void Bolt12InvoiceFeatures_free(struct LDKBolt12InvoiceFeatures this_obj);
37556 * Frees any resources used by the BlindedHopFeatures, if is_owned is set and inner is non-NULL.
37558 void BlindedHopFeatures_free(struct LDKBlindedHopFeatures this_obj);
37561 * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
37563 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
37566 * Create a blank Features with no features set
37568 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
37571 * Returns true if this `Features` object contains required features unknown by `other`.
37573 MUST_USE_RES bool InitFeatures_requires_unknown_bits_from(const struct LDKInitFeatures *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR other);
37576 * Returns true if this `Features` object contains unknown feature flags which are set as
37579 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37582 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37585 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37586 * be set instead (i.e., `bit - 1`).
37588 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37590 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37593 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37596 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37597 * set instead (i.e., `bit + 1`).
37599 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37601 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37604 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37605 * by [bLIP 2] or if it is a known `T` feature.
37607 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37608 * be set instead (i.e., `bit - 1`).
37610 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37612 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37615 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37616 * by [bLIP 2] or if it is a known `T` feature.
37618 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37619 * set instead (i.e., `bit + 1`).
37621 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37623 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37626 * Create a blank Features with no features set
37628 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
37631 * Returns true if this `Features` object contains required features unknown by `other`.
37633 MUST_USE_RES bool NodeFeatures_requires_unknown_bits_from(const struct LDKNodeFeatures *NONNULL_PTR this_arg, const struct LDKNodeFeatures *NONNULL_PTR other);
37636 * Returns true if this `Features` object contains unknown feature flags which are set as
37639 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37642 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37645 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37646 * be set instead (i.e., `bit - 1`).
37648 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37650 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37653 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37656 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37657 * set instead (i.e., `bit + 1`).
37659 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37661 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37664 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37665 * by [bLIP 2] or if it is a known `T` feature.
37667 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37668 * be set instead (i.e., `bit - 1`).
37670 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37672 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37675 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37676 * by [bLIP 2] or if it is a known `T` feature.
37678 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37679 * set instead (i.e., `bit + 1`).
37681 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37683 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37686 * Create a blank Features with no features set
37688 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
37691 * Returns true if this `Features` object contains required features unknown by `other`.
37693 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits_from(const struct LDKChannelFeatures *NONNULL_PTR this_arg, const struct LDKChannelFeatures *NONNULL_PTR other);
37696 * Returns true if this `Features` object contains unknown feature flags which are set as
37699 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
37702 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37705 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37706 * be set instead (i.e., `bit - 1`).
37708 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37710 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37713 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37716 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37717 * set instead (i.e., `bit + 1`).
37719 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37721 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37724 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37725 * by [bLIP 2] or if it is a known `T` feature.
37727 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37728 * be set instead (i.e., `bit - 1`).
37730 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37732 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37735 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37736 * by [bLIP 2] or if it is a known `T` feature.
37738 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37739 * set instead (i.e., `bit + 1`).
37741 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37743 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37746 * Create a blank Features with no features set
37748 MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_empty(void);
37751 * Returns true if this `Features` object contains required features unknown by `other`.
37753 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR other);
37756 * Returns true if this `Features` object contains unknown feature flags which are set as
37759 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
37762 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37765 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37766 * be set instead (i.e., `bit - 1`).
37768 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37770 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37773 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37776 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37777 * set instead (i.e., `bit + 1`).
37779 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37781 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37784 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37785 * by [bLIP 2] or if it is a known `T` feature.
37787 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37788 * be set instead (i.e., `bit - 1`).
37790 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37792 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37795 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37796 * by [bLIP 2] or if it is a known `T` feature.
37798 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37799 * set instead (i.e., `bit + 1`).
37801 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37803 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37806 * Create a blank Features with no features set
37808 MUST_USE_RES struct LDKOfferFeatures OfferFeatures_empty(void);
37811 * Returns true if this `Features` object contains required features unknown by `other`.
37813 MUST_USE_RES bool OfferFeatures_requires_unknown_bits_from(const struct LDKOfferFeatures *NONNULL_PTR this_arg, const struct LDKOfferFeatures *NONNULL_PTR other);
37816 * Returns true if this `Features` object contains unknown feature flags which are set as
37819 MUST_USE_RES bool OfferFeatures_requires_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg);
37822 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37825 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37826 * be set instead (i.e., `bit - 1`).
37828 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37830 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37833 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37836 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37837 * set instead (i.e., `bit + 1`).
37839 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37841 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37844 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37845 * by [bLIP 2] or if it is a known `T` feature.
37847 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37848 * be set instead (i.e., `bit - 1`).
37850 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37852 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37855 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37856 * by [bLIP 2] or if it is a known `T` feature.
37858 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37859 * set instead (i.e., `bit + 1`).
37861 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37863 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37866 * Create a blank Features with no features set
37868 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_empty(void);
37871 * Returns true if this `Features` object contains required features unknown by `other`.
37873 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits_from(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, const struct LDKInvoiceRequestFeatures *NONNULL_PTR other);
37876 * Returns true if this `Features` object contains unknown feature flags which are set as
37879 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg);
37882 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37885 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37886 * be set instead (i.e., `bit - 1`).
37888 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37890 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37893 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37896 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37897 * set instead (i.e., `bit + 1`).
37899 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37901 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37904 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37905 * by [bLIP 2] or if it is a known `T` feature.
37907 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37908 * be set instead (i.e., `bit - 1`).
37910 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37912 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37915 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37916 * by [bLIP 2] or if it is a known `T` feature.
37918 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37919 * set instead (i.e., `bit + 1`).
37921 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37923 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37926 * Create a blank Features with no features set
37928 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_empty(void);
37931 * Returns true if this `Features` object contains required features unknown by `other`.
37933 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR other);
37936 * Returns true if this `Features` object contains unknown feature flags which are set as
37939 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
37942 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37945 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37946 * be set instead (i.e., `bit - 1`).
37948 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37950 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37953 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37956 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37957 * set instead (i.e., `bit + 1`).
37959 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37961 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37964 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37965 * by [bLIP 2] or if it is a known `T` feature.
37967 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37968 * be set instead (i.e., `bit - 1`).
37970 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37972 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37975 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37976 * by [bLIP 2] or if it is a known `T` feature.
37978 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37979 * set instead (i.e., `bit + 1`).
37981 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37983 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37986 * Create a blank Features with no features set
37988 MUST_USE_RES struct LDKBlindedHopFeatures BlindedHopFeatures_empty(void);
37991 * Returns true if this `Features` object contains required features unknown by `other`.
37993 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits_from(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, const struct LDKBlindedHopFeatures *NONNULL_PTR other);
37996 * Returns true if this `Features` object contains unknown feature flags which are set as
37999 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg);
38002 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
38005 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
38006 * be set instead (i.e., `bit - 1`).
38008 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
38010 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
38013 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
38016 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
38017 * set instead (i.e., `bit + 1`).
38019 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
38021 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
38024 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
38025 * by [bLIP 2] or if it is a known `T` feature.
38027 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
38028 * be set instead (i.e., `bit - 1`).
38030 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
38032 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
38035 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
38036 * by [bLIP 2] or if it is a known `T` feature.
38038 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
38039 * set instead (i.e., `bit + 1`).
38041 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
38043 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
38046 * Create a blank Features with no features set
38048 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
38051 * Returns true if this `Features` object contains required features unknown by `other`.
38053 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits_from(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, const struct LDKChannelTypeFeatures *NONNULL_PTR other);
38056 * Returns true if this `Features` object contains unknown feature flags which are set as
38059 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38062 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
38065 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
38066 * be set instead (i.e., `bit - 1`).
38068 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
38070 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
38073 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
38076 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
38077 * set instead (i.e., `bit + 1`).
38079 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
38081 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
38084 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
38085 * by [bLIP 2] or if it is a known `T` feature.
38087 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
38088 * be set instead (i.e., `bit - 1`).
38090 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
38092 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
38095 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
38096 * by [bLIP 2] or if it is a known `T` feature.
38098 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
38099 * set instead (i.e., `bit + 1`).
38101 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
38103 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
38106 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
38108 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
38111 * Read a InitFeatures from a byte array, created by InitFeatures_write
38113 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
38116 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
38118 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
38121 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
38123 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
38126 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
38128 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
38131 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
38133 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
38136 * Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read
38138 struct LDKCVec_u8Z Bolt11InvoiceFeatures_write(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR obj);
38141 * Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write
38143 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ Bolt11InvoiceFeatures_read(struct LDKu8slice ser);
38146 * Serialize the Bolt12InvoiceFeatures object into a byte array which can be read by Bolt12InvoiceFeatures_read
38148 struct LDKCVec_u8Z Bolt12InvoiceFeatures_write(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR obj);
38151 * Read a Bolt12InvoiceFeatures from a byte array, created by Bolt12InvoiceFeatures_write
38153 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ Bolt12InvoiceFeatures_read(struct LDKu8slice ser);
38156 * Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read
38158 struct LDKCVec_u8Z BlindedHopFeatures_write(const struct LDKBlindedHopFeatures *NONNULL_PTR obj);
38161 * Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write
38163 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ BlindedHopFeatures_read(struct LDKu8slice ser);
38166 * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
38168 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
38171 * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
38173 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
38176 * Set this feature as optional.
38178 void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38181 * Set this feature as required.
38183 void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38186 * Checks if this feature is supported.
38188 MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38191 * Set this feature as optional.
38193 void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38196 * Set this feature as required.
38198 void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38201 * Checks if this feature is supported.
38203 MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38206 * Checks if this feature is required.
38208 MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38211 * Checks if this feature is required.
38213 MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38216 * Set this feature as optional.
38218 void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38221 * Set this feature as required.
38223 void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38226 * Checks if this feature is supported.
38228 MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38231 * Set this feature as optional.
38233 void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38236 * Set this feature as required.
38238 void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38241 * Checks if this feature is supported.
38243 MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38246 * Set this feature as optional.
38248 void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38251 * Set this feature as required.
38253 void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38256 * Checks if this feature is supported.
38258 MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38261 * Checks if this feature is required.
38263 MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38266 * Checks if this feature is required.
38268 MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38271 * Set this feature as optional.
38273 void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38276 * Set this feature as required.
38278 void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38281 * Checks if this feature is supported.
38283 MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38286 * Set this feature as optional.
38288 void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38291 * Set this feature as required.
38293 void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38296 * Checks if this feature is supported.
38298 MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38301 * Checks if this feature is required.
38303 MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38306 * Checks if this feature is required.
38308 MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38311 * Set this feature as optional.
38313 void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38316 * Set this feature as required.
38318 void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38321 * Checks if this feature is supported.
38323 MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38326 * Set this feature as optional.
38328 void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38331 * Set this feature as required.
38333 void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38336 * Checks if this feature is supported.
38338 MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38341 * Set this feature as optional.
38343 void Bolt11InvoiceFeatures_set_variable_length_onion_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38346 * Set this feature as required.
38348 void Bolt11InvoiceFeatures_set_variable_length_onion_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38351 * Checks if this feature is supported.
38353 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38356 * Checks if this feature is required.
38358 MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38361 * Checks if this feature is required.
38363 MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38366 * Checks if this feature is required.
38368 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38371 * Set this feature as optional.
38373 void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38376 * Set this feature as required.
38378 void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38381 * Checks if this feature is supported.
38383 MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38386 * Set this feature as optional.
38388 void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38391 * Set this feature as required.
38393 void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38396 * Checks if this feature is supported.
38398 MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38401 * Set this feature as optional.
38403 void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38406 * Set this feature as required.
38408 void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38411 * Checks if this feature is supported.
38413 MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38416 * Checks if this feature is required.
38418 MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38421 * Checks if this feature is required.
38423 MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38426 * Checks if this feature is required.
38428 MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38431 * Set this feature as optional.
38433 void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38436 * Set this feature as required.
38438 void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38441 * Checks if this feature is supported.
38443 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38446 * Set this feature as optional.
38448 void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38451 * Set this feature as required.
38453 void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38456 * Checks if this feature is supported.
38458 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38461 * Set this feature as optional.
38463 void Bolt11InvoiceFeatures_set_payment_secret_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38466 * Set this feature as required.
38468 void Bolt11InvoiceFeatures_set_payment_secret_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38471 * Checks if this feature is supported.
38473 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38476 * Checks if this feature is required.
38478 MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38481 * Checks if this feature is required.
38483 MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38486 * Checks if this feature is required.
38488 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38491 * Set this feature as optional.
38493 void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38496 * Set this feature as required.
38498 void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38501 * Checks if this feature is supported.
38503 MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38506 * Set this feature as optional.
38508 void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38511 * Set this feature as required.
38513 void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38516 * Checks if this feature is supported.
38518 MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38521 * Set this feature as optional.
38523 void Bolt11InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38526 * Set this feature as required.
38528 void Bolt11InvoiceFeatures_set_basic_mpp_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38531 * Checks if this feature is supported.
38533 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38536 * Set this feature as optional.
38538 void Bolt12InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
38541 * Set this feature as required.
38543 void Bolt12InvoiceFeatures_set_basic_mpp_required(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
38546 * Checks if this feature is supported.
38548 MUST_USE_RES bool Bolt12InvoiceFeatures_supports_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
38551 * Checks if this feature is required.
38553 MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38556 * Checks if this feature is required.
38558 MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38561 * Checks if this feature is required.
38563 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38566 * Checks if this feature is required.
38568 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
38571 * Set this feature as optional.
38573 void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38576 * Set this feature as required.
38578 void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38581 * Checks if this feature is supported.
38583 MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38586 * Set this feature as optional.
38588 void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38591 * Set this feature as required.
38593 void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38596 * Checks if this feature is supported.
38598 MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38601 * Checks if this feature is required.
38603 MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38606 * Checks if this feature is required.
38608 MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38611 * Set this feature as optional.
38613 void InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38616 * Set this feature as required.
38618 void InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38621 * Checks if this feature is supported.
38623 MUST_USE_RES bool InitFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38626 * Set this feature as optional.
38628 void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38631 * Set this feature as required.
38633 void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38636 * Checks if this feature is supported.
38638 MUST_USE_RES bool NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38641 * Set this feature as optional.
38643 void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38646 * Set this feature as required.
38648 void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38651 * Checks if this feature is supported.
38653 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38656 * Checks if this feature is required.
38658 MUST_USE_RES bool InitFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38661 * Checks if this feature is required.
38663 MUST_USE_RES bool NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38666 * Checks if this feature is required.
38668 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38671 * Set this feature as optional.
38673 void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38676 * Set this feature as required.
38678 void InitFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38681 * Checks if this feature is supported.
38683 MUST_USE_RES bool InitFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38686 * Set this feature as optional.
38688 void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38691 * Set this feature as required.
38693 void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38696 * Checks if this feature is supported.
38698 MUST_USE_RES bool NodeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38701 * Set this feature as optional.
38703 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38706 * Set this feature as required.
38708 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38711 * Checks if this feature is supported.
38713 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38716 * Checks if this feature is required.
38718 MUST_USE_RES bool InitFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38721 * Checks if this feature is required.
38723 MUST_USE_RES bool NodeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38726 * Checks if this feature is required.
38728 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38731 * Set this feature as optional.
38733 void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38736 * Set this feature as required.
38738 void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38741 * Checks if this feature is supported.
38743 MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38746 * Set this feature as optional.
38748 void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38751 * Set this feature as required.
38753 void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38756 * Checks if this feature is supported.
38758 MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38761 * Checks if this feature is required.
38763 MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38766 * Checks if this feature is required.
38768 MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38771 * Set this feature as optional.
38773 void InitFeatures_set_taproot_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38776 * Set this feature as required.
38778 void InitFeatures_set_taproot_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38781 * Checks if this feature is supported.
38783 MUST_USE_RES bool InitFeatures_supports_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38786 * Set this feature as optional.
38788 void NodeFeatures_set_taproot_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38791 * Set this feature as required.
38793 void NodeFeatures_set_taproot_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38796 * Checks if this feature is supported.
38798 MUST_USE_RES bool NodeFeatures_supports_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38801 * Set this feature as optional.
38803 void ChannelTypeFeatures_set_taproot_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38806 * Set this feature as required.
38808 void ChannelTypeFeatures_set_taproot_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38811 * Checks if this feature is supported.
38813 MUST_USE_RES bool ChannelTypeFeatures_supports_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38816 * Checks if this feature is required.
38818 MUST_USE_RES bool InitFeatures_requires_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38821 * Checks if this feature is required.
38823 MUST_USE_RES bool NodeFeatures_requires_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38826 * Checks if this feature is required.
38828 MUST_USE_RES bool ChannelTypeFeatures_requires_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38831 * Set this feature as optional.
38833 void InitFeatures_set_onion_messages_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38836 * Set this feature as required.
38838 void InitFeatures_set_onion_messages_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38841 * Checks if this feature is supported.
38843 MUST_USE_RES bool InitFeatures_supports_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38846 * Set this feature as optional.
38848 void NodeFeatures_set_onion_messages_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38851 * Set this feature as required.
38853 void NodeFeatures_set_onion_messages_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38856 * Checks if this feature is supported.
38858 MUST_USE_RES bool NodeFeatures_supports_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38861 * Checks if this feature is required.
38863 MUST_USE_RES bool InitFeatures_requires_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38866 * Checks if this feature is required.
38868 MUST_USE_RES bool NodeFeatures_requires_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38871 * Set this feature as optional.
38873 void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38876 * Set this feature as required.
38878 void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38881 * Checks if this feature is supported.
38883 MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38886 * Set this feature as optional.
38888 void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38891 * Set this feature as required.
38893 void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38896 * Checks if this feature is supported.
38898 MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38901 * Checks if this feature is required.
38903 MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38906 * Checks if this feature is required.
38908 MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38911 * Set this feature as optional.
38913 void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38916 * Set this feature as required.
38918 void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38921 * Checks if this feature is supported.
38923 MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38926 * Set this feature as optional.
38928 void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38931 * Set this feature as required.
38933 void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38936 * Checks if this feature is supported.
38938 MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38941 * Set this feature as optional.
38943 void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38946 * Set this feature as required.
38948 void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38951 * Checks if this feature is supported.
38953 MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38956 * Checks if this feature is required.
38958 MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38961 * Checks if this feature is required.
38963 MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38966 * Checks if this feature is required.
38968 MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38971 * Set this feature as optional.
38973 void Bolt11InvoiceFeatures_set_payment_metadata_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38976 * Set this feature as required.
38978 void Bolt11InvoiceFeatures_set_payment_metadata_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38981 * Checks if this feature is supported.
38983 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38986 * Checks if this feature is required.
38988 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38991 * Set this feature as optional.
38993 void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38996 * Set this feature as required.
38998 void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
39001 * Checks if this feature is supported.
39003 MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
39006 * Set this feature as optional.
39008 void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
39011 * Set this feature as required.
39013 void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
39016 * Checks if this feature is supported.
39018 MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
39021 * Set this feature as optional.
39023 void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
39026 * Set this feature as required.
39028 void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
39031 * Checks if this feature is supported.
39033 MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
39036 * Checks if this feature is required.
39038 MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
39041 * Checks if this feature is required.
39043 MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
39046 * Checks if this feature is required.
39048 MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
39051 * Set this feature as optional.
39053 void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
39056 * Set this feature as required.
39058 void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
39061 * Checks if this feature is supported.
39063 MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
39066 * Checks if this feature is required.
39068 MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
39071 * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
39073 void ShutdownScript_free(struct LDKShutdownScript this_obj);
39076 * Creates a copy of the ShutdownScript
39078 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
39081 * Checks if two ShutdownScripts contain equal inner contents.
39082 * This ignores pointers and is_owned flags and looks at the values in fields.
39083 * Two objects with NULL inner values will be considered "equal" here.
39085 bool ShutdownScript_eq(const struct LDKShutdownScript *NONNULL_PTR a, const struct LDKShutdownScript *NONNULL_PTR b);
39088 * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
39090 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
39093 * The script that did not meet the requirements from [BOLT #2].
39095 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
39097 struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
39100 * The script that did not meet the requirements from [BOLT #2].
39102 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
39104 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
39107 * Constructs a new InvalidShutdownScript given each field
39109 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
39112 * Creates a copy of the InvalidShutdownScript
39114 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
39117 * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
39119 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
39122 * Read a ShutdownScript from a byte array, created by ShutdownScript_write
39124 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
39127 * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
39129 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
39132 * Generates a P2WSH script pubkey from the given [`WScriptHash`].
39134 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
39137 * Generates a witness script pubkey from the given segwit version and program.
39139 * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
39140 * [`ShutdownScript::new_p2wsh`] instead.
39144 * This function may return an error if `program` is invalid for the segwit `version`.
39146 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessVersion version, struct LDKu8slice program);
39149 * Converts the shutdown script into the underlying [`Script`].
39151 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
39154 * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
39156 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39158 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
39161 * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
39163 * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
39165 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
39168 * Frees any resources used by the Retry
39170 void Retry_free(struct LDKRetry this_ptr);
39173 * Creates a copy of the Retry
39175 struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig);
39178 * Utility method to constructs a new Attempts-variant Retry
39180 struct LDKRetry Retry_attempts(uint32_t a);
39183 * Utility method to constructs a new Timeout-variant Retry
39185 struct LDKRetry Retry_timeout(uint64_t a);
39188 * Checks if two Retrys contain equal inner contents.
39189 * This ignores pointers and is_owned flags and looks at the values in fields.
39191 bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b);
39194 * Generates a non-cryptographic 64-bit hash of the Retry.
39196 uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o);
39199 * Serialize the Retry object into a byte array which can be read by Retry_read
39201 struct LDKCVec_u8Z Retry_write(const struct LDKRetry *NONNULL_PTR obj);
39204 * Read a Retry from a byte array, created by Retry_write
39206 struct LDKCResult_RetryDecodeErrorZ Retry_read(struct LDKu8slice ser);
39209 * Creates a copy of the RetryableSendFailure
39211 enum LDKRetryableSendFailure RetryableSendFailure_clone(const enum LDKRetryableSendFailure *NONNULL_PTR orig);
39214 * Utility method to constructs a new PaymentExpired-variant RetryableSendFailure
39216 enum LDKRetryableSendFailure RetryableSendFailure_payment_expired(void);
39219 * Utility method to constructs a new RouteNotFound-variant RetryableSendFailure
39221 enum LDKRetryableSendFailure RetryableSendFailure_route_not_found(void);
39224 * Utility method to constructs a new DuplicatePayment-variant RetryableSendFailure
39226 enum LDKRetryableSendFailure RetryableSendFailure_duplicate_payment(void);
39229 * Checks if two RetryableSendFailures contain equal inner contents.
39230 * This ignores pointers and is_owned flags and looks at the values in fields.
39232 bool RetryableSendFailure_eq(const enum LDKRetryableSendFailure *NONNULL_PTR a, const enum LDKRetryableSendFailure *NONNULL_PTR b);
39235 * Frees any resources used by the PaymentSendFailure
39237 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
39240 * Creates a copy of the PaymentSendFailure
39242 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
39245 * Utility method to constructs a new ParameterError-variant PaymentSendFailure
39247 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
39250 * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
39252 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
39255 * Utility method to constructs a new AllFailedResendSafe-variant PaymentSendFailure
39257 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_resend_safe(struct LDKCVec_APIErrorZ a);
39260 * Utility method to constructs a new DuplicatePayment-variant PaymentSendFailure
39262 struct LDKPaymentSendFailure PaymentSendFailure_duplicate_payment(void);
39265 * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
39267 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
39270 * Checks if two PaymentSendFailures contain equal inner contents.
39271 * This ignores pointers and is_owned flags and looks at the values in fields.
39273 bool PaymentSendFailure_eq(const struct LDKPaymentSendFailure *NONNULL_PTR a, const struct LDKPaymentSendFailure *NONNULL_PTR b);
39276 * Frees any resources used by the ProbeSendFailure
39278 void ProbeSendFailure_free(struct LDKProbeSendFailure this_ptr);
39281 * Creates a copy of the ProbeSendFailure
39283 struct LDKProbeSendFailure ProbeSendFailure_clone(const struct LDKProbeSendFailure *NONNULL_PTR orig);
39286 * Utility method to constructs a new RouteNotFound-variant ProbeSendFailure
39288 struct LDKProbeSendFailure ProbeSendFailure_route_not_found(void);
39291 * Utility method to constructs a new SendingFailed-variant ProbeSendFailure
39293 struct LDKProbeSendFailure ProbeSendFailure_sending_failed(struct LDKPaymentSendFailure a);
39296 * Checks if two ProbeSendFailures contain equal inner contents.
39297 * This ignores pointers and is_owned flags and looks at the values in fields.
39299 bool ProbeSendFailure_eq(const struct LDKProbeSendFailure *NONNULL_PTR a, const struct LDKProbeSendFailure *NONNULL_PTR b);
39302 * Frees any resources used by the RecipientOnionFields, if is_owned is set and inner is non-NULL.
39304 void RecipientOnionFields_free(struct LDKRecipientOnionFields this_obj);
39307 * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
39308 * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
39309 * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
39312 * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
39313 * multi-path payments require a recipient-provided secret.
39315 * Some implementations may reject spontaneous payments with payment secrets, so you may only
39316 * want to provide a secret for a spontaneous payment if MPP is needed and you know your
39317 * recipient will not reject it.
39319 struct LDKCOption_ThirtyTwoBytesZ RecipientOnionFields_get_payment_secret(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
39322 * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
39323 * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
39324 * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
39327 * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
39328 * multi-path payments require a recipient-provided secret.
39330 * Some implementations may reject spontaneous payments with payment secrets, so you may only
39331 * want to provide a secret for a spontaneous payment if MPP is needed and you know your
39332 * recipient will not reject it.
39334 void RecipientOnionFields_set_payment_secret(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
39337 * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
39338 * arbitrary length. This gives recipients substantially more flexibility to receive
39341 * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
39342 * scheme to authenticate received payments against expected payments and invoices, this field
39343 * is not used in LDK for received payments, and can be used to store arbitrary data in
39344 * invoices which will be received with the payment.
39346 * Note that this field was added to the lightning specification more recently than
39347 * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
39348 * may not be supported as universally.
39350 * Returns a copy of the field.
39352 struct LDKCOption_CVec_u8ZZ RecipientOnionFields_get_payment_metadata(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
39355 * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
39356 * arbitrary length. This gives recipients substantially more flexibility to receive
39359 * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
39360 * scheme to authenticate received payments against expected payments and invoices, this field
39361 * is not used in LDK for received payments, and can be used to store arbitrary data in
39362 * invoices which will be received with the payment.
39364 * Note that this field was added to the lightning specification more recently than
39365 * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
39366 * may not be supported as universally.
39368 void RecipientOnionFields_set_payment_metadata(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
39371 * Creates a copy of the RecipientOnionFields
39373 struct LDKRecipientOnionFields RecipientOnionFields_clone(const struct LDKRecipientOnionFields *NONNULL_PTR orig);
39376 * Checks if two RecipientOnionFieldss contain equal inner contents.
39377 * This ignores pointers and is_owned flags and looks at the values in fields.
39378 * Two objects with NULL inner values will be considered "equal" here.
39380 bool RecipientOnionFields_eq(const struct LDKRecipientOnionFields *NONNULL_PTR a, const struct LDKRecipientOnionFields *NONNULL_PTR b);
39383 * Serialize the RecipientOnionFields object into a byte array which can be read by RecipientOnionFields_read
39385 struct LDKCVec_u8Z RecipientOnionFields_write(const struct LDKRecipientOnionFields *NONNULL_PTR obj);
39388 * Read a RecipientOnionFields from a byte array, created by RecipientOnionFields_write
39390 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ RecipientOnionFields_read(struct LDKu8slice ser);
39393 * Creates a [`RecipientOnionFields`] from only a [`PaymentSecret`]. This is the most common
39394 * set of onion fields for today's BOLT11 invoices - most nodes require a [`PaymentSecret`]
39395 * but do not require or provide any further data.
39397 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_secret_only(struct LDKThirtyTwoBytes payment_secret);
39400 * Creates a new [`RecipientOnionFields`] with no fields. This generally does not create
39401 * payable HTLCs except for single-path spontaneous payments, i.e. this should generally
39402 * only be used for calls to [`ChannelManager::send_spontaneous_payment`]. If you are sending
39403 * a spontaneous MPP this will not work as all MPP require payment secrets; you may
39404 * instead want to use [`RecipientOnionFields::secret_only`].
39406 * [`ChannelManager::send_spontaneous_payment`]: super::channelmanager::ChannelManager::send_spontaneous_payment
39407 * [`RecipientOnionFields::secret_only`]: RecipientOnionFields::secret_only
39409 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_spontaneous_empty(void);
39412 * Creates a new [`RecipientOnionFields`] from an existing one, adding custom TLVs. Each
39413 * TLV is provided as a `(u64, Vec<u8>)` for the type number and serialized value
39414 * respectively. TLV type numbers must be unique and within the range
39415 * reserved for custom types, i.e. >= 2^16, otherwise this method will return `Err(())`.
39417 * This method will also error for types in the experimental range which have been
39418 * standardized within the protocol, which only includes 5482373484 (keysend) for now.
39420 * See [`Self::custom_tlvs`] for more info.
39422 MUST_USE_RES struct LDKCResult_RecipientOnionFieldsNoneZ RecipientOnionFields_with_custom_tlvs(struct LDKRecipientOnionFields this_arg, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs);
39425 * Gets the custom TLVs that will be sent or have been received.
39427 * Custom TLVs allow sending extra application-specific data with a payment. They provide
39428 * additional flexibility on top of payment metadata, as while other implementations may
39429 * require `payment_metadata` to reflect metadata provided in an invoice, custom TLVs
39430 * do not have this restriction.
39432 * Note that if this field is non-empty, it will contain strictly increasing TLVs, each
39433 * represented by a `(u64, Vec<u8>)` for its type number and serialized value respectively.
39434 * This is validated when setting this field using [`Self::with_custom_tlvs`].
39436 MUST_USE_RES struct LDKCVec_C2Tuple_u64CVec_u8ZZZ RecipientOnionFields_custom_tlvs(const struct LDKRecipientOnionFields *NONNULL_PTR this_arg);
39439 * Calls the free function if one is set
39441 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
39444 * Creates a copy of a Type
39446 struct LDKType Type_clone(const struct LDKType *NONNULL_PTR orig);
39449 * Calls the free function if one is set
39451 void Type_free(struct LDKType this_ptr);
39454 * Frees any resources used by the Offer, if is_owned is set and inner is non-NULL.
39456 void Offer_free(struct LDKOffer this_obj);
39459 * Creates a copy of the Offer
39461 struct LDKOffer Offer_clone(const struct LDKOffer *NONNULL_PTR orig);
39464 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
39465 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
39466 * for the selected chain.
39468 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ Offer_chains(const struct LDKOffer *NONNULL_PTR this_arg);
39471 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
39472 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
39474 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Offer_metadata(const struct LDKOffer *NONNULL_PTR this_arg);
39477 * The minimum amount required for a successful payment of a single item.
39479 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39481 MUST_USE_RES struct LDKAmount Offer_amount(const struct LDKOffer *NONNULL_PTR this_arg);
39484 * A complete description of the purpose of the payment. Intended to be displayed to the user
39485 * but with the caveat that it has not been verified in any way.
39487 MUST_USE_RES struct LDKPrintableString Offer_description(const struct LDKOffer *NONNULL_PTR this_arg);
39490 * Features pertaining to the offer.
39492 MUST_USE_RES struct LDKOfferFeatures Offer_offer_features(const struct LDKOffer *NONNULL_PTR this_arg);
39495 * Duration since the Unix epoch when an invoice should no longer be requested.
39497 * If `None`, the offer does not expire.
39499 MUST_USE_RES struct LDKCOption_u64Z Offer_absolute_expiry(const struct LDKOffer *NONNULL_PTR this_arg);
39502 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
39503 * displayed to the user but with the caveat that it has not been verified in any way.
39505 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39507 MUST_USE_RES struct LDKPrintableString Offer_issuer(const struct LDKOffer *NONNULL_PTR this_arg);
39510 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
39511 * recipient privacy by obfuscating its node id.
39513 MUST_USE_RES struct LDKCVec_BlindedPathZ Offer_paths(const struct LDKOffer *NONNULL_PTR this_arg);
39516 * The quantity of items supported.
39518 MUST_USE_RES struct LDKQuantity Offer_supported_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
39521 * The public key used by the recipient to sign invoices.
39523 MUST_USE_RES struct LDKPublicKey Offer_signing_pubkey(const struct LDKOffer *NONNULL_PTR this_arg);
39526 * Returns whether the given chain is supported by the offer.
39528 MUST_USE_RES bool Offer_supports_chain(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes chain);
39531 * Whether the offer has expired.
39533 MUST_USE_RES bool Offer_is_expired(const struct LDKOffer *NONNULL_PTR this_arg);
39536 * Returns whether the given quantity is valid for the offer.
39538 MUST_USE_RES bool Offer_is_valid_quantity(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t quantity);
39541 * Returns whether a quantity is expected in an [`InvoiceRequest`] for the offer.
39543 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
39545 MUST_USE_RES bool Offer_expects_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
39548 * Serialize the Offer object into a byte array which can be read by Offer_read
39550 struct LDKCVec_u8Z Offer_write(const struct LDKOffer *NONNULL_PTR obj);
39553 * Frees any resources used by the Amount, if is_owned is set and inner is non-NULL.
39555 void Amount_free(struct LDKAmount this_obj);
39558 * Creates a copy of the Amount
39560 struct LDKAmount Amount_clone(const struct LDKAmount *NONNULL_PTR orig);
39563 * Frees any resources used by the Quantity, if is_owned is set and inner is non-NULL.
39565 void Quantity_free(struct LDKQuantity this_obj);
39568 * Creates a copy of the Quantity
39570 struct LDKQuantity Quantity_clone(const struct LDKQuantity *NONNULL_PTR orig);
39573 * Read a Offer object from a string
39575 struct LDKCResult_OfferBolt12ParseErrorZ Offer_from_str(struct LDKStr s);
39578 * Frees any resources used by the UnsignedBolt12Invoice, if is_owned is set and inner is non-NULL.
39580 void UnsignedBolt12Invoice_free(struct LDKUnsignedBolt12Invoice this_obj);
39583 * Returns the [`TaggedHash`] of the invoice to sign.
39585 MUST_USE_RES struct LDKTaggedHash UnsignedBolt12Invoice_tagged_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39588 * Frees any resources used by the Bolt12Invoice, if is_owned is set and inner is non-NULL.
39590 void Bolt12Invoice_free(struct LDKBolt12Invoice this_obj);
39593 * Creates a copy of the Bolt12Invoice
39595 struct LDKBolt12Invoice Bolt12Invoice_clone(const struct LDKBolt12Invoice *NONNULL_PTR orig);
39598 * The chains that may be used when paying a requested invoice.
39600 * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
39602 * [`Offer::chains`]: crate::offers::offer::Offer::chains
39604 MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ UnsignedBolt12Invoice_offer_chains(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39607 * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
39608 * invoice originated from an offer.
39610 * From [`InvoiceRequest::chain`] or [`Refund::chain`].
39612 * [`offer_chains`]: Self::offer_chains
39613 * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
39615 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_chain(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39618 * Opaque bytes set by the originating [`Offer`].
39620 * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
39621 * if the [`Offer`] did not set it.
39623 * [`Offer`]: crate::offers::offer::Offer
39624 * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
39626 MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedBolt12Invoice_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39629 * The minimum amount required for a successful payment of a single item.
39631 * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
39632 * the [`Offer`] did not set it.
39634 * [`Offer`]: crate::offers::offer::Offer
39635 * [`Offer::amount`]: crate::offers::offer::Offer::amount
39637 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39639 MUST_USE_RES struct LDKAmount UnsignedBolt12Invoice_amount(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39642 * Features pertaining to the originating [`Offer`].
39644 * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
39647 * [`Offer`]: crate::offers::offer::Offer
39648 * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
39650 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39652 MUST_USE_RES struct LDKOfferFeatures UnsignedBolt12Invoice_offer_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39655 * A complete description of the purpose of the originating offer or refund.
39657 * From [`Offer::description`] or [`Refund::description`].
39659 * [`Offer::description`]: crate::offers::offer::Offer::description
39661 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_description(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39664 * Duration since the Unix epoch when an invoice should no longer be requested.
39666 * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
39668 * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
39670 MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_absolute_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39673 * The issuer of the offer or refund.
39675 * From [`Offer::issuer`] or [`Refund::issuer`].
39677 * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
39679 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39681 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_issuer(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39684 * Paths to the recipient originating from publicly reachable nodes.
39686 * From [`Offer::paths`] or [`Refund::paths`].
39688 * [`Offer::paths`]: crate::offers::offer::Offer::paths
39690 MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedBolt12Invoice_message_paths(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39693 * The quantity of items supported.
39695 * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
39698 * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
39700 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39702 MUST_USE_RES struct LDKQuantity UnsignedBolt12Invoice_supported_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39705 * An unpredictable series of bytes from the payer.
39707 * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
39709 MUST_USE_RES struct LDKu8slice UnsignedBolt12Invoice_payer_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39712 * Features pertaining to requesting an invoice.
39714 * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
39716 MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedBolt12Invoice_invoice_request_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39719 * The quantity of items requested or refunded for.
39721 * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
39723 MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39726 * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
39727 * refund in case there are no [`message_paths`].
39729 * [`message_paths`]: Self::message_paths
39731 MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_payer_id(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39734 * A payer-provided note reflected back in the invoice.
39736 * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
39738 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39740 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_payer_note(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39743 * Duration since the Unix epoch when the invoice was created.
39745 MUST_USE_RES uint64_t UnsignedBolt12Invoice_created_at(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39748 * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
39749 * should no longer be paid.
39751 MUST_USE_RES uint64_t UnsignedBolt12Invoice_relative_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39754 * Whether the invoice has expired.
39756 MUST_USE_RES bool UnsignedBolt12Invoice_is_expired(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39759 * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
39761 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_payment_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39764 * The minimum amount required for a successful payment of the invoice.
39766 MUST_USE_RES uint64_t UnsignedBolt12Invoice_amount_msats(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39769 * Features pertaining to paying an invoice.
39771 MUST_USE_RES struct LDKBolt12InvoiceFeatures UnsignedBolt12Invoice_invoice_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39774 * The public key corresponding to the key used to sign the invoice.
39776 MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_signing_pubkey(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39779 * The chains that may be used when paying a requested invoice.
39781 * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
39783 * [`Offer::chains`]: crate::offers::offer::Offer::chains
39785 MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ Bolt12Invoice_offer_chains(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39788 * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
39789 * invoice originated from an offer.
39791 * From [`InvoiceRequest::chain`] or [`Refund::chain`].
39793 * [`offer_chains`]: Self::offer_chains
39794 * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
39796 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_chain(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39799 * Opaque bytes set by the originating [`Offer`].
39801 * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
39802 * if the [`Offer`] did not set it.
39804 * [`Offer`]: crate::offers::offer::Offer
39805 * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
39807 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt12Invoice_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39810 * The minimum amount required for a successful payment of a single item.
39812 * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
39813 * the [`Offer`] did not set it.
39815 * [`Offer`]: crate::offers::offer::Offer
39816 * [`Offer::amount`]: crate::offers::offer::Offer::amount
39818 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39820 MUST_USE_RES struct LDKAmount Bolt12Invoice_amount(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39823 * Features pertaining to the originating [`Offer`].
39825 * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
39828 * [`Offer`]: crate::offers::offer::Offer
39829 * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
39831 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39833 MUST_USE_RES struct LDKOfferFeatures Bolt12Invoice_offer_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39836 * A complete description of the purpose of the originating offer or refund.
39838 * From [`Offer::description`] or [`Refund::description`].
39840 * [`Offer::description`]: crate::offers::offer::Offer::description
39842 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_description(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39845 * Duration since the Unix epoch when an invoice should no longer be requested.
39847 * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
39849 * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
39851 MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_absolute_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39854 * The issuer of the offer or refund.
39856 * From [`Offer::issuer`] or [`Refund::issuer`].
39858 * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
39860 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39862 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_issuer(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39865 * Paths to the recipient originating from publicly reachable nodes.
39867 * From [`Offer::paths`] or [`Refund::paths`].
39869 * [`Offer::paths`]: crate::offers::offer::Offer::paths
39871 MUST_USE_RES struct LDKCVec_BlindedPathZ Bolt12Invoice_message_paths(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39874 * The quantity of items supported.
39876 * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
39879 * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
39881 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39883 MUST_USE_RES struct LDKQuantity Bolt12Invoice_supported_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39886 * An unpredictable series of bytes from the payer.
39888 * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
39890 MUST_USE_RES struct LDKu8slice Bolt12Invoice_payer_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39893 * Features pertaining to requesting an invoice.
39895 * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
39897 MUST_USE_RES struct LDKInvoiceRequestFeatures Bolt12Invoice_invoice_request_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39900 * The quantity of items requested or refunded for.
39902 * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
39904 MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39907 * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
39908 * refund in case there are no [`message_paths`].
39910 * [`message_paths`]: Self::message_paths
39912 MUST_USE_RES struct LDKPublicKey Bolt12Invoice_payer_id(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39915 * A payer-provided note reflected back in the invoice.
39917 * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
39919 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39921 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_payer_note(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39924 * Duration since the Unix epoch when the invoice was created.
39926 MUST_USE_RES uint64_t Bolt12Invoice_created_at(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39929 * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
39930 * should no longer be paid.
39932 MUST_USE_RES uint64_t Bolt12Invoice_relative_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39935 * Whether the invoice has expired.
39937 MUST_USE_RES bool Bolt12Invoice_is_expired(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39940 * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
39942 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_payment_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39945 * The minimum amount required for a successful payment of the invoice.
39947 MUST_USE_RES uint64_t Bolt12Invoice_amount_msats(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39950 * Features pertaining to paying an invoice.
39952 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12Invoice_invoice_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39955 * The public key corresponding to the key used to sign the invoice.
39957 MUST_USE_RES struct LDKPublicKey Bolt12Invoice_signing_pubkey(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39960 * Signature of the invoice verified using [`Bolt12Invoice::signing_pubkey`].
39962 MUST_USE_RES struct LDKSchnorrSignature Bolt12Invoice_signature(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39965 * Hash that was used for signing the invoice.
39967 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_signable_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39970 * Verifies that the invoice was for a request or refund created using the given key. Returns
39971 * the associated [`PaymentId`] to use when sending the payment.
39973 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ Bolt12Invoice_verify(const struct LDKBolt12Invoice *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
39976 * Serialize the UnsignedBolt12Invoice object into a byte array which can be read by UnsignedBolt12Invoice_read
39978 struct LDKCVec_u8Z UnsignedBolt12Invoice_write(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR obj);
39981 * Serialize the Bolt12Invoice object into a byte array which can be read by Bolt12Invoice_read
39983 struct LDKCVec_u8Z Bolt12Invoice_write(const struct LDKBolt12Invoice *NONNULL_PTR obj);
39986 * Frees any resources used by the BlindedPayInfo, if is_owned is set and inner is non-NULL.
39988 void BlindedPayInfo_free(struct LDKBlindedPayInfo this_obj);
39991 * Base fee charged (in millisatoshi) for the entire blinded path.
39993 uint32_t BlindedPayInfo_get_fee_base_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
39996 * Base fee charged (in millisatoshi) for the entire blinded path.
39998 void BlindedPayInfo_set_fee_base_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
40001 * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
40002 * (i.e., 10,000 is 1%).
40004 uint32_t BlindedPayInfo_get_fee_proportional_millionths(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
40007 * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
40008 * (i.e., 10,000 is 1%).
40010 void BlindedPayInfo_set_fee_proportional_millionths(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
40013 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
40016 uint16_t BlindedPayInfo_get_cltv_expiry_delta(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
40019 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
40022 void BlindedPayInfo_set_cltv_expiry_delta(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint16_t val);
40025 * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
40026 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
40027 * seen by the recipient.
40029 uint64_t BlindedPayInfo_get_htlc_minimum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
40032 * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
40033 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
40034 * seen by the recipient.
40036 void BlindedPayInfo_set_htlc_minimum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
40039 * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
40040 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
40041 * seen by the recipient.
40043 uint64_t BlindedPayInfo_get_htlc_maximum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
40046 * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
40047 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
40048 * seen by the recipient.
40050 void BlindedPayInfo_set_htlc_maximum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
40053 * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
40056 struct LDKBlindedHopFeatures BlindedPayInfo_get_features(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
40059 * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
40062 void BlindedPayInfo_set_features(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
40065 * Constructs a new BlindedPayInfo given each field
40067 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);
40070 * Creates a copy of the BlindedPayInfo
40072 struct LDKBlindedPayInfo BlindedPayInfo_clone(const struct LDKBlindedPayInfo *NONNULL_PTR orig);
40075 * Generates a non-cryptographic 64-bit hash of the BlindedPayInfo.
40077 uint64_t BlindedPayInfo_hash(const struct LDKBlindedPayInfo *NONNULL_PTR o);
40080 * Checks if two BlindedPayInfos contain equal inner contents.
40081 * This ignores pointers and is_owned flags and looks at the values in fields.
40082 * Two objects with NULL inner values will be considered "equal" here.
40084 bool BlindedPayInfo_eq(const struct LDKBlindedPayInfo *NONNULL_PTR a, const struct LDKBlindedPayInfo *NONNULL_PTR b);
40087 * Serialize the BlindedPayInfo object into a byte array which can be read by BlindedPayInfo_read
40089 struct LDKCVec_u8Z BlindedPayInfo_write(const struct LDKBlindedPayInfo *NONNULL_PTR obj);
40092 * Read a BlindedPayInfo from a byte array, created by BlindedPayInfo_write
40094 struct LDKCResult_BlindedPayInfoDecodeErrorZ BlindedPayInfo_read(struct LDKu8slice ser);
40097 * Frees any resources used by the InvoiceError, if is_owned is set and inner is non-NULL.
40099 void InvoiceError_free(struct LDKInvoiceError this_obj);
40102 * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
40104 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
40105 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
40107 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40109 struct LDKErroneousField InvoiceError_get_erroneous_field(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
40112 * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
40114 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
40115 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
40117 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40119 void InvoiceError_set_erroneous_field(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKErroneousField val);
40122 * An explanation of the error.
40124 struct LDKUntrustedString InvoiceError_get_message(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
40127 * An explanation of the error.
40129 void InvoiceError_set_message(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKUntrustedString val);
40132 * Constructs a new InvoiceError given each field
40134 * Note that erroneous_field_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
40136 MUST_USE_RES struct LDKInvoiceError InvoiceError_new(struct LDKErroneousField erroneous_field_arg, struct LDKUntrustedString message_arg);
40139 * Creates a copy of the InvoiceError
40141 struct LDKInvoiceError InvoiceError_clone(const struct LDKInvoiceError *NONNULL_PTR orig);
40144 * Frees any resources used by the ErroneousField, if is_owned is set and inner is non-NULL.
40146 void ErroneousField_free(struct LDKErroneousField this_obj);
40149 * The type number of the TLV field containing the error.
40151 uint64_t ErroneousField_get_tlv_fieldnum(const struct LDKErroneousField *NONNULL_PTR this_ptr);
40154 * The type number of the TLV field containing the error.
40156 void ErroneousField_set_tlv_fieldnum(struct LDKErroneousField *NONNULL_PTR this_ptr, uint64_t val);
40159 * A value to use for the TLV field to avoid the error.
40161 * Returns a copy of the field.
40163 struct LDKCOption_CVec_u8ZZ ErroneousField_get_suggested_value(const struct LDKErroneousField *NONNULL_PTR this_ptr);
40166 * A value to use for the TLV field to avoid the error.
40168 void ErroneousField_set_suggested_value(struct LDKErroneousField *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
40171 * Constructs a new ErroneousField given each field
40173 MUST_USE_RES struct LDKErroneousField ErroneousField_new(uint64_t tlv_fieldnum_arg, struct LDKCOption_CVec_u8ZZ suggested_value_arg);
40176 * Creates a copy of the ErroneousField
40178 struct LDKErroneousField ErroneousField_clone(const struct LDKErroneousField *NONNULL_PTR orig);
40181 * Creates an [`InvoiceError`] with the given message.
40183 MUST_USE_RES struct LDKInvoiceError InvoiceError_from_string(struct LDKStr s);
40186 * Serialize the InvoiceError object into a byte array which can be read by InvoiceError_read
40188 struct LDKCVec_u8Z InvoiceError_write(const struct LDKInvoiceError *NONNULL_PTR obj);
40191 * Read a InvoiceError from a byte array, created by InvoiceError_write
40193 struct LDKCResult_InvoiceErrorDecodeErrorZ InvoiceError_read(struct LDKu8slice ser);
40196 * Frees any resources used by the UnsignedInvoiceRequest, if is_owned is set and inner is non-NULL.
40198 void UnsignedInvoiceRequest_free(struct LDKUnsignedInvoiceRequest this_obj);
40201 * Returns the [`TaggedHash`] of the invoice to sign.
40203 MUST_USE_RES struct LDKTaggedHash UnsignedInvoiceRequest_tagged_hash(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40206 * Frees any resources used by the InvoiceRequest, if is_owned is set and inner is non-NULL.
40208 void InvoiceRequest_free(struct LDKInvoiceRequest this_obj);
40211 * Creates a copy of the InvoiceRequest
40213 struct LDKInvoiceRequest InvoiceRequest_clone(const struct LDKInvoiceRequest *NONNULL_PTR orig);
40216 * Frees any resources used by the VerifiedInvoiceRequest, if is_owned is set and inner is non-NULL.
40218 void VerifiedInvoiceRequest_free(struct LDKVerifiedInvoiceRequest this_obj);
40221 * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
40223 * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
40224 * [`respond_with`].
40226 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
40227 * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
40228 * [`respond_with`]: Self::respond_with
40230 struct LDKCOption_SecretKeyZ VerifiedInvoiceRequest_get_keys(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr);
40233 * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
40235 * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
40236 * [`respond_with`].
40238 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
40239 * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
40240 * [`respond_with`]: Self::respond_with
40242 void VerifiedInvoiceRequest_set_keys(struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr, struct LDKCOption_SecretKeyZ val);
40245 * Creates a copy of the VerifiedInvoiceRequest
40247 struct LDKVerifiedInvoiceRequest VerifiedInvoiceRequest_clone(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR orig);
40250 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
40251 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
40252 * for the selected chain.
40254 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ UnsignedInvoiceRequest_chains(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40257 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
40258 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
40260 MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedInvoiceRequest_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40263 * The minimum amount required for a successful payment of a single item.
40265 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40267 MUST_USE_RES struct LDKAmount UnsignedInvoiceRequest_amount(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40270 * A complete description of the purpose of the payment. Intended to be displayed to the user
40271 * but with the caveat that it has not been verified in any way.
40273 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_description(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40276 * Features pertaining to the offer.
40278 MUST_USE_RES struct LDKOfferFeatures UnsignedInvoiceRequest_offer_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40281 * Duration since the Unix epoch when an invoice should no longer be requested.
40283 * If `None`, the offer does not expire.
40285 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_absolute_expiry(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40288 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
40289 * displayed to the user but with the caveat that it has not been verified in any way.
40291 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40293 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_issuer(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40296 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
40297 * recipient privacy by obfuscating its node id.
40299 MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedInvoiceRequest_paths(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40302 * The quantity of items supported.
40304 MUST_USE_RES struct LDKQuantity UnsignedInvoiceRequest_supported_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40307 * The public key used by the recipient to sign invoices.
40309 MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_signing_pubkey(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40312 * An unpredictable series of bytes, typically containing information about the derivation of
40315 * [`payer_id`]: Self::payer_id
40317 MUST_USE_RES struct LDKu8slice UnsignedInvoiceRequest_payer_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40320 * A chain from [`Offer::chains`] that the offer is valid for.
40322 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedInvoiceRequest_chain(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40325 * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
40326 * must be greater than or equal to [`Offer::amount`], converted if necessary.
40328 * [`chain`]: Self::chain
40330 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_amount_msats(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40333 * Features pertaining to requesting an invoice.
40335 MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedInvoiceRequest_invoice_request_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40338 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
40340 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40343 * A possibly transient pubkey used to sign the invoice request.
40345 MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_payer_id(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40348 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
40351 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40353 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_payer_note(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
40356 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
40357 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
40358 * for the selected chain.
40360 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ InvoiceRequest_chains(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40363 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
40364 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
40366 MUST_USE_RES struct LDKCOption_CVec_u8ZZ InvoiceRequest_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40369 * The minimum amount required for a successful payment of a single item.
40371 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40373 MUST_USE_RES struct LDKAmount InvoiceRequest_amount(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40376 * A complete description of the purpose of the payment. Intended to be displayed to the user
40377 * but with the caveat that it has not been verified in any way.
40379 MUST_USE_RES struct LDKPrintableString InvoiceRequest_description(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40382 * Features pertaining to the offer.
40384 MUST_USE_RES struct LDKOfferFeatures InvoiceRequest_offer_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40387 * Duration since the Unix epoch when an invoice should no longer be requested.
40389 * If `None`, the offer does not expire.
40391 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_absolute_expiry(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40394 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
40395 * displayed to the user but with the caveat that it has not been verified in any way.
40397 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40399 MUST_USE_RES struct LDKPrintableString InvoiceRequest_issuer(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40402 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
40403 * recipient privacy by obfuscating its node id.
40405 MUST_USE_RES struct LDKCVec_BlindedPathZ InvoiceRequest_paths(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40408 * The quantity of items supported.
40410 MUST_USE_RES struct LDKQuantity InvoiceRequest_supported_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40413 * The public key used by the recipient to sign invoices.
40415 MUST_USE_RES struct LDKPublicKey InvoiceRequest_signing_pubkey(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40418 * An unpredictable series of bytes, typically containing information about the derivation of
40421 * [`payer_id`]: Self::payer_id
40423 MUST_USE_RES struct LDKu8slice InvoiceRequest_payer_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40426 * A chain from [`Offer::chains`] that the offer is valid for.
40428 MUST_USE_RES struct LDKThirtyTwoBytes InvoiceRequest_chain(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40431 * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
40432 * must be greater than or equal to [`Offer::amount`], converted if necessary.
40434 * [`chain`]: Self::chain
40436 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_amount_msats(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40439 * Features pertaining to requesting an invoice.
40441 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequest_invoice_request_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40444 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
40446 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40449 * A possibly transient pubkey used to sign the invoice request.
40451 MUST_USE_RES struct LDKPublicKey InvoiceRequest_payer_id(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40454 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
40457 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40459 MUST_USE_RES struct LDKPrintableString InvoiceRequest_payer_note(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40462 * Signature of the invoice request using [`payer_id`].
40464 * [`payer_id`]: Self::payer_id
40466 MUST_USE_RES struct LDKSchnorrSignature InvoiceRequest_signature(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
40469 * Verifies that the request was for an offer created using the given key. Returns the verified
40470 * request which contains the derived keys needed to sign a [`Bolt12Invoice`] for the request
40471 * if they could be extracted from the metadata.
40473 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
40475 MUST_USE_RES struct LDKCResult_VerifiedInvoiceRequestNoneZ InvoiceRequest_verify(struct LDKInvoiceRequest this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
40478 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
40479 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
40480 * for the selected chain.
40482 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ VerifiedInvoiceRequest_chains(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40485 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
40486 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
40488 MUST_USE_RES struct LDKCOption_CVec_u8ZZ VerifiedInvoiceRequest_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40491 * The minimum amount required for a successful payment of a single item.
40493 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40495 MUST_USE_RES struct LDKAmount VerifiedInvoiceRequest_amount(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40498 * A complete description of the purpose of the payment. Intended to be displayed to the user
40499 * but with the caveat that it has not been verified in any way.
40501 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_description(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40504 * Features pertaining to the offer.
40506 MUST_USE_RES struct LDKOfferFeatures VerifiedInvoiceRequest_offer_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40509 * Duration since the Unix epoch when an invoice should no longer be requested.
40511 * If `None`, the offer does not expire.
40513 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_absolute_expiry(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40516 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
40517 * displayed to the user but with the caveat that it has not been verified in any way.
40519 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40521 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_issuer(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40524 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
40525 * recipient privacy by obfuscating its node id.
40527 MUST_USE_RES struct LDKCVec_BlindedPathZ VerifiedInvoiceRequest_paths(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40530 * The quantity of items supported.
40532 MUST_USE_RES struct LDKQuantity VerifiedInvoiceRequest_supported_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40535 * The public key used by the recipient to sign invoices.
40537 MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_signing_pubkey(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40540 * An unpredictable series of bytes, typically containing information about the derivation of
40543 * [`payer_id`]: Self::payer_id
40545 MUST_USE_RES struct LDKu8slice VerifiedInvoiceRequest_payer_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40548 * A chain from [`Offer::chains`] that the offer is valid for.
40550 MUST_USE_RES struct LDKThirtyTwoBytes VerifiedInvoiceRequest_chain(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40553 * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
40554 * must be greater than or equal to [`Offer::amount`], converted if necessary.
40556 * [`chain`]: Self::chain
40558 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_amount_msats(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40561 * Features pertaining to requesting an invoice.
40563 MUST_USE_RES struct LDKInvoiceRequestFeatures VerifiedInvoiceRequest_invoice_request_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40566 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
40568 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40571 * A possibly transient pubkey used to sign the invoice request.
40573 MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_payer_id(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40576 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
40579 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40581 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_payer_note(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40584 * Serialize the UnsignedInvoiceRequest object into a byte array which can be read by UnsignedInvoiceRequest_read
40586 struct LDKCVec_u8Z UnsignedInvoiceRequest_write(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR obj);
40589 * Serialize the InvoiceRequest object into a byte array which can be read by InvoiceRequest_read
40591 struct LDKCVec_u8Z InvoiceRequest_write(const struct LDKInvoiceRequest *NONNULL_PTR obj);
40594 * Frees any resources used by the TaggedHash, if is_owned is set and inner is non-NULL.
40596 void TaggedHash_free(struct LDKTaggedHash this_obj);
40599 * Frees any resources used by the Bolt12ParseError, if is_owned is set and inner is non-NULL.
40601 void Bolt12ParseError_free(struct LDKBolt12ParseError this_obj);
40604 * Creates a copy of the Bolt12ParseError
40606 struct LDKBolt12ParseError Bolt12ParseError_clone(const struct LDKBolt12ParseError *NONNULL_PTR orig);
40609 * Creates a copy of the Bolt12SemanticError
40611 enum LDKBolt12SemanticError Bolt12SemanticError_clone(const enum LDKBolt12SemanticError *NONNULL_PTR orig);
40614 * Utility method to constructs a new AlreadyExpired-variant Bolt12SemanticError
40616 enum LDKBolt12SemanticError Bolt12SemanticError_already_expired(void);
40619 * Utility method to constructs a new UnsupportedChain-variant Bolt12SemanticError
40621 enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_chain(void);
40624 * Utility method to constructs a new UnexpectedChain-variant Bolt12SemanticError
40626 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_chain(void);
40629 * Utility method to constructs a new MissingAmount-variant Bolt12SemanticError
40631 enum LDKBolt12SemanticError Bolt12SemanticError_missing_amount(void);
40634 * Utility method to constructs a new InvalidAmount-variant Bolt12SemanticError
40636 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_amount(void);
40639 * Utility method to constructs a new InsufficientAmount-variant Bolt12SemanticError
40641 enum LDKBolt12SemanticError Bolt12SemanticError_insufficient_amount(void);
40644 * Utility method to constructs a new UnexpectedAmount-variant Bolt12SemanticError
40646 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_amount(void);
40649 * Utility method to constructs a new UnsupportedCurrency-variant Bolt12SemanticError
40651 enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_currency(void);
40654 * Utility method to constructs a new UnknownRequiredFeatures-variant Bolt12SemanticError
40656 enum LDKBolt12SemanticError Bolt12SemanticError_unknown_required_features(void);
40659 * Utility method to constructs a new UnexpectedFeatures-variant Bolt12SemanticError
40661 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_features(void);
40664 * Utility method to constructs a new MissingDescription-variant Bolt12SemanticError
40666 enum LDKBolt12SemanticError Bolt12SemanticError_missing_description(void);
40669 * Utility method to constructs a new MissingSigningPubkey-variant Bolt12SemanticError
40671 enum LDKBolt12SemanticError Bolt12SemanticError_missing_signing_pubkey(void);
40674 * Utility method to constructs a new InvalidSigningPubkey-variant Bolt12SemanticError
40676 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_signing_pubkey(void);
40679 * Utility method to constructs a new UnexpectedSigningPubkey-variant Bolt12SemanticError
40681 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_signing_pubkey(void);
40684 * Utility method to constructs a new MissingQuantity-variant Bolt12SemanticError
40686 enum LDKBolt12SemanticError Bolt12SemanticError_missing_quantity(void);
40689 * Utility method to constructs a new InvalidQuantity-variant Bolt12SemanticError
40691 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_quantity(void);
40694 * Utility method to constructs a new UnexpectedQuantity-variant Bolt12SemanticError
40696 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_quantity(void);
40699 * Utility method to constructs a new InvalidMetadata-variant Bolt12SemanticError
40701 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_metadata(void);
40704 * Utility method to constructs a new UnexpectedMetadata-variant Bolt12SemanticError
40706 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_metadata(void);
40709 * Utility method to constructs a new MissingPayerMetadata-variant Bolt12SemanticError
40711 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_metadata(void);
40714 * Utility method to constructs a new MissingPayerId-variant Bolt12SemanticError
40716 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_id(void);
40719 * Utility method to constructs a new DuplicatePaymentId-variant Bolt12SemanticError
40721 enum LDKBolt12SemanticError Bolt12SemanticError_duplicate_payment_id(void);
40724 * Utility method to constructs a new MissingPaths-variant Bolt12SemanticError
40726 enum LDKBolt12SemanticError Bolt12SemanticError_missing_paths(void);
40729 * Utility method to constructs a new InvalidPayInfo-variant Bolt12SemanticError
40731 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_pay_info(void);
40734 * Utility method to constructs a new MissingCreationTime-variant Bolt12SemanticError
40736 enum LDKBolt12SemanticError Bolt12SemanticError_missing_creation_time(void);
40739 * Utility method to constructs a new MissingPaymentHash-variant Bolt12SemanticError
40741 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payment_hash(void);
40744 * Utility method to constructs a new MissingSignature-variant Bolt12SemanticError
40746 enum LDKBolt12SemanticError Bolt12SemanticError_missing_signature(void);
40749 * Frees any resources used by the Refund, if is_owned is set and inner is non-NULL.
40751 void Refund_free(struct LDKRefund this_obj);
40754 * Creates a copy of the Refund
40756 struct LDKRefund Refund_clone(const struct LDKRefund *NONNULL_PTR orig);
40759 * A complete description of the purpose of the refund. Intended to be displayed to the user
40760 * but with the caveat that it has not been verified in any way.
40762 MUST_USE_RES struct LDKPrintableString Refund_description(const struct LDKRefund *NONNULL_PTR this_arg);
40765 * Duration since the Unix epoch when an invoice should no longer be sent.
40767 * If `None`, the refund does not expire.
40769 MUST_USE_RES struct LDKCOption_u64Z Refund_absolute_expiry(const struct LDKRefund *NONNULL_PTR this_arg);
40772 * Whether the refund has expired.
40774 MUST_USE_RES bool Refund_is_expired(const struct LDKRefund *NONNULL_PTR this_arg);
40777 * The issuer of the refund, possibly beginning with `user@domain` or `domain`. Intended to be
40778 * displayed to the user but with the caveat that it has not been verified in any way.
40780 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40782 MUST_USE_RES struct LDKPrintableString Refund_issuer(const struct LDKRefund *NONNULL_PTR this_arg);
40785 * Paths to the sender originating from publicly reachable nodes. Blinded paths provide sender
40786 * privacy by obfuscating its node id.
40788 MUST_USE_RES struct LDKCVec_BlindedPathZ Refund_paths(const struct LDKRefund *NONNULL_PTR this_arg);
40791 * An unpredictable series of bytes, typically containing information about the derivation of
40794 * [`payer_id`]: Self::payer_id
40796 MUST_USE_RES struct LDKu8slice Refund_payer_metadata(const struct LDKRefund *NONNULL_PTR this_arg);
40799 * A chain that the refund is valid for.
40801 MUST_USE_RES struct LDKThirtyTwoBytes Refund_chain(const struct LDKRefund *NONNULL_PTR this_arg);
40804 * The amount to refund in msats (i.e., the minimum lightning-payable unit for [`chain`]).
40806 * [`chain`]: Self::chain
40808 MUST_USE_RES uint64_t Refund_amount_msats(const struct LDKRefund *NONNULL_PTR this_arg);
40811 * Features pertaining to requesting an invoice.
40813 MUST_USE_RES struct LDKInvoiceRequestFeatures Refund_features(const struct LDKRefund *NONNULL_PTR this_arg);
40816 * The quantity of an item that refund is for.
40818 MUST_USE_RES struct LDKCOption_u64Z Refund_quantity(const struct LDKRefund *NONNULL_PTR this_arg);
40821 * A public node id to send to in the case where there are no [`paths`]. Otherwise, a possibly
40822 * transient pubkey.
40824 * [`paths`]: Self::paths
40826 MUST_USE_RES struct LDKPublicKey Refund_payer_id(const struct LDKRefund *NONNULL_PTR this_arg);
40829 * Payer provided note to include in the invoice.
40831 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40833 MUST_USE_RES struct LDKPrintableString Refund_payer_note(const struct LDKRefund *NONNULL_PTR this_arg);
40836 * Serialize the Refund object into a byte array which can be read by Refund_read
40838 struct LDKCVec_u8Z Refund_write(const struct LDKRefund *NONNULL_PTR obj);
40841 * Read a Refund object from a string
40843 struct LDKCResult_RefundBolt12ParseErrorZ Refund_from_str(struct LDKStr s);
40846 * Creates a copy of the UtxoLookupError
40848 enum LDKUtxoLookupError UtxoLookupError_clone(const enum LDKUtxoLookupError *NONNULL_PTR orig);
40851 * Utility method to constructs a new UnknownChain-variant UtxoLookupError
40853 enum LDKUtxoLookupError UtxoLookupError_unknown_chain(void);
40856 * Utility method to constructs a new UnknownTx-variant UtxoLookupError
40858 enum LDKUtxoLookupError UtxoLookupError_unknown_tx(void);
40861 * Frees any resources used by the UtxoResult
40863 void UtxoResult_free(struct LDKUtxoResult this_ptr);
40866 * Creates a copy of the UtxoResult
40868 struct LDKUtxoResult UtxoResult_clone(const struct LDKUtxoResult *NONNULL_PTR orig);
40871 * Utility method to constructs a new Sync-variant UtxoResult
40873 struct LDKUtxoResult UtxoResult_sync(struct LDKCResult_TxOutUtxoLookupErrorZ a);
40876 * Utility method to constructs a new Async-variant UtxoResult
40878 struct LDKUtxoResult UtxoResult_async(struct LDKUtxoFuture a);
40881 * Calls the free function if one is set
40883 void UtxoLookup_free(struct LDKUtxoLookup this_ptr);
40886 * Frees any resources used by the UtxoFuture, if is_owned is set and inner is non-NULL.
40888 void UtxoFuture_free(struct LDKUtxoFuture this_obj);
40891 * Creates a copy of the UtxoFuture
40893 struct LDKUtxoFuture UtxoFuture_clone(const struct LDKUtxoFuture *NONNULL_PTR orig);
40896 * Builds a new future for later resolution.
40898 MUST_USE_RES struct LDKUtxoFuture UtxoFuture_new(void);
40901 * Resolves this future against the given `graph` and with the given `result`.
40903 * This is identical to calling [`UtxoFuture::resolve`] with a dummy `gossip`, disabling
40904 * forwarding the validated gossip message onwards to peers.
40906 * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
40907 * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
40910 * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
40911 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
40913 void UtxoFuture_resolve_without_forwarding(const struct LDKUtxoFuture *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR graph, struct LDKCResult_TxOutUtxoLookupErrorZ result);
40916 * Resolves this future against the given `graph` and with the given `result`.
40918 * The given `gossip` is used to broadcast any validated messages onwards to all peers which
40919 * have available buffer space.
40921 * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
40922 * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
40925 * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
40926 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
40928 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);
40931 * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
40933 void NodeId_free(struct LDKNodeId this_obj);
40936 * Creates a copy of the NodeId
40938 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
40941 * Create a new NodeId from a public key
40943 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
40946 * Get the public key slice from this NodeId
40948 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
40951 * Get the public key from this NodeId
40953 MUST_USE_RES struct LDKCResult_PublicKeySecp256k1ErrorZ NodeId_as_pubkey(const struct LDKNodeId *NONNULL_PTR this_arg);
40956 * Generates a non-cryptographic 64-bit hash of the NodeId.
40958 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
40961 * Serialize the NodeId object into a byte array which can be read by NodeId_read
40963 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
40966 * Read a NodeId from a byte array, created by NodeId_write
40968 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
40971 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
40973 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
40976 * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
40978 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
40981 * Frees any resources used by the NetworkUpdate
40983 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
40986 * Creates a copy of the NetworkUpdate
40988 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
40991 * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
40993 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
40996 * Utility method to constructs a new ChannelFailure-variant NetworkUpdate
40998 struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent);
41001 * Utility method to constructs a new NodeFailure-variant NetworkUpdate
41003 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
41006 * Checks if two NetworkUpdates contain equal inner contents.
41007 * This ignores pointers and is_owned flags and looks at the values in fields.
41009 bool NetworkUpdate_eq(const struct LDKNetworkUpdate *NONNULL_PTR a, const struct LDKNetworkUpdate *NONNULL_PTR b);
41012 * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
41014 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
41017 * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
41019 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
41022 * Frees any resources used by the P2PGossipSync, if is_owned is set and inner is non-NULL.
41024 void P2PGossipSync_free(struct LDKP2PGossipSync this_obj);
41027 * Creates a new tracker of the actual state of the network of channels and nodes,
41028 * assuming an existing [`NetworkGraph`].
41029 * UTXO lookup is used to make sure announced channels exist on-chain, channel data is
41030 * correct, and the announcement is signed with channel owners' keys.
41032 MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_UtxoLookupZ utxo_lookup, struct LDKLogger logger);
41035 * Adds a provider used to check new announcements. Does not affect
41036 * existing announcements unless they are updated.
41037 * Add, update or remove the provider would replace the current one.
41039 void P2PGossipSync_add_utxo_lookup(const struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_UtxoLookupZ utxo_lookup);
41042 * Handles any network updates originating from [`Event`]s.
41043 * Note that this will skip applying any [`NetworkUpdate::ChannelUpdateMessage`] to avoid
41044 * leaking possibly identifying information of the sender to the public network.
41046 * [`Event`]: crate::events::Event
41048 void NetworkGraph_handle_network_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNetworkUpdate *NONNULL_PTR network_update);
41051 * Gets the chain hash for this network graph.
41053 MUST_USE_RES struct LDKThirtyTwoBytes NetworkGraph_get_chain_hash(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
41056 * Verifies the signature of a [`NodeAnnouncement`].
41058 * Returns an error if it is invalid.
41060 struct LDKCResult_NoneLightningErrorZ verify_node_announcement(const struct LDKNodeAnnouncement *NONNULL_PTR msg);
41063 * Verifies all signatures included in a [`ChannelAnnouncement`].
41065 * Returns an error if one of the signatures is invalid.
41067 struct LDKCResult_NoneLightningErrorZ verify_channel_announcement(const struct LDKChannelAnnouncement *NONNULL_PTR msg);
41070 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
41071 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
41073 struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
41076 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
41077 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
41079 struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
41082 * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
41084 void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
41087 * When the last update to the channel direction was issued.
41088 * Value is opaque, as set in the announcement.
41090 uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
41093 * When the last update to the channel direction was issued.
41094 * Value is opaque, as set in the announcement.
41096 void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
41099 * Whether the channel can be currently used for payments (in this one direction).
41101 bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
41104 * Whether the channel can be currently used for payments (in this one direction).
41106 void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
41109 * The difference in CLTV values that you must have when routing through this channel.
41111 uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
41114 * The difference in CLTV values that you must have when routing through this channel.
41116 void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
41119 * The minimum value, which must be relayed to the next hop via the channel
41121 uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
41124 * The minimum value, which must be relayed to the next hop via the channel
41126 void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
41129 * The maximum value which may be relayed to the next hop via the channel.
41131 uint64_t ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
41134 * The maximum value which may be relayed to the next hop via the channel.
41136 void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
41139 * Fees charged when the channel is used for routing
41141 struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
41144 * Fees charged when the channel is used for routing
41146 void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
41149 * Most recent update for the channel received from the network
41150 * Mostly redundant with the data we store in fields explicitly.
41151 * Everything else is useful only for sending out for initial routing sync.
41152 * Not stored if contains excess data to prevent DoS.
41154 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41156 struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
41159 * Most recent update for the channel received from the network
41160 * Mostly redundant with the data we store in fields explicitly.
41161 * Everything else is useful only for sending out for initial routing sync.
41162 * Not stored if contains excess data to prevent DoS.
41164 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
41166 void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
41169 * Constructs a new ChannelUpdateInfo given each field
41171 * Note that last_update_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
41173 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);
41176 * Creates a copy of the ChannelUpdateInfo
41178 struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
41181 * Checks if two ChannelUpdateInfos contain equal inner contents.
41182 * This ignores pointers and is_owned flags and looks at the values in fields.
41183 * Two objects with NULL inner values will be considered "equal" here.
41185 bool ChannelUpdateInfo_eq(const struct LDKChannelUpdateInfo *NONNULL_PTR a, const struct LDKChannelUpdateInfo *NONNULL_PTR b);
41188 * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
41190 struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
41193 * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
41195 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
41198 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
41200 void ChannelInfo_free(struct LDKChannelInfo this_obj);
41203 * Protocol features of a channel communicated during its announcement
41205 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
41208 * Protocol features of a channel communicated during its announcement
41210 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
41213 * Source node of the first direction of a channel
41215 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
41218 * Source node of the first direction of a channel
41220 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
41223 * Details about the first direction of a channel
41225 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41227 struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
41230 * Details about the first direction of a channel
41232 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
41234 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
41237 * Source node of the second direction of a channel
41239 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
41242 * Source node of the second direction of a channel
41244 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
41247 * Details about the second direction of a channel
41249 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41251 struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
41254 * Details about the second direction of a channel
41256 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
41258 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
41261 * The channel capacity as seen on-chain, if chain lookup is available.
41263 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
41266 * The channel capacity as seen on-chain, if chain lookup is available.
41268 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
41271 * An initial announcement of the channel
41272 * Mostly redundant with the data we store in fields explicitly.
41273 * Everything else is useful only for sending out for initial routing sync.
41274 * Not stored if contains excess data to prevent DoS.
41276 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41278 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
41281 * An initial announcement of the channel
41282 * Mostly redundant with the data we store in fields explicitly.
41283 * Everything else is useful only for sending out for initial routing sync.
41284 * Not stored if contains excess data to prevent DoS.
41286 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
41288 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
41291 * Creates a copy of the ChannelInfo
41293 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
41296 * Checks if two ChannelInfos contain equal inner contents.
41297 * This ignores pointers and is_owned flags and looks at the values in fields.
41298 * Two objects with NULL inner values will be considered "equal" here.
41300 bool ChannelInfo_eq(const struct LDKChannelInfo *NONNULL_PTR a, const struct LDKChannelInfo *NONNULL_PTR b);
41303 * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
41305 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41307 MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
41310 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
41312 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
41315 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
41317 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
41320 * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
41322 void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
41325 * Creates a copy of the DirectedChannelInfo
41327 struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
41330 * Returns information for the channel.
41332 MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
41335 * Returns the maximum HTLC amount allowed over the channel in the direction.
41337 MUST_USE_RES uint64_t DirectedChannelInfo_htlc_maximum_msat(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
41340 * Returns the [`EffectiveCapacity`] of the channel in the direction.
41342 * This is either the total capacity from the funding transaction, if known, or the
41343 * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
41346 MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
41349 * Frees any resources used by the EffectiveCapacity
41351 void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
41354 * Creates a copy of the EffectiveCapacity
41356 struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
41359 * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
41361 struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
41364 * Utility method to constructs a new AdvertisedMaxHTLC-variant EffectiveCapacity
41366 struct LDKEffectiveCapacity EffectiveCapacity_advertised_max_htlc(uint64_t amount_msat);
41369 * Utility method to constructs a new Total-variant EffectiveCapacity
41371 struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, uint64_t htlc_maximum_msat);
41374 * Utility method to constructs a new Infinite-variant EffectiveCapacity
41376 struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
41379 * Utility method to constructs a new HintMaxHTLC-variant EffectiveCapacity
41381 struct LDKEffectiveCapacity EffectiveCapacity_hint_max_htlc(uint64_t amount_msat);
41384 * Utility method to constructs a new Unknown-variant EffectiveCapacity
41386 struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
41389 * Returns the effective capacity denominated in millisatoshi.
41391 MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
41394 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
41396 void RoutingFees_free(struct LDKRoutingFees this_obj);
41399 * Flat routing fee in millisatoshis.
41401 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
41404 * Flat routing fee in millisatoshis.
41406 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
41409 * Liquidity-based routing fee in millionths of a routed amount.
41410 * In other words, 10000 is 1%.
41412 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
41415 * Liquidity-based routing fee in millionths of a routed amount.
41416 * In other words, 10000 is 1%.
41418 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
41421 * Constructs a new RoutingFees given each field
41423 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
41426 * Checks if two RoutingFeess contain equal inner contents.
41427 * This ignores pointers and is_owned flags and looks at the values in fields.
41428 * Two objects with NULL inner values will be considered "equal" here.
41430 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
41433 * Creates a copy of the RoutingFees
41435 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
41438 * Generates a non-cryptographic 64-bit hash of the RoutingFees.
41440 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
41443 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
41445 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
41448 * Read a RoutingFees from a byte array, created by RoutingFees_write
41450 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
41453 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
41455 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
41458 * Protocol features the node announced support for
41460 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
41463 * Protocol features the node announced support for
41465 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
41468 * When the last known update to the node state was issued.
41469 * Value is opaque, as set in the announcement.
41471 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
41474 * When the last known update to the node state was issued.
41475 * Value is opaque, as set in the announcement.
41477 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
41480 * Color assigned to the node
41482 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
41485 * Color assigned to the node
41487 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
41490 * Moniker assigned to the node.
41491 * May be invalid or malicious (eg control chars),
41492 * should not be exposed to the user.
41494 struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
41497 * Moniker assigned to the node.
41498 * May be invalid or malicious (eg control chars),
41499 * should not be exposed to the user.
41501 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
41504 * An initial announcement of the node
41505 * Mostly redundant with the data we store in fields explicitly.
41506 * Everything else is useful only for sending out for initial routing sync.
41507 * Not stored if contains excess data to prevent DoS.
41509 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41511 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
41514 * An initial announcement of the node
41515 * Mostly redundant with the data we store in fields explicitly.
41516 * Everything else is useful only for sending out for initial routing sync.
41517 * Not stored if contains excess data to prevent DoS.
41519 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
41521 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
41524 * Constructs a new NodeAnnouncementInfo given each field
41526 * Note that announcement_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
41528 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);
41531 * Creates a copy of the NodeAnnouncementInfo
41533 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
41536 * Checks if two NodeAnnouncementInfos contain equal inner contents.
41537 * This ignores pointers and is_owned flags and looks at the values in fields.
41538 * Two objects with NULL inner values will be considered "equal" here.
41540 bool NodeAnnouncementInfo_eq(const struct LDKNodeAnnouncementInfo *NONNULL_PTR a, const struct LDKNodeAnnouncementInfo *NONNULL_PTR b);
41543 * Internet-level addresses via which one can connect to the node
41545 MUST_USE_RES struct LDKCVec_SocketAddressZ NodeAnnouncementInfo_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg);
41548 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
41550 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
41553 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
41555 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
41558 * Frees any resources used by the NodeAlias, if is_owned is set and inner is non-NULL.
41560 void NodeAlias_free(struct LDKNodeAlias this_obj);
41562 const uint8_t (*NodeAlias_get_a(const struct LDKNodeAlias *NONNULL_PTR this_ptr))[32];
41564 void NodeAlias_set_a(struct LDKNodeAlias *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41567 * Constructs a new NodeAlias given each field
41569 MUST_USE_RES struct LDKNodeAlias NodeAlias_new(struct LDKThirtyTwoBytes a_arg);
41572 * Creates a copy of the NodeAlias
41574 struct LDKNodeAlias NodeAlias_clone(const struct LDKNodeAlias *NONNULL_PTR orig);
41577 * Checks if two NodeAliass contain equal inner contents.
41578 * This ignores pointers and is_owned flags and looks at the values in fields.
41579 * Two objects with NULL inner values will be considered "equal" here.
41581 bool NodeAlias_eq(const struct LDKNodeAlias *NONNULL_PTR a, const struct LDKNodeAlias *NONNULL_PTR b);
41584 * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
41586 struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj);
41589 * Read a NodeAlias from a byte array, created by NodeAlias_write
41591 struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser);
41594 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
41596 void NodeInfo_free(struct LDKNodeInfo this_obj);
41599 * All valid channels a node has announced
41601 * Returns a copy of the field.
41603 struct LDKCVec_u64Z NodeInfo_get_channels(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
41606 * All valid channels a node has announced
41608 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
41611 * More information about a node from node_announcement.
41612 * Optional because we store a Node entry after learning about it from
41613 * a channel announcement, but before receiving a node announcement.
41615 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41617 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
41620 * More information about a node from node_announcement.
41621 * Optional because we store a Node entry after learning about it from
41622 * a channel announcement, but before receiving a node announcement.
41624 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
41626 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
41629 * Constructs a new NodeInfo given each field
41631 * Note that announcement_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
41633 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
41636 * Creates a copy of the NodeInfo
41638 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
41641 * Checks if two NodeInfos contain equal inner contents.
41642 * This ignores pointers and is_owned flags and looks at the values in fields.
41643 * Two objects with NULL inner values will be considered "equal" here.
41645 bool NodeInfo_eq(const struct LDKNodeInfo *NONNULL_PTR a, const struct LDKNodeInfo *NONNULL_PTR b);
41648 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
41650 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
41653 * Read a NodeInfo from a byte array, created by NodeInfo_write
41655 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
41658 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
41660 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
41663 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
41665 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg);
41668 * Creates a new, empty, network graph.
41670 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(enum LDKNetwork network, struct LDKLogger logger);
41673 * Returns a read-only view of the network graph.
41675 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
41678 * The unix timestamp provided by the most recent rapid gossip sync.
41679 * It will be set by the rapid sync process after every sync completion.
41681 MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
41684 * Update the unix timestamp provided by the most recent rapid gossip sync.
41685 * This should be done automatically by the rapid sync process after every sync completion.
41687 void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp);
41690 * For an already known node (from channel announcements), update its stored properties from a
41691 * given node announcement.
41693 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
41694 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
41695 * routing messages from a source using a protocol other than the lightning P2P protocol.
41697 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
41700 * For an already known node (from channel announcements), update its stored properties from a
41701 * given node announcement without verifying the associated signatures. Because we aren't
41702 * given the associated signatures here we cannot relay the node announcement to any of our
41705 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);
41708 * Store or update channel info from a channel announcement.
41710 * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
41711 * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
41712 * routing messages from a source using a protocol other than the lightning P2P protocol.
41714 * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
41715 * the corresponding UTXO exists on chain and is correctly-formatted.
41717 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);
41720 * Store or update channel info from a channel announcement.
41722 * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
41723 * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
41724 * routing messages from a source using a protocol other than the lightning P2P protocol.
41726 * This will skip verification of if the channel is actually on-chain.
41728 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);
41731 * Store or update channel info from a channel announcement without verifying the associated
41732 * signatures. Because we aren't given the associated signatures here we cannot relay the
41733 * channel announcement to any of our peers.
41735 * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
41736 * the corresponding UTXO exists on chain and is correctly-formatted.
41738 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);
41741 * Update channel from partial announcement data received via rapid gossip sync
41743 * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the
41744 * rapid gossip sync server)
41746 * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields.
41748 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);
41751 * Marks a channel in the graph as failed permanently.
41753 * The channel and any node for which this was their last channel are removed from the graph.
41755 void NetworkGraph_channel_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
41758 * Marks a node in the graph as permanently failed, effectively removing it and its channels
41759 * from local storage.
41761 void NetworkGraph_node_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
41764 * Removes information about channels that we haven't heard any updates about in some time.
41765 * This can be used regularly to prune the network graph of channels that likely no longer
41768 * While there is no formal requirement that nodes regularly re-broadcast their channel
41769 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
41770 * pruning occur for updates which are at least two weeks old, which we implement here.
41772 * Note that for users of the `lightning-background-processor` crate this method may be
41773 * automatically called regularly for you.
41775 * This method will also cause us to stop tracking removed nodes and channels if they have been
41776 * in the map for a while so that these can be resynced from gossip in the future.
41778 * This method is only available with the `std` feature. See
41779 * [`NetworkGraph::remove_stale_channels_and_tracking_with_time`] for `no-std` use.
41781 void NetworkGraph_remove_stale_channels_and_tracking(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
41784 * Removes information about channels that we haven't heard any updates about in some time.
41785 * This can be used regularly to prune the network graph of channels that likely no longer
41788 * While there is no formal requirement that nodes regularly re-broadcast their channel
41789 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
41790 * pruning occur for updates which are at least two weeks old, which we implement here.
41792 * This method will also cause us to stop tracking removed nodes and channels if they have been
41793 * in the map for a while so that these can be resynced from gossip in the future.
41795 * This function takes the current unix time as an argument. For users with the `std` feature
41796 * enabled, [`NetworkGraph::remove_stale_channels_and_tracking`] may be preferable.
41798 void NetworkGraph_remove_stale_channels_and_tracking_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
41801 * For an already known (from announcement) channel, update info about one of the directions
41804 * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
41805 * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
41806 * routing messages from a source using a protocol other than the lightning P2P protocol.
41808 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
41809 * materially in the future will be rejected.
41811 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
41814 * For an already known (from announcement) channel, update info about one of the directions
41815 * of the channel without verifying the associated signatures. Because we aren't given the
41816 * associated signatures here we cannot relay the channel update to any of our peers.
41818 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
41819 * materially in the future will be rejected.
41821 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
41824 * For an already known (from announcement) channel, verify the given [`ChannelUpdate`].
41826 * This checks whether the update currently is applicable by [`Self::update_channel`].
41828 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
41829 * materially in the future will be rejected.
41831 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_verify_channel_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
41834 * Returns information on a channel with the given id.
41836 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41838 MUST_USE_RES struct LDKChannelInfo ReadOnlyNetworkGraph_channel(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
41841 * Returns the list of channels in the graph
41843 MUST_USE_RES struct LDKCVec_u64Z ReadOnlyNetworkGraph_list_channels(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
41846 * Returns information on a node with the given id.
41848 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41850 MUST_USE_RES struct LDKNodeInfo ReadOnlyNetworkGraph_node(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
41853 * Returns the list of nodes in the graph
41855 MUST_USE_RES struct LDKCVec_NodeIdZ ReadOnlyNetworkGraph_list_nodes(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
41858 * Get network addresses by node id.
41859 * Returns None if the requested node is completely unknown,
41860 * or if node announcement for the node was never received.
41862 MUST_USE_RES struct LDKCOption_CVec_SocketAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
41865 * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
41867 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
41870 * Creates a new router.
41872 MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, struct LDKThirtyTwoBytes random_seed_bytes, struct LDKLockableScore scorer, struct LDKProbabilisticScoringFeeParameters score_params);
41875 * Constructs a new Router which calls the relevant methods on this_arg.
41876 * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
41878 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
41881 * Calls the free function if one is set
41883 void Router_free(struct LDKRouter this_ptr);
41886 * Frees any resources used by the ScorerAccountingForInFlightHtlcs, if is_owned is set and inner is non-NULL.
41888 void ScorerAccountingForInFlightHtlcs_free(struct LDKScorerAccountingForInFlightHtlcs this_obj);
41891 * Initialize a new `ScorerAccountingForInFlightHtlcs`.
41893 MUST_USE_RES struct LDKScorerAccountingForInFlightHtlcs ScorerAccountingForInFlightHtlcs_new(struct LDKScoreLookUp scorer, const struct LDKInFlightHtlcs *NONNULL_PTR inflight_htlcs);
41896 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
41897 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
41899 struct LDKScoreLookUp ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(const struct LDKScorerAccountingForInFlightHtlcs *NONNULL_PTR this_arg);
41902 * Frees any resources used by the InFlightHtlcs, if is_owned is set and inner is non-NULL.
41904 void InFlightHtlcs_free(struct LDKInFlightHtlcs this_obj);
41907 * Creates a copy of the InFlightHtlcs
41909 struct LDKInFlightHtlcs InFlightHtlcs_clone(const struct LDKInFlightHtlcs *NONNULL_PTR orig);
41912 * Constructs an empty `InFlightHtlcs`.
41914 MUST_USE_RES struct LDKInFlightHtlcs InFlightHtlcs_new(void);
41917 * Takes in a path with payer's node id and adds the path's details to `InFlightHtlcs`.
41919 void InFlightHtlcs_process_path(struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKPath *NONNULL_PTR path, struct LDKPublicKey payer_node_id);
41922 * Adds a known HTLC given the public key of the HTLC source, target, and short channel
41925 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);
41928 * Returns liquidity in msat given the public key of the HTLC source, target, and short channel
41931 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);
41934 * Serialize the InFlightHtlcs object into a byte array which can be read by InFlightHtlcs_read
41936 struct LDKCVec_u8Z InFlightHtlcs_write(const struct LDKInFlightHtlcs *NONNULL_PTR obj);
41939 * Read a InFlightHtlcs from a byte array, created by InFlightHtlcs_write
41941 struct LDKCResult_InFlightHtlcsDecodeErrorZ InFlightHtlcs_read(struct LDKu8slice ser);
41944 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
41946 void RouteHop_free(struct LDKRouteHop this_obj);
41949 * The node_id of the node at this hop.
41951 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
41954 * The node_id of the node at this hop.
41956 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
41959 * The node_announcement features of the node at this hop. For the last hop, these may be
41960 * amended to match the features present in the invoice this node generated.
41962 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
41965 * The node_announcement features of the node at this hop. For the last hop, these may be
41966 * amended to match the features present in the invoice this node generated.
41968 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
41971 * The channel that should be used from the previous hop to reach this node.
41973 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
41976 * The channel that should be used from the previous hop to reach this node.
41978 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
41981 * The channel_announcement features of the channel that should be used from the previous hop
41982 * to reach this node.
41984 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
41987 * The channel_announcement features of the channel that should be used from the previous hop
41988 * to reach this node.
41990 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
41993 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
41994 * If this is the last hop in [`Path::hops`]:
41995 * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
41996 * * otherwise, this is the full value of this [`Path`]'s part of the payment
41998 * [`BlindedPath`]: crate::blinded_path::BlindedPath
42000 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
42003 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
42004 * If this is the last hop in [`Path::hops`]:
42005 * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
42006 * * otherwise, this is the full value of this [`Path`]'s part of the payment
42008 * [`BlindedPath`]: crate::blinded_path::BlindedPath
42010 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
42013 * The CLTV delta added for this hop.
42014 * If this is the last hop in [`Path::hops`]:
42015 * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
42016 * * otherwise, this is the CLTV delta expected at the destination
42018 * [`BlindedPath`]: crate::blinded_path::BlindedPath
42020 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
42023 * The CLTV delta added for this hop.
42024 * If this is the last hop in [`Path::hops`]:
42025 * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
42026 * * otherwise, this is the CLTV delta expected at the destination
42028 * [`BlindedPath`]: crate::blinded_path::BlindedPath
42030 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
42033 * Indicates whether this hop is possibly announced in the public network graph.
42035 * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
42036 * either know for sure it's announced in the public graph, or if any public channels exist
42037 * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
42038 * the channel to be unannounced.
42040 * Will be `true` for objects serialized with LDK version 0.0.116 and before.
42042 bool RouteHop_get_maybe_announced_channel(const struct LDKRouteHop *NONNULL_PTR this_ptr);
42045 * Indicates whether this hop is possibly announced in the public network graph.
42047 * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
42048 * either know for sure it's announced in the public graph, or if any public channels exist
42049 * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
42050 * the channel to be unannounced.
42052 * Will be `true` for objects serialized with LDK version 0.0.116 and before.
42054 void RouteHop_set_maybe_announced_channel(struct LDKRouteHop *NONNULL_PTR this_ptr, bool val);
42057 * Constructs a new RouteHop given each field
42059 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);
42062 * Creates a copy of the RouteHop
42064 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
42067 * Generates a non-cryptographic 64-bit hash of the RouteHop.
42069 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
42072 * Checks if two RouteHops contain equal inner contents.
42073 * This ignores pointers and is_owned flags and looks at the values in fields.
42074 * Two objects with NULL inner values will be considered "equal" here.
42076 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
42079 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
42081 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
42084 * Read a RouteHop from a byte array, created by RouteHop_write
42086 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
42089 * Frees any resources used by the BlindedTail, if is_owned is set and inner is non-NULL.
42091 void BlindedTail_free(struct LDKBlindedTail this_obj);
42094 * The hops of the [`BlindedPath`] provided by the recipient.
42096 * [`BlindedPath`]: crate::blinded_path::BlindedPath
42098 struct LDKCVec_BlindedHopZ BlindedTail_get_hops(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
42101 * The hops of the [`BlindedPath`] provided by the recipient.
42103 * [`BlindedPath`]: crate::blinded_path::BlindedPath
42105 void BlindedTail_set_hops(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
42108 * The blinding point of the [`BlindedPath`] provided by the recipient.
42110 * [`BlindedPath`]: crate::blinded_path::BlindedPath
42112 struct LDKPublicKey BlindedTail_get_blinding_point(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
42115 * The blinding point of the [`BlindedPath`] provided by the recipient.
42117 * [`BlindedPath`]: crate::blinded_path::BlindedPath
42119 void BlindedTail_set_blinding_point(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKPublicKey val);
42122 * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
42123 * inferring the destination. May be 0.
42125 uint32_t BlindedTail_get_excess_final_cltv_expiry_delta(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
42128 * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
42129 * inferring the destination. May be 0.
42131 void BlindedTail_set_excess_final_cltv_expiry_delta(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint32_t val);
42134 * The total amount paid on this [`Path`], excluding the fees.
42136 uint64_t BlindedTail_get_final_value_msat(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
42139 * The total amount paid on this [`Path`], excluding the fees.
42141 void BlindedTail_set_final_value_msat(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint64_t val);
42144 * Constructs a new BlindedTail given each field
42146 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);
42149 * Creates a copy of the BlindedTail
42151 struct LDKBlindedTail BlindedTail_clone(const struct LDKBlindedTail *NONNULL_PTR orig);
42154 * Generates a non-cryptographic 64-bit hash of the BlindedTail.
42156 uint64_t BlindedTail_hash(const struct LDKBlindedTail *NONNULL_PTR o);
42159 * Checks if two BlindedTails contain equal inner contents.
42160 * This ignores pointers and is_owned flags and looks at the values in fields.
42161 * Two objects with NULL inner values will be considered "equal" here.
42163 bool BlindedTail_eq(const struct LDKBlindedTail *NONNULL_PTR a, const struct LDKBlindedTail *NONNULL_PTR b);
42166 * Serialize the BlindedTail object into a byte array which can be read by BlindedTail_read
42168 struct LDKCVec_u8Z BlindedTail_write(const struct LDKBlindedTail *NONNULL_PTR obj);
42171 * Read a BlindedTail from a byte array, created by BlindedTail_write
42173 struct LDKCResult_BlindedTailDecodeErrorZ BlindedTail_read(struct LDKu8slice ser);
42176 * Frees any resources used by the Path, if is_owned is set and inner is non-NULL.
42178 void Path_free(struct LDKPath this_obj);
42181 * The list of unblinded hops in this [`Path`]. Must be at least length one.
42183 struct LDKCVec_RouteHopZ Path_get_hops(const struct LDKPath *NONNULL_PTR this_ptr);
42186 * The list of unblinded hops in this [`Path`]. Must be at least length one.
42188 void Path_set_hops(struct LDKPath *NONNULL_PTR this_ptr, struct LDKCVec_RouteHopZ val);
42191 * The blinded path at which this path terminates, if we're sending to one, and its metadata.
42193 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
42195 struct LDKBlindedTail Path_get_blinded_tail(const struct LDKPath *NONNULL_PTR this_ptr);
42198 * The blinded path at which this path terminates, if we're sending to one, and its metadata.
42200 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
42202 void Path_set_blinded_tail(struct LDKPath *NONNULL_PTR this_ptr, struct LDKBlindedTail val);
42205 * Constructs a new Path given each field
42207 * Note that blinded_tail_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
42209 MUST_USE_RES struct LDKPath Path_new(struct LDKCVec_RouteHopZ hops_arg, struct LDKBlindedTail blinded_tail_arg);
42212 * Creates a copy of the Path
42214 struct LDKPath Path_clone(const struct LDKPath *NONNULL_PTR orig);
42217 * Generates a non-cryptographic 64-bit hash of the Path.
42219 uint64_t Path_hash(const struct LDKPath *NONNULL_PTR o);
42222 * Checks if two Paths contain equal inner contents.
42223 * This ignores pointers and is_owned flags and looks at the values in fields.
42224 * Two objects with NULL inner values will be considered "equal" here.
42226 bool Path_eq(const struct LDKPath *NONNULL_PTR a, const struct LDKPath *NONNULL_PTR b);
42229 * Gets the fees for a given path, excluding any excess paid to the recipient.
42231 MUST_USE_RES uint64_t Path_fee_msat(const struct LDKPath *NONNULL_PTR this_arg);
42234 * Gets the total amount paid on this [`Path`], excluding the fees.
42236 MUST_USE_RES uint64_t Path_final_value_msat(const struct LDKPath *NONNULL_PTR this_arg);
42239 * Gets the final hop's CLTV expiry delta.
42241 MUST_USE_RES struct LDKCOption_u32Z Path_final_cltv_expiry_delta(const struct LDKPath *NONNULL_PTR this_arg);
42244 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
42246 void Route_free(struct LDKRoute this_obj);
42249 * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
42250 * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
42253 struct LDKCVec_PathZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
42256 * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
42257 * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
42260 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_PathZ val);
42263 * The `route_params` parameter passed to [`find_route`].
42265 * This is used by `ChannelManager` to track information which may be required for retries.
42267 * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
42269 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
42271 struct LDKRouteParameters Route_get_route_params(const struct LDKRoute *NONNULL_PTR this_ptr);
42274 * The `route_params` parameter passed to [`find_route`].
42276 * This is used by `ChannelManager` to track information which may be required for retries.
42278 * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
42280 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
42282 void Route_set_route_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKRouteParameters val);
42285 * Constructs a new Route given each field
42287 * Note that route_params_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
42289 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_PathZ paths_arg, struct LDKRouteParameters route_params_arg);
42292 * Creates a copy of the Route
42294 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
42297 * Generates a non-cryptographic 64-bit hash of the Route.
42299 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
42302 * Checks if two Routes contain equal inner contents.
42303 * This ignores pointers and is_owned flags and looks at the values in fields.
42304 * Two objects with NULL inner values will be considered "equal" here.
42306 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
42309 * Returns the total amount of fees paid on this [`Route`].
42311 * For objects serialized with LDK 0.0.117 and after, this includes any extra payment made to
42312 * the recipient, which can happen in excess of the amount passed to [`find_route`] via
42313 * [`RouteParameters::final_value_msat`], if we had to reach the [`htlc_minimum_msat`] limits.
42315 * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
42317 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
42320 * Returns the total amount paid on this [`Route`], excluding the fees.
42322 * Might be more than requested as part of the given [`RouteParameters::final_value_msat`] if
42323 * we had to reach the [`htlc_minimum_msat`] limits.
42325 * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
42327 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
42330 * Serialize the Route object into a byte array which can be read by Route_read
42332 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
42335 * Read a Route from a byte array, created by Route_write
42337 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
42340 * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
42342 void RouteParameters_free(struct LDKRouteParameters this_obj);
42345 * The parameters of the failed payment path.
42347 struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
42350 * The parameters of the failed payment path.
42352 void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
42355 * The amount in msats sent on the failed payment path.
42357 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
42360 * The amount in msats sent on the failed payment path.
42362 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
42365 * The maximum total fees, in millisatoshi, that may accrue during route finding.
42367 * This limit also applies to the total fees that may arise while retrying failed payment
42370 * Note that values below a few sats may result in some paths being spuriously ignored.
42372 struct LDKCOption_u64Z RouteParameters_get_max_total_routing_fee_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
42375 * The maximum total fees, in millisatoshi, that may accrue during route finding.
42377 * This limit also applies to the total fees that may arise while retrying failed payment
42380 * Note that values below a few sats may result in some paths being spuriously ignored.
42382 void RouteParameters_set_max_total_routing_fee_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
42385 * Constructs a new RouteParameters given each field
42387 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);
42390 * Creates a copy of the RouteParameters
42392 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
42395 * Generates a non-cryptographic 64-bit hash of the RouteParameters.
42397 uint64_t RouteParameters_hash(const struct LDKRouteParameters *NONNULL_PTR o);
42400 * Checks if two RouteParameterss contain equal inner contents.
42401 * This ignores pointers and is_owned flags and looks at the values in fields.
42402 * Two objects with NULL inner values will be considered "equal" here.
42404 bool RouteParameters_eq(const struct LDKRouteParameters *NONNULL_PTR a, const struct LDKRouteParameters *NONNULL_PTR b);
42407 * Constructs [`RouteParameters`] from the given [`PaymentParameters`] and a payment amount.
42409 * [`Self::max_total_routing_fee_msat`] defaults to 1% of the payment amount + 50 sats
42411 MUST_USE_RES struct LDKRouteParameters RouteParameters_from_payment_params_and_value(struct LDKPaymentParameters payment_params, uint64_t final_value_msat);
42414 * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
42416 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
42419 * Read a RouteParameters from a byte array, created by RouteParameters_write
42421 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
42424 * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
42426 void PaymentParameters_free(struct LDKPaymentParameters this_obj);
42429 * Information about the payee, such as their features and route hints for their channels.
42431 struct LDKPayee PaymentParameters_get_payee(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
42434 * Information about the payee, such as their features and route hints for their channels.
42436 void PaymentParameters_set_payee(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPayee val);
42439 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
42441 struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
42444 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
42446 void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
42449 * The maximum total CLTV delta we accept for the route.
42450 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
42452 uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
42455 * The maximum total CLTV delta we accept for the route.
42456 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
42458 void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
42461 * The maximum number of paths that may be used by (MPP) payments.
42462 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
42464 uint8_t PaymentParameters_get_max_path_count(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
42467 * The maximum number of paths that may be used by (MPP) payments.
42468 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
42470 void PaymentParameters_set_max_path_count(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
42473 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
42474 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
42475 * a lower value prefers to send larger MPP parts, potentially saturating channels and
42476 * increasing failure probability for those paths.
42478 * Note that this restriction will be relaxed during pathfinding after paths which meet this
42479 * restriction have been found. While paths which meet this criteria will be searched for, it
42480 * is ultimately up to the scorer to select them over other paths.
42482 * A value of 0 will allow payments up to and including a channel's total announced usable
42483 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
42487 uint8_t PaymentParameters_get_max_channel_saturation_power_of_half(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
42490 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
42491 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
42492 * a lower value prefers to send larger MPP parts, potentially saturating channels and
42493 * increasing failure probability for those paths.
42495 * Note that this restriction will be relaxed during pathfinding after paths which meet this
42496 * restriction have been found. While paths which meet this criteria will be searched for, it
42497 * is ultimately up to the scorer to select them over other paths.
42499 * A value of 0 will allow payments up to and including a channel's total announced usable
42500 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
42504 void PaymentParameters_set_max_channel_saturation_power_of_half(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
42507 * A list of SCIDs which this payment was previously attempted over and which caused the
42508 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
42511 * Returns a copy of the field.
42513 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_channels(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
42516 * A list of SCIDs which this payment was previously attempted over and which caused the
42517 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
42520 void PaymentParameters_set_previously_failed_channels(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
42523 * Constructs a new PaymentParameters given each field
42525 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);
42528 * Creates a copy of the PaymentParameters
42530 struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
42533 * Generates a non-cryptographic 64-bit hash of the PaymentParameters.
42535 uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
42538 * Checks if two PaymentParameterss contain equal inner contents.
42539 * This ignores pointers and is_owned flags and looks at the values in fields.
42540 * Two objects with NULL inner values will be considered "equal" here.
42542 bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
42545 * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
42547 struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
42550 * Read a PaymentParameters from a byte array, created by PaymentParameters_write
42552 struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser, uint32_t arg);
42555 * Creates a payee with the node id of the given `pubkey`.
42557 * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
42560 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta);
42563 * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
42565 * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
42568 * Note that MPP keysend is not widely supported yet. The `allow_mpp` lets you choose
42569 * whether your router will be allowed to find a multi-part route for this payment. If you
42570 * set `allow_mpp` to true, you should ensure a payment secret is set on send, likely via
42571 * [`RecipientOnionFields::secret_only`].
42573 * [`RecipientOnionFields::secret_only`]: crate::ln::channelmanager::RecipientOnionFields::secret_only
42575 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta, bool allow_mpp);
42578 * Creates parameters for paying to a blinded payee from the provided invoice. Sets
42579 * [`Payee::Blinded::route_hints`], [`Payee::Blinded::features`], and
42580 * [`PaymentParameters::expiry_time`].
42582 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_bolt12_invoice(const struct LDKBolt12Invoice *NONNULL_PTR invoice);
42585 * Creates parameters for paying to a blinded payee from the provided blinded route hints.
42587 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ blinded_route_hints);
42590 * Frees any resources used by the Payee
42592 void Payee_free(struct LDKPayee this_ptr);
42595 * Creates a copy of the Payee
42597 struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig);
42600 * Utility method to constructs a new Blinded-variant Payee
42602 struct LDKPayee Payee_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints, struct LDKBolt12InvoiceFeatures features);
42605 * Utility method to constructs a new Clear-variant Payee
42607 struct LDKPayee Payee_clear(struct LDKPublicKey node_id, struct LDKCVec_RouteHintZ route_hints, struct LDKBolt11InvoiceFeatures features, uint32_t final_cltv_expiry_delta);
42610 * Generates a non-cryptographic 64-bit hash of the Payee.
42612 uint64_t Payee_hash(const struct LDKPayee *NONNULL_PTR o);
42615 * Checks if two Payees contain equal inner contents.
42616 * This ignores pointers and is_owned flags and looks at the values in fields.
42618 bool Payee_eq(const struct LDKPayee *NONNULL_PTR a, const struct LDKPayee *NONNULL_PTR b);
42621 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
42623 void RouteHint_free(struct LDKRouteHint this_obj);
42625 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
42627 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
42630 * Constructs a new RouteHint given each field
42632 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
42635 * Creates a copy of the RouteHint
42637 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
42640 * Generates a non-cryptographic 64-bit hash of the RouteHint.
42642 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
42645 * Checks if two RouteHints contain equal inner contents.
42646 * This ignores pointers and is_owned flags and looks at the values in fields.
42647 * Two objects with NULL inner values will be considered "equal" here.
42649 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
42652 * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
42654 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
42657 * Read a RouteHint from a byte array, created by RouteHint_write
42659 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
42662 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
42664 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
42667 * The node_id of the non-target end of the route
42669 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
42672 * The node_id of the non-target end of the route
42674 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
42677 * The short_channel_id of this channel
42679 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
42682 * The short_channel_id of this channel
42684 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
42687 * The fees which must be paid to use this channel
42689 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
42692 * The fees which must be paid to use this channel
42694 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
42697 * The difference in CLTV values between this node and the next node.
42699 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
42702 * The difference in CLTV values between this node and the next node.
42704 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
42707 * The minimum value, in msat, which must be relayed to the next hop.
42709 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
42712 * The minimum value, in msat, which must be relayed to the next hop.
42714 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
42717 * The maximum value in msat available for routing with a single HTLC.
42719 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
42722 * The maximum value in msat available for routing with a single HTLC.
42724 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
42727 * Constructs a new RouteHintHop given each field
42729 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);
42732 * Creates a copy of the RouteHintHop
42734 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
42737 * Generates a non-cryptographic 64-bit hash of the RouteHintHop.
42739 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
42742 * Checks if two RouteHintHops contain equal inner contents.
42743 * This ignores pointers and is_owned flags and looks at the values in fields.
42744 * Two objects with NULL inner values will be considered "equal" here.
42746 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
42749 * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
42751 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
42754 * Read a RouteHintHop from a byte array, created by RouteHintHop_write
42756 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
42759 * Finds a route from us (payer) to the given target node (payee).
42761 * If the payee provided features in their invoice, they should be provided via the `payee` field
42762 * in the given [`RouteParameters::payment_params`].
42763 * Without this, MPP will only be used if the payee's features are available in the network graph.
42765 * Private routing paths between a public node and the target may be included in the `payee` field
42766 * of [`RouteParameters::payment_params`].
42768 * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
42769 * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels
42770 * from `network_graph` will be ignored, and only those in `first_hops` will be used.
42772 * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
42773 * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
42774 * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
42778 * Panics if first_hops contains channels without `short_channel_id`s;
42779 * [`ChannelManager::list_usable_channels`] will never include such channels.
42781 * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
42782 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
42783 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
42785 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
42787 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]);
42790 * Construct a route from us (payer) to the target node (payee) via the given hops (which should
42791 * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
42793 * Re-uses logic from `find_route`, so the restrictions described there also apply here.
42795 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]);
42798 * Calls the free function if one is set
42800 void ScoreLookUp_free(struct LDKScoreLookUp this_ptr);
42803 * Calls the free function if one is set
42805 void ScoreUpdate_free(struct LDKScoreUpdate this_ptr);
42808 * Calls the free function if one is set
42810 void Score_free(struct LDKScore this_ptr);
42813 * Calls the free function if one is set
42815 void LockableScore_free(struct LDKLockableScore this_ptr);
42818 * Calls the free function if one is set
42820 void WriteableScore_free(struct LDKWriteableScore this_ptr);
42823 * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
42825 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
42828 * Constructs a new LockableScore which calls the relevant methods on this_arg.
42829 * This copies the `inner` pointer in this_arg and thus the returned LockableScore must be freed before this_arg is
42831 struct LDKLockableScore MultiThreadedLockableScore_as_LockableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
42834 * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
42836 struct LDKCVec_u8Z MultiThreadedLockableScore_write(const struct LDKMultiThreadedLockableScore *NONNULL_PTR obj);
42839 * Constructs a new WriteableScore which calls the relevant methods on this_arg.
42840 * This copies the `inner` pointer in this_arg and thus the returned WriteableScore must be freed before this_arg is
42842 struct LDKWriteableScore MultiThreadedLockableScore_as_WriteableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
42845 * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
42847 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
42850 * Frees any resources used by the MultiThreadedScoreLockRead, if is_owned is set and inner is non-NULL.
42852 void MultiThreadedScoreLockRead_free(struct LDKMultiThreadedScoreLockRead this_obj);
42855 * Frees any resources used by the MultiThreadedScoreLockWrite, if is_owned is set and inner is non-NULL.
42857 void MultiThreadedScoreLockWrite_free(struct LDKMultiThreadedScoreLockWrite this_obj);
42860 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
42861 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
42863 struct LDKScoreLookUp MultiThreadedScoreLockRead_as_ScoreLookUp(const struct LDKMultiThreadedScoreLockRead *NONNULL_PTR this_arg);
42866 * Serialize the MultiThreadedScoreLockWrite object into a byte array which can be read by MultiThreadedScoreLockWrite_read
42868 struct LDKCVec_u8Z MultiThreadedScoreLockWrite_write(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR obj);
42871 * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
42872 * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
42874 struct LDKScoreUpdate MultiThreadedScoreLockWrite_as_ScoreUpdate(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR this_arg);
42877 * Frees any resources used by the ChannelUsage, if is_owned is set and inner is non-NULL.
42879 void ChannelUsage_free(struct LDKChannelUsage this_obj);
42882 * The amount to send through the channel, denominated in millisatoshis.
42884 uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
42887 * The amount to send through the channel, denominated in millisatoshis.
42889 void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
42892 * Total amount, denominated in millisatoshis, already allocated to send through the channel
42893 * as part of a multi-path payment.
42895 uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
42898 * Total amount, denominated in millisatoshis, already allocated to send through the channel
42899 * as part of a multi-path payment.
42901 void ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
42904 * The effective capacity of the channel.
42906 struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
42909 * The effective capacity of the channel.
42911 void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val);
42914 * Constructs a new ChannelUsage given each field
42916 MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg);
42919 * Creates a copy of the ChannelUsage
42921 struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig);
42924 * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
42926 void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
42929 * Creates a copy of the FixedPenaltyScorer
42931 struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
42934 * Creates a new scorer using `penalty_msat`.
42936 MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
42939 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
42940 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
42942 struct LDKScoreLookUp FixedPenaltyScorer_as_ScoreLookUp(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
42945 * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
42946 * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
42948 struct LDKScoreUpdate FixedPenaltyScorer_as_ScoreUpdate(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
42951 * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
42953 struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
42956 * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
42958 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
42961 * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
42963 void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
42966 * Frees any resources used by the ProbabilisticScoringFeeParameters, if is_owned is set and inner is non-NULL.
42968 void ProbabilisticScoringFeeParameters_free(struct LDKProbabilisticScoringFeeParameters this_obj);
42971 * A fixed penalty in msats to apply to each channel.
42973 * Default value: 500 msat
42975 uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
42978 * A fixed penalty in msats to apply to each channel.
42980 * Default value: 500 msat
42982 void ProbabilisticScoringFeeParameters_set_base_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
42985 * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
42986 * applied to each channel, in excess of the [`base_penalty_msat`].
42988 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
42989 * fees plus penalty) for large payments. The penalty is computed as the product of this
42990 * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
42991 * amount plus the amount of any other HTLCs flowing we sent over the same channel).
42993 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
42995 * Default value: 8,192 msat
42997 * [`base_penalty_msat`]: Self::base_penalty_msat
42999 uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
43002 * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
43003 * applied to each channel, in excess of the [`base_penalty_msat`].
43005 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
43006 * fees plus penalty) for large payments. The penalty is computed as the product of this
43007 * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
43008 * amount plus the amount of any other HTLCs flowing we sent over the same channel).
43010 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
43012 * Default value: 8,192 msat
43014 * [`base_penalty_msat`]: Self::base_penalty_msat
43016 void ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
43019 * A multiplier used in conjunction with the negative `log10` of the channel's success
43020 * probability for a payment, as determined by our latest estimates of the channel's
43021 * liquidity, to determine the liquidity penalty.
43023 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
43024 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
43025 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
43026 * lower bounding the success probability to `0.01`) when the amount falls within the
43027 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
43028 * result in a `u64::max_value` penalty, however.
43030 * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
43032 * Default value: 30,000 msat
43034 * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
43036 uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
43039 * A multiplier used in conjunction with the negative `log10` of the channel's success
43040 * probability for a payment, as determined by our latest estimates of the channel's
43041 * liquidity, to determine the liquidity penalty.
43043 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
43044 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
43045 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
43046 * lower bounding the success probability to `0.01`) when the amount falls within the
43047 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
43048 * result in a `u64::max_value` penalty, however.
43050 * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
43052 * Default value: 30,000 msat
43054 * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
43056 void ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
43059 * A multiplier used in conjunction with the total amount flowing over a channel and the
43060 * negative `log10` of the channel's success probability for the payment, as determined by our
43061 * latest estimates of the channel's liquidity, to determine the amount penalty.
43063 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
43064 * fees plus penalty) for large payments. The penalty is computed as the product of this
43065 * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
43066 * `log10` of the success probability.
43068 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
43070 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
43071 * the amount will result in a penalty of the multiplier. And, as the success probability
43072 * decreases, the negative `log10` weighting will increase dramatically. For higher success
43073 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
43076 * Default value: 192 msat
43078 uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
43081 * A multiplier used in conjunction with the total amount flowing over a channel and the
43082 * negative `log10` of the channel's success probability for the payment, as determined by our
43083 * latest estimates of the channel's liquidity, to determine the amount penalty.
43085 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
43086 * fees plus penalty) for large payments. The penalty is computed as the product of this
43087 * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
43088 * `log10` of the success probability.
43090 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
43092 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
43093 * the amount will result in a penalty of the multiplier. And, as the success probability
43094 * decreases, the negative `log10` weighting will increase dramatically. For higher success
43095 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
43098 * Default value: 192 msat
43100 void ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
43103 * A multiplier used in conjunction with the negative `log10` of the channel's success
43104 * probability for the payment, as determined based on the history of our estimates of the
43105 * channel's available liquidity, to determine a penalty.
43107 * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
43108 * only our latest estimate for the current liquidity available in the channel, it estimates
43109 * success probability based on the estimated liquidity available in the channel through
43110 * history. Specifically, every time we update our liquidity bounds on a given channel, we
43111 * track which of several buckets those bounds fall into, exponentially decaying the
43112 * probability of each bucket as new samples are added.
43114 * Default value: 10,000 msat
43116 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
43118 uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
43121 * A multiplier used in conjunction with the negative `log10` of the channel's success
43122 * probability for the payment, as determined based on the history of our estimates of the
43123 * channel's available liquidity, to determine a penalty.
43125 * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
43126 * only our latest estimate for the current liquidity available in the channel, it estimates
43127 * success probability based on the estimated liquidity available in the channel through
43128 * history. Specifically, every time we update our liquidity bounds on a given channel, we
43129 * track which of several buckets those bounds fall into, exponentially decaying the
43130 * probability of each bucket as new samples are added.
43132 * Default value: 10,000 msat
43134 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
43136 void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
43139 * A multiplier used in conjunction with the total amount flowing over a channel and the
43140 * negative `log10` of the channel's success probability for the payment, as determined based
43141 * on the history of our estimates of the channel's available liquidity, to determine a
43144 * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
43145 * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
43146 * of the amount flowing over this channel, weighted by the negative `log10` of the success
43149 * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
43150 * of using only our latest estimate for the current liquidity available in the channel, it
43151 * estimates success probability based on the estimated liquidity available in the channel
43152 * through history. Specifically, every time we update our liquidity bounds on a given
43153 * channel, we track which of several buckets those bounds fall into, exponentially decaying
43154 * the probability of each bucket as new samples are added.
43156 * Default value: 64 msat
43158 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
43160 uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
43163 * A multiplier used in conjunction with the total amount flowing over a channel and the
43164 * negative `log10` of the channel's success probability for the payment, as determined based
43165 * on the history of our estimates of the channel's available liquidity, to determine a
43168 * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
43169 * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
43170 * of the amount flowing over this channel, weighted by the negative `log10` of the success
43173 * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
43174 * of using only our latest estimate for the current liquidity available in the channel, it
43175 * estimates success probability based on the estimated liquidity available in the channel
43176 * through history. Specifically, every time we update our liquidity bounds on a given
43177 * channel, we track which of several buckets those bounds fall into, exponentially decaying
43178 * the probability of each bucket as new samples are added.
43180 * Default value: 64 msat
43182 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
43184 void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
43187 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
43188 * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
43189 * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
43190 * as this makes balance discovery attacks harder to execute, thereby creating an incentive
43191 * to restrict `htlc_maximum_msat` and improve privacy.
43193 * Default value: 250 msat
43195 uint64_t ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
43198 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
43199 * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
43200 * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
43201 * as this makes balance discovery attacks harder to execute, thereby creating an incentive
43202 * to restrict `htlc_maximum_msat` and improve privacy.
43204 * Default value: 250 msat
43206 void ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
43209 * This penalty is applied when the total amount flowing over a channel exceeds our current
43210 * estimate of the channel's available liquidity. The total amount is the amount of the
43211 * current HTLC plus any HTLCs which we've sent over the same channel.
43213 * Note that in this case all other penalties, including the
43214 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
43215 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
43216 * applicable, are still included in the overall penalty.
43218 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
43219 * `u64::max_value()` will guarantee that.
43221 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
43223 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
43224 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
43225 * [`base_penalty_msat`]: Self::base_penalty_msat
43226 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
43228 uint64_t ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
43231 * This penalty is applied when the total amount flowing over a channel exceeds our current
43232 * estimate of the channel's available liquidity. The total amount is the amount of the
43233 * current HTLC plus any HTLCs which we've sent over the same channel.
43235 * Note that in this case all other penalties, including the
43236 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
43237 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
43238 * applicable, are still included in the overall penalty.
43240 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
43241 * `u64::max_value()` will guarantee that.
43243 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
43245 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
43246 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
43247 * [`base_penalty_msat`]: Self::base_penalty_msat
43248 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
43250 void ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
43253 * In order to calculate most of the scores above, we must first convert a lower and upper
43254 * bound on the available liquidity in a channel into the probability that we think a payment
43255 * will succeed. That probability is derived from a Probability Density Function for where we
43256 * think the liquidity in a channel likely lies, given such bounds.
43258 * If this flag is set, that PDF is simply a constant - we assume that the actual available
43259 * liquidity in a channel is just as likely to be at any point between our lower and upper
43262 * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
43263 * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
43264 * matches experimental results - most routing nodes do not aggressively rebalance their
43265 * channels and flows in the network are often unbalanced, leaving liquidity usually
43268 * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
43269 * of floating-point multiplications in the hottest routing code, which may lead to routing
43270 * performance degradation on some machines.
43272 * Default value: false
43274 bool ProbabilisticScoringFeeParameters_get_linear_success_probability(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
43277 * In order to calculate most of the scores above, we must first convert a lower and upper
43278 * bound on the available liquidity in a channel into the probability that we think a payment
43279 * will succeed. That probability is derived from a Probability Density Function for where we
43280 * think the liquidity in a channel likely lies, given such bounds.
43282 * If this flag is set, that PDF is simply a constant - we assume that the actual available
43283 * liquidity in a channel is just as likely to be at any point between our lower and upper
43286 * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
43287 * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
43288 * matches experimental results - most routing nodes do not aggressively rebalance their
43289 * channels and flows in the network are often unbalanced, leaving liquidity usually
43292 * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
43293 * of floating-point multiplications in the hottest routing code, which may lead to routing
43294 * performance degradation on some machines.
43296 * Default value: false
43298 void ProbabilisticScoringFeeParameters_set_linear_success_probability(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, bool val);
43301 * Creates a copy of the ProbabilisticScoringFeeParameters
43303 struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_clone(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR orig);
43306 * Creates a "default" ProbabilisticScoringFeeParameters. See struct and individual field documentaiton for details on which values are used.
43308 MUST_USE_RES struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_default(void);
43311 * Marks the node with the given `node_id` as banned,
43312 * i.e it will be avoided during path finding.
43314 void ProbabilisticScoringFeeParameters_add_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
43317 * Marks all nodes in the given list as banned, i.e.,
43318 * they will be avoided during path finding.
43320 void ProbabilisticScoringFeeParameters_add_banned_from_list(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, struct LDKCVec_NodeIdZ node_ids);
43323 * Removes the node with the given `node_id` from the list of nodes to avoid.
43325 void ProbabilisticScoringFeeParameters_remove_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
43328 * Sets a manual penalty for the given node.
43330 void ProbabilisticScoringFeeParameters_set_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id, uint64_t penalty);
43333 * Removes the node with the given `node_id` from the list of manual penalties.
43335 void ProbabilisticScoringFeeParameters_remove_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
43338 * Clears the list of manual penalties that are applied during path finding.
43340 void ProbabilisticScoringFeeParameters_clear_manual_penalties(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg);
43343 * Frees any resources used by the ProbabilisticScoringDecayParameters, if is_owned is set and inner is non-NULL.
43345 void ProbabilisticScoringDecayParameters_free(struct LDKProbabilisticScoringDecayParameters this_obj);
43348 * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
43349 * tracking can simply live on with increasingly stale data. Instead, when a channel has not
43350 * seen a liquidity estimate update for this amount of time, the historical datapoints are
43352 * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
43354 * Note that after 16 or more half lives all historical data will be completely gone.
43356 * Default value: 14 days
43358 * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorerUsingTime::historical_estimated_channel_liquidity_probabilities
43360 uint64_t ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
43363 * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
43364 * tracking can simply live on with increasingly stale data. Instead, when a channel has not
43365 * seen a liquidity estimate update for this amount of time, the historical datapoints are
43367 * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
43369 * Note that after 16 or more half lives all historical data will be completely gone.
43371 * Default value: 14 days
43373 * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorerUsingTime::historical_estimated_channel_liquidity_probabilities
43375 void ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
43378 * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
43379 * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
43380 * the available liquidity is halved and the upper-bound moves half-way to the channel's total
43383 * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
43384 * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
43385 * struct documentation for more info on the way the liquidity bounds are used.
43387 * For example, if the channel's capacity is 1 million sats, and the current upper and lower
43388 * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
43389 * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
43391 * Default value: 6 hours
43395 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
43396 * liquidity knowledge will never decay except when the bounds cross.
43398 uint64_t ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
43401 * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
43402 * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
43403 * the available liquidity is halved and the upper-bound moves half-way to the channel's total
43406 * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
43407 * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
43408 * struct documentation for more info on the way the liquidity bounds are used.
43410 * For example, if the channel's capacity is 1 million sats, and the current upper and lower
43411 * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
43412 * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
43414 * Default value: 6 hours
43418 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
43419 * liquidity knowledge will never decay except when the bounds cross.
43421 void ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
43424 * Constructs a new ProbabilisticScoringDecayParameters given each field
43426 MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_new(uint64_t historical_no_updates_half_life_arg, uint64_t liquidity_offset_half_life_arg);
43429 * Creates a copy of the ProbabilisticScoringDecayParameters
43431 struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_clone(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR orig);
43434 * Creates a "default" ProbabilisticScoringDecayParameters. See struct and individual field documentaiton for details on which values are used.
43436 MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_default(void);
43439 * Creates a new scorer using the given scoring parameters for sending payments from a node
43440 * through a network graph.
43442 MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringDecayParameters decay_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
43445 * Dump the contents of this scorer into the configured logger.
43447 * Note that this writes roughly one line per channel for which we have a liquidity estimate,
43448 * which may be a substantial amount of log output.
43450 void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
43453 * Query the estimated minimum and maximum liquidity available for sending a payment over the
43454 * channel with `scid` towards the given `target` node.
43456 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);
43459 * Query the historical estimated minimum and maximum liquidity available for sending a
43460 * payment over the channel with `scid` towards the given `target` node.
43462 * Returns two sets of 32 buckets. The first set describes the lower-bound liquidity history,
43463 * the second set describes the upper-bound liquidity history. Each bucket describes the
43464 * relative frequency at which we've seen a liquidity bound in the bucket's range relative to
43465 * the channel's total capacity, on an arbitrary scale. Because the values are slowly decayed,
43466 * more recent data points are weighted more heavily than older datapoints.
43468 * Note that the range of each bucket varies by its location to provide more granular results
43469 * at the edges of a channel's capacity, where it is more likely to sit.
43471 * When scoring, the estimated probability that an upper-/lower-bound lies in a given bucket
43472 * is calculated by dividing that bucket's value with the total value of all buckets.
43474 * For example, using a lower bucket count for illustrative purposes, a value of
43475 * `[0, 0, 0, ..., 0, 32]` indicates that we believe the probability of a bound being very
43476 * close to the channel's capacity to be 100%, and have never (recently) seen it in any other
43477 * bucket. A value of `[31, 0, 0, ..., 0, 0, 32]` indicates we've seen the bound being both
43478 * in the top and bottom bucket, and roughly with similar (recent) frequency.
43480 * Because the datapoints are decayed slowly over time, values will eventually return to
43481 * `Some(([1; 32], [1; 32]))` and then to `None` once no datapoints remain.
43483 * In order to fetch a single success probability from the buckets provided here, as used in
43484 * the scoring model, see [`Self::historical_estimated_payment_success_probability`].
43486 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);
43489 * Query the probability of payment success sending the given `amount_msat` over the channel
43490 * with `scid` towards the given `target` node, based on the historical estimated liquidity
43493 * These are the same bounds as returned by
43494 * [`Self::historical_estimated_channel_liquidity_probabilities`] (but not those returned by
43495 * [`Self::estimated_channel_liquidity_range`]).
43497 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);
43500 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
43501 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
43503 struct LDKScoreLookUp ProbabilisticScorer_as_ScoreLookUp(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
43506 * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
43507 * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
43509 struct LDKScoreUpdate ProbabilisticScorer_as_ScoreUpdate(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
43512 * Constructs a new Score which calls the relevant methods on this_arg.
43513 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
43515 struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
43518 * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
43520 struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
43523 * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
43525 struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringDecayParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
43528 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
43530 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
43533 * The outpoint which is spendable.
43535 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43538 * The outpoint which is spendable.
43540 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
43543 * Per commitment point to derive the delayed payment key by key holder.
43545 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43548 * Per commitment point to derive the delayed payment key by key holder.
43550 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
43553 * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
43554 * the witness_script.
43556 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43559 * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
43560 * the witness_script.
43562 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
43565 * The output which is referenced by the given outpoint.
43567 struct LDKTxOut DelayedPaymentOutputDescriptor_get_output(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43570 * The output which is referenced by the given outpoint.
43572 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
43575 * The revocation point specific to the commitment transaction which was broadcast. Used to
43576 * derive the witnessScript for this output.
43578 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43581 * The revocation point specific to the commitment transaction which was broadcast. Used to
43582 * derive the witnessScript for this output.
43584 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
43587 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
43588 * This may be useful in re-deriving keys used in the channel to spend the output.
43590 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
43593 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
43594 * This may be useful in re-deriving keys used in the channel to spend the output.
43596 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43599 * The value of the channel which this output originated from, possibly indirectly.
43601 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43604 * The value of the channel which this output originated from, possibly indirectly.
43606 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
43609 * Constructs a new DelayedPaymentOutputDescriptor given each field
43611 MUST_USE_RES struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKPublicKey per_commitment_point_arg, uint16_t to_self_delay_arg, struct LDKTxOut output_arg, struct LDKPublicKey revocation_pubkey_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg);
43614 * Creates a copy of the DelayedPaymentOutputDescriptor
43616 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
43619 * Generates a non-cryptographic 64-bit hash of the DelayedPaymentOutputDescriptor.
43621 uint64_t DelayedPaymentOutputDescriptor_hash(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR o);
43624 * Checks if two DelayedPaymentOutputDescriptors contain equal inner contents.
43625 * This ignores pointers and is_owned flags and looks at the values in fields.
43626 * Two objects with NULL inner values will be considered "equal" here.
43628 bool DelayedPaymentOutputDescriptor_eq(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR b);
43631 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
43633 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
43636 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
43638 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
43641 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
43643 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
43646 * The outpoint which is spendable.
43648 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43651 * The outpoint which is spendable.
43653 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
43656 * The output which is referenced by the given outpoint.
43658 struct LDKTxOut StaticPaymentOutputDescriptor_get_output(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43661 * The output which is referenced by the given outpoint.
43663 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
43666 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
43667 * This may be useful in re-deriving keys used in the channel to spend the output.
43669 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
43672 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
43673 * This may be useful in re-deriving keys used in the channel to spend the output.
43675 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43678 * The value of the channel which this transactions spends.
43680 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43683 * The value of the channel which this transactions spends.
43685 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
43688 * The necessary channel parameters that need to be provided to the re-derived signer through
43689 * [`ChannelSigner::provide_channel_parameters`].
43691 * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
43693 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43695 struct LDKChannelTransactionParameters StaticPaymentOutputDescriptor_get_channel_transaction_parameters(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43698 * The necessary channel parameters that need to be provided to the re-derived signer through
43699 * [`ChannelSigner::provide_channel_parameters`].
43701 * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
43703 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
43705 void StaticPaymentOutputDescriptor_set_channel_transaction_parameters(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
43708 * Constructs a new StaticPaymentOutputDescriptor given each field
43710 * Note that channel_transaction_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
43712 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);
43715 * Creates a copy of the StaticPaymentOutputDescriptor
43717 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
43720 * Generates a non-cryptographic 64-bit hash of the StaticPaymentOutputDescriptor.
43722 uint64_t StaticPaymentOutputDescriptor_hash(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR o);
43725 * Checks if two StaticPaymentOutputDescriptors contain equal inner contents.
43726 * This ignores pointers and is_owned flags and looks at the values in fields.
43727 * Two objects with NULL inner values will be considered "equal" here.
43729 bool StaticPaymentOutputDescriptor_eq(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR b);
43732 * Returns the `witness_script` of the spendable output.
43734 * Note that this will only return `Some` for [`StaticPaymentOutputDescriptor`]s that
43735 * originated from an anchor outputs channel, as they take the form of a P2WSH script.
43737 MUST_USE_RES struct LDKCOption_CVec_u8ZZ StaticPaymentOutputDescriptor_witness_script(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
43740 * The maximum length a well-formed witness spending one of these should have.
43741 * Note: If you have the grind_signatures feature enabled, this will be at least 1 byte
43744 MUST_USE_RES uintptr_t StaticPaymentOutputDescriptor_max_witness_length(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
43747 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
43749 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
43752 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
43754 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
43757 * Frees any resources used by the SpendableOutputDescriptor
43759 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
43762 * Creates a copy of the SpendableOutputDescriptor
43764 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
43767 * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
43769 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output);
43772 * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
43774 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
43777 * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
43779 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
43782 * Generates a non-cryptographic 64-bit hash of the SpendableOutputDescriptor.
43784 uint64_t SpendableOutputDescriptor_hash(const struct LDKSpendableOutputDescriptor *NONNULL_PTR o);
43787 * Checks if two SpendableOutputDescriptors contain equal inner contents.
43788 * This ignores pointers and is_owned flags and looks at the values in fields.
43790 bool SpendableOutputDescriptor_eq(const struct LDKSpendableOutputDescriptor *NONNULL_PTR a, const struct LDKSpendableOutputDescriptor *NONNULL_PTR b);
43793 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
43795 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
43798 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
43800 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
43803 * Creates an unsigned [`PartiallySignedTransaction`] which spends the given descriptors to
43804 * the given outputs, plus an output to the given change destination (if sufficient
43805 * change value remains). The PSBT will have a feerate, at least, of the given value.
43807 * The `locktime` argument is used to set the transaction's locktime. If `None`, the
43808 * transaction will have a locktime of 0. It it recommended to set this to the current block
43809 * height to avoid fee sniping, unless you have some specific reason to use a different
43812 * Returns the PSBT and expected max transaction weight.
43814 * Returns `Err(())` if the output value is greater than the input value minus required fee,
43815 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
43816 * does not match the one we can spend.
43818 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
43820 MUST_USE_RES struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ 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);
43823 * Frees any resources used by the ChannelDerivationParameters, if is_owned is set and inner is non-NULL.
43825 void ChannelDerivationParameters_free(struct LDKChannelDerivationParameters this_obj);
43828 * The value in satoshis of the channel we're attempting to spend the anchor output of.
43830 uint64_t ChannelDerivationParameters_get_value_satoshis(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
43833 * The value in satoshis of the channel we're attempting to spend the anchor output of.
43835 void ChannelDerivationParameters_set_value_satoshis(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, uint64_t val);
43838 * The unique identifier to re-derive the signer for the associated channel.
43840 const uint8_t (*ChannelDerivationParameters_get_keys_id(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr))[32];
43843 * The unique identifier to re-derive the signer for the associated channel.
43845 void ChannelDerivationParameters_set_keys_id(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43848 * The necessary channel parameters that need to be provided to the re-derived signer through
43849 * [`ChannelSigner::provide_channel_parameters`].
43851 struct LDKChannelTransactionParameters ChannelDerivationParameters_get_transaction_parameters(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
43854 * The necessary channel parameters that need to be provided to the re-derived signer through
43855 * [`ChannelSigner::provide_channel_parameters`].
43857 void ChannelDerivationParameters_set_transaction_parameters(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
43860 * Constructs a new ChannelDerivationParameters given each field
43862 MUST_USE_RES struct LDKChannelDerivationParameters ChannelDerivationParameters_new(uint64_t value_satoshis_arg, struct LDKThirtyTwoBytes keys_id_arg, struct LDKChannelTransactionParameters transaction_parameters_arg);
43865 * Creates a copy of the ChannelDerivationParameters
43867 struct LDKChannelDerivationParameters ChannelDerivationParameters_clone(const struct LDKChannelDerivationParameters *NONNULL_PTR orig);
43870 * Checks if two ChannelDerivationParameterss contain equal inner contents.
43871 * This ignores pointers and is_owned flags and looks at the values in fields.
43872 * Two objects with NULL inner values will be considered "equal" here.
43874 bool ChannelDerivationParameters_eq(const struct LDKChannelDerivationParameters *NONNULL_PTR a, const struct LDKChannelDerivationParameters *NONNULL_PTR b);
43877 * Serialize the ChannelDerivationParameters object into a byte array which can be read by ChannelDerivationParameters_read
43879 struct LDKCVec_u8Z ChannelDerivationParameters_write(const struct LDKChannelDerivationParameters *NONNULL_PTR obj);
43882 * Read a ChannelDerivationParameters from a byte array, created by ChannelDerivationParameters_write
43884 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ ChannelDerivationParameters_read(struct LDKu8slice ser);
43887 * Frees any resources used by the HTLCDescriptor, if is_owned is set and inner is non-NULL.
43889 void HTLCDescriptor_free(struct LDKHTLCDescriptor this_obj);
43892 * The parameters required to derive the signer for the HTLC input.
43894 struct LDKChannelDerivationParameters HTLCDescriptor_get_channel_derivation_parameters(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
43897 * The parameters required to derive the signer for the HTLC input.
43899 void HTLCDescriptor_set_channel_derivation_parameters(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
43902 * The number of the commitment transaction in which the HTLC output lives.
43904 uint64_t HTLCDescriptor_get_per_commitment_number(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
43907 * The number of the commitment transaction in which the HTLC output lives.
43909 void HTLCDescriptor_set_per_commitment_number(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint64_t val);
43912 * The key tweak corresponding to the number of the commitment transaction in which the HTLC
43913 * output lives. This tweak is applied to all the basepoints for both parties in the channel to
43914 * arrive at unique keys per commitment.
43916 * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
43918 struct LDKPublicKey HTLCDescriptor_get_per_commitment_point(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
43921 * The key tweak corresponding to the number of the commitment transaction in which the HTLC
43922 * output lives. This tweak is applied to all the basepoints for both parties in the channel to
43923 * arrive at unique keys per commitment.
43925 * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
43927 void HTLCDescriptor_set_per_commitment_point(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
43930 * The feerate to use on the HTLC claiming transaction. This is always `0` for HTLCs
43931 * originating from a channel supporting anchor outputs, otherwise it is the channel's
43932 * negotiated feerate at the time the commitment transaction was built.
43934 uint32_t HTLCDescriptor_get_feerate_per_kw(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
43937 * The feerate to use on the HTLC claiming transaction. This is always `0` for HTLCs
43938 * originating from a channel supporting anchor outputs, otherwise it is the channel's
43939 * negotiated feerate at the time the commitment transaction was built.
43941 void HTLCDescriptor_set_feerate_per_kw(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint32_t val);
43944 * The details of the HTLC as it appears in the commitment transaction.
43946 struct LDKHTLCOutputInCommitment HTLCDescriptor_get_htlc(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
43949 * The details of the HTLC as it appears in the commitment transaction.
43951 void HTLCDescriptor_set_htlc(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKHTLCOutputInCommitment val);
43954 * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
43957 struct LDKCOption_ThirtyTwoBytesZ HTLCDescriptor_get_preimage(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
43960 * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
43963 void HTLCDescriptor_set_preimage(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
43966 * The counterparty's signature required to spend the HTLC output.
43968 struct LDKECDSASignature HTLCDescriptor_get_counterparty_sig(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
43971 * The counterparty's signature required to spend the HTLC output.
43973 void HTLCDescriptor_set_counterparty_sig(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
43976 * Creates a copy of the HTLCDescriptor
43978 struct LDKHTLCDescriptor HTLCDescriptor_clone(const struct LDKHTLCDescriptor *NONNULL_PTR orig);
43981 * Checks if two HTLCDescriptors contain equal inner contents.
43982 * This ignores pointers and is_owned flags and looks at the values in fields.
43983 * Two objects with NULL inner values will be considered "equal" here.
43985 bool HTLCDescriptor_eq(const struct LDKHTLCDescriptor *NONNULL_PTR a, const struct LDKHTLCDescriptor *NONNULL_PTR b);
43988 * Serialize the HTLCDescriptor object into a byte array which can be read by HTLCDescriptor_read
43990 struct LDKCVec_u8Z HTLCDescriptor_write(const struct LDKHTLCDescriptor *NONNULL_PTR obj);
43993 * Read a HTLCDescriptor from a byte array, created by HTLCDescriptor_write
43995 struct LDKCResult_HTLCDescriptorDecodeErrorZ HTLCDescriptor_read(struct LDKu8slice ser);
43998 * Returns the outpoint of the HTLC output in the commitment transaction. This is the outpoint
43999 * being spent by the HTLC input in the HTLC transaction.
44001 MUST_USE_RES struct LDKOutPoint HTLCDescriptor_outpoint(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
44004 * Returns the UTXO to be spent by the HTLC input, which can be obtained via
44005 * [`Self::unsigned_tx_input`].
44007 MUST_USE_RES struct LDKTxOut HTLCDescriptor_previous_utxo(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
44010 * Returns the unsigned transaction input spending the HTLC output in the commitment
44013 MUST_USE_RES struct LDKTxIn HTLCDescriptor_unsigned_tx_input(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
44016 * Returns the delayed output created as a result of spending the HTLC output in the commitment
44019 MUST_USE_RES struct LDKTxOut HTLCDescriptor_tx_output(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
44022 * Returns the witness script of the HTLC output in the commitment transaction.
44024 MUST_USE_RES struct LDKCVec_u8Z HTLCDescriptor_witness_script(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
44027 * Returns the fully signed witness required to spend the HTLC output in the commitment
44030 MUST_USE_RES struct LDKWitness HTLCDescriptor_tx_input_witness(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature, struct LDKu8slice witness_script);
44033 * Derives the channel signer required to sign the HTLC input.
44035 MUST_USE_RES struct LDKWriteableEcdsaChannelSigner HTLCDescriptor_derive_channel_signer(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
44038 * Calls the free function if one is set
44040 void ChannelSigner_free(struct LDKChannelSigner this_ptr);
44043 * Calls the free function if one is set
44045 void EcdsaChannelSigner_free(struct LDKEcdsaChannelSigner this_ptr);
44048 * Creates a copy of a WriteableEcdsaChannelSigner
44050 struct LDKWriteableEcdsaChannelSigner WriteableEcdsaChannelSigner_clone(const struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR orig);
44053 * Calls the free function if one is set
44055 void WriteableEcdsaChannelSigner_free(struct LDKWriteableEcdsaChannelSigner this_ptr);
44058 * Creates a copy of the Recipient
44060 enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
44063 * Utility method to constructs a new Node-variant Recipient
44065 enum LDKRecipient Recipient_node(void);
44068 * Utility method to constructs a new PhantomNode-variant Recipient
44070 enum LDKRecipient Recipient_phantom_node(void);
44073 * Calls the free function if one is set
44075 void EntropySource_free(struct LDKEntropySource this_ptr);
44078 * Calls the free function if one is set
44080 void NodeSigner_free(struct LDKNodeSigner this_ptr);
44083 * Calls the free function if one is set
44085 void SignerProvider_free(struct LDKSignerProvider this_ptr);
44088 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
44090 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
44093 * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
44094 * holder's anchor output in a commitment transaction, if one is present.
44096 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
44099 * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
44100 * holder's anchor output in a commitment transaction, if one is present.
44102 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
44105 * Holder secret key for blinded revocation pubkey.
44107 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
44110 * Holder secret key for blinded revocation pubkey.
44112 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
44115 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
44117 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
44120 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
44122 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
44125 * Holder secret key used in an HTLC transaction.
44127 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
44130 * Holder secret key used in an HTLC transaction.
44132 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
44135 * Holder HTLC secret key used in commitment transaction HTLC outputs.
44137 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
44140 * Holder HTLC secret key used in commitment transaction HTLC outputs.
44142 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
44147 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
44152 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
44155 * Creates a copy of the InMemorySigner
44157 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
44160 * Creates a new [`InMemorySigner`].
44162 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);
44165 * Returns the counterparty's pubkeys.
44167 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
44168 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
44170 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44172 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
44175 * Returns the `contest_delay` value specified by our counterparty and applied on holder-broadcastable
44176 * transactions, i.e., the amount of time that we have to wait to recover our funds if we
44177 * broadcast a transaction.
44179 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
44180 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
44182 MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
44185 * Returns the `contest_delay` value specified by us and applied on transactions broadcastable
44186 * by our counterparty, i.e., the amount of time that they have to wait to recover their funds
44187 * if they broadcast a transaction.
44189 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
44190 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
44192 MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
44195 * Returns whether the holder is the initiator.
44197 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
44198 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
44200 MUST_USE_RES struct LDKCOption_boolZ InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
44205 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
44206 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
44208 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44210 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
44213 * Returns a [`ChannelTransactionParameters`] for this channel, to be used when verifying or
44214 * building transactions.
44216 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
44217 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
44219 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44221 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
44224 * Returns the channel type features of the channel parameters. Should be helpful for
44225 * determining a channel's category, i. e. legacy/anchors/taproot/etc.
44227 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
44228 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
44230 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44232 MUST_USE_RES struct LDKChannelTypeFeatures InMemorySigner_channel_type_features(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
44235 * Sign the single input of `spend_tx` at index `input_idx`, which spends the output described
44236 * by `descriptor`, returning the witness stack for the input.
44238 * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
44239 * is not spending the outpoint described by [`descriptor.outpoint`],
44240 * or if an output descriptor `script_pubkey` does not match the one we can spend.
44242 * [`descriptor.outpoint`]: StaticPaymentOutputDescriptor::outpoint
44244 MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ InMemorySigner_sign_counterparty_payment_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR descriptor);
44247 * Sign the single input of `spend_tx` at index `input_idx` which spends the output
44248 * described by `descriptor`, returning the witness stack for the input.
44250 * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
44251 * is not spending the outpoint described by [`descriptor.outpoint`], does not have a
44252 * sequence set to [`descriptor.to_self_delay`], or if an output descriptor
44253 * `script_pubkey` does not match the one we can spend.
44255 * [`descriptor.outpoint`]: DelayedPaymentOutputDescriptor::outpoint
44256 * [`descriptor.to_self_delay`]: DelayedPaymentOutputDescriptor::to_self_delay
44258 MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ InMemorySigner_sign_dynamic_p2wsh_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR descriptor);
44261 * Constructs a new EntropySource which calls the relevant methods on this_arg.
44262 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
44264 struct LDKEntropySource InMemorySigner_as_EntropySource(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
44267 * Constructs a new ChannelSigner which calls the relevant methods on this_arg.
44268 * This copies the `inner` pointer in this_arg and thus the returned ChannelSigner must be freed before this_arg is
44270 struct LDKChannelSigner InMemorySigner_as_ChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
44273 * Constructs a new EcdsaChannelSigner which calls the relevant methods on this_arg.
44274 * This copies the `inner` pointer in this_arg and thus the returned EcdsaChannelSigner must be freed before this_arg is
44276 struct LDKEcdsaChannelSigner InMemorySigner_as_EcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
44279 * Constructs a new WriteableEcdsaChannelSigner which calls the relevant methods on this_arg.
44280 * This copies the `inner` pointer in this_arg and thus the returned WriteableEcdsaChannelSigner must be freed before this_arg is
44282 struct LDKWriteableEcdsaChannelSigner InMemorySigner_as_WriteableEcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
44285 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
44287 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
44290 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
44292 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKEntropySource arg);
44295 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
44297 void KeysManager_free(struct LDKKeysManager this_obj);
44300 * Constructs a [`KeysManager`] from a 32-byte seed. If the seed is in some way biased (e.g.,
44301 * your CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
44302 * `starting_time` isn't strictly required to actually be a time, but it must absolutely,
44303 * without a doubt, be unique to this instance. ie if you start multiple times with the same
44304 * `seed`, `starting_time` must be unique to each run. Thus, the easiest way to achieve this
44305 * is to simply use the current time (with very high precision).
44307 * The `seed` MUST be backed up safely prior to use so that the keys can be re-created, however,
44308 * obviously, `starting_time` should be unique every time you reload the library - it is only
44309 * used to generate new ephemeral key data (which will be stored by the individual channel if
44312 * Note that the seed is required to recover certain on-chain funds independent of
44313 * [`ChannelMonitor`] data, though a current copy of [`ChannelMonitor`] data is also required
44314 * for any channel, and some on-chain during-closing funds.
44316 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
44318 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
44321 * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
44323 MUST_USE_RES struct LDKSecretKey KeysManager_get_node_secret_key(const struct LDKKeysManager *NONNULL_PTR this_arg);
44326 * Derive an old [`WriteableEcdsaChannelSigner`] containing per-channel secrets based on a key derivation parameters.
44328 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]);
44331 * Signs the given [`PartiallySignedTransaction`] which spends the given [`SpendableOutputDescriptor`]s.
44332 * The resulting inputs will be finalized and the PSBT will be ready for broadcast if there
44333 * are no other inputs that need signing.
44335 * Returns `Err(())` if the PSBT is missing a descriptor or if we fail to sign.
44337 * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used
44338 * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`].
44340 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);
44343 * Creates a [`Transaction`] which spends the given descriptors to the given outputs, plus an
44344 * output to the given change destination (if sufficient change value remains). The
44345 * transaction will have a feerate, at least, of the given value.
44347 * The `locktime` argument is used to set the transaction's locktime. If `None`, the
44348 * transaction will have a locktime of 0. It it recommended to set this to the current block
44349 * height to avoid fee sniping, unless you have some specific reason to use a different
44352 * Returns `Err(())` if the output value is greater than the input value minus required fee,
44353 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
44354 * does not match the one we can spend.
44356 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
44358 * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used
44359 * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`].
44361 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);
44364 * Constructs a new EntropySource which calls the relevant methods on this_arg.
44365 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
44367 struct LDKEntropySource KeysManager_as_EntropySource(const struct LDKKeysManager *NONNULL_PTR this_arg);
44370 * Constructs a new NodeSigner which calls the relevant methods on this_arg.
44371 * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
44373 struct LDKNodeSigner KeysManager_as_NodeSigner(const struct LDKKeysManager *NONNULL_PTR this_arg);
44376 * Constructs a new SignerProvider which calls the relevant methods on this_arg.
44377 * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
44379 struct LDKSignerProvider KeysManager_as_SignerProvider(const struct LDKKeysManager *NONNULL_PTR this_arg);
44382 * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
44384 void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
44387 * Constructs a new EntropySource which calls the relevant methods on this_arg.
44388 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
44390 struct LDKEntropySource PhantomKeysManager_as_EntropySource(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
44393 * Constructs a new NodeSigner which calls the relevant methods on this_arg.
44394 * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
44396 struct LDKNodeSigner PhantomKeysManager_as_NodeSigner(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
44399 * Constructs a new SignerProvider which calls the relevant methods on this_arg.
44400 * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
44402 struct LDKSignerProvider PhantomKeysManager_as_SignerProvider(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
44405 * Constructs a [`PhantomKeysManager`] given a 32-byte seed and an additional `cross_node_seed`
44406 * that is shared across all nodes that intend to participate in [phantom node payments]
44409 * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
44410 * `starting_time_nanos`.
44412 * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
44413 * same across restarts, or else inbound payments may fail.
44415 * [phantom node payments]: PhantomKeysManager
44417 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]);
44420 * See [`KeysManager::spend_spendable_outputs`] for documentation on this method.
44422 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);
44425 * See [`KeysManager::derive_channel_keys`] for documentation on this method.
44427 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]);
44430 * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
44432 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
44435 * Gets the \"node_id\" secret key of the phantom node used to sign invoices, decode the
44436 * last-hop onion data, etc.
44438 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_phantom_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
44441 * Frees any resources used by the OnionMessenger, if is_owned is set and inner is non-NULL.
44443 void OnionMessenger_free(struct LDKOnionMessenger this_obj);
44446 * Calls the free function if one is set
44448 void MessageRouter_free(struct LDKMessageRouter this_ptr);
44451 * Frees any resources used by the DefaultMessageRouter, if is_owned is set and inner is non-NULL.
44453 void DefaultMessageRouter_free(struct LDKDefaultMessageRouter this_obj);
44456 * Constructs a new DefaultMessageRouter given each field
44458 MUST_USE_RES struct LDKDefaultMessageRouter DefaultMessageRouter_new(void);
44461 * Constructs a new MessageRouter which calls the relevant methods on this_arg.
44462 * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is
44464 struct LDKMessageRouter DefaultMessageRouter_as_MessageRouter(const struct LDKDefaultMessageRouter *NONNULL_PTR this_arg);
44467 * Frees any resources used by the OnionMessagePath, if is_owned is set and inner is non-NULL.
44469 void OnionMessagePath_free(struct LDKOnionMessagePath this_obj);
44472 * Nodes on the path between the sender and the destination.
44474 * Returns a copy of the field.
44476 struct LDKCVec_PublicKeyZ OnionMessagePath_get_intermediate_nodes(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
44479 * Nodes on the path between the sender and the destination.
44481 void OnionMessagePath_set_intermediate_nodes(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKCVec_PublicKeyZ val);
44484 * The recipient of the message.
44486 struct LDKDestination OnionMessagePath_get_destination(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
44489 * The recipient of the message.
44491 void OnionMessagePath_set_destination(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKDestination val);
44494 * Constructs a new OnionMessagePath given each field
44496 MUST_USE_RES struct LDKOnionMessagePath OnionMessagePath_new(struct LDKCVec_PublicKeyZ intermediate_nodes_arg, struct LDKDestination destination_arg);
44499 * Creates a copy of the OnionMessagePath
44501 struct LDKOnionMessagePath OnionMessagePath_clone(const struct LDKOnionMessagePath *NONNULL_PTR orig);
44504 * Frees any resources used by the Destination
44506 void Destination_free(struct LDKDestination this_ptr);
44509 * Creates a copy of the Destination
44511 struct LDKDestination Destination_clone(const struct LDKDestination *NONNULL_PTR orig);
44514 * Utility method to constructs a new Node-variant Destination
44516 struct LDKDestination Destination_node(struct LDKPublicKey a);
44519 * Utility method to constructs a new BlindedPath-variant Destination
44521 struct LDKDestination Destination_blinded_path(struct LDKBlindedPath a);
44524 * Frees any resources used by the SendError
44526 void SendError_free(struct LDKSendError this_ptr);
44529 * Creates a copy of the SendError
44531 struct LDKSendError SendError_clone(const struct LDKSendError *NONNULL_PTR orig);
44534 * Utility method to constructs a new Secp256k1-variant SendError
44536 struct LDKSendError SendError_secp256k1(enum LDKSecp256k1Error a);
44539 * Utility method to constructs a new TooBigPacket-variant SendError
44541 struct LDKSendError SendError_too_big_packet(void);
44544 * Utility method to constructs a new TooFewBlindedHops-variant SendError
44546 struct LDKSendError SendError_too_few_blinded_hops(void);
44549 * Utility method to constructs a new InvalidFirstHop-variant SendError
44551 struct LDKSendError SendError_invalid_first_hop(void);
44554 * Utility method to constructs a new InvalidMessage-variant SendError
44556 struct LDKSendError SendError_invalid_message(void);
44559 * Utility method to constructs a new BufferFull-variant SendError
44561 struct LDKSendError SendError_buffer_full(void);
44564 * Utility method to constructs a new GetNodeIdFailed-variant SendError
44566 struct LDKSendError SendError_get_node_id_failed(void);
44569 * Utility method to constructs a new BlindedPathAdvanceFailed-variant SendError
44571 struct LDKSendError SendError_blinded_path_advance_failed(void);
44574 * Checks if two SendErrors contain equal inner contents.
44575 * This ignores pointers and is_owned flags and looks at the values in fields.
44577 bool SendError_eq(const struct LDKSendError *NONNULL_PTR a, const struct LDKSendError *NONNULL_PTR b);
44580 * Calls the free function if one is set
44582 void CustomOnionMessageHandler_free(struct LDKCustomOnionMessageHandler this_ptr);
44585 * Frees any resources used by the PeeledOnion
44587 void PeeledOnion_free(struct LDKPeeledOnion this_ptr);
44590 * Creates a copy of the PeeledOnion
44592 struct LDKPeeledOnion PeeledOnion_clone(const struct LDKPeeledOnion *NONNULL_PTR orig);
44595 * Utility method to constructs a new Forward-variant PeeledOnion
44597 struct LDKPeeledOnion PeeledOnion_forward(struct LDKPublicKey a, struct LDKOnionMessage b);
44600 * Utility method to constructs a new Receive-variant PeeledOnion
44602 struct LDKPeeledOnion PeeledOnion_receive(struct LDKParsedOnionMessageContents a, struct LDKThirtyTwoBytes b, struct LDKBlindedPath c);
44605 * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of
44608 * Returns both the node id of the peer to send the message to and the message itself.
44610 * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
44612 struct LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ 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);
44615 * Decode one layer of an incoming [`OnionMessage`].
44617 * Returns either the next layer of the onion for forwarding or the decrypted content for the
44620 struct LDKCResult_PeeledOnionNoneZ peel_onion_message(const struct LDKOnionMessage *NONNULL_PTR msg, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKCustomOnionMessageHandler custom_handler);
44623 * Constructs a new `OnionMessenger` to send, forward, and delegate received onion messages to
44624 * their respective handlers.
44626 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);
44629 * Sends an [`OnionMessage`] with the given `contents` for sending to the destination of
44632 * See [`OnionMessenger`] for example usage.
44634 * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
44636 MUST_USE_RES struct LDKCResult_NoneSendErrorZ OnionMessenger_send_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKOnionMessagePath path, struct LDKOnionMessageContents contents, struct LDKBlindedPath reply_path);
44639 * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
44640 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
44642 struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
44645 * Calls the free function if one is set
44647 void OffersMessageHandler_free(struct LDKOffersMessageHandler this_ptr);
44650 * Frees any resources used by the OffersMessage
44652 void OffersMessage_free(struct LDKOffersMessage this_ptr);
44655 * Creates a copy of the OffersMessage
44657 struct LDKOffersMessage OffersMessage_clone(const struct LDKOffersMessage *NONNULL_PTR orig);
44660 * Utility method to constructs a new InvoiceRequest-variant OffersMessage
44662 struct LDKOffersMessage OffersMessage_invoice_request(struct LDKInvoiceRequest a);
44665 * Utility method to constructs a new Invoice-variant OffersMessage
44667 struct LDKOffersMessage OffersMessage_invoice(struct LDKBolt12Invoice a);
44670 * Utility method to constructs a new InvoiceError-variant OffersMessage
44672 struct LDKOffersMessage OffersMessage_invoice_error(struct LDKInvoiceError a);
44675 * Returns whether `tlv_type` corresponds to a TLV record for Offers.
44677 MUST_USE_RES bool OffersMessage_is_known_type(uint64_t tlv_type);
44680 * Serialize the OffersMessage object into a byte array which can be read by OffersMessage_read
44682 struct LDKCVec_u8Z OffersMessage_write(const struct LDKOffersMessage *NONNULL_PTR obj);
44685 * Read a OffersMessage from a byte array, created by OffersMessage_write
44687 struct LDKCResult_OffersMessageDecodeErrorZ OffersMessage_read(struct LDKu8slice ser, uint64_t arg_a, const struct LDKLogger *NONNULL_PTR arg_b);
44690 * Frees any resources used by the Packet, if is_owned is set and inner is non-NULL.
44692 void Packet_free(struct LDKPacket this_obj);
44695 * Bolt 04 version number
44697 uint8_t Packet_get_version(const struct LDKPacket *NONNULL_PTR this_ptr);
44700 * Bolt 04 version number
44702 void Packet_set_version(struct LDKPacket *NONNULL_PTR this_ptr, uint8_t val);
44705 * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
44707 struct LDKPublicKey Packet_get_public_key(const struct LDKPacket *NONNULL_PTR this_ptr);
44710 * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
44712 void Packet_set_public_key(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44715 * Encrypted payload for the next hop
44717 * Returns a copy of the field.
44719 struct LDKCVec_u8Z Packet_get_hop_data(const struct LDKPacket *NONNULL_PTR this_ptr);
44722 * Encrypted payload for the next hop
44724 void Packet_set_hop_data(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
44727 * HMAC to verify the integrity of hop_data
44729 const uint8_t (*Packet_get_hmac(const struct LDKPacket *NONNULL_PTR this_ptr))[32];
44732 * HMAC to verify the integrity of hop_data
44734 void Packet_set_hmac(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
44737 * Constructs a new Packet given each field
44739 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);
44742 * Creates a copy of the Packet
44744 struct LDKPacket Packet_clone(const struct LDKPacket *NONNULL_PTR orig);
44747 * Checks if two Packets contain equal inner contents.
44748 * This ignores pointers and is_owned flags and looks at the values in fields.
44749 * Two objects with NULL inner values will be considered "equal" here.
44751 bool Packet_eq(const struct LDKPacket *NONNULL_PTR a, const struct LDKPacket *NONNULL_PTR b);
44754 * Serialize the Packet object into a byte array which can be read by Packet_read
44756 struct LDKCVec_u8Z Packet_write(const struct LDKPacket *NONNULL_PTR obj);
44759 * Frees any resources used by the ParsedOnionMessageContents
44761 void ParsedOnionMessageContents_free(struct LDKParsedOnionMessageContents this_ptr);
44764 * Creates a copy of the ParsedOnionMessageContents
44766 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_clone(const struct LDKParsedOnionMessageContents *NONNULL_PTR orig);
44769 * Utility method to constructs a new Offers-variant ParsedOnionMessageContents
44771 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_offers(struct LDKOffersMessage a);
44774 * Utility method to constructs a new Custom-variant ParsedOnionMessageContents
44776 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_custom(struct LDKOnionMessageContents a);
44779 * Constructs a new OnionMessageContents which calls the relevant methods on this_arg.
44780 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is
44782 struct LDKOnionMessageContents ParsedOnionMessageContents_as_OnionMessageContents(const struct LDKParsedOnionMessageContents *NONNULL_PTR this_arg);
44785 * Serialize the ParsedOnionMessageContents object into a byte array which can be read by ParsedOnionMessageContents_read
44787 struct LDKCVec_u8Z ParsedOnionMessageContents_write(const struct LDKParsedOnionMessageContents *NONNULL_PTR obj);
44790 * Creates a copy of a OnionMessageContents
44792 struct LDKOnionMessageContents OnionMessageContents_clone(const struct LDKOnionMessageContents *NONNULL_PTR orig);
44795 * Calls the free function if one is set
44797 void OnionMessageContents_free(struct LDKOnionMessageContents this_ptr);
44800 * Frees any resources used by the BlindedPath, if is_owned is set and inner is non-NULL.
44802 void BlindedPath_free(struct LDKBlindedPath this_obj);
44805 * To send to a blinded path, the sender first finds a route to the unblinded
44806 * `introduction_node_id`, which can unblind its [`encrypted_payload`] to find out the onion
44807 * message or payment's next hop and forward it along.
44809 * [`encrypted_payload`]: BlindedHop::encrypted_payload
44811 struct LDKPublicKey BlindedPath_get_introduction_node_id(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
44814 * To send to a blinded path, the sender first finds a route to the unblinded
44815 * `introduction_node_id`, which can unblind its [`encrypted_payload`] to find out the onion
44816 * message or payment's next hop and forward it along.
44818 * [`encrypted_payload`]: BlindedHop::encrypted_payload
44820 void BlindedPath_set_introduction_node_id(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44823 * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion
44824 * message or payment.
44826 * [`encrypted_payload`]: BlindedHop::encrypted_payload
44828 struct LDKPublicKey BlindedPath_get_blinding_point(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
44831 * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion
44832 * message or payment.
44834 * [`encrypted_payload`]: BlindedHop::encrypted_payload
44836 void BlindedPath_set_blinding_point(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44839 * The hops composing the blinded path.
44841 struct LDKCVec_BlindedHopZ BlindedPath_get_blinded_hops(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
44844 * The hops composing the blinded path.
44846 void BlindedPath_set_blinded_hops(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
44849 * Constructs a new BlindedPath given each field
44851 MUST_USE_RES struct LDKBlindedPath BlindedPath_new(struct LDKPublicKey introduction_node_id_arg, struct LDKPublicKey blinding_point_arg, struct LDKCVec_BlindedHopZ blinded_hops_arg);
44854 * Creates a copy of the BlindedPath
44856 struct LDKBlindedPath BlindedPath_clone(const struct LDKBlindedPath *NONNULL_PTR orig);
44859 * Generates a non-cryptographic 64-bit hash of the BlindedPath.
44861 uint64_t BlindedPath_hash(const struct LDKBlindedPath *NONNULL_PTR o);
44864 * Checks if two BlindedPaths contain equal inner contents.
44865 * This ignores pointers and is_owned flags and looks at the values in fields.
44866 * Two objects with NULL inner values will be considered "equal" here.
44868 bool BlindedPath_eq(const struct LDKBlindedPath *NONNULL_PTR a, const struct LDKBlindedPath *NONNULL_PTR b);
44871 * Frees any resources used by the BlindedHop, if is_owned is set and inner is non-NULL.
44873 void BlindedHop_free(struct LDKBlindedHop this_obj);
44876 * The blinded node id of this hop in a [`BlindedPath`].
44878 struct LDKPublicKey BlindedHop_get_blinded_node_id(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
44881 * The blinded node id of this hop in a [`BlindedPath`].
44883 void BlindedHop_set_blinded_node_id(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44886 * The encrypted payload intended for this hop in a [`BlindedPath`].
44888 * Returns a copy of the field.
44890 struct LDKCVec_u8Z BlindedHop_get_encrypted_payload(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
44893 * The encrypted payload intended for this hop in a [`BlindedPath`].
44895 void BlindedHop_set_encrypted_payload(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
44898 * Constructs a new BlindedHop given each field
44900 MUST_USE_RES struct LDKBlindedHop BlindedHop_new(struct LDKPublicKey blinded_node_id_arg, struct LDKCVec_u8Z encrypted_payload_arg);
44903 * Creates a copy of the BlindedHop
44905 struct LDKBlindedHop BlindedHop_clone(const struct LDKBlindedHop *NONNULL_PTR orig);
44908 * Generates a non-cryptographic 64-bit hash of the BlindedHop.
44910 uint64_t BlindedHop_hash(const struct LDKBlindedHop *NONNULL_PTR o);
44913 * Checks if two BlindedHops contain equal inner contents.
44914 * This ignores pointers and is_owned flags and looks at the values in fields.
44915 * Two objects with NULL inner values will be considered "equal" here.
44917 bool BlindedHop_eq(const struct LDKBlindedHop *NONNULL_PTR a, const struct LDKBlindedHop *NONNULL_PTR b);
44920 * Create a one-hop blinded path for a message.
44922 MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_one_hop_for_message(struct LDKPublicKey recipient_node_id, const struct LDKEntropySource *NONNULL_PTR entropy_source);
44925 * Create a blinded path for an onion message, to be forwarded along `node_pks`. The last node
44926 * pubkey in `node_pks` will be the destination node.
44928 * Errors if no hops are provided or if `node_pk`(s) are invalid.
44930 MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_new_for_message(struct LDKCVec_PublicKeyZ node_pks, const struct LDKEntropySource *NONNULL_PTR entropy_source);
44933 * Create a one-hop blinded path for a payment.
44935 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);
44938 * Serialize the BlindedPath object into a byte array which can be read by BlindedPath_read
44940 struct LDKCVec_u8Z BlindedPath_write(const struct LDKBlindedPath *NONNULL_PTR obj);
44943 * Read a BlindedPath from a byte array, created by BlindedPath_write
44945 struct LDKCResult_BlindedPathDecodeErrorZ BlindedPath_read(struct LDKu8slice ser);
44948 * Serialize the BlindedHop object into a byte array which can be read by BlindedHop_read
44950 struct LDKCVec_u8Z BlindedHop_write(const struct LDKBlindedHop *NONNULL_PTR obj);
44953 * Read a BlindedHop from a byte array, created by BlindedHop_write
44955 struct LDKCResult_BlindedHopDecodeErrorZ BlindedHop_read(struct LDKu8slice ser);
44958 * Frees any resources used by the ForwardNode, if is_owned is set and inner is non-NULL.
44960 void ForwardNode_free(struct LDKForwardNode this_obj);
44963 * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
44964 * used for [`BlindedPayInfo`] construction.
44966 struct LDKForwardTlvs ForwardNode_get_tlvs(const struct LDKForwardNode *NONNULL_PTR this_ptr);
44969 * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
44970 * used for [`BlindedPayInfo`] construction.
44972 void ForwardNode_set_tlvs(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKForwardTlvs val);
44975 * This node's pubkey.
44977 struct LDKPublicKey ForwardNode_get_node_id(const struct LDKForwardNode *NONNULL_PTR this_ptr);
44980 * This node's pubkey.
44982 void ForwardNode_set_node_id(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44985 * The maximum value, in msat, that may be accepted by this node.
44987 uint64_t ForwardNode_get_htlc_maximum_msat(const struct LDKForwardNode *NONNULL_PTR this_ptr);
44990 * The maximum value, in msat, that may be accepted by this node.
44992 void ForwardNode_set_htlc_maximum_msat(struct LDKForwardNode *NONNULL_PTR this_ptr, uint64_t val);
44995 * Constructs a new ForwardNode given each field
44997 MUST_USE_RES struct LDKForwardNode ForwardNode_new(struct LDKForwardTlvs tlvs_arg, struct LDKPublicKey node_id_arg, uint64_t htlc_maximum_msat_arg);
45000 * Creates a copy of the ForwardNode
45002 struct LDKForwardNode ForwardNode_clone(const struct LDKForwardNode *NONNULL_PTR orig);
45005 * Frees any resources used by the ForwardTlvs, if is_owned is set and inner is non-NULL.
45007 void ForwardTlvs_free(struct LDKForwardTlvs this_obj);
45010 * The short channel id this payment should be forwarded out over.
45012 uint64_t ForwardTlvs_get_short_channel_id(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
45015 * The short channel id this payment should be forwarded out over.
45017 void ForwardTlvs_set_short_channel_id(struct LDKForwardTlvs *NONNULL_PTR this_ptr, uint64_t val);
45020 * Payment parameters for relaying over [`Self::short_channel_id`].
45022 struct LDKPaymentRelay ForwardTlvs_get_payment_relay(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
45025 * Payment parameters for relaying over [`Self::short_channel_id`].
45027 void ForwardTlvs_set_payment_relay(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentRelay val);
45030 * Payment constraints for relaying over [`Self::short_channel_id`].
45032 struct LDKPaymentConstraints ForwardTlvs_get_payment_constraints(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
45035 * Payment constraints for relaying over [`Self::short_channel_id`].
45037 void ForwardTlvs_set_payment_constraints(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
45040 * Supported and required features when relaying a payment onion containing this object's
45041 * corresponding [`BlindedHop::encrypted_payload`].
45043 * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
45045 struct LDKBlindedHopFeatures ForwardTlvs_get_features(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
45048 * Supported and required features when relaying a payment onion containing this object's
45049 * corresponding [`BlindedHop::encrypted_payload`].
45051 * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
45053 void ForwardTlvs_set_features(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
45056 * Constructs a new ForwardTlvs given each field
45058 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);
45061 * Creates a copy of the ForwardTlvs
45063 struct LDKForwardTlvs ForwardTlvs_clone(const struct LDKForwardTlvs *NONNULL_PTR orig);
45066 * Frees any resources used by the ReceiveTlvs, if is_owned is set and inner is non-NULL.
45068 void ReceiveTlvs_free(struct LDKReceiveTlvs this_obj);
45071 * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
45073 const uint8_t (*ReceiveTlvs_get_payment_secret(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr))[32];
45076 * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
45078 void ReceiveTlvs_set_payment_secret(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
45081 * Constraints for the receiver of this payment.
45083 struct LDKPaymentConstraints ReceiveTlvs_get_payment_constraints(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr);
45086 * Constraints for the receiver of this payment.
45088 void ReceiveTlvs_set_payment_constraints(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
45091 * Constructs a new ReceiveTlvs given each field
45093 MUST_USE_RES struct LDKReceiveTlvs ReceiveTlvs_new(struct LDKThirtyTwoBytes payment_secret_arg, struct LDKPaymentConstraints payment_constraints_arg);
45096 * Creates a copy of the ReceiveTlvs
45098 struct LDKReceiveTlvs ReceiveTlvs_clone(const struct LDKReceiveTlvs *NONNULL_PTR orig);
45101 * Frees any resources used by the PaymentRelay, if is_owned is set and inner is non-NULL.
45103 void PaymentRelay_free(struct LDKPaymentRelay this_obj);
45106 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
45108 uint16_t PaymentRelay_get_cltv_expiry_delta(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
45111 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
45113 void PaymentRelay_set_cltv_expiry_delta(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint16_t val);
45116 * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
45117 * this [`BlindedHop`], (i.e., 10,000 is 1%).
45119 uint32_t PaymentRelay_get_fee_proportional_millionths(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
45122 * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
45123 * this [`BlindedHop`], (i.e., 10,000 is 1%).
45125 void PaymentRelay_set_fee_proportional_millionths(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
45128 * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
45130 uint32_t PaymentRelay_get_fee_base_msat(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
45133 * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
45135 void PaymentRelay_set_fee_base_msat(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
45138 * Constructs a new PaymentRelay given each field
45140 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);
45143 * Creates a copy of the PaymentRelay
45145 struct LDKPaymentRelay PaymentRelay_clone(const struct LDKPaymentRelay *NONNULL_PTR orig);
45148 * Frees any resources used by the PaymentConstraints, if is_owned is set and inner is non-NULL.
45150 void PaymentConstraints_free(struct LDKPaymentConstraints this_obj);
45153 * The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
45155 uint32_t PaymentConstraints_get_max_cltv_expiry(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
45158 * The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
45160 void PaymentConstraints_set_max_cltv_expiry(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint32_t val);
45163 * The minimum value, in msat, that may be accepted by the node corresponding to this
45166 uint64_t PaymentConstraints_get_htlc_minimum_msat(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
45169 * The minimum value, in msat, that may be accepted by the node corresponding to this
45172 void PaymentConstraints_set_htlc_minimum_msat(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint64_t val);
45175 * Constructs a new PaymentConstraints given each field
45177 MUST_USE_RES struct LDKPaymentConstraints PaymentConstraints_new(uint32_t max_cltv_expiry_arg, uint64_t htlc_minimum_msat_arg);
45180 * Creates a copy of the PaymentConstraints
45182 struct LDKPaymentConstraints PaymentConstraints_clone(const struct LDKPaymentConstraints *NONNULL_PTR orig);
45185 * Serialize the ForwardTlvs object into a byte array which can be read by ForwardTlvs_read
45187 struct LDKCVec_u8Z ForwardTlvs_write(const struct LDKForwardTlvs *NONNULL_PTR obj);
45190 * Serialize the ReceiveTlvs object into a byte array which can be read by ReceiveTlvs_read
45192 struct LDKCVec_u8Z ReceiveTlvs_write(const struct LDKReceiveTlvs *NONNULL_PTR obj);
45195 * Read a ReceiveTlvs from a byte array, created by ReceiveTlvs_write
45197 struct LDKCResult_ReceiveTlvsDecodeErrorZ ReceiveTlvs_read(struct LDKu8slice ser);
45200 * Serialize the PaymentRelay object into a byte array which can be read by PaymentRelay_read
45202 struct LDKCVec_u8Z PaymentRelay_write(const struct LDKPaymentRelay *NONNULL_PTR obj);
45205 * Read a PaymentRelay from a byte array, created by PaymentRelay_write
45207 struct LDKCResult_PaymentRelayDecodeErrorZ PaymentRelay_read(struct LDKu8slice ser);
45210 * Serialize the PaymentConstraints object into a byte array which can be read by PaymentConstraints_read
45212 struct LDKCVec_u8Z PaymentConstraints_write(const struct LDKPaymentConstraints *NONNULL_PTR obj);
45215 * Read a PaymentConstraints from a byte array, created by PaymentConstraints_write
45217 struct LDKCResult_PaymentConstraintsDecodeErrorZ PaymentConstraints_read(struct LDKu8slice ser);
45220 * Frees any resources used by the PaymentPurpose
45222 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
45225 * Creates a copy of the PaymentPurpose
45227 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
45230 * Utility method to constructs a new InvoicePayment-variant PaymentPurpose
45232 struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret);
45235 * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
45237 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
45240 * Checks if two PaymentPurposes contain equal inner contents.
45241 * This ignores pointers and is_owned flags and looks at the values in fields.
45243 bool PaymentPurpose_eq(const struct LDKPaymentPurpose *NONNULL_PTR a, const struct LDKPaymentPurpose *NONNULL_PTR b);
45246 * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
45248 struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj);
45251 * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
45253 struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser);
45256 * Frees any resources used by the ClaimedHTLC, if is_owned is set and inner is non-NULL.
45258 void ClaimedHTLC_free(struct LDKClaimedHTLC this_obj);
45261 * The `channel_id` of the channel over which the HTLC was received.
45263 const uint8_t (*ClaimedHTLC_get_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr))[32];
45266 * The `channel_id` of the channel over which the HTLC was received.
45268 void ClaimedHTLC_set_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
45271 * The `user_channel_id` of the channel over which the HTLC was received. This is the value
45272 * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
45273 * [`ChannelManager::accept_inbound_channel`] for inbound channels if
45274 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
45275 * `user_channel_id` will be randomized for an inbound channel.
45277 * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
45278 * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
45279 * was not actually claimed until after upgrading.)
45281 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
45282 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
45283 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
45285 struct LDKU128 ClaimedHTLC_get_user_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
45288 * The `user_channel_id` of the channel over which the HTLC was received. This is the value
45289 * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
45290 * [`ChannelManager::accept_inbound_channel`] for inbound channels if
45291 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
45292 * `user_channel_id` will be randomized for an inbound channel.
45294 * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
45295 * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
45296 * was not actually claimed until after upgrading.)
45298 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
45299 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
45300 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
45302 void ClaimedHTLC_set_user_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKU128 val);
45305 * The block height at which this HTLC expires.
45307 uint32_t ClaimedHTLC_get_cltv_expiry(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
45310 * The block height at which this HTLC expires.
45312 void ClaimedHTLC_set_cltv_expiry(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint32_t val);
45315 * The amount (in msats) of this part of an MPP.
45317 uint64_t ClaimedHTLC_get_value_msat(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
45320 * The amount (in msats) of this part of an MPP.
45322 void ClaimedHTLC_set_value_msat(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint64_t val);
45325 * Constructs a new ClaimedHTLC given each field
45327 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);
45330 * Creates a copy of the ClaimedHTLC
45332 struct LDKClaimedHTLC ClaimedHTLC_clone(const struct LDKClaimedHTLC *NONNULL_PTR orig);
45335 * Checks if two ClaimedHTLCs contain equal inner contents.
45336 * This ignores pointers and is_owned flags and looks at the values in fields.
45337 * Two objects with NULL inner values will be considered "equal" here.
45339 bool ClaimedHTLC_eq(const struct LDKClaimedHTLC *NONNULL_PTR a, const struct LDKClaimedHTLC *NONNULL_PTR b);
45342 * Serialize the ClaimedHTLC object into a byte array which can be read by ClaimedHTLC_read
45344 struct LDKCVec_u8Z ClaimedHTLC_write(const struct LDKClaimedHTLC *NONNULL_PTR obj);
45347 * Read a ClaimedHTLC from a byte array, created by ClaimedHTLC_write
45349 struct LDKCResult_ClaimedHTLCDecodeErrorZ ClaimedHTLC_read(struct LDKu8slice ser);
45352 * Frees any resources used by the PathFailure
45354 void PathFailure_free(struct LDKPathFailure this_ptr);
45357 * Creates a copy of the PathFailure
45359 struct LDKPathFailure PathFailure_clone(const struct LDKPathFailure *NONNULL_PTR orig);
45362 * Utility method to constructs a new InitialSend-variant PathFailure
45364 struct LDKPathFailure PathFailure_initial_send(struct LDKAPIError err);
45367 * Utility method to constructs a new OnPath-variant PathFailure
45369 struct LDKPathFailure PathFailure_on_path(struct LDKCOption_NetworkUpdateZ network_update);
45372 * Checks if two PathFailures contain equal inner contents.
45373 * This ignores pointers and is_owned flags and looks at the values in fields.
45375 bool PathFailure_eq(const struct LDKPathFailure *NONNULL_PTR a, const struct LDKPathFailure *NONNULL_PTR b);
45378 * Serialize the PathFailure object into a byte array which can be read by PathFailure_read
45380 struct LDKCVec_u8Z PathFailure_write(const struct LDKPathFailure *NONNULL_PTR obj);
45383 * Read a PathFailure from a byte array, created by PathFailure_write
45385 struct LDKCResult_COption_PathFailureZDecodeErrorZ PathFailure_read(struct LDKu8slice ser);
45388 * Frees any resources used by the ClosureReason
45390 void ClosureReason_free(struct LDKClosureReason this_ptr);
45393 * Creates a copy of the ClosureReason
45395 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
45398 * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
45400 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKUntrustedString peer_msg);
45403 * Utility method to constructs a new HolderForceClosed-variant ClosureReason
45405 struct LDKClosureReason ClosureReason_holder_force_closed(void);
45408 * Utility method to constructs a new CooperativeClosure-variant ClosureReason
45410 struct LDKClosureReason ClosureReason_cooperative_closure(void);
45413 * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
45415 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
45418 * Utility method to constructs a new FundingTimedOut-variant ClosureReason
45420 struct LDKClosureReason ClosureReason_funding_timed_out(void);
45423 * Utility method to constructs a new ProcessingError-variant ClosureReason
45425 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
45428 * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
45430 struct LDKClosureReason ClosureReason_disconnected_peer(void);
45433 * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
45435 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
45438 * Utility method to constructs a new CounterpartyCoopClosedUnfundedChannel-variant ClosureReason
45440 struct LDKClosureReason ClosureReason_counterparty_coop_closed_unfunded_channel(void);
45443 * Utility method to constructs a new FundingBatchClosure-variant ClosureReason
45445 struct LDKClosureReason ClosureReason_funding_batch_closure(void);
45448 * Checks if two ClosureReasons contain equal inner contents.
45449 * This ignores pointers and is_owned flags and looks at the values in fields.
45451 bool ClosureReason_eq(const struct LDKClosureReason *NONNULL_PTR a, const struct LDKClosureReason *NONNULL_PTR b);
45454 * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
45456 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
45459 * Read a ClosureReason from a byte array, created by ClosureReason_write
45461 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
45464 * Frees any resources used by the HTLCDestination
45466 void HTLCDestination_free(struct LDKHTLCDestination this_ptr);
45469 * Creates a copy of the HTLCDestination
45471 struct LDKHTLCDestination HTLCDestination_clone(const struct LDKHTLCDestination *NONNULL_PTR orig);
45474 * Utility method to constructs a new NextHopChannel-variant HTLCDestination
45476 struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKThirtyTwoBytes channel_id);
45479 * Utility method to constructs a new UnknownNextHop-variant HTLCDestination
45481 struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid);
45484 * Utility method to constructs a new InvalidForward-variant HTLCDestination
45486 struct LDKHTLCDestination HTLCDestination_invalid_forward(uint64_t requested_forward_scid);
45489 * Utility method to constructs a new FailedPayment-variant HTLCDestination
45491 struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash);
45494 * Checks if two HTLCDestinations contain equal inner contents.
45495 * This ignores pointers and is_owned flags and looks at the values in fields.
45497 bool HTLCDestination_eq(const struct LDKHTLCDestination *NONNULL_PTR a, const struct LDKHTLCDestination *NONNULL_PTR b);
45500 * Serialize the HTLCDestination object into a byte array which can be read by HTLCDestination_read
45502 struct LDKCVec_u8Z HTLCDestination_write(const struct LDKHTLCDestination *NONNULL_PTR obj);
45505 * Read a HTLCDestination from a byte array, created by HTLCDestination_write
45507 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(struct LDKu8slice ser);
45510 * Creates a copy of the PaymentFailureReason
45512 enum LDKPaymentFailureReason PaymentFailureReason_clone(const enum LDKPaymentFailureReason *NONNULL_PTR orig);
45515 * Utility method to constructs a new RecipientRejected-variant PaymentFailureReason
45517 enum LDKPaymentFailureReason PaymentFailureReason_recipient_rejected(void);
45520 * Utility method to constructs a new UserAbandoned-variant PaymentFailureReason
45522 enum LDKPaymentFailureReason PaymentFailureReason_user_abandoned(void);
45525 * Utility method to constructs a new RetriesExhausted-variant PaymentFailureReason
45527 enum LDKPaymentFailureReason PaymentFailureReason_retries_exhausted(void);
45530 * Utility method to constructs a new PaymentExpired-variant PaymentFailureReason
45532 enum LDKPaymentFailureReason PaymentFailureReason_payment_expired(void);
45535 * Utility method to constructs a new RouteNotFound-variant PaymentFailureReason
45537 enum LDKPaymentFailureReason PaymentFailureReason_route_not_found(void);
45540 * Utility method to constructs a new UnexpectedError-variant PaymentFailureReason
45542 enum LDKPaymentFailureReason PaymentFailureReason_unexpected_error(void);
45545 * Checks if two PaymentFailureReasons contain equal inner contents.
45546 * This ignores pointers and is_owned flags and looks at the values in fields.
45548 bool PaymentFailureReason_eq(const enum LDKPaymentFailureReason *NONNULL_PTR a, const enum LDKPaymentFailureReason *NONNULL_PTR b);
45551 * Serialize the PaymentFailureReason object into a byte array which can be read by PaymentFailureReason_read
45553 struct LDKCVec_u8Z PaymentFailureReason_write(const enum LDKPaymentFailureReason *NONNULL_PTR obj);
45556 * Read a PaymentFailureReason from a byte array, created by PaymentFailureReason_write
45558 struct LDKCResult_PaymentFailureReasonDecodeErrorZ PaymentFailureReason_read(struct LDKu8slice ser);
45561 * Frees any resources used by the Event
45563 void Event_free(struct LDKEvent this_ptr);
45566 * Creates a copy of the Event
45568 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
45571 * Utility method to constructs a new FundingGenerationReady-variant Event
45573 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);
45576 * Utility method to constructs a new PaymentClaimable-variant Event
45578 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);
45581 * Utility method to constructs a new PaymentClaimed-variant Event
45583 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);
45586 * Utility method to constructs a new InvoiceRequestFailed-variant Event
45588 struct LDKEvent Event_invoice_request_failed(struct LDKThirtyTwoBytes payment_id);
45591 * Utility method to constructs a new PaymentSent-variant Event
45593 struct LDKEvent Event_payment_sent(struct LDKCOption_ThirtyTwoBytesZ payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
45596 * Utility method to constructs a new PaymentFailed-variant Event
45598 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_PaymentFailureReasonZ reason);
45601 * Utility method to constructs a new PaymentPathSuccessful-variant Event
45603 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash, struct LDKPath path);
45606 * Utility method to constructs a new PaymentPathFailed-variant Event
45608 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);
45611 * Utility method to constructs a new ProbeSuccessful-variant Event
45613 struct LDKEvent Event_probe_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path);
45616 * Utility method to constructs a new ProbeFailed-variant Event
45618 struct LDKEvent Event_probe_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path, struct LDKCOption_u64Z short_channel_id);
45621 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
45623 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
45626 * Utility method to constructs a new HTLCIntercepted-variant Event
45628 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);
45631 * Utility method to constructs a new SpendableOutputs-variant Event
45633 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs, struct LDKCOption_ThirtyTwoBytesZ channel_id);
45636 * Utility method to constructs a new PaymentForwarded-variant Event
45638 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);
45641 * Utility method to constructs a new ChannelPending-variant Event
45643 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);
45646 * Utility method to constructs a new ChannelReady-variant Event
45648 struct LDKEvent Event_channel_ready(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKChannelTypeFeatures channel_type);
45651 * Utility method to constructs a new ChannelClosed-variant Event
45653 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);
45656 * Utility method to constructs a new DiscardFunding-variant Event
45658 struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction);
45661 * Utility method to constructs a new OpenChannelRequest-variant Event
45663 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);
45666 * Utility method to constructs a new HTLCHandlingFailed-variant Event
45668 struct LDKEvent Event_htlchandling_failed(struct LDKThirtyTwoBytes prev_channel_id, struct LDKHTLCDestination failed_next_destination);
45671 * Utility method to constructs a new BumpTransaction-variant Event
45673 struct LDKEvent Event_bump_transaction(struct LDKBumpTransactionEvent a);
45676 * Checks if two Events contain equal inner contents.
45677 * This ignores pointers and is_owned flags and looks at the values in fields.
45679 bool Event_eq(const struct LDKEvent *NONNULL_PTR a, const struct LDKEvent *NONNULL_PTR b);
45682 * Serialize the Event object into a byte array which can be read by Event_read
45684 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
45687 * Read a Event from a byte array, created by Event_write
45689 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
45692 * Frees any resources used by the MessageSendEvent
45694 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
45697 * Creates a copy of the MessageSendEvent
45699 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
45702 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
45704 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
45707 * Utility method to constructs a new SendAcceptChannelV2-variant MessageSendEvent
45709 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel_v2(struct LDKPublicKey node_id, struct LDKAcceptChannelV2 msg);
45712 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
45714 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
45717 * Utility method to constructs a new SendOpenChannelV2-variant MessageSendEvent
45719 struct LDKMessageSendEvent MessageSendEvent_send_open_channel_v2(struct LDKPublicKey node_id, struct LDKOpenChannelV2 msg);
45722 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
45724 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
45727 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
45729 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
45732 * Utility method to constructs a new SendTxAddInput-variant MessageSendEvent
45734 struct LDKMessageSendEvent MessageSendEvent_send_tx_add_input(struct LDKPublicKey node_id, struct LDKTxAddInput msg);
45737 * Utility method to constructs a new SendTxAddOutput-variant MessageSendEvent
45739 struct LDKMessageSendEvent MessageSendEvent_send_tx_add_output(struct LDKPublicKey node_id, struct LDKTxAddOutput msg);
45742 * Utility method to constructs a new SendTxRemoveInput-variant MessageSendEvent
45744 struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_input(struct LDKPublicKey node_id, struct LDKTxRemoveInput msg);
45747 * Utility method to constructs a new SendTxRemoveOutput-variant MessageSendEvent
45749 struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_output(struct LDKPublicKey node_id, struct LDKTxRemoveOutput msg);
45752 * Utility method to constructs a new SendTxComplete-variant MessageSendEvent
45754 struct LDKMessageSendEvent MessageSendEvent_send_tx_complete(struct LDKPublicKey node_id, struct LDKTxComplete msg);
45757 * Utility method to constructs a new SendTxSignatures-variant MessageSendEvent
45759 struct LDKMessageSendEvent MessageSendEvent_send_tx_signatures(struct LDKPublicKey node_id, struct LDKTxSignatures msg);
45762 * Utility method to constructs a new SendTxInitRbf-variant MessageSendEvent
45764 struct LDKMessageSendEvent MessageSendEvent_send_tx_init_rbf(struct LDKPublicKey node_id, struct LDKTxInitRbf msg);
45767 * Utility method to constructs a new SendTxAckRbf-variant MessageSendEvent
45769 struct LDKMessageSendEvent MessageSendEvent_send_tx_ack_rbf(struct LDKPublicKey node_id, struct LDKTxAckRbf msg);
45772 * Utility method to constructs a new SendTxAbort-variant MessageSendEvent
45774 struct LDKMessageSendEvent MessageSendEvent_send_tx_abort(struct LDKPublicKey node_id, struct LDKTxAbort msg);
45777 * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
45779 struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg);
45782 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
45784 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
45787 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
45789 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
45792 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
45794 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
45797 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
45799 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
45802 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
45804 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
45807 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
45809 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
45812 * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
45814 struct LDKMessageSendEvent MessageSendEvent_send_channel_announcement(struct LDKPublicKey node_id, struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
45817 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
45819 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
45822 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
45824 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
45827 * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
45829 struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
45832 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
45834 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
45837 * Utility method to constructs a new HandleError-variant MessageSendEvent
45839 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
45842 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
45844 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
45847 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
45849 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
45852 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
45854 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
45857 * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
45859 struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
45862 * Calls the free function if one is set
45864 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
45867 * Calls the free function if one is set
45869 void EventsProvider_free(struct LDKEventsProvider this_ptr);
45872 * Calls the free function if one is set
45874 void EventHandler_free(struct LDKEventHandler this_ptr);
45877 * Frees any resources used by the AnchorDescriptor, if is_owned is set and inner is non-NULL.
45879 void AnchorDescriptor_free(struct LDKAnchorDescriptor this_obj);
45882 * The parameters required to derive the signer for the anchor input.
45884 struct LDKChannelDerivationParameters AnchorDescriptor_get_channel_derivation_parameters(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
45887 * The parameters required to derive the signer for the anchor input.
45889 void AnchorDescriptor_set_channel_derivation_parameters(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
45892 * The transaction input's outpoint corresponding to the commitment transaction's anchor
45895 struct LDKOutPoint AnchorDescriptor_get_outpoint(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
45898 * The transaction input's outpoint corresponding to the commitment transaction's anchor
45901 void AnchorDescriptor_set_outpoint(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
45904 * Constructs a new AnchorDescriptor given each field
45906 MUST_USE_RES struct LDKAnchorDescriptor AnchorDescriptor_new(struct LDKChannelDerivationParameters channel_derivation_parameters_arg, struct LDKOutPoint outpoint_arg);
45909 * Creates a copy of the AnchorDescriptor
45911 struct LDKAnchorDescriptor AnchorDescriptor_clone(const struct LDKAnchorDescriptor *NONNULL_PTR orig);
45914 * Checks if two AnchorDescriptors contain equal inner contents.
45915 * This ignores pointers and is_owned flags and looks at the values in fields.
45916 * Two objects with NULL inner values will be considered "equal" here.
45918 bool AnchorDescriptor_eq(const struct LDKAnchorDescriptor *NONNULL_PTR a, const struct LDKAnchorDescriptor *NONNULL_PTR b);
45921 * Returns the UTXO to be spent by the anchor input, which can be obtained via
45922 * [`Self::unsigned_tx_input`].
45924 MUST_USE_RES struct LDKTxOut AnchorDescriptor_previous_utxo(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
45927 * Returns the unsigned transaction input spending the anchor output in the commitment
45930 MUST_USE_RES struct LDKTxIn AnchorDescriptor_unsigned_tx_input(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
45933 * Returns the witness script of the anchor output in the commitment transaction.
45935 MUST_USE_RES struct LDKCVec_u8Z AnchorDescriptor_witness_script(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
45938 * Returns the fully signed witness required to spend the anchor output in the commitment
45941 MUST_USE_RES struct LDKWitness AnchorDescriptor_tx_input_witness(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature);
45944 * Derives the channel signer required to sign the anchor input.
45946 MUST_USE_RES struct LDKWriteableEcdsaChannelSigner AnchorDescriptor_derive_channel_signer(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
45949 * Frees any resources used by the BumpTransactionEvent
45951 void BumpTransactionEvent_free(struct LDKBumpTransactionEvent this_ptr);
45954 * Creates a copy of the BumpTransactionEvent
45956 struct LDKBumpTransactionEvent BumpTransactionEvent_clone(const struct LDKBumpTransactionEvent *NONNULL_PTR orig);
45959 * Utility method to constructs a new ChannelClose-variant BumpTransactionEvent
45961 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);
45964 * Utility method to constructs a new HTLCResolution-variant BumpTransactionEvent
45966 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);
45969 * Checks if two BumpTransactionEvents contain equal inner contents.
45970 * This ignores pointers and is_owned flags and looks at the values in fields.
45972 bool BumpTransactionEvent_eq(const struct LDKBumpTransactionEvent *NONNULL_PTR a, const struct LDKBumpTransactionEvent *NONNULL_PTR b);
45975 * Frees any resources used by the Input, if is_owned is set and inner is non-NULL.
45977 void Input_free(struct LDKInput this_obj);
45980 * The unique identifier of the input.
45982 struct LDKOutPoint Input_get_outpoint(const struct LDKInput *NONNULL_PTR this_ptr);
45985 * The unique identifier of the input.
45987 void Input_set_outpoint(struct LDKInput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
45990 * The UTXO being spent by the input.
45992 struct LDKTxOut Input_get_previous_utxo(const struct LDKInput *NONNULL_PTR this_ptr);
45995 * The UTXO being spent by the input.
45997 void Input_set_previous_utxo(struct LDKInput *NONNULL_PTR this_ptr, struct LDKTxOut val);
46000 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
46001 * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
46004 uint64_t Input_get_satisfaction_weight(const struct LDKInput *NONNULL_PTR this_ptr);
46007 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
46008 * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
46011 void Input_set_satisfaction_weight(struct LDKInput *NONNULL_PTR this_ptr, uint64_t val);
46014 * Constructs a new Input given each field
46016 MUST_USE_RES struct LDKInput Input_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut previous_utxo_arg, uint64_t satisfaction_weight_arg);
46019 * Creates a copy of the Input
46021 struct LDKInput Input_clone(const struct LDKInput *NONNULL_PTR orig);
46024 * Generates a non-cryptographic 64-bit hash of the Input.
46026 uint64_t Input_hash(const struct LDKInput *NONNULL_PTR o);
46029 * Checks if two Inputs contain equal inner contents.
46030 * This ignores pointers and is_owned flags and looks at the values in fields.
46031 * Two objects with NULL inner values will be considered "equal" here.
46033 bool Input_eq(const struct LDKInput *NONNULL_PTR a, const struct LDKInput *NONNULL_PTR b);
46036 * Frees any resources used by the Utxo, if is_owned is set and inner is non-NULL.
46038 void Utxo_free(struct LDKUtxo this_obj);
46041 * The unique identifier of the output.
46043 struct LDKOutPoint Utxo_get_outpoint(const struct LDKUtxo *NONNULL_PTR this_ptr);
46046 * The unique identifier of the output.
46048 void Utxo_set_outpoint(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKOutPoint val);
46051 * The output to spend.
46053 struct LDKTxOut Utxo_get_output(const struct LDKUtxo *NONNULL_PTR this_ptr);
46056 * The output to spend.
46058 void Utxo_set_output(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKTxOut val);
46061 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
46062 * with their lengths included, required to satisfy the output's script. The weight consumed by
46063 * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
46065 uint64_t Utxo_get_satisfaction_weight(const struct LDKUtxo *NONNULL_PTR this_ptr);
46068 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
46069 * with their lengths included, required to satisfy the output's script. The weight consumed by
46070 * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
46072 void Utxo_set_satisfaction_weight(struct LDKUtxo *NONNULL_PTR this_ptr, uint64_t val);
46075 * Constructs a new Utxo given each field
46077 MUST_USE_RES struct LDKUtxo Utxo_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, uint64_t satisfaction_weight_arg);
46080 * Creates a copy of the Utxo
46082 struct LDKUtxo Utxo_clone(const struct LDKUtxo *NONNULL_PTR orig);
46085 * Generates a non-cryptographic 64-bit hash of the Utxo.
46087 uint64_t Utxo_hash(const struct LDKUtxo *NONNULL_PTR o);
46090 * Checks if two Utxos contain equal inner contents.
46091 * This ignores pointers and is_owned flags and looks at the values in fields.
46092 * Two objects with NULL inner values will be considered "equal" here.
46094 bool Utxo_eq(const struct LDKUtxo *NONNULL_PTR a, const struct LDKUtxo *NONNULL_PTR b);
46097 * Returns a `Utxo` with the `satisfaction_weight` estimate for a legacy P2PKH output.
46099 MUST_USE_RES struct LDKUtxo Utxo_new_p2pkh(struct LDKOutPoint outpoint, uint64_t value, const uint8_t (*pubkey_hash)[20]);
46102 * Frees any resources used by the CoinSelection, if is_owned is set and inner is non-NULL.
46104 void CoinSelection_free(struct LDKCoinSelection this_obj);
46107 * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
46108 * requiring additional fees.
46110 struct LDKCVec_UtxoZ CoinSelection_get_confirmed_utxos(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
46113 * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
46114 * requiring additional fees.
46116 void CoinSelection_set_confirmed_utxos(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCVec_UtxoZ val);
46119 * An additional output tracking whether any change remained after coin selection. This output
46120 * should always have a value above dust for its given `script_pubkey`. It should not be
46121 * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
46122 * not met. This implies no other party should be able to spend it except us.
46124 struct LDKCOption_TxOutZ CoinSelection_get_change_output(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
46127 * An additional output tracking whether any change remained after coin selection. This output
46128 * should always have a value above dust for its given `script_pubkey`. It should not be
46129 * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
46130 * not met. This implies no other party should be able to spend it except us.
46132 void CoinSelection_set_change_output(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCOption_TxOutZ val);
46135 * Constructs a new CoinSelection given each field
46137 MUST_USE_RES struct LDKCoinSelection CoinSelection_new(struct LDKCVec_UtxoZ confirmed_utxos_arg, struct LDKCOption_TxOutZ change_output_arg);
46140 * Creates a copy of the CoinSelection
46142 struct LDKCoinSelection CoinSelection_clone(const struct LDKCoinSelection *NONNULL_PTR orig);
46145 * Calls the free function if one is set
46147 void CoinSelectionSource_free(struct LDKCoinSelectionSource this_ptr);
46150 * Calls the free function if one is set
46152 void WalletSource_free(struct LDKWalletSource this_ptr);
46155 * Frees any resources used by the Wallet, if is_owned is set and inner is non-NULL.
46157 void Wallet_free(struct LDKWallet this_obj);
46160 * Returns a new instance backed by the given [`WalletSource`] that serves as an implementation
46161 * of [`CoinSelectionSource`].
46163 MUST_USE_RES struct LDKWallet Wallet_new(struct LDKWalletSource source, struct LDKLogger logger);
46166 * Constructs a new CoinSelectionSource which calls the relevant methods on this_arg.
46167 * This copies the `inner` pointer in this_arg and thus the returned CoinSelectionSource must be freed before this_arg is
46169 struct LDKCoinSelectionSource Wallet_as_CoinSelectionSource(const struct LDKWallet *NONNULL_PTR this_arg);
46172 * Frees any resources used by the BumpTransactionEventHandler, if is_owned is set and inner is non-NULL.
46174 void BumpTransactionEventHandler_free(struct LDKBumpTransactionEventHandler this_obj);
46177 * Returns a new instance capable of handling [`Event::BumpTransaction`] events.
46179 * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
46181 MUST_USE_RES struct LDKBumpTransactionEventHandler BumpTransactionEventHandler_new(struct LDKBroadcasterInterface broadcaster, struct LDKCoinSelectionSource utxo_source, struct LDKSignerProvider signer_provider, struct LDKLogger logger);
46184 * Handles all variants of [`BumpTransactionEvent`].
46186 void BumpTransactionEventHandler_handle_event(const struct LDKBumpTransactionEventHandler *NONNULL_PTR this_arg, const struct LDKBumpTransactionEvent *NONNULL_PTR event);
46189 * Frees any resources used by the FilesystemStore, if is_owned is set and inner is non-NULL.
46191 void FilesystemStore_free(struct LDKFilesystemStore this_obj);
46194 * Constructs a new [`FilesystemStore`].
46196 MUST_USE_RES struct LDKFilesystemStore FilesystemStore_new(struct LDKStr data_dir);
46199 * Returns the data directory.
46201 MUST_USE_RES struct LDKStr FilesystemStore_get_data_dir(const struct LDKFilesystemStore *NONNULL_PTR this_arg);
46204 * Constructs a new KVStore which calls the relevant methods on this_arg.
46205 * This copies the `inner` pointer in this_arg and thus the returned KVStore must be freed before this_arg is
46207 struct LDKKVStore FilesystemStore_as_KVStore(const struct LDKFilesystemStore *NONNULL_PTR this_arg);
46210 * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
46212 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
46215 * Frees any resources used by the GossipSync
46217 void GossipSync_free(struct LDKGossipSync this_ptr);
46220 * Utility method to constructs a new P2P-variant GossipSync
46222 struct LDKGossipSync GossipSync_p2_p(const struct LDKP2PGossipSync *NONNULL_PTR a);
46225 * Utility method to constructs a new Rapid-variant GossipSync
46227 struct LDKGossipSync GossipSync_rapid(const struct LDKRapidGossipSync *NONNULL_PTR a);
46230 * Utility method to constructs a new None-variant GossipSync
46232 struct LDKGossipSync GossipSync_none(void);
46235 * Start a background thread that takes care of responsibilities enumerated in the [top-level
46238 * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
46239 * [`Persister::persist_manager`] returns an error. In case of an error, the error is retrieved by calling
46240 * either [`join`] or [`stop`].
46242 * # Data Persistence
46244 * [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
46245 * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
46246 * [`ChannelManager`]. See the `lightning-persister` crate for LDK's
46247 * provided implementation.
46249 * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if
46250 * [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
46251 * See the `lightning-persister` crate for LDK's provided implementation.
46253 * Typically, users should either implement [`Persister::persist_manager`] to never return an
46254 * error or call [`join`] and handle any error that may arise. For the latter case,
46255 * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
46259 * `event_handler` is responsible for handling events that users should be notified of (e.g.,
46260 * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
46261 * functionality implemented by other handlers.
46262 * * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures.
46264 * # Rapid Gossip Sync
46266 * If rapid gossip sync is meant to run at startup, pass [`RapidGossipSync`] via `gossip_sync`
46267 * to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
46268 * until the [`RapidGossipSync`] instance completes its first sync.
46270 * [top-level documentation]: BackgroundProcessor
46271 * [`join`]: Self::join
46272 * [`stop`]: Self::stop
46273 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
46274 * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
46275 * [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager
46276 * [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph
46277 * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
46278 * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
46280 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);
46283 * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
46284 * [`ChannelManager`].
46288 * This function panics if the background thread has panicked such as while persisting or
46291 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
46293 MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
46296 * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
46297 * [`ChannelManager`].
46301 * This function panics if the background thread has panicked such as while persisting or
46304 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
46306 MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
46309 * Frees any resources used by the Bolt11ParseError
46311 void Bolt11ParseError_free(struct LDKBolt11ParseError this_ptr);
46314 * Creates a copy of the Bolt11ParseError
46316 struct LDKBolt11ParseError Bolt11ParseError_clone(const struct LDKBolt11ParseError *NONNULL_PTR orig);
46319 * Utility method to constructs a new Bech32Error-variant Bolt11ParseError
46321 struct LDKBolt11ParseError Bolt11ParseError_bech32_error(struct LDKBech32Error a);
46324 * Utility method to constructs a new ParseAmountError-variant Bolt11ParseError
46326 struct LDKBolt11ParseError Bolt11ParseError_parse_amount_error(struct LDKError a);
46329 * Utility method to constructs a new MalformedSignature-variant Bolt11ParseError
46331 struct LDKBolt11ParseError Bolt11ParseError_malformed_signature(enum LDKSecp256k1Error a);
46334 * Utility method to constructs a new BadPrefix-variant Bolt11ParseError
46336 struct LDKBolt11ParseError Bolt11ParseError_bad_prefix(void);
46339 * Utility method to constructs a new UnknownCurrency-variant Bolt11ParseError
46341 struct LDKBolt11ParseError Bolt11ParseError_unknown_currency(void);
46344 * Utility method to constructs a new UnknownSiPrefix-variant Bolt11ParseError
46346 struct LDKBolt11ParseError Bolt11ParseError_unknown_si_prefix(void);
46349 * Utility method to constructs a new MalformedHRP-variant Bolt11ParseError
46351 struct LDKBolt11ParseError Bolt11ParseError_malformed_hrp(void);
46354 * Utility method to constructs a new TooShortDataPart-variant Bolt11ParseError
46356 struct LDKBolt11ParseError Bolt11ParseError_too_short_data_part(void);
46359 * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant Bolt11ParseError
46361 struct LDKBolt11ParseError Bolt11ParseError_unexpected_end_of_tagged_fields(void);
46364 * Utility method to constructs a new DescriptionDecodeError-variant Bolt11ParseError
46366 struct LDKBolt11ParseError Bolt11ParseError_description_decode_error(struct LDKError a);
46369 * Utility method to constructs a new PaddingError-variant Bolt11ParseError
46371 struct LDKBolt11ParseError Bolt11ParseError_padding_error(void);
46374 * Utility method to constructs a new IntegerOverflowError-variant Bolt11ParseError
46376 struct LDKBolt11ParseError Bolt11ParseError_integer_overflow_error(void);
46379 * Utility method to constructs a new InvalidSegWitProgramLength-variant Bolt11ParseError
46381 struct LDKBolt11ParseError Bolt11ParseError_invalid_seg_wit_program_length(void);
46384 * Utility method to constructs a new InvalidPubKeyHashLength-variant Bolt11ParseError
46386 struct LDKBolt11ParseError Bolt11ParseError_invalid_pub_key_hash_length(void);
46389 * Utility method to constructs a new InvalidScriptHashLength-variant Bolt11ParseError
46391 struct LDKBolt11ParseError Bolt11ParseError_invalid_script_hash_length(void);
46394 * Utility method to constructs a new InvalidRecoveryId-variant Bolt11ParseError
46396 struct LDKBolt11ParseError Bolt11ParseError_invalid_recovery_id(void);
46399 * Utility method to constructs a new InvalidSliceLength-variant Bolt11ParseError
46401 struct LDKBolt11ParseError Bolt11ParseError_invalid_slice_length(struct LDKStr a);
46404 * Utility method to constructs a new Skip-variant Bolt11ParseError
46406 struct LDKBolt11ParseError Bolt11ParseError_skip(void);
46409 * Checks if two Bolt11ParseErrors contain equal inner contents.
46410 * This ignores pointers and is_owned flags and looks at the values in fields.
46412 bool Bolt11ParseError_eq(const struct LDKBolt11ParseError *NONNULL_PTR a, const struct LDKBolt11ParseError *NONNULL_PTR b);
46415 * Frees any resources used by the ParseOrSemanticError
46417 void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr);
46420 * Creates a copy of the ParseOrSemanticError
46422 struct LDKParseOrSemanticError ParseOrSemanticError_clone(const struct LDKParseOrSemanticError *NONNULL_PTR orig);
46425 * Utility method to constructs a new ParseError-variant ParseOrSemanticError
46427 struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKBolt11ParseError a);
46430 * Utility method to constructs a new SemanticError-variant ParseOrSemanticError
46432 struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKBolt11SemanticError a);
46435 * Checks if two ParseOrSemanticErrors contain equal inner contents.
46436 * This ignores pointers and is_owned flags and looks at the values in fields.
46438 bool ParseOrSemanticError_eq(const struct LDKParseOrSemanticError *NONNULL_PTR a, const struct LDKParseOrSemanticError *NONNULL_PTR b);
46441 * Frees any resources used by the Bolt11Invoice, if is_owned is set and inner is non-NULL.
46443 void Bolt11Invoice_free(struct LDKBolt11Invoice this_obj);
46446 * Checks if two Bolt11Invoices contain equal inner contents.
46447 * This ignores pointers and is_owned flags and looks at the values in fields.
46448 * Two objects with NULL inner values will be considered "equal" here.
46450 bool Bolt11Invoice_eq(const struct LDKBolt11Invoice *NONNULL_PTR a, const struct LDKBolt11Invoice *NONNULL_PTR b);
46453 * Creates a copy of the Bolt11Invoice
46455 struct LDKBolt11Invoice Bolt11Invoice_clone(const struct LDKBolt11Invoice *NONNULL_PTR orig);
46458 * Generates a non-cryptographic 64-bit hash of the Bolt11Invoice.
46460 uint64_t Bolt11Invoice_hash(const struct LDKBolt11Invoice *NONNULL_PTR o);
46463 * Frees any resources used by the SignedRawBolt11Invoice, if is_owned is set and inner is non-NULL.
46465 void SignedRawBolt11Invoice_free(struct LDKSignedRawBolt11Invoice this_obj);
46468 * Checks if two SignedRawBolt11Invoices contain equal inner contents.
46469 * This ignores pointers and is_owned flags and looks at the values in fields.
46470 * Two objects with NULL inner values will be considered "equal" here.
46472 bool SignedRawBolt11Invoice_eq(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR a, const struct LDKSignedRawBolt11Invoice *NONNULL_PTR b);
46475 * Creates a copy of the SignedRawBolt11Invoice
46477 struct LDKSignedRawBolt11Invoice SignedRawBolt11Invoice_clone(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR orig);
46480 * Generates a non-cryptographic 64-bit hash of the SignedRawBolt11Invoice.
46482 uint64_t SignedRawBolt11Invoice_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o);
46485 * Frees any resources used by the RawBolt11Invoice, if is_owned is set and inner is non-NULL.
46487 void RawBolt11Invoice_free(struct LDKRawBolt11Invoice this_obj);
46492 struct LDKRawDataPart RawBolt11Invoice_get_data(const struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr);
46497 void RawBolt11Invoice_set_data(struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
46500 * Checks if two RawBolt11Invoices contain equal inner contents.
46501 * This ignores pointers and is_owned flags and looks at the values in fields.
46502 * Two objects with NULL inner values will be considered "equal" here.
46504 bool RawBolt11Invoice_eq(const struct LDKRawBolt11Invoice *NONNULL_PTR a, const struct LDKRawBolt11Invoice *NONNULL_PTR b);
46507 * Creates a copy of the RawBolt11Invoice
46509 struct LDKRawBolt11Invoice RawBolt11Invoice_clone(const struct LDKRawBolt11Invoice *NONNULL_PTR orig);
46512 * Generates a non-cryptographic 64-bit hash of the RawBolt11Invoice.
46514 uint64_t RawBolt11Invoice_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR o);
46517 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
46519 void RawDataPart_free(struct LDKRawDataPart this_obj);
46522 * generation time of the invoice
46524 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
46527 * generation time of the invoice
46529 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
46532 * Checks if two RawDataParts contain equal inner contents.
46533 * This ignores pointers and is_owned flags and looks at the values in fields.
46534 * Two objects with NULL inner values will be considered "equal" here.
46536 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
46539 * Creates a copy of the RawDataPart
46541 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
46544 * Generates a non-cryptographic 64-bit hash of the RawDataPart.
46546 uint64_t RawDataPart_hash(const struct LDKRawDataPart *NONNULL_PTR o);
46549 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
46551 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
46554 * Checks if two PositiveTimestamps contain equal inner contents.
46555 * This ignores pointers and is_owned flags and looks at the values in fields.
46556 * Two objects with NULL inner values will be considered "equal" here.
46558 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
46561 * Creates a copy of the PositiveTimestamp
46563 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
46566 * Generates a non-cryptographic 64-bit hash of the PositiveTimestamp.
46568 uint64_t PositiveTimestamp_hash(const struct LDKPositiveTimestamp *NONNULL_PTR o);
46571 * Creates a copy of the SiPrefix
46573 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
46576 * Utility method to constructs a new Milli-variant SiPrefix
46578 enum LDKSiPrefix SiPrefix_milli(void);
46581 * Utility method to constructs a new Micro-variant SiPrefix
46583 enum LDKSiPrefix SiPrefix_micro(void);
46586 * Utility method to constructs a new Nano-variant SiPrefix
46588 enum LDKSiPrefix SiPrefix_nano(void);
46591 * Utility method to constructs a new Pico-variant SiPrefix
46593 enum LDKSiPrefix SiPrefix_pico(void);
46596 * Checks if two SiPrefixs contain equal inner contents.
46597 * This ignores pointers and is_owned flags and looks at the values in fields.
46599 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
46602 * Generates a non-cryptographic 64-bit hash of the SiPrefix.
46604 uint64_t SiPrefix_hash(const enum LDKSiPrefix *NONNULL_PTR o);
46607 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
46608 * This is effectively 10^12 * the prefix multiplier
46610 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
46613 * Creates a copy of the Currency
46615 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
46618 * Utility method to constructs a new Bitcoin-variant Currency
46620 enum LDKCurrency Currency_bitcoin(void);
46623 * Utility method to constructs a new BitcoinTestnet-variant Currency
46625 enum LDKCurrency Currency_bitcoin_testnet(void);
46628 * Utility method to constructs a new Regtest-variant Currency
46630 enum LDKCurrency Currency_regtest(void);
46633 * Utility method to constructs a new Simnet-variant Currency
46635 enum LDKCurrency Currency_simnet(void);
46638 * Utility method to constructs a new Signet-variant Currency
46640 enum LDKCurrency Currency_signet(void);
46643 * Generates a non-cryptographic 64-bit hash of the Currency.
46645 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
46648 * Checks if two Currencys contain equal inner contents.
46649 * This ignores pointers and is_owned flags and looks at the values in fields.
46651 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
46654 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
46656 void Sha256_free(struct LDKSha256 this_obj);
46659 * Creates a copy of the Sha256
46661 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
46664 * Generates a non-cryptographic 64-bit hash of the Sha256.
46666 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
46669 * Checks if two Sha256s contain equal inner contents.
46670 * This ignores pointers and is_owned flags and looks at the values in fields.
46671 * Two objects with NULL inner values will be considered "equal" here.
46673 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
46676 * Constructs a new [`Sha256`] from the given bytes, which are assumed to be the output of a
46677 * single sha256 hash.
46679 MUST_USE_RES struct LDKSha256 Sha256_from_bytes(const uint8_t (*bytes)[32]);
46682 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
46684 void Description_free(struct LDKDescription this_obj);
46687 * Creates a copy of the Description
46689 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
46692 * Generates a non-cryptographic 64-bit hash of the Description.
46694 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
46697 * Checks if two Descriptions contain equal inner contents.
46698 * This ignores pointers and is_owned flags and looks at the values in fields.
46699 * Two objects with NULL inner values will be considered "equal" here.
46701 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
46704 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
46706 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
46708 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
46710 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
46713 * Constructs a new PayeePubKey given each field
46715 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
46718 * Creates a copy of the PayeePubKey
46720 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
46723 * Generates a non-cryptographic 64-bit hash of the PayeePubKey.
46725 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
46728 * Checks if two PayeePubKeys contain equal inner contents.
46729 * This ignores pointers and is_owned flags and looks at the values in fields.
46730 * Two objects with NULL inner values will be considered "equal" here.
46732 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
46735 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
46737 void ExpiryTime_free(struct LDKExpiryTime this_obj);
46740 * Creates a copy of the ExpiryTime
46742 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
46745 * Generates a non-cryptographic 64-bit hash of the ExpiryTime.
46747 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
46750 * Checks if two ExpiryTimes contain equal inner contents.
46751 * This ignores pointers and is_owned flags and looks at the values in fields.
46752 * Two objects with NULL inner values will be considered "equal" here.
46754 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
46757 * Frees any resources used by the MinFinalCltvExpiryDelta, if is_owned is set and inner is non-NULL.
46759 void MinFinalCltvExpiryDelta_free(struct LDKMinFinalCltvExpiryDelta this_obj);
46761 uint64_t MinFinalCltvExpiryDelta_get_a(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr);
46763 void MinFinalCltvExpiryDelta_set_a(struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr, uint64_t val);
46766 * Constructs a new MinFinalCltvExpiryDelta given each field
46768 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_new(uint64_t a_arg);
46771 * Creates a copy of the MinFinalCltvExpiryDelta
46773 struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_clone(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR orig);
46776 * Generates a non-cryptographic 64-bit hash of the MinFinalCltvExpiryDelta.
46778 uint64_t MinFinalCltvExpiryDelta_hash(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR o);
46781 * Checks if two MinFinalCltvExpiryDeltas contain equal inner contents.
46782 * This ignores pointers and is_owned flags and looks at the values in fields.
46783 * Two objects with NULL inner values will be considered "equal" here.
46785 bool MinFinalCltvExpiryDelta_eq(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR a, const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR b);
46788 * Frees any resources used by the Fallback
46790 void Fallback_free(struct LDKFallback this_ptr);
46793 * Creates a copy of the Fallback
46795 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
46798 * Utility method to constructs a new SegWitProgram-variant Fallback
46800 struct LDKFallback Fallback_seg_wit_program(struct LDKWitnessVersion version, struct LDKCVec_u8Z program);
46803 * Utility method to constructs a new PubKeyHash-variant Fallback
46805 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
46808 * Utility method to constructs a new ScriptHash-variant Fallback
46810 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
46813 * Generates a non-cryptographic 64-bit hash of the Fallback.
46815 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
46818 * Checks if two Fallbacks contain equal inner contents.
46819 * This ignores pointers and is_owned flags and looks at the values in fields.
46821 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
46824 * Frees any resources used by the Bolt11InvoiceSignature, if is_owned is set and inner is non-NULL.
46826 void Bolt11InvoiceSignature_free(struct LDKBolt11InvoiceSignature this_obj);
46829 * Creates a copy of the Bolt11InvoiceSignature
46831 struct LDKBolt11InvoiceSignature Bolt11InvoiceSignature_clone(const struct LDKBolt11InvoiceSignature *NONNULL_PTR orig);
46834 * Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceSignature.
46836 uint64_t Bolt11InvoiceSignature_hash(const struct LDKBolt11InvoiceSignature *NONNULL_PTR o);
46839 * Checks if two Bolt11InvoiceSignatures contain equal inner contents.
46840 * This ignores pointers and is_owned flags and looks at the values in fields.
46841 * Two objects with NULL inner values will be considered "equal" here.
46843 bool Bolt11InvoiceSignature_eq(const struct LDKBolt11InvoiceSignature *NONNULL_PTR a, const struct LDKBolt11InvoiceSignature *NONNULL_PTR b);
46846 * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
46848 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
46851 * Creates a copy of the PrivateRoute
46853 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
46856 * Generates a non-cryptographic 64-bit hash of the PrivateRoute.
46858 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
46861 * Checks if two PrivateRoutes contain equal inner contents.
46862 * This ignores pointers and is_owned flags and looks at the values in fields.
46863 * Two objects with NULL inner values will be considered "equal" here.
46865 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
46868 * Disassembles the `SignedRawBolt11Invoice` into its three parts:
46870 * 2. hash of the raw invoice
46873 MUST_USE_RES struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ SignedRawBolt11Invoice_into_parts(struct LDKSignedRawBolt11Invoice this_arg);
46876 * The [`RawBolt11Invoice`] which was signed.
46878 MUST_USE_RES struct LDKRawBolt11Invoice SignedRawBolt11Invoice_raw_invoice(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
46881 * The hash of the [`RawBolt11Invoice`] that was signed.
46883 MUST_USE_RES const uint8_t (*SignedRawBolt11Invoice_signable_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg))[32];
46886 * Signature for the invoice.
46888 MUST_USE_RES struct LDKBolt11InvoiceSignature SignedRawBolt11Invoice_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
46891 * Recovers the public key used for signing the invoice from the recoverable signature.
46893 MUST_USE_RES struct LDKCResult_PayeePubKeySecp256k1ErrorZ SignedRawBolt11Invoice_recover_payee_pub_key(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
46896 * Checks if the signature is valid for the included payee public key or if none exists if it's
46897 * valid for the recovered signature (which should always be true?).
46899 MUST_USE_RES bool SignedRawBolt11Invoice_check_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
46902 * Calculate the hash of the encoded `RawBolt11Invoice` which should be signed.
46904 MUST_USE_RES struct LDKThirtyTwoBytes RawBolt11Invoice_signable_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46908 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46910 MUST_USE_RES struct LDKSha256 RawBolt11Invoice_payment_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46914 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46916 MUST_USE_RES struct LDKDescription RawBolt11Invoice_description(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46920 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46922 MUST_USE_RES struct LDKPayeePubKey RawBolt11Invoice_payee_pub_key(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46926 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46928 MUST_USE_RES struct LDKSha256 RawBolt11Invoice_description_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46932 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46934 MUST_USE_RES struct LDKExpiryTime RawBolt11Invoice_expiry_time(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46938 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46940 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta RawBolt11Invoice_min_final_cltv_expiry_delta(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46942 MUST_USE_RES struct LDKCOption_ThirtyTwoBytesZ RawBolt11Invoice_payment_secret(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46944 MUST_USE_RES struct LDKCOption_CVec_u8ZZ RawBolt11Invoice_payment_metadata(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46948 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46950 MUST_USE_RES struct LDKBolt11InvoiceFeatures RawBolt11Invoice_features(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46952 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawBolt11Invoice_private_routes(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46954 MUST_USE_RES struct LDKCOption_u64Z RawBolt11Invoice_amount_pico_btc(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46956 MUST_USE_RES enum LDKCurrency RawBolt11Invoice_currency(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46959 * Creates a `PositiveTimestamp` from a Unix timestamp in the range `0..=MAX_TIMESTAMP`.
46961 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
46963 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
46966 * Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
46967 * the range `0..=MAX_TIMESTAMP`.
46969 * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
46971 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
46973 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
46976 * Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
46977 * `0..=MAX_TIMESTAMP`.
46979 * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
46981 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
46983 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_duration_since_epoch(uint64_t duration);
46986 * Returns the Unix timestamp representing the stored time
46988 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
46991 * Returns the duration of the stored time since the Unix epoch
46993 MUST_USE_RES uint64_t PositiveTimestamp_as_duration_since_epoch(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
46996 * Returns the [`SystemTime`] representing the stored time
46998 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
47001 * The hash of the [`RawBolt11Invoice`] that was signed.
47003 MUST_USE_RES struct LDKThirtyTwoBytes Bolt11Invoice_signable_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47006 * Transform the `Bolt11Invoice` into its unchecked version.
47008 MUST_USE_RES struct LDKSignedRawBolt11Invoice Bolt11Invoice_into_signed_raw(struct LDKBolt11Invoice this_arg);
47011 * Check that the invoice is signed correctly and that key recovery works
47013 MUST_USE_RES struct LDKCResult_NoneBolt11SemanticErrorZ Bolt11Invoice_check_signature(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47016 * Constructs a `Bolt11Invoice` from a [`SignedRawBolt11Invoice`] by checking all its invariants.
47018 * use lightning_invoice::*;
47020 * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
47021 * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
47022 * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
47023 * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
47024 * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
47025 * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
47026 * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
47027 * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
47028 * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
47029 * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
47030 * j5r6drg6k6zcqj0fcwg\";
47032 * let signed = invoice.parse::<SignedRawBolt11Invoice>().unwrap();
47034 * assert!(Bolt11Invoice::from_signed(signed).is_ok());
47037 MUST_USE_RES struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ Bolt11Invoice_from_signed(struct LDKSignedRawBolt11Invoice signed_invoice);
47040 * Returns the `Bolt11Invoice`'s timestamp (should equal its creation time)
47042 MUST_USE_RES uint64_t Bolt11Invoice_timestamp(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47045 * Returns the `Bolt11Invoice`'s timestamp as a duration since the Unix epoch
47047 MUST_USE_RES uint64_t Bolt11Invoice_duration_since_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47050 * Returns the hash to which we will receive the preimage on completion of the payment
47052 MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32];
47055 * Get the payee's public key if one was included in the invoice
47057 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47059 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47062 * Get the payment secret if one was included in the invoice
47064 MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_secret(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32];
47067 * Get the payment metadata blob if one was included in the invoice
47069 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt11Invoice_payment_metadata(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47072 * Get the invoice features if they were included in the invoice
47074 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47076 MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11Invoice_features(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47079 * Recover the payee's public key (only to be used if none was included in the invoice)
47081 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_recover_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47084 * Returns the Duration since the Unix epoch at which the invoice expires.
47085 * Returning None if overflow occurred.
47087 MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_expires_at(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47090 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
47092 MUST_USE_RES uint64_t Bolt11Invoice_expiry_time(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47095 * Returns whether the invoice has expired.
47097 MUST_USE_RES bool Bolt11Invoice_is_expired(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47100 * Returns the Duration remaining until the invoice expires.
47102 MUST_USE_RES uint64_t Bolt11Invoice_duration_until_expiry(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47105 * Returns the Duration remaining until the invoice expires given the current time.
47106 * `time` is the timestamp as a duration since the Unix epoch.
47108 MUST_USE_RES uint64_t Bolt11Invoice_expiration_remaining_from_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t time);
47111 * Returns whether the expiry time would pass at the given point in time.
47112 * `at_time` is the timestamp as a duration since the Unix epoch.
47114 MUST_USE_RES bool Bolt11Invoice_would_expire(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t at_time);
47117 * Returns the invoice's `min_final_cltv_expiry_delta` time, if present, otherwise
47118 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA`].
47120 MUST_USE_RES uint64_t Bolt11Invoice_min_final_cltv_expiry_delta(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47123 * Returns a list of all fallback addresses as [`Address`]es
47125 MUST_USE_RES struct LDKCVec_StrZ Bolt11Invoice_fallback_addresses(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47128 * Returns a list of all routes included in the invoice
47130 MUST_USE_RES struct LDKCVec_PrivateRouteZ Bolt11Invoice_private_routes(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47133 * Returns a list of all routes included in the invoice as the underlying hints
47135 MUST_USE_RES struct LDKCVec_RouteHintZ Bolt11Invoice_route_hints(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47138 * Returns the currency for which the invoice was issued
47140 MUST_USE_RES enum LDKCurrency Bolt11Invoice_currency(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47143 * Returns the amount if specified in the invoice as millisatoshis.
47145 MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_amount_milli_satoshis(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
47148 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
47149 * returns [`CreationError::DescriptionTooLong`] otherwise
47151 * Please note that single characters may use more than one byte due to UTF8 encoding.
47153 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
47156 * Returns the underlying description [`String`]
47158 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
47161 * Construct an `ExpiryTime` from seconds.
47163 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds);
47166 * Construct an `ExpiryTime` from a [`Duration`], dropping the sub-second part.
47168 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_duration(uint64_t duration);
47171 * Returns the expiry time in seconds
47173 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
47176 * Returns a reference to the underlying [`Duration`] (=expiry time)
47178 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
47181 * Creates a new (partial) route from a list of hops
47183 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
47186 * Returns the underlying list of hops
47188 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
47191 * Creates a copy of the CreationError
47193 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
47196 * Utility method to constructs a new DescriptionTooLong-variant CreationError
47198 enum LDKCreationError CreationError_description_too_long(void);
47201 * Utility method to constructs a new RouteTooLong-variant CreationError
47203 enum LDKCreationError CreationError_route_too_long(void);
47206 * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
47208 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
47211 * Utility method to constructs a new InvalidAmount-variant CreationError
47213 enum LDKCreationError CreationError_invalid_amount(void);
47216 * Utility method to constructs a new MissingRouteHints-variant CreationError
47218 enum LDKCreationError CreationError_missing_route_hints(void);
47221 * Utility method to constructs a new MinFinalCltvExpiryDeltaTooShort-variant CreationError
47223 enum LDKCreationError CreationError_min_final_cltv_expiry_delta_too_short(void);
47226 * Checks if two CreationErrors contain equal inner contents.
47227 * This ignores pointers and is_owned flags and looks at the values in fields.
47229 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
47232 * Get the string representation of a CreationError object
47234 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
47237 * Creates a copy of the Bolt11SemanticError
47239 enum LDKBolt11SemanticError Bolt11SemanticError_clone(const enum LDKBolt11SemanticError *NONNULL_PTR orig);
47242 * Utility method to constructs a new NoPaymentHash-variant Bolt11SemanticError
47244 enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_hash(void);
47247 * Utility method to constructs a new MultiplePaymentHashes-variant Bolt11SemanticError
47249 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_hashes(void);
47252 * Utility method to constructs a new NoDescription-variant Bolt11SemanticError
47254 enum LDKBolt11SemanticError Bolt11SemanticError_no_description(void);
47257 * Utility method to constructs a new MultipleDescriptions-variant Bolt11SemanticError
47259 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_descriptions(void);
47262 * Utility method to constructs a new NoPaymentSecret-variant Bolt11SemanticError
47264 enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_secret(void);
47267 * Utility method to constructs a new MultiplePaymentSecrets-variant Bolt11SemanticError
47269 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_secrets(void);
47272 * Utility method to constructs a new InvalidFeatures-variant Bolt11SemanticError
47274 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_features(void);
47277 * Utility method to constructs a new InvalidRecoveryId-variant Bolt11SemanticError
47279 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_recovery_id(void);
47282 * Utility method to constructs a new InvalidSignature-variant Bolt11SemanticError
47284 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_signature(void);
47287 * Utility method to constructs a new ImpreciseAmount-variant Bolt11SemanticError
47289 enum LDKBolt11SemanticError Bolt11SemanticError_imprecise_amount(void);
47292 * Checks if two Bolt11SemanticErrors contain equal inner contents.
47293 * This ignores pointers and is_owned flags and looks at the values in fields.
47295 bool Bolt11SemanticError_eq(const enum LDKBolt11SemanticError *NONNULL_PTR a, const enum LDKBolt11SemanticError *NONNULL_PTR b);
47298 * Get the string representation of a Bolt11SemanticError object
47300 struct LDKStr Bolt11SemanticError_to_str(const enum LDKBolt11SemanticError *NONNULL_PTR o);
47303 * Frees any resources used by the SignOrCreationError
47305 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
47308 * Creates a copy of the SignOrCreationError
47310 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
47313 * Utility method to constructs a new SignError-variant SignOrCreationError
47315 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
47318 * Utility method to constructs a new CreationError-variant SignOrCreationError
47320 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
47323 * Checks if two SignOrCreationErrors contain equal inner contents.
47324 * This ignores pointers and is_owned flags and looks at the values in fields.
47326 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
47329 * Get the string representation of a SignOrCreationError object
47331 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
47334 * Pays the given [`Bolt11Invoice`], retrying if needed based on [`Retry`].
47336 * [`Bolt11Invoice::payment_hash`] is used as the [`PaymentId`], which ensures idempotency as long
47337 * as the payment is still pending. If the payment succeeds, you must ensure that a second payment
47338 * with the same [`PaymentHash`] is never sent.
47340 * If you wish to use a different payment idempotency token, see [`pay_invoice_with_id`].
47342 struct LDKCResult_ThirtyTwoBytesPaymentErrorZ pay_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
47345 * Pays the given [`Bolt11Invoice`] with a custom idempotency key, retrying if needed based on
47348 * Note that idempotency is only guaranteed as long as the payment is still pending. Once the
47349 * payment completes or fails, no idempotency guarantees are made.
47351 * You should ensure that the [`Bolt11Invoice::payment_hash`] is unique and the same
47352 * [`PaymentHash`] has never been paid before.
47354 * See [`pay_invoice`] for a variant which uses the [`PaymentHash`] for the idempotency token.
47356 struct LDKCResult_NonePaymentErrorZ pay_invoice_with_id(const struct LDKBolt11Invoice *NONNULL_PTR invoice, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
47359 * Pays the given zero-value [`Bolt11Invoice`] using the given amount, retrying if needed based on
47362 * [`Bolt11Invoice::payment_hash`] is used as the [`PaymentId`], which ensures idempotency as long
47363 * as the payment is still pending. If the payment succeeds, you must ensure that a second payment
47364 * with the same [`PaymentHash`] is never sent.
47366 * If you wish to use a different payment idempotency token, see
47367 * [`pay_zero_value_invoice_with_id`].
47369 struct LDKCResult_ThirtyTwoBytesPaymentErrorZ pay_zero_value_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msats, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
47372 * Pays the given zero-value [`Bolt11Invoice`] using the given amount and custom idempotency key,
47373 * retrying if needed based on [`Retry`].
47375 * Note that idempotency is only guaranteed as long as the payment is still pending. Once the
47376 * payment completes or fails, no idempotency guarantees are made.
47378 * You should ensure that the [`Bolt11Invoice::payment_hash`] is unique and the same
47379 * [`PaymentHash`] has never been paid before.
47381 * See [`pay_zero_value_invoice`] for a variant which uses the [`PaymentHash`] for the
47382 * idempotency token.
47384 struct LDKCResult_NonePaymentErrorZ pay_zero_value_invoice_with_id(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msats, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
47387 * Sends payment probes over all paths of a route that would be used to pay the given invoice.
47389 * See [`ChannelManager::send_preflight_probes`] for more information.
47391 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ preflight_probe_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKCOption_u64Z liquidity_limit_multiplier);
47394 * Sends payment probes over all paths of a route that would be used to pay the given zero-value
47395 * invoice using the given amount.
47397 * See [`ChannelManager::send_preflight_probes`] for more information.
47399 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ preflight_probe_zero_value_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msat, const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKCOption_u64Z liquidity_limit_multiplier);
47402 * Frees any resources used by the PaymentError
47404 void PaymentError_free(struct LDKPaymentError this_ptr);
47407 * Creates a copy of the PaymentError
47409 struct LDKPaymentError PaymentError_clone(const struct LDKPaymentError *NONNULL_PTR orig);
47412 * Utility method to constructs a new Invoice-variant PaymentError
47414 struct LDKPaymentError PaymentError_invoice(struct LDKStr a);
47417 * Utility method to constructs a new Sending-variant PaymentError
47419 struct LDKPaymentError PaymentError_sending(enum LDKRetryableSendFailure a);
47422 * Checks if two PaymentErrors contain equal inner contents.
47423 * This ignores pointers and is_owned flags and looks at the values in fields.
47425 bool PaymentError_eq(const struct LDKPaymentError *NONNULL_PTR a, const struct LDKPaymentError *NONNULL_PTR b);
47428 * Frees any resources used by the ProbingError
47430 void ProbingError_free(struct LDKProbingError this_ptr);
47433 * Creates a copy of the ProbingError
47435 struct LDKProbingError ProbingError_clone(const struct LDKProbingError *NONNULL_PTR orig);
47438 * Utility method to constructs a new Invoice-variant ProbingError
47440 struct LDKProbingError ProbingError_invoice(struct LDKStr a);
47443 * Utility method to constructs a new Sending-variant ProbingError
47445 struct LDKProbingError ProbingError_sending(struct LDKProbeSendFailure a);
47448 * Checks if two ProbingErrors contain equal inner contents.
47449 * This ignores pointers and is_owned flags and looks at the values in fields.
47451 bool ProbingError_eq(const struct LDKProbingError *NONNULL_PTR a, const struct LDKProbingError *NONNULL_PTR b);
47454 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
47455 * See [`PhantomKeysManager`] for more information on phantom node payments.
47457 * `phantom_route_hints` parameter:
47458 * * Contains channel info for all nodes participating in the phantom invoice
47459 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
47460 * participating node
47461 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
47462 * updated when a channel becomes disabled or closes
47463 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
47464 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
47467 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
47468 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
47469 * If `None` is provided for `payment_hash`, then one will be created.
47471 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
47472 * in excess of the current time.
47474 * `duration_since_epoch` is the current time since epoch in seconds.
47476 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
47477 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`] - 3.
47478 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
47479 * confirmations during routing.
47481 * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
47482 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
47485 * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
47486 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
47487 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
47488 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
47489 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
47490 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
47492 * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
47493 * available and the current time is supplied by the caller.
47495 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);
47498 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
47499 * See [`PhantomKeysManager`] for more information on phantom node payments.
47501 * `phantom_route_hints` parameter:
47502 * * Contains channel info for all nodes participating in the phantom invoice
47503 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
47504 * participating node
47505 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
47506 * updated when a channel becomes disabled or closes
47507 * * Note that the route hints generated from `phantom_route_hints` will be limited to a maximum
47508 * of 3 hints to ensure that the invoice can be scanned in a QR code. These hints are selected
47509 * in the order that the nodes in `PhantomRouteHints` are specified, selecting one hint per node
47510 * until the maximum is hit. Callers may provide as many `PhantomRouteHints::channels` as
47511 * desired, but note that some nodes will be trimmed if more than 3 nodes are provided.
47513 * `description_hash` is a SHA-256 hash of the description text
47515 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
47516 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
47517 * If `None` is provided for `payment_hash`, then one will be created.
47519 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
47520 * in excess of the current time.
47522 * `duration_since_epoch` is the current time since epoch in seconds.
47524 * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
47525 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
47528 * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
47529 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
47530 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
47531 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
47532 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
47534 * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
47535 * available and the current time is supplied by the caller.
47537 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);
47540 * Utility to construct an invoice. Generally, unless you want to do something like a custom
47541 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
47542 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
47543 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
47544 * that the payment secret is valid when the invoice is paid.
47546 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
47547 * in excess of the current time.
47549 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
47550 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
47551 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
47552 * confirmations during routing.
47554 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
47556 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);
47559 * Utility to construct an invoice. Generally, unless you want to do something like a custom
47560 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
47561 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
47562 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
47563 * that the payment secret is valid when the invoice is paid.
47564 * Use this variant if you want to pass the `description_hash` to the invoice.
47566 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
47567 * in excess of the current time.
47569 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
47570 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
47571 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
47572 * confirmations during routing.
47574 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
47576 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);
47579 * See [`create_invoice_from_channelmanager_with_description_hash`]
47580 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
47581 * available and the current time is supplied by the caller.
47583 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);
47586 * See [`create_invoice_from_channelmanager`]
47587 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
47588 * available and the current time is supplied by the caller.
47590 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);
47593 * See [`create_invoice_from_channelmanager_and_duration_since_epoch`]
47594 * This version allows for providing a custom [`PaymentHash`] for the invoice.
47595 * This may be useful if you're building an on-chain swap or involving another protocol where
47596 * the payment hash is also involved outside the scope of lightning.
47598 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);
47601 * Read a SiPrefix object from a string
47603 struct LDKCResult_SiPrefixBolt11ParseErrorZ SiPrefix_from_str(struct LDKStr s);
47606 * Read a Bolt11Invoice object from a string
47608 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ Bolt11Invoice_from_str(struct LDKStr s);
47611 * Read a SignedRawBolt11Invoice object from a string
47613 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ SignedRawBolt11Invoice_from_str(struct LDKStr s);
47616 * Get the string representation of a Bolt11ParseError object
47618 struct LDKStr Bolt11ParseError_to_str(const struct LDKBolt11ParseError *NONNULL_PTR o);
47621 * Get the string representation of a ParseOrSemanticError object
47623 struct LDKStr ParseOrSemanticError_to_str(const struct LDKParseOrSemanticError *NONNULL_PTR o);
47626 * Get the string representation of a Bolt11Invoice object
47628 struct LDKStr Bolt11Invoice_to_str(const struct LDKBolt11Invoice *NONNULL_PTR o);
47631 * Get the string representation of a SignedRawBolt11Invoice object
47633 struct LDKStr SignedRawBolt11Invoice_to_str(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o);
47636 * Get the string representation of a Currency object
47638 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
47641 * Get the string representation of a SiPrefix object
47643 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
47646 * Frees any resources used by the RapidGossipSync, if is_owned is set and inner is non-NULL.
47648 void RapidGossipSync_free(struct LDKRapidGossipSync this_obj);
47651 * Instantiate a new [`RapidGossipSync`] instance.
47653 MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
47656 * Sync gossip data from a file.
47657 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
47659 * `network_graph`: The network graph to apply the updates to
47661 * `sync_path`: Path to the file where the gossip update data is located
47664 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_sync_network_graph_with_file_path(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKStr sync_path);
47667 * Update network graph from binary data.
47668 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
47670 * `update_data`: `&[u8]` binary stream that comprises the update data
47672 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data);
47675 * Update network graph from binary data.
47676 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
47678 * `update_data`: `&[u8]` binary stream that comprises the update data
47679 * `current_time_unix`: `Option<u64>` optional current timestamp to verify data age
47681 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);
47684 * Returns whether a rapid gossip sync has completed at least once.
47686 MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg);
47689 * Frees any resources used by the GraphSyncError
47691 void GraphSyncError_free(struct LDKGraphSyncError this_ptr);
47694 * Creates a copy of the GraphSyncError
47696 struct LDKGraphSyncError GraphSyncError_clone(const struct LDKGraphSyncError *NONNULL_PTR orig);
47699 * Utility method to constructs a new DecodeError-variant GraphSyncError
47701 struct LDKGraphSyncError GraphSyncError_decode_error(struct LDKDecodeError a);
47704 * Utility method to constructs a new LightningError-variant GraphSyncError
47706 struct LDKGraphSyncError GraphSyncError_lightning_error(struct LDKLightningError a);
47708 #endif /* LDK_C_BINDINGS_H */
47710 #include "ldk_ver.h"