1 #ifndef LDK_C_BINDINGS_H
2 #define LDK_C_BINDINGS_H
4 /* Generated with cbindgen:0.24.5 */
6 /* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */
11 #include "ldk_rust_types.h"
14 * Whether this blinded HTLC is being failed backwards by the introduction node or a blinded node,
15 * which determines the failure message that should be used.
17 typedef enum LDKBlindedFailure {
19 * This HTLC is being failed backwards by the introduction node, and thus should be failed with
20 * [`msgs::UpdateFailHTLC`] and error code `0x8000|0x4000|24`.
22 LDKBlindedFailure_FromIntroductionNode,
24 * This HTLC is being failed backwards by a blinded node within the path, and thus should be
25 * failed with [`msgs::UpdateFailMalformedHTLC`] and error code `0x8000|0x4000|24`.
27 LDKBlindedFailure_FromBlindedNode,
29 * Must be last for serialization purposes
31 LDKBlindedFailure_Sentinel,
35 * Errors that may occur when converting a [`RawBolt11Invoice`] to a [`Bolt11Invoice`]. They relate to
36 * the requirements sections in BOLT #11
38 typedef enum LDKBolt11SemanticError {
40 * The invoice is missing the mandatory payment hash
42 LDKBolt11SemanticError_NoPaymentHash,
44 * The invoice has multiple payment hashes which isn't allowed
46 LDKBolt11SemanticError_MultiplePaymentHashes,
48 * No description or description hash are part of the invoice
50 LDKBolt11SemanticError_NoDescription,
52 * The invoice contains multiple descriptions and/or description hashes which isn't allowed
54 LDKBolt11SemanticError_MultipleDescriptions,
56 * The invoice is missing the mandatory payment secret, which all modern lightning nodes
59 LDKBolt11SemanticError_NoPaymentSecret,
61 * The invoice contains multiple payment secrets
63 LDKBolt11SemanticError_MultiplePaymentSecrets,
65 * The invoice's features are invalid
67 LDKBolt11SemanticError_InvalidFeatures,
69 * The recovery id doesn't fit the signature/pub key
71 LDKBolt11SemanticError_InvalidRecoveryId,
73 * The invoice's signature is invalid
75 LDKBolt11SemanticError_InvalidSignature,
77 * The invoice's amount was not a whole number of millisatoshis
79 LDKBolt11SemanticError_ImpreciseAmount,
81 * Must be last for serialization purposes
83 LDKBolt11SemanticError_Sentinel,
84 } LDKBolt11SemanticError;
87 * Error when interpreting a TLV stream as a specific type.
89 typedef enum LDKBolt12SemanticError {
91 * The current [`std::time::SystemTime`] is past the offer or invoice's expiration.
93 LDKBolt12SemanticError_AlreadyExpired,
95 * The provided chain hash does not correspond to a supported chain.
97 LDKBolt12SemanticError_UnsupportedChain,
99 * A chain was provided but was not expected.
101 LDKBolt12SemanticError_UnexpectedChain,
103 * An amount was expected but was missing.
105 LDKBolt12SemanticError_MissingAmount,
107 * The amount exceeded the total bitcoin supply.
109 LDKBolt12SemanticError_InvalidAmount,
111 * An amount was provided but was not sufficient in value.
113 LDKBolt12SemanticError_InsufficientAmount,
115 * An amount was provided but was not expected.
117 LDKBolt12SemanticError_UnexpectedAmount,
119 * A currency was provided that is not supported.
121 LDKBolt12SemanticError_UnsupportedCurrency,
123 * A feature was required but is unknown.
125 LDKBolt12SemanticError_UnknownRequiredFeatures,
127 * Features were provided but were not expected.
129 LDKBolt12SemanticError_UnexpectedFeatures,
131 * A required description was not provided.
133 LDKBolt12SemanticError_MissingDescription,
135 * A signing pubkey was not provided.
137 LDKBolt12SemanticError_MissingSigningPubkey,
139 * A signing pubkey was provided but a different one was expected.
141 LDKBolt12SemanticError_InvalidSigningPubkey,
143 * A signing pubkey was provided but was not expected.
145 LDKBolt12SemanticError_UnexpectedSigningPubkey,
147 * A quantity was expected but was missing.
149 LDKBolt12SemanticError_MissingQuantity,
151 * An unsupported quantity was provided.
153 LDKBolt12SemanticError_InvalidQuantity,
155 * A quantity or quantity bounds was provided but was not expected.
157 LDKBolt12SemanticError_UnexpectedQuantity,
159 * Metadata could not be used to verify the offers message.
161 LDKBolt12SemanticError_InvalidMetadata,
163 * Metadata was provided but was not expected.
165 LDKBolt12SemanticError_UnexpectedMetadata,
167 * Payer metadata was expected but was missing.
169 LDKBolt12SemanticError_MissingPayerMetadata,
171 * A payer id was expected but was missing.
173 LDKBolt12SemanticError_MissingPayerId,
175 * The payment id for a refund or request is already in use.
177 LDKBolt12SemanticError_DuplicatePaymentId,
179 * Blinded paths were expected but were missing.
181 LDKBolt12SemanticError_MissingPaths,
183 * Blinded paths were provided but were not expected.
185 LDKBolt12SemanticError_UnexpectedPaths,
187 * The blinded payinfo given does not match the number of blinded path hops.
189 LDKBolt12SemanticError_InvalidPayInfo,
191 * An invoice creation time was expected but was missing.
193 LDKBolt12SemanticError_MissingCreationTime,
195 * An invoice payment hash was expected but was missing.
197 LDKBolt12SemanticError_MissingPaymentHash,
199 * A signature was expected but was missing.
201 LDKBolt12SemanticError_MissingSignature,
203 * Must be last for serialization purposes
205 LDKBolt12SemanticError_Sentinel,
206 } LDKBolt12SemanticError;
209 * An enum which can either contain a or not
211 typedef enum LDKCOption_NoneZ {
213 * When we're in this state, this COption_NoneZ contains a
215 LDKCOption_NoneZ_Some,
217 * When we're in this state, this COption_NoneZ contains nothing
219 LDKCOption_NoneZ_None,
221 * Must be last for serialization purposes
223 LDKCOption_NoneZ_Sentinel,
227 * An enum representing the status of a channel monitor update persistence.
229 * These are generally used as the return value for an implementation of [`Persist`] which is used
230 * as the storage layer for a [`ChainMonitor`]. See the docs on [`Persist`] for a high-level
231 * explanation of how to handle different cases.
233 * While `UnrecoverableError` is provided as a failure variant, it is not truly \"handled\" on the
234 * calling side, and generally results in an immediate panic. For those who prefer to avoid
235 * panics, `InProgress` can be used and you can retry the update operation in the background or
238 * Note that channels should generally *not* be force-closed after a persistence failure.
239 * Force-closing with the latest [`ChannelMonitorUpdate`] applied may result in a transaction
240 * being broadcast which can only be spent by the latest [`ChannelMonitor`]! Thus, if the
241 * latest [`ChannelMonitor`] is not durably persisted anywhere and exists only in memory, naively
242 * calling [`ChannelManager::force_close_broadcasting_latest_txn`] *may result in loss of funds*!
244 * [`Persist`]: chainmonitor::Persist
245 * [`ChainMonitor`]: chainmonitor::ChainMonitor
246 * [`ChannelManager::force_close_broadcasting_latest_txn`]: crate::ln::channelmanager::ChannelManager::force_close_broadcasting_latest_txn
248 typedef enum LDKChannelMonitorUpdateStatus {
250 * The update has been durably persisted and all copies of the relevant [`ChannelMonitor`]
253 * This includes performing any `fsync()` calls required to ensure the update is guaranteed to
254 * be available on restart even if the application crashes.
256 LDKChannelMonitorUpdateStatus_Completed,
258 * Indicates that the update will happen asynchronously in the background or that a transient
259 * failure occurred which is being retried in the background and will eventually complete.
261 * This will \"freeze\" a channel, preventing us from revoking old states or submitting a new
262 * commitment transaction to the counterparty. Once the update(s) which are `InProgress` have
263 * been completed, a [`MonitorEvent::Completed`] can be used to restore the channel to an
266 * Even when a channel has been \"frozen\", updates to the [`ChannelMonitor`] can continue to
267 * occur (e.g. if an inbound HTLC which we forwarded was claimed upstream, resulting in us
268 * attempting to claim it on this channel) and those updates must still be persisted.
270 * No updates to the channel will be made which could invalidate other [`ChannelMonitor`]s
271 * until a [`MonitorEvent::Completed`] is provided, even if you return no error on a later
272 * monitor update for the same channel.
274 * For deployments where a copy of [`ChannelMonitor`]s and other local state are backed up in
275 * a remote location (with local copies persisted immediately), it is anticipated that all
276 * updates will return [`InProgress`] until the remote copies could be updated.
278 * Note that while fully asynchronous persistence of [`ChannelMonitor`] data is generally
279 * reliable, this feature is considered beta, and a handful of edge-cases remain. Until the
280 * remaining cases are fixed, in rare cases, *using this feature may lead to funds loss*.
282 * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
284 LDKChannelMonitorUpdateStatus_InProgress,
286 * Indicates that an update has failed and will not complete at any point in the future.
288 * Currently returning this variant will cause LDK to immediately panic to encourage immediate
289 * shutdown. In the future this may be updated to disconnect peers and refuse to continue
290 * normal operation without a panic.
292 * Applications which wish to perform an orderly shutdown after failure should consider
293 * returning [`InProgress`] instead and simply shut down without ever marking the update
296 * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
298 LDKChannelMonitorUpdateStatus_UnrecoverableError,
300 * Must be last for serialization purposes
302 LDKChannelMonitorUpdateStatus_Sentinel,
303 } LDKChannelMonitorUpdateStatus;
306 * Further information on the details of the channel shutdown.
307 * Upon channels being forced closed (i.e. commitment transaction confirmation detected
308 * by `ChainMonitor`), ChannelShutdownState will be set to `ShutdownComplete` or
309 * the channel will be removed shortly.
310 * Also note, that in normal operation, peers could disconnect at any of these states
311 * and require peer re-connection before making progress onto other states
313 typedef enum LDKChannelShutdownState {
315 * Channel has not sent or received a shutdown message.
317 LDKChannelShutdownState_NotShuttingDown,
319 * Local node has sent a shutdown message for this channel.
321 LDKChannelShutdownState_ShutdownInitiated,
323 * Shutdown message exchanges have concluded and the channels are in the midst of
324 * resolving all existing open HTLCs before closing can continue.
326 LDKChannelShutdownState_ResolvingHTLCs,
328 * All HTLCs have been resolved, nodes are currently negotiating channel close onchain fee rates.
330 LDKChannelShutdownState_NegotiatingClosingFee,
332 * We've successfully negotiated a closing_signed dance. At this point `ChannelManager` is about
333 * to drop the channel.
335 LDKChannelShutdownState_ShutdownComplete,
337 * Must be last for serialization purposes
339 LDKChannelShutdownState_Sentinel,
340 } LDKChannelShutdownState;
343 * An enum that represents the priority at which we want a transaction to confirm used for feerate
346 typedef enum LDKConfirmationTarget {
348 * We have some funds available on chain which we need to spend prior to some expiry time at
349 * which point our counterparty may be able to steal them. Generally we have in the high tens
350 * to low hundreds of blocks to get our transaction on-chain, but we shouldn't risk too low a
351 * fee - this should be a relatively high priority feerate.
353 LDKConfirmationTarget_OnChainSweep,
355 * This is the lowest feerate we will allow our channel counterparty to have in an anchor
356 * channel in order to close the channel if a channel party goes away.
358 * This needs to be sufficient to get into the mempool when the channel needs to
359 * be force-closed. Setting too high may result in force-closures if our counterparty attempts
360 * to use a lower feerate. Because this is for anchor channels, we can always bump the feerate
361 * later; the feerate here only needs to be sufficient to enter the mempool.
363 * A good estimate is the expected mempool minimum at the time of force-closure. Obviously this
364 * is not an estimate which is very easy to calculate because we do not know the future. Using
365 * a simple long-term fee estimate or tracking of the mempool minimum is a good approach to
366 * ensure you can always close the channel. A future change to Bitcoin's P2P network
367 * (package relay) may obviate the need for this entirely.
369 LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee,
371 * The lowest feerate we will allow our channel counterparty to have in a non-anchor channel.
373 * This is the feerate on the transaction which we (or our counterparty) will broadcast in
374 * order to close the channel if a channel party goes away. Setting this value too high will
375 * cause immediate force-closures in order to avoid having an unbroadcastable state.
377 * This feerate represents the fee we pick now, which must be sufficient to enter a block at an
378 * arbitrary time in the future. Obviously this is not an estimate which is very easy to
379 * calculate. This can leave channels subject to being unable to close if feerates rise, and in
380 * general you should prefer anchor channels to ensure you can increase the feerate when the
381 * transactions need broadcasting.
383 * Do note some fee estimators round up to the next full sat/vbyte (ie 250 sats per kw),
384 * causing occasional issues with feerate disagreements between an initiator that wants a
385 * feerate of 1.1 sat/vbyte and a receiver that wants 1.1 rounded up to 2. If your fee
386 * estimator rounds subtracting 250 to your desired feerate here can help avoid this issue.
388 * [`ChannelConfig::max_dust_htlc_exposure`]: crate::util::config::ChannelConfig::max_dust_htlc_exposure
390 LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee,
392 * This is the feerate on the transaction which we (or our counterparty) will broadcast in
393 * order to close the channel if a channel party goes away.
395 * This needs to be sufficient to get into the mempool when the channel needs to
396 * be force-closed. Setting too low may result in force-closures. Because this is for anchor
397 * channels, it can be a low value as we can always bump the feerate later.
399 * A good estimate is the expected mempool minimum at the time of force-closure. Obviously this
400 * is not an estimate which is very easy to calculate because we do not know the future. Using
401 * a simple long-term fee estimate or tracking of the mempool minimum is a good approach to
402 * ensure you can always close the channel. A future change to Bitcoin's P2P network
403 * (package relay) may obviate the need for this entirely.
405 LDKConfirmationTarget_AnchorChannelFee,
407 * Lightning is built around the ability to broadcast a transaction in the future to close our
408 * channel and claim all pending funds. In order to do so, non-anchor channels are built with
409 * transactions which we need to be able to broadcast at some point in the future.
411 * This feerate represents the fee we pick now, which must be sufficient to enter a block at an
412 * arbitrary time in the future. Obviously this is not an estimate which is very easy to
413 * calculate, so most lightning nodes use some relatively high-priority feerate using the
414 * current mempool. This leaves channels subject to being unable to close if feerates rise, and
415 * in general you should prefer anchor channels to ensure you can increase the feerate when the
416 * transactions need broadcasting.
418 * Since this should represent the feerate of a channel close that does not need fee
419 * bumping, this is also used as an upper bound for our attempted feerate when doing cooperative
420 * closure of any channel.
422 LDKConfirmationTarget_NonAnchorChannelFee,
424 * When cooperatively closing a channel, this is the minimum feerate we will accept.
425 * Recommended at least within a day or so worth of blocks.
427 * This will also be used when initiating a cooperative close of a channel. When closing a
428 * channel you can override this fee by using
429 * [`ChannelManager::close_channel_with_feerate_and_script`].
431 * [`ChannelManager::close_channel_with_feerate_and_script`]: crate::ln::channelmanager::ChannelManager::close_channel_with_feerate_and_script
433 LDKConfirmationTarget_ChannelCloseMinimum,
435 * The feerate [`OutputSweeper`] will use on transactions spending
436 * [`SpendableOutputDescriptor`]s after a channel closure.
438 * Generally spending these outputs is safe as long as they eventually confirm, so a value
439 * (slightly above) the mempool minimum should suffice. However, as this value will influence
440 * how long funds will be unavailable after channel closure, [`FeeEstimator`] implementors
441 * might want to choose a higher feerate to regain control over funds faster.
443 * [`OutputSweeper`]: crate::util::sweep::OutputSweeper
444 * [`SpendableOutputDescriptor`]: crate::sign::SpendableOutputDescriptor
446 LDKConfirmationTarget_OutputSpendingFee,
448 * Must be last for serialization purposes
450 LDKConfirmationTarget_Sentinel,
451 } LDKConfirmationTarget;
454 * Errors that may occur when constructing a new [`RawBolt11Invoice`] or [`Bolt11Invoice`]
456 typedef enum LDKCreationError {
458 * The supplied description string was longer than 639 __bytes__ (see [`Description::new`])
460 LDKCreationError_DescriptionTooLong,
462 * The specified route has too many hops and can't be encoded
464 LDKCreationError_RouteTooLong,
466 * The Unix timestamp of the supplied date is less than zero or greater than 35-bits
468 LDKCreationError_TimestampOutOfBounds,
470 * The supplied millisatoshi amount was greater than the total bitcoin supply.
472 LDKCreationError_InvalidAmount,
474 * Route hints were required for this invoice and were missing. Applies to
475 * [phantom invoices].
477 * [phantom invoices]: crate::utils::create_phantom_invoice
479 LDKCreationError_MissingRouteHints,
481 * The provided `min_final_cltv_expiry_delta` was less than [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
483 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
485 LDKCreationError_MinFinalCltvExpiryDeltaTooShort,
487 * Must be last for serialization purposes
489 LDKCreationError_Sentinel,
493 * Enum representing the crypto currencies (or networks) supported by this library
495 typedef enum LDKCurrency {
503 LDKCurrency_BitcoinTestnet,
517 * Must be last for serialization purposes
519 LDKCurrency_Sentinel,
523 * The side of a channel that is the [`IntroductionNode`] in a [`BlindedPath`]. [BOLT 7] defines
524 * which nodes is which in the [`ChannelAnnouncement`] message.
526 * [BOLT 7]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
527 * [`ChannelAnnouncement`]: crate::ln::msgs::ChannelAnnouncement
529 typedef enum LDKDirection {
531 * The lesser node id when compared lexicographically in ascending order.
533 LDKDirection_NodeOne,
535 * The greater node id when compared lexicographically in ascending order.
537 LDKDirection_NodeTwo,
539 * Must be last for serialization purposes
541 LDKDirection_Sentinel,
545 * Describes the type of HTLC claim as determined by analyzing the witness.
547 typedef enum LDKHTLCClaim {
549 * Claims an offered output on a commitment transaction through the timeout path.
551 LDKHTLCClaim_OfferedTimeout,
553 * Claims an offered output on a commitment transaction through the success path.
555 LDKHTLCClaim_OfferedPreimage,
557 * Claims an accepted output on a commitment transaction through the timeout path.
559 LDKHTLCClaim_AcceptedTimeout,
561 * Claims an accepted output on a commitment transaction through the success path.
563 LDKHTLCClaim_AcceptedPreimage,
565 * Claims an offered/accepted output on a commitment transaction through the revocation path.
567 LDKHTLCClaim_Revocation,
569 * Must be last for serialization purposes
571 LDKHTLCClaim_Sentinel,
575 * Represents an IO Error. Note that some information is lost in the conversion from Rust.
577 typedef enum LDKIOError {
579 LDKIOError_PermissionDenied,
580 LDKIOError_ConnectionRefused,
581 LDKIOError_ConnectionReset,
582 LDKIOError_ConnectionAborted,
583 LDKIOError_NotConnected,
584 LDKIOError_AddrInUse,
585 LDKIOError_AddrNotAvailable,
586 LDKIOError_BrokenPipe,
587 LDKIOError_AlreadyExists,
588 LDKIOError_WouldBlock,
589 LDKIOError_InvalidInput,
590 LDKIOError_InvalidData,
592 LDKIOError_WriteZero,
593 LDKIOError_Interrupted,
595 LDKIOError_UnexpectedEof,
597 * Must be last for serialization purposes
603 * An enum representing the available verbosity levels of the logger.
605 typedef enum LDKLevel {
607 * Designates extremely verbose information, including gossip-induced messages
611 * Designates very low priority, often extremely verbose, information
615 * Designates lower priority information
619 * Designates useful information
623 * Designates hazardous situations
627 * Designates very serious errors
631 * Must be last for serialization purposes
637 * An enum representing the possible Bitcoin or test networks which we can run on
639 typedef enum LDKNetwork {
641 * The main Bitcoin blockchain.
645 * The testnet3 blockchain.
649 * A local test blockchain.
653 * A blockchain on which blocks are signed instead of mined.
657 * Must be last for serialization purposes
663 * The reason the payment failed. Used in [`Event::PaymentFailed`].
665 typedef enum LDKPaymentFailureReason {
667 * The intended recipient rejected our payment.
669 LDKPaymentFailureReason_RecipientRejected,
671 * The user chose to abandon this payment by calling [`ChannelManager::abandon_payment`].
673 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
675 LDKPaymentFailureReason_UserAbandoned,
677 * We exhausted all of our retry attempts while trying to send the payment, or we
678 * exhausted the [`Retry::Timeout`] if the user set one. If at any point a retry
679 * attempt failed while being forwarded along the path, an [`Event::PaymentPathFailed`] will
680 * have come before this.
682 * [`Retry::Timeout`]: crate::ln::channelmanager::Retry::Timeout
684 LDKPaymentFailureReason_RetriesExhausted,
686 * The payment expired while retrying, based on the provided
687 * [`PaymentParameters::expiry_time`].
689 * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
691 LDKPaymentFailureReason_PaymentExpired,
693 * We failed to find a route while retrying the payment.
695 * Note that this generally indicates that we've exhausted the available set of possible
696 * routes - we tried the payment over a few routes but were not able to find any further
697 * candidate routes beyond those.
699 LDKPaymentFailureReason_RouteNotFound,
701 * This error should generally never happen. This likely means that there is a problem with
704 LDKPaymentFailureReason_UnexpectedError,
706 * Must be last for serialization purposes
708 LDKPaymentFailureReason_Sentinel,
709 } LDKPaymentFailureReason;
712 * Specifies the recipient of an invoice.
714 * This indicates to [`NodeSigner::sign_invoice`] what node secret key should be used to sign
717 typedef enum LDKRecipient {
719 * The invoice should be signed with the local node secret key.
723 * The invoice should be signed with the phantom node secret key. This secret key must be the
724 * same for all nodes participating in the [phantom node payment].
726 * [phantom node payment]: PhantomKeysManager
728 LDKRecipient_PhantomNode,
730 * Must be last for serialization purposes
732 LDKRecipient_Sentinel,
736 * Indicates an immediate error on [`ChannelManager::send_payment`]. Further errors may be
737 * surfaced later via [`Event::PaymentPathFailed`] and [`Event::PaymentFailed`].
739 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
740 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
741 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
743 typedef enum LDKRetryableSendFailure {
745 * The provided [`PaymentParameters::expiry_time`] indicated that the payment has expired. Note
746 * that this error is *not* caused by [`Retry::Timeout`].
748 * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
750 LDKRetryableSendFailure_PaymentExpired,
752 * We were unable to find a route to the destination.
754 LDKRetryableSendFailure_RouteNotFound,
756 * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
757 * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
759 * [`PaymentId`]: crate::ln::channelmanager::PaymentId
760 * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
761 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
763 LDKRetryableSendFailure_DuplicatePayment,
765 * Must be last for serialization purposes
767 LDKRetryableSendFailure_Sentinel,
768 } LDKRetryableSendFailure;
771 * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
773 typedef enum LDKSecp256k1Error {
775 * Signature failed verification
777 LDKSecp256k1Error_IncorrectSignature,
779 * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
781 LDKSecp256k1Error_InvalidMessage,
785 LDKSecp256k1Error_InvalidPublicKey,
789 LDKSecp256k1Error_InvalidSignature,
793 LDKSecp256k1Error_InvalidSecretKey,
797 LDKSecp256k1Error_InvalidSharedSecret,
801 LDKSecp256k1Error_InvalidRecoveryId,
803 * Invalid tweak for add_assign or mul_assign
805 LDKSecp256k1Error_InvalidTweak,
807 * Didn't pass enough memory to context creation with preallocated memory
809 LDKSecp256k1Error_NotEnoughMemory,
811 * Bad set of public keys.
813 LDKSecp256k1Error_InvalidPublicKeySum,
815 * The only valid parity values are 0 or 1.
817 LDKSecp256k1Error_InvalidParityValue,
819 * Must be last for serialization purposes
821 LDKSecp256k1Error_Sentinel,
825 * A `short_channel_id` construction error
827 typedef enum LDKShortChannelIdError {
829 * Block height too high
831 LDKShortChannelIdError_BlockOverflow,
835 LDKShortChannelIdError_TxIndexOverflow,
837 * Vout index too high
839 LDKShortChannelIdError_VoutIndexOverflow,
841 * Must be last for serialization purposes
843 LDKShortChannelIdError_Sentinel,
844 } LDKShortChannelIdError;
847 * SI prefixes for the human readable part
849 typedef enum LDKSiPrefix {
867 * Must be last for serialization purposes
869 LDKSiPrefix_Sentinel,
873 * [`SocketAddress`] error variants
875 typedef enum LDKSocketAddressParseError {
877 * Socket address (IPv4/IPv6) parsing error
879 LDKSocketAddressParseError_SocketAddrParse,
881 * Invalid input format
883 LDKSocketAddressParseError_InvalidInput,
887 LDKSocketAddressParseError_InvalidPort,
889 * Invalid onion v3 address
891 LDKSocketAddressParseError_InvalidOnionV3,
893 * Must be last for serialization purposes
895 LDKSocketAddressParseError_Sentinel,
896 } LDKSocketAddressParseError;
899 * An error when accessing the chain via [`UtxoLookup`].
901 typedef enum LDKUtxoLookupError {
903 * The requested chain is unknown.
905 LDKUtxoLookupError_UnknownChain,
907 * The requested transaction doesn't exist or hasn't confirmed.
909 LDKUtxoLookupError_UnknownTx,
911 * Must be last for serialization purposes
913 LDKUtxoLookupError_Sentinel,
914 } LDKUtxoLookupError;
917 * A Rust str object, ie a reference to a UTF8-valid string.
918 * This is *not* null-terminated so cannot be used directly as a C string!
920 typedef struct LDKStr {
922 * A pointer to the string's bytes, in UTF8 encoding
924 const uint8_t *chars;
926 * The number of bytes (not characters!) pointed to by `chars`
930 * Whether the data pointed to by `chars` should be freed or not.
936 * A 16-byte byte array.
938 typedef struct LDKSixteenBytes {
946 * Unsigned, 128-bit integer.
948 * Because LLVM implements an incorrect ABI for 128-bit integers, a wrapper type is defined here.
949 * See https://github.com/rust-lang/rust/issues/54341 for more details.
951 typedef struct LDKU128 {
953 * The 128-bit integer, as 16 little-endian bytes
955 uint8_t le_bytes[16];
959 * Integer in the range `0..=16`
961 typedef struct LDKWitnessVersion {
966 * A dynamically-allocated array of u8s of arbitrary size.
967 * This corresponds to std::vector in C++
969 typedef struct LDKCVec_u8Z {
971 * The elements in the array.
972 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
976 * The number of elements pointed to by `data`.
982 * A segregated witness version byte and script bytes
984 typedef struct LDKWitnessProgram {
985 struct LDKWitnessVersion version;
986 struct LDKCVec_u8Z program;
990 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
991 * own the memory pointed to by data.
993 typedef struct LDKu8slice {
995 * A pointer to the byte buffer
999 * The number of bytes pointed to by `data`.
1005 * Represents a scalar value between zero and the secp256k1 curve order, in big endian.
1007 typedef struct LDKBigEndianScalar {
1009 * The bytes of the scalar value.
1011 uint8_t big_endian_bytes[32];
1012 } LDKBigEndianScalar;
1015 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
1016 * look up the corresponding function in rust-lightning's docs.
1018 typedef struct LDKThirtyTwoBytes {
1020 * The thirty-two bytes
1023 } LDKThirtyTwoBytes;
1026 * Represents an error returned from the bech32 library during validation of some bech32 data
1028 typedef enum LDKBech32Error_Tag {
1030 * String does not contain the separator character
1032 LDKBech32Error_MissingSeparator,
1034 * The checksum does not match the rest of the data
1036 LDKBech32Error_InvalidChecksum,
1038 * The data or human-readable part is too long or too short
1040 LDKBech32Error_InvalidLength,
1042 * Some part of the string contains an invalid character
1044 LDKBech32Error_InvalidChar,
1046 * Some part of the data has an invalid value
1048 LDKBech32Error_InvalidData,
1050 * The bit conversion failed due to a padding issue
1052 LDKBech32Error_InvalidPadding,
1054 * The whole string must be of one case
1056 LDKBech32Error_MixedCase,
1058 * Must be last for serialization purposes
1060 LDKBech32Error_Sentinel,
1061 } LDKBech32Error_Tag;
1063 typedef struct LDKBech32Error {
1064 LDKBech32Error_Tag tag;
1067 uint32_t invalid_char;
1070 uint8_t invalid_data;
1076 * A serialized transaction, in (pointer, length) form.
1078 * This type optionally owns its own memory, and thus the semantics around access change based on
1079 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
1080 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
1081 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
1082 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
1083 * you would be invalid.
1085 * Note that, while it may change in the future, because transactions on the Rust side are stored
1086 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
1087 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
1088 * `data_is_owned` either set or unset at your discretion.
1090 typedef struct LDKTransaction {
1092 * The serialized transaction data.
1094 * This is non-const for your convenience, an object passed to Rust is never written to.
1098 * The length of the serialized transaction
1102 * Whether the data pointed to by `data` should be freed or not.
1108 * A serialized witness.
1110 typedef struct LDKWitness {
1112 * The serialized transaction data.
1114 * This is non-const for your convenience, an object passed to Rust is never written to.
1118 * The length of the serialized transaction
1122 * Whether the data pointed to by `data` should be freed or not.
1128 * An input to a transaction.
1130 * This contains the witness, the scriptSig and the previous outpoint and represents a single
1131 * input to a transaction
1133 typedef struct LDKTxIn {
1135 * The witness which includes any signatures required to spend a segwit output.
1137 struct LDKWitness witness;
1139 * The script_sig which includes signatures requires to spend a pre-segwit output (or a
1140 * P2SH-wrapped segwit output).
1142 struct LDKCVec_u8Z script_sig;
1144 * The sequence number of the transaction input
1148 * The txid of the transaction being spent.
1150 struct LDKThirtyTwoBytes previous_txid;
1152 * The output index of the transaction being spent.
1154 uint32_t previous_vout;
1158 * A transaction output including a scriptPubKey and value.
1159 * This type *does* own its own memory, so must be free'd appropriately.
1161 typedef struct LDKTxOut {
1163 * The script_pubkey in this output
1165 struct LDKCVec_u8Z script_pubkey;
1167 * The value, in satoshis, of this output
1175 * Builds a [`Refund`] for the \"offer for money\" flow.
1177 * See [module-level documentation] for usage.
1179 * [module-level documentation]: self
1181 typedef struct MUST_USE_STRUCT LDKRefundMaybeWithDerivedMetadataBuilder {
1183 * A pointer to the opaque Rust object.
1184 * Nearly everywhere, inner must be non-null, however in places where
1185 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1187 LDKnativeRefundMaybeWithDerivedMetadataBuilder *inner;
1189 * Indicates that this is the only struct which contains the same pointer.
1190 * Rust functions which take ownership of an object provided via an argument require
1191 * this to be true and invalidate the object pointed to by inner.
1194 } LDKRefundMaybeWithDerivedMetadataBuilder;
1197 * The contents of CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ
1199 typedef union LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZPtr {
1201 * A pointer to the contents in the success state.
1202 * Reading from this pointer when `result_ok` is not set is undefined.
1204 struct LDKRefundMaybeWithDerivedMetadataBuilder *result;
1206 * A pointer to the contents in the error state.
1207 * Reading from this pointer when `result_ok` is set is undefined.
1209 enum LDKBolt12SemanticError *err;
1210 } LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZPtr;
1213 * A CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
1214 * containing a crate::lightning::offers::refund::RefundMaybeWithDerivedMetadataBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
1215 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1217 typedef struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ {
1219 * The contents of this CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ, accessible via either
1220 * `err` or `result` depending on the state of `result_ok`.
1222 union LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZPtr contents;
1224 * Whether this CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ represents a success state.
1227 } LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ;
1232 * A `Refund` is a request to send an [`Bolt12Invoice`] without a preceding [`Offer`].
1234 * Typically, after an invoice is paid, the recipient may publish a refund allowing the sender to
1235 * recoup their funds. A refund may be used more generally as an \"offer for money\", such as with a
1238 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
1239 * [`Offer`]: crate::offers::offer::Offer
1241 typedef struct MUST_USE_STRUCT LDKRefund {
1243 * A pointer to the opaque Rust object.
1244 * Nearly everywhere, inner must be non-null, however in places where
1245 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1247 LDKnativeRefund *inner;
1249 * Indicates that this is the only struct which contains the same pointer.
1250 * Rust functions which take ownership of an object provided via an argument require
1251 * this to be true and invalidate the object pointed to by inner.
1257 * The contents of CResult_RefundBolt12SemanticErrorZ
1259 typedef union LDKCResult_RefundBolt12SemanticErrorZPtr {
1261 * A pointer to the contents in the success state.
1262 * Reading from this pointer when `result_ok` is not set is undefined.
1264 struct LDKRefund *result;
1266 * A pointer to the contents in the error state.
1267 * Reading from this pointer when `result_ok` is set is undefined.
1269 enum LDKBolt12SemanticError *err;
1270 } LDKCResult_RefundBolt12SemanticErrorZPtr;
1273 * A CResult_RefundBolt12SemanticErrorZ represents the result of a fallible operation,
1274 * containing a crate::lightning::offers::refund::Refund on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
1275 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1277 typedef struct LDKCResult_RefundBolt12SemanticErrorZ {
1279 * The contents of this CResult_RefundBolt12SemanticErrorZ, accessible via either
1280 * `err` or `result` depending on the state of `result_ok`.
1282 union LDKCResult_RefundBolt12SemanticErrorZPtr contents;
1284 * Whether this CResult_RefundBolt12SemanticErrorZ represents a success state.
1287 } LDKCResult_RefundBolt12SemanticErrorZ;
1290 * An enum which can either contain a u64 or not
1292 typedef enum LDKCOption_u64Z_Tag {
1294 * When we're in this state, this COption_u64Z contains a u64
1296 LDKCOption_u64Z_Some,
1298 * When we're in this state, this COption_u64Z contains nothing
1300 LDKCOption_u64Z_None,
1302 * Must be last for serialization purposes
1304 LDKCOption_u64Z_Sentinel,
1305 } LDKCOption_u64Z_Tag;
1307 typedef struct LDKCOption_u64Z {
1308 LDKCOption_u64Z_Tag tag;
1319 * Onion messages and payments can be sent and received to blinded paths, which serve to hide the
1320 * identity of the recipient.
1322 typedef struct MUST_USE_STRUCT LDKBlindedPath {
1324 * A pointer to the opaque Rust object.
1325 * Nearly everywhere, inner must be non-null, however in places where
1326 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1328 LDKnativeBlindedPath *inner;
1330 * Indicates that this is the only struct which contains the same pointer.
1331 * Rust functions which take ownership of an object provided via an argument require
1332 * this to be true and invalidate the object pointed to by inner.
1338 * A dynamically-allocated array of crate::lightning::blinded_path::BlindedPaths of arbitrary size.
1339 * This corresponds to std::vector in C++
1341 typedef struct LDKCVec_BlindedPathZ {
1343 * The elements in the array.
1344 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1346 struct LDKBlindedPath *data;
1348 * The number of elements pointed to by `data`.
1351 } LDKCVec_BlindedPathZ;
1356 * Error when parsing a bech32 encoded message using [`str::parse`].
1358 typedef struct MUST_USE_STRUCT LDKBolt12ParseError {
1360 * A pointer to the opaque Rust object.
1361 * Nearly everywhere, inner must be non-null, however in places where
1362 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1364 LDKnativeBolt12ParseError *inner;
1366 * Indicates that this is the only struct which contains the same pointer.
1367 * Rust functions which take ownership of an object provided via an argument require
1368 * this to be true and invalidate the object pointed to by inner.
1371 } LDKBolt12ParseError;
1374 * The contents of CResult_RefundBolt12ParseErrorZ
1376 typedef union LDKCResult_RefundBolt12ParseErrorZPtr {
1378 * A pointer to the contents in the success state.
1379 * Reading from this pointer when `result_ok` is not set is undefined.
1381 struct LDKRefund *result;
1383 * A pointer to the contents in the error state.
1384 * Reading from this pointer when `result_ok` is set is undefined.
1386 struct LDKBolt12ParseError *err;
1387 } LDKCResult_RefundBolt12ParseErrorZPtr;
1390 * A CResult_RefundBolt12ParseErrorZ represents the result of a fallible operation,
1391 * containing a crate::lightning::offers::refund::Refund on success and a crate::lightning::offers::parse::Bolt12ParseError on failure.
1392 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1394 typedef struct LDKCResult_RefundBolt12ParseErrorZ {
1396 * The contents of this CResult_RefundBolt12ParseErrorZ, accessible via either
1397 * `err` or `result` depending on the state of `result_ok`.
1399 union LDKCResult_RefundBolt12ParseErrorZPtr contents;
1401 * Whether this CResult_RefundBolt12ParseErrorZ represents a success state.
1404 } LDKCResult_RefundBolt12ParseErrorZ;
1407 * Strategies available to retry payment path failures.
1409 typedef enum LDKRetry_Tag {
1411 * Max number of attempts to retry payment.
1413 * Each attempt may be multiple HTLCs along multiple paths if the router decides to split up a
1414 * retry, and may retry multiple failed HTLCs at once if they failed around the same time and
1415 * were retried along a route from a single call to [`Router::find_route_with_id`].
1419 * Time elapsed before abandoning retries for a payment. At least one attempt at payment is made;
1420 * see [`PaymentParameters::expiry_time`] to avoid any attempt at payment after a specific time.
1422 * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
1426 * Must be last for serialization purposes
1431 typedef struct MUST_USE_STRUCT LDKRetry {
1444 * An error in decoding a message or struct.
1446 typedef enum LDKDecodeError_Tag {
1448 * A version byte specified something we don't know how to handle.
1450 * Includes unknown realm byte in an onion hop data packet.
1452 LDKDecodeError_UnknownVersion,
1454 * Unknown feature mandating we fail to parse message (e.g., TLV with an even, unknown type)
1456 LDKDecodeError_UnknownRequiredFeature,
1458 * Value was invalid.
1460 * For example, a byte which was supposed to be a bool was something other than a 0
1461 * or 1, a public key/private key/signature was invalid, text wasn't UTF-8, TLV was
1462 * syntactically incorrect, etc.
1464 LDKDecodeError_InvalidValue,
1466 * The buffer to be read was too short.
1468 LDKDecodeError_ShortRead,
1470 * A length descriptor in the packet didn't describe the later data correctly.
1472 LDKDecodeError_BadLengthDescriptor,
1474 * Error from [`std::io`].
1478 * The message included zlib-compressed values, which we don't support.
1480 LDKDecodeError_UnsupportedCompression,
1482 * Value is validly encoded but is dangerous to use.
1484 * This is used for things like [`ChannelManager`] deserialization where we want to ensure
1485 * that we don't use a [`ChannelManager`] which is in out of sync with the [`ChannelMonitor`].
1486 * This indicates that there is a critical implementation flaw in the storage implementation
1487 * and it's unsafe to continue.
1489 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
1490 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
1492 LDKDecodeError_DangerousValue,
1494 * Must be last for serialization purposes
1496 LDKDecodeError_Sentinel,
1497 } LDKDecodeError_Tag;
1499 typedef struct MUST_USE_STRUCT LDKDecodeError {
1500 LDKDecodeError_Tag tag;
1509 * The contents of CResult_RetryDecodeErrorZ
1511 typedef union LDKCResult_RetryDecodeErrorZPtr {
1513 * A pointer to the contents in the success state.
1514 * Reading from this pointer when `result_ok` is not set is undefined.
1516 struct LDKRetry *result;
1518 * A pointer to the contents in the error state.
1519 * Reading from this pointer when `result_ok` is set is undefined.
1521 struct LDKDecodeError *err;
1522 } LDKCResult_RetryDecodeErrorZPtr;
1525 * A CResult_RetryDecodeErrorZ represents the result of a fallible operation,
1526 * containing a crate::lightning::ln::outbound_payment::Retry on success and a crate::lightning::ln::msgs::DecodeError on failure.
1527 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1529 typedef struct LDKCResult_RetryDecodeErrorZ {
1531 * The contents of this CResult_RetryDecodeErrorZ, accessible via either
1532 * `err` or `result` depending on the state of `result_ok`.
1534 union LDKCResult_RetryDecodeErrorZPtr contents;
1536 * Whether this CResult_RetryDecodeErrorZ represents a success state.
1539 } LDKCResult_RetryDecodeErrorZ;
1544 * A script pubkey for shutting down a channel as defined by [BOLT #2].
1546 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
1548 typedef struct MUST_USE_STRUCT LDKShutdownScript {
1550 * A pointer to the opaque Rust object.
1551 * Nearly everywhere, inner must be non-null, however in places where
1552 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1554 LDKnativeShutdownScript *inner;
1556 * Indicates that this is the only struct which contains the same pointer.
1557 * Rust functions which take ownership of an object provided via an argument require
1558 * this to be true and invalidate the object pointed to by inner.
1561 } LDKShutdownScript;
1564 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
1567 typedef enum LDKAPIError_Tag {
1569 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
1570 * are documented, but generally indicates some precondition of a function was violated.
1572 LDKAPIError_APIMisuseError,
1574 * Due to a high feerate, we were unable to complete the request.
1575 * For example, this may be returned if the feerate implies we cannot open a channel at the
1576 * requested value, but opening a larger channel would succeed.
1578 LDKAPIError_FeeRateTooHigh,
1580 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
1581 * too-many-hops, etc).
1583 LDKAPIError_InvalidRoute,
1585 * We were unable to complete the request as the Channel required to do so is unable to
1586 * complete the request (or was not found). This can take many forms, including disconnected
1587 * peer, channel at capacity, channel shutting down, etc.
1589 LDKAPIError_ChannelUnavailable,
1591 * An attempt to call [`chain::Watch::watch_channel`]/[`chain::Watch::update_channel`]
1592 * returned a [`ChannelMonitorUpdateStatus::InProgress`] indicating the persistence of a
1593 * monitor update is awaiting async resolution. Once it resolves the attempted action should
1594 * complete automatically.
1596 * [`chain::Watch::watch_channel`]: crate::chain::Watch::watch_channel
1597 * [`chain::Watch::update_channel`]: crate::chain::Watch::update_channel
1598 * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
1600 LDKAPIError_MonitorUpdateInProgress,
1602 * [`SignerProvider::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
1603 * with the channel counterparty as negotiated in [`InitFeatures`].
1605 * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
1606 * a channel or cooperatively close one with this peer (and will have to force-close instead).
1608 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
1609 * [`InitFeatures`]: crate::ln::features::InitFeatures
1611 LDKAPIError_IncompatibleShutdownScript,
1613 * Must be last for serialization purposes
1615 LDKAPIError_Sentinel,
1618 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
1620 * A human-readable error message
1623 } LDKAPIError_LDKAPIMisuseError_Body;
1625 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
1627 * A human-readable error message
1631 * The feerate which was too high.
1634 } LDKAPIError_LDKFeeRateTooHigh_Body;
1636 typedef struct LDKAPIError_LDKInvalidRoute_Body {
1638 * A human-readable error message
1641 } LDKAPIError_LDKInvalidRoute_Body;
1643 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
1645 * A human-readable error message
1648 } LDKAPIError_LDKChannelUnavailable_Body;
1650 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
1652 * The incompatible shutdown script.
1654 struct LDKShutdownScript script;
1655 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
1657 typedef struct MUST_USE_STRUCT LDKAPIError {
1658 LDKAPIError_Tag tag;
1660 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
1661 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
1662 LDKAPIError_LDKInvalidRoute_Body invalid_route;
1663 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
1664 LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
1669 * The contents of CResult_NoneAPIErrorZ
1671 typedef union LDKCResult_NoneAPIErrorZPtr {
1673 * Note that this value is always NULL, as there are no contents in the OK variant
1677 * A pointer to the contents in the error state.
1678 * Reading from this pointer when `result_ok` is set is undefined.
1680 struct LDKAPIError *err;
1681 } LDKCResult_NoneAPIErrorZPtr;
1684 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
1685 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
1686 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1688 typedef struct LDKCResult_NoneAPIErrorZ {
1690 * The contents of this CResult_NoneAPIErrorZ, accessible via either
1691 * `err` or `result` depending on the state of `result_ok`.
1693 union LDKCResult_NoneAPIErrorZPtr contents;
1695 * Whether this CResult_NoneAPIErrorZ represents a success state.
1698 } LDKCResult_NoneAPIErrorZ;
1701 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
1702 * This corresponds to std::vector in C++
1704 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
1706 * The elements in the array.
1707 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1709 struct LDKCResult_NoneAPIErrorZ *data;
1711 * The number of elements pointed to by `data`.
1714 } LDKCVec_CResult_NoneAPIErrorZZ;
1717 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
1718 * This corresponds to std::vector in C++
1720 typedef struct LDKCVec_APIErrorZ {
1722 * The elements in the array.
1723 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1725 struct LDKAPIError *data;
1727 * The number of elements pointed to by `data`.
1730 } LDKCVec_APIErrorZ;
1733 * An enum which can either contain a crate::c_types::ThirtyTwoBytes or not
1735 typedef enum LDKCOption_ThirtyTwoBytesZ_Tag {
1737 * When we're in this state, this COption_ThirtyTwoBytesZ contains a crate::c_types::ThirtyTwoBytes
1739 LDKCOption_ThirtyTwoBytesZ_Some,
1741 * When we're in this state, this COption_ThirtyTwoBytesZ contains nothing
1743 LDKCOption_ThirtyTwoBytesZ_None,
1745 * Must be last for serialization purposes
1747 LDKCOption_ThirtyTwoBytesZ_Sentinel,
1748 } LDKCOption_ThirtyTwoBytesZ_Tag;
1750 typedef struct LDKCOption_ThirtyTwoBytesZ {
1751 LDKCOption_ThirtyTwoBytesZ_Tag tag;
1754 struct LDKThirtyTwoBytes some;
1757 } LDKCOption_ThirtyTwoBytesZ;
1760 * An enum which can either contain a crate::c_types::derived::CVec_u8Z or not
1762 typedef enum LDKCOption_CVec_u8ZZ_Tag {
1764 * When we're in this state, this COption_CVec_u8ZZ contains a crate::c_types::derived::CVec_u8Z
1766 LDKCOption_CVec_u8ZZ_Some,
1768 * When we're in this state, this COption_CVec_u8ZZ contains nothing
1770 LDKCOption_CVec_u8ZZ_None,
1772 * Must be last for serialization purposes
1774 LDKCOption_CVec_u8ZZ_Sentinel,
1775 } LDKCOption_CVec_u8ZZ_Tag;
1777 typedef struct LDKCOption_CVec_u8ZZ {
1778 LDKCOption_CVec_u8ZZ_Tag tag;
1781 struct LDKCVec_u8Z some;
1784 } LDKCOption_CVec_u8ZZ;
1789 * Information which is provided, encrypted, to the payment recipient when sending HTLCs.
1791 * This should generally be constructed with data communicated to us from the recipient (via a
1792 * BOLT11 or BOLT12 invoice).
1794 typedef struct MUST_USE_STRUCT LDKRecipientOnionFields {
1796 * A pointer to the opaque Rust object.
1797 * Nearly everywhere, inner must be non-null, however in places where
1798 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1800 LDKnativeRecipientOnionFields *inner;
1802 * Indicates that this is the only struct which contains the same pointer.
1803 * Rust functions which take ownership of an object provided via an argument require
1804 * this to be true and invalidate the object pointed to by inner.
1807 } LDKRecipientOnionFields;
1810 * The contents of CResult_RecipientOnionFieldsDecodeErrorZ
1812 typedef union LDKCResult_RecipientOnionFieldsDecodeErrorZPtr {
1814 * A pointer to the contents in the success state.
1815 * Reading from this pointer when `result_ok` is not set is undefined.
1817 struct LDKRecipientOnionFields *result;
1819 * A pointer to the contents in the error state.
1820 * Reading from this pointer when `result_ok` is set is undefined.
1822 struct LDKDecodeError *err;
1823 } LDKCResult_RecipientOnionFieldsDecodeErrorZPtr;
1826 * A CResult_RecipientOnionFieldsDecodeErrorZ represents the result of a fallible operation,
1827 * containing a crate::lightning::ln::outbound_payment::RecipientOnionFields on success and a crate::lightning::ln::msgs::DecodeError on failure.
1828 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1830 typedef struct LDKCResult_RecipientOnionFieldsDecodeErrorZ {
1832 * The contents of this CResult_RecipientOnionFieldsDecodeErrorZ, accessible via either
1833 * `err` or `result` depending on the state of `result_ok`.
1835 union LDKCResult_RecipientOnionFieldsDecodeErrorZPtr contents;
1837 * Whether this CResult_RecipientOnionFieldsDecodeErrorZ represents a success state.
1840 } LDKCResult_RecipientOnionFieldsDecodeErrorZ;
1843 * A tuple of 2 elements. See the individual fields for the types contained.
1845 typedef struct LDKC2Tuple_u64CVec_u8ZZ {
1847 * The element at position 0
1851 * The element at position 1
1853 struct LDKCVec_u8Z b;
1854 } LDKC2Tuple_u64CVec_u8ZZ;
1857 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u64CVec_u8ZZs of arbitrary size.
1858 * This corresponds to std::vector in C++
1860 typedef struct LDKCVec_C2Tuple_u64CVec_u8ZZZ {
1862 * The elements in the array.
1863 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1865 struct LDKC2Tuple_u64CVec_u8ZZ *data;
1867 * The number of elements pointed to by `data`.
1870 } LDKCVec_C2Tuple_u64CVec_u8ZZZ;
1873 * The contents of CResult_RecipientOnionFieldsNoneZ
1875 typedef union LDKCResult_RecipientOnionFieldsNoneZPtr {
1877 * A pointer to the contents in the success state.
1878 * Reading from this pointer when `result_ok` is not set is undefined.
1880 struct LDKRecipientOnionFields *result;
1882 * Note that this value is always NULL, as there are no contents in the Err variant
1885 } LDKCResult_RecipientOnionFieldsNoneZPtr;
1888 * A CResult_RecipientOnionFieldsNoneZ represents the result of a fallible operation,
1889 * containing a crate::lightning::ln::outbound_payment::RecipientOnionFields on success and a () on failure.
1890 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1892 typedef struct LDKCResult_RecipientOnionFieldsNoneZ {
1894 * The contents of this CResult_RecipientOnionFieldsNoneZ, accessible via either
1895 * `err` or `result` depending on the state of `result_ok`.
1897 union LDKCResult_RecipientOnionFieldsNoneZPtr contents;
1899 * Whether this CResult_RecipientOnionFieldsNoneZ represents a success state.
1902 } LDKCResult_RecipientOnionFieldsNoneZ;
1907 * A semantically valid [`Bolt12Invoice`] that hasn't been signed.
1911 * This is serialized as a TLV stream, which includes TLV records from the originating message. As
1912 * such, it may include unknown, odd TLV records.
1914 typedef struct MUST_USE_STRUCT LDKUnsignedBolt12Invoice {
1916 * A pointer to the opaque Rust object.
1917 * Nearly everywhere, inner must be non-null, however in places where
1918 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1920 LDKnativeUnsignedBolt12Invoice *inner;
1922 * Indicates that this is the only struct which contains the same pointer.
1923 * Rust functions which take ownership of an object provided via an argument require
1924 * this to be true and invalidate the object pointed to by inner.
1927 } LDKUnsignedBolt12Invoice;
1930 * The contents of CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ
1932 typedef union LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZPtr {
1934 * A pointer to the contents in the success state.
1935 * Reading from this pointer when `result_ok` is not set is undefined.
1937 struct LDKUnsignedBolt12Invoice *result;
1939 * A pointer to the contents in the error state.
1940 * Reading from this pointer when `result_ok` is set is undefined.
1942 enum LDKBolt12SemanticError *err;
1943 } LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZPtr;
1946 * A CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ represents the result of a fallible operation,
1947 * containing a crate::lightning::offers::invoice::UnsignedBolt12Invoice on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
1948 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1950 typedef struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ {
1952 * The contents of this CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ, accessible via either
1953 * `err` or `result` depending on the state of `result_ok`.
1955 union LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZPtr contents;
1957 * Whether this CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ represents a success state.
1960 } LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ;
1965 * A `Bolt12Invoice` is a payment request, typically corresponding to an [`Offer`] or a [`Refund`].
1967 * An invoice may be sent in response to an [`InvoiceRequest`] in the case of an offer or sent
1968 * directly after scanning a refund. It includes all the information needed to pay a recipient.
1970 * [`Offer`]: crate::offers::offer::Offer
1971 * [`Refund`]: crate::offers::refund::Refund
1972 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
1974 typedef struct MUST_USE_STRUCT LDKBolt12Invoice {
1976 * A pointer to the opaque Rust object.
1977 * Nearly everywhere, inner must be non-null, however in places where
1978 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1980 LDKnativeBolt12Invoice *inner;
1982 * Indicates that this is the only struct which contains the same pointer.
1983 * Rust functions which take ownership of an object provided via an argument require
1984 * this to be true and invalidate the object pointed to by inner.
1990 * The contents of CResult_Bolt12InvoiceBolt12SemanticErrorZ
1992 typedef union LDKCResult_Bolt12InvoiceBolt12SemanticErrorZPtr {
1994 * A pointer to the contents in the success state.
1995 * Reading from this pointer when `result_ok` is not set is undefined.
1997 struct LDKBolt12Invoice *result;
1999 * A pointer to the contents in the error state.
2000 * Reading from this pointer when `result_ok` is set is undefined.
2002 enum LDKBolt12SemanticError *err;
2003 } LDKCResult_Bolt12InvoiceBolt12SemanticErrorZPtr;
2006 * A CResult_Bolt12InvoiceBolt12SemanticErrorZ represents the result of a fallible operation,
2007 * containing a crate::lightning::offers::invoice::Bolt12Invoice on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
2008 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2010 typedef struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ {
2012 * The contents of this CResult_Bolt12InvoiceBolt12SemanticErrorZ, accessible via either
2013 * `err` or `result` depending on the state of `result_ok`.
2015 union LDKCResult_Bolt12InvoiceBolt12SemanticErrorZPtr contents;
2017 * Whether this CResult_Bolt12InvoiceBolt12SemanticErrorZ represents a success state.
2020 } LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ;
2023 * Represents a secp256k1 Schnorr signature serialized as two 32-byte numbers
2025 typedef struct LDKSchnorrSignature {
2027 * The bytes of the signature as two 32-byte numbers
2029 uint8_t compact_form[64];
2030 } LDKSchnorrSignature;
2033 * The contents of CResult_SchnorrSignatureNoneZ
2035 typedef union LDKCResult_SchnorrSignatureNoneZPtr {
2037 * A pointer to the contents in the success state.
2038 * Reading from this pointer when `result_ok` is not set is undefined.
2040 struct LDKSchnorrSignature *result;
2042 * Note that this value is always NULL, as there are no contents in the Err variant
2045 } LDKCResult_SchnorrSignatureNoneZPtr;
2048 * A CResult_SchnorrSignatureNoneZ represents the result of a fallible operation,
2049 * containing a crate::c_types::SchnorrSignature on success and a () on failure.
2050 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2052 typedef struct LDKCResult_SchnorrSignatureNoneZ {
2054 * The contents of this CResult_SchnorrSignatureNoneZ, accessible via either
2055 * `err` or `result` depending on the state of `result_ok`.
2057 union LDKCResult_SchnorrSignatureNoneZPtr contents;
2059 * Whether this CResult_SchnorrSignatureNoneZ represents a success state.
2062 } LDKCResult_SchnorrSignatureNoneZ;
2065 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
2066 * This corresponds to std::vector in C++
2068 typedef struct LDKCVec_ThirtyTwoBytesZ {
2070 * The elements in the array.
2071 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2073 struct LDKThirtyTwoBytes *data;
2075 * The number of elements pointed to by `data`.
2078 } LDKCVec_ThirtyTwoBytesZ;
2081 * An enum which can either contain a crate::c_types::derived::CVec_ThirtyTwoBytesZ or not
2083 typedef enum LDKCOption_CVec_ThirtyTwoBytesZZ_Tag {
2085 * When we're in this state, this COption_CVec_ThirtyTwoBytesZZ contains a crate::c_types::derived::CVec_ThirtyTwoBytesZ
2087 LDKCOption_CVec_ThirtyTwoBytesZZ_Some,
2089 * When we're in this state, this COption_CVec_ThirtyTwoBytesZZ contains nothing
2091 LDKCOption_CVec_ThirtyTwoBytesZZ_None,
2093 * Must be last for serialization purposes
2095 LDKCOption_CVec_ThirtyTwoBytesZZ_Sentinel,
2096 } LDKCOption_CVec_ThirtyTwoBytesZZ_Tag;
2098 typedef struct LDKCOption_CVec_ThirtyTwoBytesZZ {
2099 LDKCOption_CVec_ThirtyTwoBytesZZ_Tag tag;
2102 struct LDKCVec_ThirtyTwoBytesZ some;
2105 } LDKCOption_CVec_ThirtyTwoBytesZZ;
2108 * A 3-byte byte array.
2110 typedef struct LDKThreeBytes {
2118 * The minimum amount required for an item in an [`Offer`], denominated in either bitcoin or
2121 typedef enum LDKAmount_Tag {
2123 * An amount of bitcoin.
2127 * An amount of currency specified using ISO 4712.
2131 * Must be last for serialization purposes
2136 typedef struct LDKAmount_LDKBitcoin_Body {
2138 * The amount in millisatoshi.
2140 uint64_t amount_msats;
2141 } LDKAmount_LDKBitcoin_Body;
2143 typedef struct LDKAmount_LDKCurrency_Body {
2145 * The currency that the amount is denominated in.
2147 struct LDKThreeBytes iso4217_code;
2149 * The amount in the currency unit adjusted by the ISO 4712 exponent (e.g., USD cents).
2152 } LDKAmount_LDKCurrency_Body;
2154 typedef struct MUST_USE_STRUCT LDKAmount {
2157 LDKAmount_LDKBitcoin_Body bitcoin;
2158 LDKAmount_LDKCurrency_Body currency;
2163 * An enum which can either contain a crate::lightning::offers::offer::Amount or not
2165 typedef enum LDKCOption_AmountZ_Tag {
2167 * When we're in this state, this COption_AmountZ contains a crate::lightning::offers::offer::Amount
2169 LDKCOption_AmountZ_Some,
2171 * When we're in this state, this COption_AmountZ contains nothing
2173 LDKCOption_AmountZ_None,
2175 * Must be last for serialization purposes
2177 LDKCOption_AmountZ_Sentinel,
2178 } LDKCOption_AmountZ_Tag;
2180 typedef struct LDKCOption_AmountZ {
2181 LDKCOption_AmountZ_Tag tag;
2184 struct LDKAmount some;
2187 } LDKCOption_AmountZ;
2190 * Quantity of items supported by an [`Offer`].
2192 typedef enum LDKQuantity_Tag {
2194 * Up to a specific number of items (inclusive). Use when more than one item can be requested
2195 * but is limited (e.g., because of per customer or inventory limits).
2197 * May be used with `NonZeroU64::new(1)` but prefer to use [`Quantity::One`] if only one item
2200 LDKQuantity_Bounded,
2202 * One or more items. Use when more than one item can be requested without any limit.
2204 LDKQuantity_Unbounded,
2206 * Only one item. Use when only a single item can be requested.
2210 * Must be last for serialization purposes
2212 LDKQuantity_Sentinel,
2215 typedef struct MUST_USE_STRUCT LDKQuantity {
2216 LDKQuantity_Tag tag;
2225 * An enum which can either contain a crate::lightning::offers::offer::Quantity or not
2227 typedef enum LDKCOption_QuantityZ_Tag {
2229 * When we're in this state, this COption_QuantityZ contains a crate::lightning::offers::offer::Quantity
2231 LDKCOption_QuantityZ_Some,
2233 * When we're in this state, this COption_QuantityZ contains nothing
2235 LDKCOption_QuantityZ_None,
2237 * Must be last for serialization purposes
2239 LDKCOption_QuantityZ_Sentinel,
2240 } LDKCOption_QuantityZ_Tag;
2242 typedef struct LDKCOption_QuantityZ {
2243 LDKCOption_QuantityZ_Tag tag;
2246 struct LDKQuantity some;
2249 } LDKCOption_QuantityZ;
2252 * The contents of CResult_ThirtyTwoBytesNoneZ
2254 typedef union LDKCResult_ThirtyTwoBytesNoneZPtr {
2256 * A pointer to the contents in the success state.
2257 * Reading from this pointer when `result_ok` is not set is undefined.
2259 struct LDKThirtyTwoBytes *result;
2261 * Note that this value is always NULL, as there are no contents in the Err variant
2264 } LDKCResult_ThirtyTwoBytesNoneZPtr;
2267 * A CResult_ThirtyTwoBytesNoneZ represents the result of a fallible operation,
2268 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
2269 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2271 typedef struct LDKCResult_ThirtyTwoBytesNoneZ {
2273 * The contents of this CResult_ThirtyTwoBytesNoneZ, accessible via either
2274 * `err` or `result` depending on the state of `result_ok`.
2276 union LDKCResult_ThirtyTwoBytesNoneZPtr contents;
2278 * Whether this CResult_ThirtyTwoBytesNoneZ represents a success state.
2281 } LDKCResult_ThirtyTwoBytesNoneZ;
2286 * Information needed to route a payment across a [`BlindedPath`].
2288 typedef struct MUST_USE_STRUCT LDKBlindedPayInfo {
2290 * A pointer to the opaque Rust object.
2291 * Nearly everywhere, inner must be non-null, however in places where
2292 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2294 LDKnativeBlindedPayInfo *inner;
2296 * Indicates that this is the only struct which contains the same pointer.
2297 * Rust functions which take ownership of an object provided via an argument require
2298 * this to be true and invalidate the object pointed to by inner.
2301 } LDKBlindedPayInfo;
2304 * The contents of CResult_BlindedPayInfoDecodeErrorZ
2306 typedef union LDKCResult_BlindedPayInfoDecodeErrorZPtr {
2308 * A pointer to the contents in the success state.
2309 * Reading from this pointer when `result_ok` is not set is undefined.
2311 struct LDKBlindedPayInfo *result;
2313 * A pointer to the contents in the error state.
2314 * Reading from this pointer when `result_ok` is set is undefined.
2316 struct LDKDecodeError *err;
2317 } LDKCResult_BlindedPayInfoDecodeErrorZPtr;
2320 * A CResult_BlindedPayInfoDecodeErrorZ represents the result of a fallible operation,
2321 * containing a crate::lightning::offers::invoice::BlindedPayInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
2322 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2324 typedef struct LDKCResult_BlindedPayInfoDecodeErrorZ {
2326 * The contents of this CResult_BlindedPayInfoDecodeErrorZ, accessible via either
2327 * `err` or `result` depending on the state of `result_ok`.
2329 union LDKCResult_BlindedPayInfoDecodeErrorZPtr contents;
2331 * Whether this CResult_BlindedPayInfoDecodeErrorZ represents a success state.
2334 } LDKCResult_BlindedPayInfoDecodeErrorZ;
2339 * Information about a spendable output to a P2WSH script.
2341 * See [`SpendableOutputDescriptor::DelayedPaymentOutput`] for more details on how to spend this.
2343 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
2345 * A pointer to the opaque Rust object.
2346 * Nearly everywhere, inner must be non-null, however in places where
2347 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2349 LDKnativeDelayedPaymentOutputDescriptor *inner;
2351 * Indicates that this is the only struct which contains the same pointer.
2352 * Rust functions which take ownership of an object provided via an argument require
2353 * this to be true and invalidate the object pointed to by inner.
2356 } LDKDelayedPaymentOutputDescriptor;
2359 * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
2361 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
2363 * A pointer to the contents in the success state.
2364 * Reading from this pointer when `result_ok` is not set is undefined.
2366 struct LDKDelayedPaymentOutputDescriptor *result;
2368 * A pointer to the contents in the error state.
2369 * Reading from this pointer when `result_ok` is set is undefined.
2371 struct LDKDecodeError *err;
2372 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
2375 * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
2376 * containing a crate::lightning::sign::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2377 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2379 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
2381 * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
2382 * `err` or `result` depending on the state of `result_ok`.
2384 union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
2386 * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
2389 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
2394 * Information about a spendable output to our \"payment key\".
2396 * See [`SpendableOutputDescriptor::StaticPaymentOutput`] for more details on how to spend this.
2398 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
2400 * A pointer to the opaque Rust object.
2401 * Nearly everywhere, inner must be non-null, however in places where
2402 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2404 LDKnativeStaticPaymentOutputDescriptor *inner;
2406 * Indicates that this is the only struct which contains the same pointer.
2407 * Rust functions which take ownership of an object provided via an argument require
2408 * this to be true and invalidate the object pointed to by inner.
2411 } LDKStaticPaymentOutputDescriptor;
2414 * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
2416 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
2418 * A pointer to the contents in the success state.
2419 * Reading from this pointer when `result_ok` is not set is undefined.
2421 struct LDKStaticPaymentOutputDescriptor *result;
2423 * A pointer to the contents in the error state.
2424 * Reading from this pointer when `result_ok` is set is undefined.
2426 struct LDKDecodeError *err;
2427 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
2430 * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
2431 * containing a crate::lightning::sign::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2432 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2434 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
2436 * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
2437 * `err` or `result` depending on the state of `result_ok`.
2439 union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
2441 * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
2444 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
2449 * A reference to a transaction output.
2451 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
2452 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
2454 typedef struct MUST_USE_STRUCT LDKOutPoint {
2456 * A pointer to the opaque Rust object.
2457 * Nearly everywhere, inner must be non-null, however in places where
2458 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2460 LDKnativeOutPoint *inner;
2462 * Indicates that this is the only struct which contains the same pointer.
2463 * Rust functions which take ownership of an object provided via an argument require
2464 * this to be true and invalidate the object pointed to by inner.
2470 * Describes the necessary information to spend a spendable output.
2472 * When on-chain outputs are created by LDK (which our counterparty is not able to claim at any
2473 * point in the future) a [`SpendableOutputs`] event is generated which you must track and be able
2474 * to spend on-chain. The information needed to do this is provided in this enum, including the
2475 * outpoint describing which `txid` and output `index` is available, the full output which exists
2476 * at that `txid`/`index`, and any keys or other information required to sign.
2478 * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
2480 typedef enum LDKSpendableOutputDescriptor_Tag {
2482 * An output to a script which was provided via [`SignerProvider`] directly, either from
2483 * [`get_destination_script`] or [`get_shutdown_scriptpubkey`], thus you should already
2484 * know how to spend it. No secret keys are provided as LDK was never given any key.
2485 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
2486 * on-chain using the payment preimage or after it has timed out.
2488 * [`get_shutdown_scriptpubkey`]: SignerProvider::get_shutdown_scriptpubkey
2489 * [`get_destination_script`]: SignerProvider::get_shutdown_scriptpubkey
2491 LDKSpendableOutputDescriptor_StaticOutput,
2493 * An output to a P2WSH script which can be spent with a single signature after an `OP_CSV`
2496 * The witness in the spending input should be:
2498 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
2501 * Note that the `nSequence` field in the spending input must be set to
2502 * [`DelayedPaymentOutputDescriptor::to_self_delay`] (which means the transaction is not
2503 * broadcastable until at least [`DelayedPaymentOutputDescriptor::to_self_delay`] blocks after
2504 * the outpoint confirms, see [BIP
2505 * 68](https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki)). Also note that LDK
2506 * won't generate a [`SpendableOutputDescriptor`] until the corresponding block height
2509 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
2510 * it is an output from an old state which we broadcast (which should never happen).
2512 * To derive the delayed payment key which is used to sign this input, you must pass the
2513 * holder [`InMemorySigner::delayed_payment_base_key`] (i.e., the private key which corresponds to the
2514 * [`ChannelPublicKeys::delayed_payment_basepoint`] in [`ChannelSigner::pubkeys`]) and the provided
2515 * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to [`chan_utils::derive_private_key`]. The DelayedPaymentKey can be
2516 * generated without the secret key using [`DelayedPaymentKey::from_basepoint`] and only the
2517 * [`ChannelPublicKeys::delayed_payment_basepoint`] which appears in [`ChannelSigner::pubkeys`].
2519 * To derive the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] provided here (which is
2520 * used in the witness script generation), you must pass the counterparty
2521 * [`ChannelPublicKeys::revocation_basepoint`] (which appears in the call to
2522 * [`ChannelSigner::provide_channel_parameters`]) and the provided
2523 * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to
2524 * [`RevocationKey`].
2526 * The witness script which is hashed and included in the output `script_pubkey` may be
2527 * regenerated by passing the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] (derived
2528 * as explained above), our delayed payment pubkey (derived as explained above), and the
2529 * [`DelayedPaymentOutputDescriptor::to_self_delay`] contained here to
2530 * [`chan_utils::get_revokeable_redeemscript`].
2532 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
2534 * An output spendable exclusively by our payment key (i.e., the private key that corresponds
2535 * to the `payment_point` in [`ChannelSigner::pubkeys`]). The output type depends on the
2536 * channel type negotiated.
2538 * On an anchor outputs channel, the witness in the spending input is:
2540 * <BIP 143 signature> <witness script>
2545 * <BIP 143 signature> <payment key>
2548 * These are generally the result of our counterparty having broadcast the current state,
2549 * allowing us to claim the non-HTLC-encumbered outputs immediately, or after one confirmation
2550 * in the case of anchor outputs channels.
2552 LDKSpendableOutputDescriptor_StaticPaymentOutput,
2554 * Must be last for serialization purposes
2556 LDKSpendableOutputDescriptor_Sentinel,
2557 } LDKSpendableOutputDescriptor_Tag;
2559 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
2561 * The outpoint which is spendable.
2563 struct LDKOutPoint outpoint;
2565 * The output which is referenced by the given outpoint.
2567 struct LDKTxOut output;
2569 * The `channel_keys_id` for the channel which this output came from.
2571 * For channels which were generated on LDK 0.0.119 or later, this is the value which was
2572 * passed to the [`SignerProvider::get_destination_script`] call which provided this
2575 * For channels which were generated prior to LDK 0.0.119, no such argument existed,
2576 * however this field may still be filled in if such data is available.
2578 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2580 struct LDKThirtyTwoBytes channel_keys_id;
2581 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
2583 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
2584 LDKSpendableOutputDescriptor_Tag tag;
2586 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
2588 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
2591 struct LDKStaticPaymentOutputDescriptor static_payment_output;
2594 } LDKSpendableOutputDescriptor;
2597 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
2599 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
2601 * A pointer to the contents in the success state.
2602 * Reading from this pointer when `result_ok` is not set is undefined.
2604 struct LDKSpendableOutputDescriptor *result;
2606 * A pointer to the contents in the error state.
2607 * Reading from this pointer when `result_ok` is set is undefined.
2609 struct LDKDecodeError *err;
2610 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
2613 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
2614 * containing a crate::lightning::sign::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2615 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2617 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
2619 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
2620 * `err` or `result` depending on the state of `result_ok`.
2622 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
2624 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
2627 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
2630 * A dynamically-allocated array of crate::lightning::sign::SpendableOutputDescriptors of arbitrary size.
2631 * This corresponds to std::vector in C++
2633 typedef struct LDKCVec_SpendableOutputDescriptorZ {
2635 * The elements in the array.
2636 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2638 struct LDKSpendableOutputDescriptor *data;
2640 * The number of elements pointed to by `data`.
2643 } LDKCVec_SpendableOutputDescriptorZ;
2646 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
2647 * This corresponds to std::vector in C++
2649 typedef struct LDKCVec_TxOutZ {
2651 * The elements in the array.
2652 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2654 struct LDKTxOut *data;
2656 * The number of elements pointed to by `data`.
2662 * An enum which can either contain a u32 or not
2664 typedef enum LDKCOption_u32Z_Tag {
2666 * When we're in this state, this COption_u32Z contains a u32
2668 LDKCOption_u32Z_Some,
2670 * When we're in this state, this COption_u32Z contains nothing
2672 LDKCOption_u32Z_None,
2674 * Must be last for serialization purposes
2676 LDKCOption_u32Z_Sentinel,
2677 } LDKCOption_u32Z_Tag;
2679 typedef struct LDKCOption_u32Z {
2680 LDKCOption_u32Z_Tag tag;
2689 * A tuple of 2 elements. See the individual fields for the types contained.
2691 typedef struct LDKC2Tuple_CVec_u8Zu64Z {
2693 * The element at position 0
2695 struct LDKCVec_u8Z a;
2697 * The element at position 1
2700 } LDKC2Tuple_CVec_u8Zu64Z;
2703 * The contents of CResult_C2Tuple_CVec_u8Zu64ZNoneZ
2705 typedef union LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZPtr {
2707 * A pointer to the contents in the success state.
2708 * Reading from this pointer when `result_ok` is not set is undefined.
2710 struct LDKC2Tuple_CVec_u8Zu64Z *result;
2712 * Note that this value is always NULL, as there are no contents in the Err variant
2715 } LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZPtr;
2718 * A CResult_C2Tuple_CVec_u8Zu64ZNoneZ represents the result of a fallible operation,
2719 * containing a crate::c_types::derived::C2Tuple_CVec_u8Zu64Z on success and a () on failure.
2720 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2722 typedef struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ {
2724 * The contents of this CResult_C2Tuple_CVec_u8Zu64ZNoneZ, accessible via either
2725 * `err` or `result` depending on the state of `result_ok`.
2727 union LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZPtr contents;
2729 * Whether this CResult_C2Tuple_CVec_u8Zu64ZNoneZ represents a success state.
2732 } LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ;
2737 * The parameters required to derive a channel signer via [`SignerProvider`].
2739 typedef struct MUST_USE_STRUCT LDKChannelDerivationParameters {
2741 * A pointer to the opaque Rust object.
2742 * Nearly everywhere, inner must be non-null, however in places where
2743 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2745 LDKnativeChannelDerivationParameters *inner;
2747 * Indicates that this is the only struct which contains the same pointer.
2748 * Rust functions which take ownership of an object provided via an argument require
2749 * this to be true and invalidate the object pointed to by inner.
2752 } LDKChannelDerivationParameters;
2755 * The contents of CResult_ChannelDerivationParametersDecodeErrorZ
2757 typedef union LDKCResult_ChannelDerivationParametersDecodeErrorZPtr {
2759 * A pointer to the contents in the success state.
2760 * Reading from this pointer when `result_ok` is not set is undefined.
2762 struct LDKChannelDerivationParameters *result;
2764 * A pointer to the contents in the error state.
2765 * Reading from this pointer when `result_ok` is set is undefined.
2767 struct LDKDecodeError *err;
2768 } LDKCResult_ChannelDerivationParametersDecodeErrorZPtr;
2771 * A CResult_ChannelDerivationParametersDecodeErrorZ represents the result of a fallible operation,
2772 * containing a crate::lightning::sign::ChannelDerivationParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
2773 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2775 typedef struct LDKCResult_ChannelDerivationParametersDecodeErrorZ {
2777 * The contents of this CResult_ChannelDerivationParametersDecodeErrorZ, accessible via either
2778 * `err` or `result` depending on the state of `result_ok`.
2780 union LDKCResult_ChannelDerivationParametersDecodeErrorZPtr contents;
2782 * Whether this CResult_ChannelDerivationParametersDecodeErrorZ represents a success state.
2785 } LDKCResult_ChannelDerivationParametersDecodeErrorZ;
2790 * A descriptor used to sign for a commitment transaction's HTLC output.
2792 typedef struct MUST_USE_STRUCT LDKHTLCDescriptor {
2794 * A pointer to the opaque Rust object.
2795 * Nearly everywhere, inner must be non-null, however in places where
2796 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2798 LDKnativeHTLCDescriptor *inner;
2800 * Indicates that this is the only struct which contains the same pointer.
2801 * Rust functions which take ownership of an object provided via an argument require
2802 * this to be true and invalidate the object pointed to by inner.
2805 } LDKHTLCDescriptor;
2808 * The contents of CResult_HTLCDescriptorDecodeErrorZ
2810 typedef union LDKCResult_HTLCDescriptorDecodeErrorZPtr {
2812 * A pointer to the contents in the success state.
2813 * Reading from this pointer when `result_ok` is not set is undefined.
2815 struct LDKHTLCDescriptor *result;
2817 * A pointer to the contents in the error state.
2818 * Reading from this pointer when `result_ok` is set is undefined.
2820 struct LDKDecodeError *err;
2821 } LDKCResult_HTLCDescriptorDecodeErrorZPtr;
2824 * A CResult_HTLCDescriptorDecodeErrorZ represents the result of a fallible operation,
2825 * containing a crate::lightning::sign::HTLCDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2826 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2828 typedef struct LDKCResult_HTLCDescriptorDecodeErrorZ {
2830 * The contents of this CResult_HTLCDescriptorDecodeErrorZ, accessible via either
2831 * `err` or `result` depending on the state of `result_ok`.
2833 union LDKCResult_HTLCDescriptorDecodeErrorZPtr contents;
2835 * Whether this CResult_HTLCDescriptorDecodeErrorZ represents a success state.
2838 } LDKCResult_HTLCDescriptorDecodeErrorZ;
2841 * The contents of CResult_NoneNoneZ
2843 typedef union LDKCResult_NoneNoneZPtr {
2845 * Note that this value is always NULL, as there are no contents in the OK variant
2849 * Note that this value is always NULL, as there are no contents in the Err variant
2852 } LDKCResult_NoneNoneZPtr;
2855 * A CResult_NoneNoneZ represents the result of a fallible operation,
2856 * containing a () on success and a () on failure.
2857 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2859 typedef struct LDKCResult_NoneNoneZ {
2861 * The contents of this CResult_NoneNoneZ, accessible via either
2862 * `err` or `result` depending on the state of `result_ok`.
2864 union LDKCResult_NoneNoneZPtr contents;
2866 * Whether this CResult_NoneNoneZ represents a success state.
2869 } LDKCResult_NoneNoneZ;
2872 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
2874 typedef struct LDKPublicKey {
2876 * The bytes of the public key
2878 uint8_t compressed_form[33];
2882 * The contents of CResult_PublicKeyNoneZ
2884 typedef union LDKCResult_PublicKeyNoneZPtr {
2886 * A pointer to the contents in the success state.
2887 * Reading from this pointer when `result_ok` is not set is undefined.
2889 struct LDKPublicKey *result;
2891 * Note that this value is always NULL, as there are no contents in the Err variant
2894 } LDKCResult_PublicKeyNoneZPtr;
2897 * A CResult_PublicKeyNoneZ represents the result of a fallible operation,
2898 * containing a crate::c_types::PublicKey on success and a () on failure.
2899 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2901 typedef struct LDKCResult_PublicKeyNoneZ {
2903 * The contents of this CResult_PublicKeyNoneZ, accessible via either
2904 * `err` or `result` depending on the state of `result_ok`.
2906 union LDKCResult_PublicKeyNoneZPtr contents;
2908 * Whether this CResult_PublicKeyNoneZ represents a success state.
2911 } LDKCResult_PublicKeyNoneZ;
2914 * An enum which can either contain a crate::c_types::BigEndianScalar or not
2916 typedef enum LDKCOption_BigEndianScalarZ_Tag {
2918 * When we're in this state, this COption_BigEndianScalarZ contains a crate::c_types::BigEndianScalar
2920 LDKCOption_BigEndianScalarZ_Some,
2922 * When we're in this state, this COption_BigEndianScalarZ contains nothing
2924 LDKCOption_BigEndianScalarZ_None,
2926 * Must be last for serialization purposes
2928 LDKCOption_BigEndianScalarZ_Sentinel,
2929 } LDKCOption_BigEndianScalarZ_Tag;
2931 typedef struct LDKCOption_BigEndianScalarZ {
2932 LDKCOption_BigEndianScalarZ_Tag tag;
2935 struct LDKBigEndianScalar some;
2938 } LDKCOption_BigEndianScalarZ;
2941 * Integer in the range `0..32`
2943 typedef struct LDKU5 {
2948 * A dynamically-allocated array of crate::c_types::U5s of arbitrary size.
2949 * This corresponds to std::vector in C++
2951 typedef struct LDKCVec_U5Z {
2953 * The elements in the array.
2954 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2958 * The number of elements pointed to by `data`.
2964 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
2965 * allows recovering the exact public key which created the signature given the message.
2967 typedef struct LDKRecoverableSignature {
2969 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
2972 uint8_t serialized_form[68];
2973 } LDKRecoverableSignature;
2976 * The contents of CResult_RecoverableSignatureNoneZ
2978 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
2980 * A pointer to the contents in the success state.
2981 * Reading from this pointer when `result_ok` is not set is undefined.
2983 struct LDKRecoverableSignature *result;
2985 * Note that this value is always NULL, as there are no contents in the Err variant
2988 } LDKCResult_RecoverableSignatureNoneZPtr;
2991 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
2992 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
2993 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2995 typedef struct LDKCResult_RecoverableSignatureNoneZ {
2997 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
2998 * `err` or `result` depending on the state of `result_ok`.
3000 union LDKCResult_RecoverableSignatureNoneZPtr contents;
3002 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
3005 } LDKCResult_RecoverableSignatureNoneZ;
3008 * Represents a secp256k1 ECDSA signature serialized as two 32-byte numbers
3010 typedef struct LDKECDSASignature {
3012 * The bytes of the signature in "compact" form
3014 uint8_t compact_form[64];
3015 } LDKECDSASignature;
3018 * The contents of CResult_ECDSASignatureNoneZ
3020 typedef union LDKCResult_ECDSASignatureNoneZPtr {
3022 * A pointer to the contents in the success state.
3023 * Reading from this pointer when `result_ok` is not set is undefined.
3025 struct LDKECDSASignature *result;
3027 * Note that this value is always NULL, as there are no contents in the Err variant
3030 } LDKCResult_ECDSASignatureNoneZPtr;
3033 * A CResult_ECDSASignatureNoneZ represents the result of a fallible operation,
3034 * containing a crate::c_types::ECDSASignature on success and a () on failure.
3035 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3037 typedef struct LDKCResult_ECDSASignatureNoneZ {
3039 * The contents of this CResult_ECDSASignatureNoneZ, accessible via either
3040 * `err` or `result` depending on the state of `result_ok`.
3042 union LDKCResult_ECDSASignatureNoneZPtr contents;
3044 * Whether this CResult_ECDSASignatureNoneZ represents a success state.
3047 } LDKCResult_ECDSASignatureNoneZ;
3050 * The contents of CResult_TransactionNoneZ
3052 typedef union LDKCResult_TransactionNoneZPtr {
3054 * A pointer to the contents in the success state.
3055 * Reading from this pointer when `result_ok` is not set is undefined.
3057 struct LDKTransaction *result;
3059 * Note that this value is always NULL, as there are no contents in the Err variant
3062 } LDKCResult_TransactionNoneZPtr;
3065 * A CResult_TransactionNoneZ represents the result of a fallible operation,
3066 * containing a crate::c_types::Transaction on success and a () on failure.
3067 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3069 typedef struct LDKCResult_TransactionNoneZ {
3071 * The contents of this CResult_TransactionNoneZ, accessible via either
3072 * `err` or `result` depending on the state of `result_ok`.
3074 union LDKCResult_TransactionNoneZPtr contents;
3076 * Whether this CResult_TransactionNoneZ represents a success state.
3079 } LDKCResult_TransactionNoneZ;
3082 * A dynamically-allocated array of crate::c_types::ECDSASignatures of arbitrary size.
3083 * This corresponds to std::vector in C++
3085 typedef struct LDKCVec_ECDSASignatureZ {
3087 * The elements in the array.
3088 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3090 struct LDKECDSASignature *data;
3092 * The number of elements pointed to by `data`.
3095 } LDKCVec_ECDSASignatureZ;
3098 * A tuple of 2 elements. See the individual fields for the types contained.
3100 typedef struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ {
3102 * The element at position 0
3104 struct LDKECDSASignature a;
3106 * The element at position 1
3108 struct LDKCVec_ECDSASignatureZ b;
3109 } LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ;
3112 * The contents of CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ
3114 typedef union LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr {
3116 * A pointer to the contents in the success state.
3117 * Reading from this pointer when `result_ok` is not set is undefined.
3119 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *result;
3121 * Note that this value is always NULL, as there are no contents in the Err variant
3124 } LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr;
3127 * A CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ represents the result of a fallible operation,
3128 * containing a crate::c_types::derived::C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ on success and a () on failure.
3129 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3131 typedef struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ {
3133 * The contents of this CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ, accessible via either
3134 * `err` or `result` depending on the state of `result_ok`.
3136 union LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr contents;
3138 * Whether this CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ represents a success state.
3141 } LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ;
3146 * This class tracks the per-transaction information needed to build a commitment transaction and will
3147 * actually build it and sign. It is used for holder transactions that we sign only when needed
3148 * and for transactions we sign for the counterparty.
3150 * This class can be used inside a signer implementation to generate a signature given the relevant
3153 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
3155 * A pointer to the opaque Rust object.
3156 * Nearly everywhere, inner must be non-null, however in places where
3157 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3159 LDKnativeCommitmentTransaction *inner;
3161 * Indicates that this is the only struct which contains the same pointer.
3162 * Rust functions which take ownership of an object provided via an argument require
3163 * this to be true and invalidate the object pointed to by inner.
3166 } LDKCommitmentTransaction;
3171 * Information needed to build and sign a holder's commitment transaction.
3173 * The transaction is only signed once we are ready to broadcast.
3175 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
3177 * A pointer to the opaque Rust object.
3178 * Nearly everywhere, inner must be non-null, however in places where
3179 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3181 LDKnativeHolderCommitmentTransaction *inner;
3183 * Indicates that this is the only struct which contains the same pointer.
3184 * Rust functions which take ownership of an object provided via an argument require
3185 * this to be true and invalidate the object pointed to by inner.
3188 } LDKHolderCommitmentTransaction;
3193 * Information about an HTLC as it appears in a commitment transaction
3195 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
3197 * A pointer to the opaque Rust object.
3198 * Nearly everywhere, inner must be non-null, however in places where
3199 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3201 LDKnativeHTLCOutputInCommitment *inner;
3203 * Indicates that this is the only struct which contains the same pointer.
3204 * Rust functions which take ownership of an object provided via an argument require
3205 * this to be true and invalidate the object pointed to by inner.
3208 } LDKHTLCOutputInCommitment;
3213 * This class tracks the per-transaction information needed to build a closing transaction and will
3214 * actually build it and sign.
3216 * This class can be used inside a signer implementation to generate a signature given the relevant
3219 typedef struct MUST_USE_STRUCT LDKClosingTransaction {
3221 * A pointer to the opaque Rust object.
3222 * Nearly everywhere, inner must be non-null, however in places where
3223 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3225 LDKnativeClosingTransaction *inner;
3227 * Indicates that this is the only struct which contains the same pointer.
3228 * Rust functions which take ownership of an object provided via an argument require
3229 * this to be true and invalidate the object pointed to by inner.
3232 } LDKClosingTransaction;
3237 * The unsigned part of a [`channel_announcement`] message.
3239 * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
3241 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
3243 * A pointer to the opaque Rust object.
3244 * Nearly everywhere, inner must be non-null, however in places where
3245 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3247 LDKnativeUnsignedChannelAnnouncement *inner;
3249 * Indicates that this is the only struct which contains the same pointer.
3250 * Rust functions which take ownership of an object provided via an argument require
3251 * this to be true and invalidate the object pointed to by inner.
3254 } LDKUnsignedChannelAnnouncement;
3259 * One counterparty's public keys which do not change over the life of a channel.
3261 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
3263 * A pointer to the opaque Rust object.
3264 * Nearly everywhere, inner must be non-null, however in places where
3265 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3267 LDKnativeChannelPublicKeys *inner;
3269 * Indicates that this is the only struct which contains the same pointer.
3270 * Rust functions which take ownership of an object provided via an argument require
3271 * this to be true and invalidate the object pointed to by inner.
3274 } LDKChannelPublicKeys;
3279 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
3280 * The fields are organized by holder/counterparty.
3282 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
3283 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
3285 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
3287 * A pointer to the opaque Rust object.
3288 * Nearly everywhere, inner must be non-null, however in places where
3289 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3291 LDKnativeChannelTransactionParameters *inner;
3293 * Indicates that this is the only struct which contains the same pointer.
3294 * Rust functions which take ownership of an object provided via an argument require
3295 * this to be true and invalidate the object pointed to by inner.
3298 } LDKChannelTransactionParameters;
3301 * A trait to handle Lightning channel key material without concretizing the channel type or
3302 * the signature mechanism.
3304 typedef struct LDKChannelSigner {
3306 * An opaque pointer which is passed to your function implementations as an argument.
3307 * This has no meaning in the LDK, and can be NULL or any other value.
3311 * Gets the per-commitment point for a specific commitment number
3313 * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
3315 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
3317 * Gets the commitment secret for a specific commitment number as part of the revocation process
3319 * An external signer implementation should error here if the commitment was already signed
3320 * and should refuse to sign it in the future.
3322 * May be called more than once for the same index.
3324 * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
3326 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
3328 * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
3330 * This is required in order for the signer to make sure that releasing a commitment
3331 * secret won't leave us without a broadcastable holder transaction.
3332 * Policy checks should be implemented in this function, including checking the amount
3333 * sent to us and checking the HTLCs.
3335 * The preimages of outbound HTLCs that were fulfilled since the last commitment are provided.
3336 * A validating signer should ensure that an HTLC output is removed only when the matching
3337 * preimage is provided, or when the value to holder is restored.
3339 * Note that all the relevant preimages will be provided, but there may also be additional
3340 * irrelevant or duplicate preimages.
3342 struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_ThirtyTwoBytesZ outbound_htlc_preimages);
3344 * Validate the counterparty's revocation.
3346 * This is required in order for the signer to make sure that the state has moved
3347 * forward and it is safe to sign the next counterparty commitment.
3349 struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
3351 * Returns the holder's channel public keys and basepoints.
3353 struct LDKChannelPublicKeys pubkeys;
3355 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
3356 * Note that this takes a pointer to this object, not the this_ptr like other methods do
3357 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
3359 void (*set_pubkeys)(const struct LDKChannelSigner*NONNULL_PTR );
3361 * Returns an arbitrary identifier describing the set of keys which are provided back to you in
3362 * some [`SpendableOutputDescriptor`] types. This should be sufficient to identify this
3363 * [`EcdsaChannelSigner`] object uniquely and lookup or re-derive its keys.
3365 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
3367 * Set the counterparty static channel data, including basepoints,
3368 * `counterparty_selected`/`holder_selected_contest_delay` and funding outpoint.
3370 * This data is static, and will never change for a channel once set. For a given [`ChannelSigner`]
3371 * instance, LDK will call this method exactly once - either immediately after construction
3372 * (not including if done via [`SignerProvider::read_chan_signer`]) or when the funding
3373 * information has been generated.
3375 * channel_parameters.is_populated() MUST be true.
3377 void (*provide_channel_parameters)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
3379 * Frees any resources associated with this object given its this_arg pointer.
3380 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3382 void (*free)(void *this_arg);
3386 * A trait to sign Lightning channel transactions as described in
3387 * [BOLT 3](https://github.com/lightning/bolts/blob/master/03-transactions.md).
3389 * Signing services could be implemented on a hardware wallet and should implement signing
3390 * policies in order to be secure. Please refer to the [VLS Policy
3391 * Controls](https://gitlab.com/lightning-signer/validating-lightning-signer/-/blob/main/docs/policy-controls.md)
3392 * for an example of such policies.
3394 typedef struct LDKEcdsaChannelSigner {
3396 * An opaque pointer which is passed to your function implementations as an argument.
3397 * This has no meaning in the LDK, and can be NULL or any other value.
3401 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
3403 * Note that if signing fails or is rejected, the channel will be force-closed.
3405 * Policy checks should be implemented in this function, including checking the amount
3406 * sent to us and checking the HTLCs.
3408 * The preimages of outbound and inbound HTLCs that were fulfilled since the last commitment
3409 * are provided. A validating signer should ensure that an outbound HTLC output is removed
3410 * only when the matching preimage is provided and after the corresponding inbound HTLC has
3411 * been removed for forwarded payments.
3413 * Note that all the relevant preimages will be provided, but there may also be additional
3414 * irrelevant or duplicate preimages.
3416 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx, struct LDKCVec_ThirtyTwoBytesZ inbound_htlc_preimages, struct LDKCVec_ThirtyTwoBytesZ outbound_htlc_preimages);
3418 * Creates a signature for a holder's commitment transaction.
3420 * This will be called
3421 * - with a non-revoked `commitment_tx`.
3422 * - with the latest `commitment_tx` when we initiate a force-close.
3424 * This may be called multiple times for the same transaction.
3426 * An external signer implementation should check that the commitment has not been revoked.
3428 * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
3429 * signature and should be retried later. Once the signer is ready to provide a signature after
3430 * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
3433 * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
3435 struct LDKCResult_ECDSASignatureNoneZ (*sign_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
3437 * Create a signature for the given input in a transaction spending an HTLC transaction output
3438 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
3440 * A justice transaction may claim multiple outputs at the same time if timelocks are
3441 * similar, but only a signature for the input at index `input` should be signed for here.
3442 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
3443 * to an upcoming timelock expiration.
3445 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
3447 * `per_commitment_key` is revocation secret which was provided by our counterparty when they
3448 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
3449 * not allow the spending of any funds by itself (you need our holder `revocation_secret` to do
3452 * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
3453 * signature and should be retried later. Once the signer is ready to provide a signature after
3454 * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
3457 * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
3459 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]);
3461 * Create a signature for the given input in a transaction spending a commitment transaction
3462 * HTLC output when our counterparty broadcasts an old state.
3464 * A justice transaction may claim multiple outputs at the same time if timelocks are
3465 * similar, but only a signature for the input at index `input` should be signed for here.
3466 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
3467 * to an upcoming timelock expiration.
3469 * `amount` is the value of the output spent by this input, committed to in the BIP 143
3472 * `per_commitment_key` is revocation secret which was provided by our counterparty when they
3473 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
3474 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
3477 * `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script
3478 * (which is committed to in the BIP 143 signatures).
3480 * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
3481 * signature and should be retried later. Once the signer is ready to provide a signature after
3482 * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
3485 * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
3487 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);
3489 * Computes the signature for a commitment transaction's HTLC output used as an input within
3490 * `htlc_tx`, which spends the commitment transaction at index `input`. The signature returned
3491 * must be be computed using [`EcdsaSighashType::All`].
3493 * Note that this may be called for HTLCs in the penultimate commitment transaction if a
3494 * [`ChannelMonitor`] [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
3495 * broadcasts it before receiving the update for the latest commitment transaction.
3497 * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
3498 * signature and should be retried later. Once the signer is ready to provide a signature after
3499 * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
3502 * [`EcdsaSighashType::All`]: bitcoin::sighash::EcdsaSighashType::All
3503 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
3504 * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
3506 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);
3508 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
3509 * transaction, either offered or received.
3511 * Such a transaction may claim multiples offered outputs at same time if we know the
3512 * preimage for each when we create it, but only the input at index `input` should be
3513 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
3514 * needed with regards to an upcoming timelock expiration.
3516 * `witness_script` is either an offered or received script as defined in BOLT3 for HTLC
3519 * `amount` is value of the output spent by this input, committed to in the BIP 143 signature.
3521 * `per_commitment_point` is the dynamic point corresponding to the channel state
3522 * detected onchain. It has been generated by our counterparty and is used to derive
3523 * channel state keys, which are then included in the witness script and committed to in the
3524 * BIP 143 signature.
3526 * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
3527 * signature and should be retried later. Once the signer is ready to provide a signature after
3528 * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
3531 * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
3533 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);
3535 * Create a signature for a (proposed) closing transaction.
3537 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
3538 * chosen to forgo their output as dust.
3540 struct LDKCResult_ECDSASignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
3542 * Computes the signature for a commitment transaction's anchor output used as an
3543 * input within `anchor_tx`, which spends the commitment transaction, at index `input`.
3545 * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
3546 * signature and should be retried later. Once the signer is ready to provide a signature after
3547 * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
3550 * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
3552 struct LDKCResult_ECDSASignatureNoneZ (*sign_holder_anchor_input)(const void *this_arg, struct LDKTransaction anchor_tx, uintptr_t input);
3554 * Signs a channel announcement message with our funding key proving it comes from one of the
3555 * channel participants.
3557 * Channel announcements also require a signature from each node's network key. Our node
3558 * signature is computed through [`NodeSigner::sign_gossip_message`].
3560 * Note that if this fails or is rejected, the channel will not be publicly announced and
3561 * our counterparty may (though likely will not) close the channel on us for violating the
3564 * [`NodeSigner::sign_gossip_message`]: crate::sign::NodeSigner::sign_gossip_message
3566 struct LDKCResult_ECDSASignatureNoneZ (*sign_channel_announcement_with_funding_key)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
3568 * Implementation of ChannelSigner for this object.
3570 struct LDKChannelSigner ChannelSigner;
3572 * Frees any resources associated with this object given its this_arg pointer.
3573 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3575 void (*free)(void *this_arg);
3576 } LDKEcdsaChannelSigner;
3579 * A writeable signer.
3581 * There will always be two instances of a signer per channel, one occupied by the
3582 * [`ChannelManager`] and another by the channel's [`ChannelMonitor`].
3584 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
3585 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
3587 typedef struct LDKWriteableEcdsaChannelSigner {
3589 * An opaque pointer which is passed to your function implementations as an argument.
3590 * This has no meaning in the LDK, and can be NULL or any other value.
3594 * Implementation of EcdsaChannelSigner for this object.
3596 struct LDKEcdsaChannelSigner EcdsaChannelSigner;
3598 * Serialize the object into a byte array
3600 struct LDKCVec_u8Z (*write)(const void *this_arg);
3602 * Called, if set, after this WriteableEcdsaChannelSigner has been cloned into a duplicate object.
3603 * The new WriteableEcdsaChannelSigner is provided, and should be mutated as needed to perform a
3604 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
3606 void (*cloned)(struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR new_WriteableEcdsaChannelSigner);
3608 * Frees any resources associated with this object given its this_arg pointer.
3609 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3611 void (*free)(void *this_arg);
3612 } LDKWriteableEcdsaChannelSigner;
3615 * The contents of CResult_WriteableEcdsaChannelSignerDecodeErrorZ
3617 typedef union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr {
3619 * A pointer to the contents in the success state.
3620 * Reading from this pointer when `result_ok` is not set is undefined.
3622 struct LDKWriteableEcdsaChannelSigner *result;
3624 * A pointer to the contents in the error state.
3625 * Reading from this pointer when `result_ok` is set is undefined.
3627 struct LDKDecodeError *err;
3628 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr;
3631 * A CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents the result of a fallible operation,
3632 * containing a crate::lightning::sign::ecdsa::WriteableEcdsaChannelSigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
3633 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3635 typedef struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ {
3637 * The contents of this CResult_WriteableEcdsaChannelSignerDecodeErrorZ, accessible via either
3638 * `err` or `result` depending on the state of `result_ok`.
3640 union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr contents;
3642 * Whether this CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents a success state.
3645 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ;
3648 * The contents of CResult_CVec_u8ZNoneZ
3650 typedef union LDKCResult_CVec_u8ZNoneZPtr {
3652 * A pointer to the contents in the success state.
3653 * Reading from this pointer when `result_ok` is not set is undefined.
3655 struct LDKCVec_u8Z *result;
3657 * Note that this value is always NULL, as there are no contents in the Err variant
3660 } LDKCResult_CVec_u8ZNoneZPtr;
3663 * A CResult_CVec_u8ZNoneZ represents the result of a fallible operation,
3664 * containing a crate::c_types::derived::CVec_u8Z on success and a () on failure.
3665 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3667 typedef struct LDKCResult_CVec_u8ZNoneZ {
3669 * The contents of this CResult_CVec_u8ZNoneZ, accessible via either
3670 * `err` or `result` depending on the state of `result_ok`.
3672 union LDKCResult_CVec_u8ZNoneZPtr contents;
3674 * Whether this CResult_CVec_u8ZNoneZ represents a success state.
3677 } LDKCResult_CVec_u8ZNoneZ;
3680 * The contents of CResult_ShutdownScriptNoneZ
3682 typedef union LDKCResult_ShutdownScriptNoneZPtr {
3684 * A pointer to the contents in the success state.
3685 * Reading from this pointer when `result_ok` is not set is undefined.
3687 struct LDKShutdownScript *result;
3689 * Note that this value is always NULL, as there are no contents in the Err variant
3692 } LDKCResult_ShutdownScriptNoneZPtr;
3695 * A CResult_ShutdownScriptNoneZ represents the result of a fallible operation,
3696 * containing a crate::lightning::ln::script::ShutdownScript on success and a () on failure.
3697 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3699 typedef struct LDKCResult_ShutdownScriptNoneZ {
3701 * The contents of this CResult_ShutdownScriptNoneZ, accessible via either
3702 * `err` or `result` depending on the state of `result_ok`.
3704 union LDKCResult_ShutdownScriptNoneZPtr contents;
3706 * Whether this CResult_ShutdownScriptNoneZ represents a success state.
3709 } LDKCResult_ShutdownScriptNoneZ;
3712 * An enum which can either contain a u16 or not
3714 typedef enum LDKCOption_u16Z_Tag {
3716 * When we're in this state, this COption_u16Z contains a u16
3718 LDKCOption_u16Z_Some,
3720 * When we're in this state, this COption_u16Z contains nothing
3722 LDKCOption_u16Z_None,
3724 * Must be last for serialization purposes
3726 LDKCOption_u16Z_Sentinel,
3727 } LDKCOption_u16Z_Tag;
3729 typedef struct LDKCOption_u16Z {
3730 LDKCOption_u16Z_Tag tag;
3739 * An enum which can either contain a bool or not
3741 typedef enum LDKCOption_boolZ_Tag {
3743 * When we're in this state, this COption_boolZ contains a bool
3745 LDKCOption_boolZ_Some,
3747 * When we're in this state, this COption_boolZ contains nothing
3749 LDKCOption_boolZ_None,
3751 * Must be last for serialization purposes
3753 LDKCOption_boolZ_Sentinel,
3754 } LDKCOption_boolZ_Tag;
3756 typedef struct LDKCOption_boolZ {
3757 LDKCOption_boolZ_Tag tag;
3766 * The contents of CResult_WitnessNoneZ
3768 typedef union LDKCResult_WitnessNoneZPtr {
3770 * A pointer to the contents in the success state.
3771 * Reading from this pointer when `result_ok` is not set is undefined.
3773 struct LDKWitness *result;
3775 * Note that this value is always NULL, as there are no contents in the Err variant
3778 } LDKCResult_WitnessNoneZPtr;
3781 * A CResult_WitnessNoneZ represents the result of a fallible operation,
3782 * containing a crate::c_types::Witness on success and a () on failure.
3783 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3785 typedef struct LDKCResult_WitnessNoneZ {
3787 * The contents of this CResult_WitnessNoneZ, accessible via either
3788 * `err` or `result` depending on the state of `result_ok`.
3790 union LDKCResult_WitnessNoneZPtr contents;
3792 * Whether this CResult_WitnessNoneZ represents a success state.
3795 } LDKCResult_WitnessNoneZ;
3800 * A simple implementation of [`WriteableEcdsaChannelSigner`] that just keeps the private keys in memory.
3802 * This implementation performs no policy checks and is insufficient by itself as
3803 * a secure external signer.
3805 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
3807 * A pointer to the opaque Rust object.
3808 * Nearly everywhere, inner must be non-null, however in places where
3809 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3811 LDKnativeInMemorySigner *inner;
3813 * Indicates that this is the only struct which contains the same pointer.
3814 * Rust functions which take ownership of an object provided via an argument require
3815 * this to be true and invalidate the object pointed to by inner.
3818 } LDKInMemorySigner;
3821 * The contents of CResult_InMemorySignerDecodeErrorZ
3823 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
3825 * A pointer to the contents in the success state.
3826 * Reading from this pointer when `result_ok` is not set is undefined.
3828 struct LDKInMemorySigner *result;
3830 * A pointer to the contents in the error state.
3831 * Reading from this pointer when `result_ok` is set is undefined.
3833 struct LDKDecodeError *err;
3834 } LDKCResult_InMemorySignerDecodeErrorZPtr;
3837 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
3838 * containing a crate::lightning::sign::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
3839 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3841 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
3843 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
3844 * `err` or `result` depending on the state of `result_ok`.
3846 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
3848 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
3851 } LDKCResult_InMemorySignerDecodeErrorZ;
3856 * A [`CandidateRouteHop::FirstHop`] entry.
3858 typedef struct MUST_USE_STRUCT LDKFirstHopCandidate {
3860 * A pointer to the opaque Rust object.
3861 * Nearly everywhere, inner must be non-null, however in places where
3862 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3864 LDKnativeFirstHopCandidate *inner;
3866 * Indicates that this is the only struct which contains the same pointer.
3867 * Rust functions which take ownership of an object provided via an argument require
3868 * this to be true and invalidate the object pointed to by inner.
3871 } LDKFirstHopCandidate;
3876 * A [`CandidateRouteHop::PublicHop`] entry.
3878 typedef struct MUST_USE_STRUCT LDKPublicHopCandidate {
3880 * A pointer to the opaque Rust object.
3881 * Nearly everywhere, inner must be non-null, however in places where
3882 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3884 LDKnativePublicHopCandidate *inner;
3886 * Indicates that this is the only struct which contains the same pointer.
3887 * Rust functions which take ownership of an object provided via an argument require
3888 * this to be true and invalidate the object pointed to by inner.
3891 } LDKPublicHopCandidate;
3896 * A [`CandidateRouteHop::PrivateHop`] entry.
3898 typedef struct MUST_USE_STRUCT LDKPrivateHopCandidate {
3900 * A pointer to the opaque Rust object.
3901 * Nearly everywhere, inner must be non-null, however in places where
3902 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3904 LDKnativePrivateHopCandidate *inner;
3906 * Indicates that this is the only struct which contains the same pointer.
3907 * Rust functions which take ownership of an object provided via an argument require
3908 * this to be true and invalidate the object pointed to by inner.
3911 } LDKPrivateHopCandidate;
3916 * A [`CandidateRouteHop::Blinded`] entry.
3918 typedef struct MUST_USE_STRUCT LDKBlindedPathCandidate {
3920 * A pointer to the opaque Rust object.
3921 * Nearly everywhere, inner must be non-null, however in places where
3922 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3924 LDKnativeBlindedPathCandidate *inner;
3926 * Indicates that this is the only struct which contains the same pointer.
3927 * Rust functions which take ownership of an object provided via an argument require
3928 * this to be true and invalidate the object pointed to by inner.
3931 } LDKBlindedPathCandidate;
3936 * A [`CandidateRouteHop::OneHopBlinded`] entry.
3938 typedef struct MUST_USE_STRUCT LDKOneHopBlindedPathCandidate {
3940 * A pointer to the opaque Rust object.
3941 * Nearly everywhere, inner must be non-null, however in places where
3942 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3944 LDKnativeOneHopBlindedPathCandidate *inner;
3946 * Indicates that this is the only struct which contains the same pointer.
3947 * Rust functions which take ownership of an object provided via an argument require
3948 * this to be true and invalidate the object pointed to by inner.
3951 } LDKOneHopBlindedPathCandidate;
3954 * A wrapper around the various hop representations.
3956 * Can be used to examine the properties of a hop,
3957 * potentially to decide whether to include it in a route.
3959 typedef enum LDKCandidateRouteHop_Tag {
3961 * A hop from the payer, where the outbound liquidity is known.
3963 LDKCandidateRouteHop_FirstHop,
3965 * A hop found in the [`ReadOnlyNetworkGraph`].
3967 LDKCandidateRouteHop_PublicHop,
3969 * A private hop communicated by the payee, generally via a BOLT 11 invoice.
3971 * Because BOLT 11 route hints can take multiple hops to get to the destination, this may not
3972 * terminate at the payee.
3974 LDKCandidateRouteHop_PrivateHop,
3976 * A blinded path which starts with an introduction point and ultimately terminates with the
3979 * Because we don't know the payee's identity, [`CandidateRouteHop::target`] will return
3980 * `None` in this state.
3982 * Because blinded paths are \"all or nothing\", and we cannot use just one part of a blinded
3983 * path, the full path is treated as a single [`CandidateRouteHop`].
3985 LDKCandidateRouteHop_Blinded,
3987 * Similar to [`Self::Blinded`], but the path here only has one hop.
3989 * While we treat this similarly to [`CandidateRouteHop::Blinded`] in many respects (e.g.
3990 * returning `None` from [`CandidateRouteHop::target`]), in this case we do actually know the
3991 * payee's identity - it's the introduction point!
3993 * [`BlindedPayInfo`] provided for 1-hop blinded paths is ignored because it is meant to apply
3994 * to the hops *between* the introduction node and the destination.
3996 * This primarily exists to track that we need to included a blinded path at the end of our
3997 * [`Route`], even though it doesn't actually add an additional hop in the payment.
3999 LDKCandidateRouteHop_OneHopBlinded,
4001 * Must be last for serialization purposes
4003 LDKCandidateRouteHop_Sentinel,
4004 } LDKCandidateRouteHop_Tag;
4006 typedef struct MUST_USE_STRUCT LDKCandidateRouteHop {
4007 LDKCandidateRouteHop_Tag tag;
4010 struct LDKFirstHopCandidate first_hop;
4013 struct LDKPublicHopCandidate public_hop;
4016 struct LDKPrivateHopCandidate private_hop;
4019 struct LDKBlindedPathCandidate blinded;
4022 struct LDKOneHopBlindedPathCandidate one_hop_blinded;
4025 } LDKCandidateRouteHop;
4030 * Proposed use of a channel passed as a parameter to [`ScoreLookUp::channel_penalty_msat`].
4032 typedef struct MUST_USE_STRUCT LDKChannelUsage {
4034 * A pointer to the opaque Rust object.
4035 * Nearly everywhere, inner must be non-null, however in places where
4036 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4038 LDKnativeChannelUsage *inner;
4040 * Indicates that this is the only struct which contains the same pointer.
4041 * Rust functions which take ownership of an object provided via an argument require
4042 * this to be true and invalidate the object pointed to by inner.
4050 * Parameters for configuring [`ProbabilisticScorer`].
4052 * Used to configure base, liquidity, and amount penalties, the sum of which comprises the channel
4053 * penalty (i.e., the amount in msats willing to be paid to avoid routing through the channel).
4055 * The penalty applied to any channel by the [`ProbabilisticScorer`] is the sum of each of the
4058 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringFeeParameters {
4060 * A pointer to the opaque Rust object.
4061 * Nearly everywhere, inner must be non-null, however in places where
4062 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4064 LDKnativeProbabilisticScoringFeeParameters *inner;
4066 * Indicates that this is the only struct which contains the same pointer.
4067 * Rust functions which take ownership of an object provided via an argument require
4068 * this to be true and invalidate the object pointed to by inner.
4071 } LDKProbabilisticScoringFeeParameters;
4074 * An interface used to score payment channels for path finding.
4076 * `ScoreLookUp` is used to determine the penalty for a given channel.
4078 * Scoring is in terms of fees willing to be paid in order to avoid routing through a channel.
4080 typedef struct LDKScoreLookUp {
4082 * An opaque pointer which is passed to your function implementations as an argument.
4083 * This has no meaning in the LDK, and can be NULL or any other value.
4087 * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
4088 * given channel in the direction from `source` to `target`.
4090 * The channel's capacity (less any other MPP parts that are also being considered for use in
4091 * the same payment) is given by `capacity_msat`. It may be determined from various sources
4092 * such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near
4093 * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount.
4094 * Thus, implementations should be overflow-safe.
4096 uint64_t (*channel_penalty_msat)(const void *this_arg, const struct LDKCandidateRouteHop *NONNULL_PTR candidate, struct LDKChannelUsage usage, const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR score_params);
4098 * Frees any resources associated with this object given its this_arg pointer.
4099 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4101 void (*free)(void *this_arg);
4107 * A path in a [`Route`] to the payment recipient. Must always be at least length one.
4108 * If no [`Path::blinded_tail`] is present, then [`Path::hops`] length may be up to 19.
4110 typedef struct MUST_USE_STRUCT LDKPath {
4112 * A pointer to the opaque Rust object.
4113 * Nearly everywhere, inner must be non-null, however in places where
4114 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4116 LDKnativePath *inner;
4118 * Indicates that this is the only struct which contains the same pointer.
4119 * Rust functions which take ownership of an object provided via an argument require
4120 * this to be true and invalidate the object pointed to by inner.
4126 * `ScoreUpdate` is used to update the scorer's internal state after a payment attempt.
4128 typedef struct LDKScoreUpdate {
4130 * An opaque pointer which is passed to your function implementations as an argument.
4131 * This has no meaning in the LDK, and can be NULL or any other value.
4135 * Handles updating channel penalties after failing to route through a channel.
4137 void (*payment_path_failed)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id, uint64_t duration_since_epoch);
4139 * Handles updating channel penalties after successfully routing along a path.
4141 void (*payment_path_successful)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t duration_since_epoch);
4143 * Handles updating channel penalties after a probe over the given path failed.
4145 void (*probe_failed)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id, uint64_t duration_since_epoch);
4147 * Handles updating channel penalties after a probe over the given path succeeded.
4149 void (*probe_successful)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t duration_since_epoch);
4151 * Scorers may wish to reduce their certainty of channel liquidity information over time.
4152 * Thus, this method is provided to allow scorers to observe the passage of time - the holder
4153 * of this object should call this method regularly (generally via the
4154 * `lightning-background-processor` crate).
4156 void (*time_passed)(void *this_arg, uint64_t duration_since_epoch);
4158 * Frees any resources associated with this object given its this_arg pointer.
4159 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4161 void (*free)(void *this_arg);
4165 * A scorer that is accessed under a lock.
4167 * Needed so that calls to [`ScoreLookUp::channel_penalty_msat`] in [`find_route`] can be made while
4168 * having shared ownership of a scorer but without requiring internal locking in [`ScoreUpdate`]
4169 * implementations. Internal locking would be detrimental to route finding performance and could
4170 * result in [`ScoreLookUp::channel_penalty_msat`] returning a different value for the same channel.
4172 * [`find_route`]: crate::routing::router::find_route
4174 typedef struct LDKLockableScore {
4176 * An opaque pointer which is passed to your function implementations as an argument.
4177 * This has no meaning in the LDK, and can be NULL or any other value.
4181 * Returns read locked scorer.
4183 struct LDKScoreLookUp (*read_lock)(const void *this_arg);
4185 * Returns write locked scorer.
4187 struct LDKScoreUpdate (*write_lock)(const void *this_arg);
4189 * Frees any resources associated with this object given its this_arg pointer.
4190 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4192 void (*free)(void *this_arg);
4196 * Refers to a scorer that is accessible under lock and also writeable to disk
4198 * We need this trait to be able to pass in a scorer to `lightning-background-processor` that will enable us to
4199 * use the Persister to persist it.
4201 typedef struct LDKWriteableScore {
4203 * An opaque pointer which is passed to your function implementations as an argument.
4204 * This has no meaning in the LDK, and can be NULL or any other value.
4208 * Implementation of LockableScore for this object.
4210 struct LDKLockableScore LockableScore;
4212 * Serialize the object into a byte array
4214 struct LDKCVec_u8Z (*write)(const void *this_arg);
4216 * Frees any resources associated with this object given its this_arg pointer.
4217 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4219 void (*free)(void *this_arg);
4220 } LDKWriteableScore;
4223 * An enum which can either contain a crate::lightning::routing::scoring::WriteableScore or not
4225 typedef enum LDKCOption_WriteableScoreZ_Tag {
4227 * When we're in this state, this COption_WriteableScoreZ contains a crate::lightning::routing::scoring::WriteableScore
4229 LDKCOption_WriteableScoreZ_Some,
4231 * When we're in this state, this COption_WriteableScoreZ contains nothing
4233 LDKCOption_WriteableScoreZ_None,
4235 * Must be last for serialization purposes
4237 LDKCOption_WriteableScoreZ_Sentinel,
4238 } LDKCOption_WriteableScoreZ_Tag;
4240 typedef struct LDKCOption_WriteableScoreZ {
4241 LDKCOption_WriteableScoreZ_Tag tag;
4244 struct LDKWriteableScore some;
4247 } LDKCOption_WriteableScoreZ;
4250 * The contents of CResult_NoneIOErrorZ
4252 typedef union LDKCResult_NoneIOErrorZPtr {
4254 * Note that this value is always NULL, as there are no contents in the OK variant
4258 * A pointer to the contents in the error state.
4259 * Reading from this pointer when `result_ok` is set is undefined.
4261 enum LDKIOError *err;
4262 } LDKCResult_NoneIOErrorZPtr;
4265 * A CResult_NoneIOErrorZ represents the result of a fallible operation,
4266 * containing a () on success and a crate::c_types::IOError on failure.
4267 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4269 typedef struct LDKCResult_NoneIOErrorZ {
4271 * The contents of this CResult_NoneIOErrorZ, accessible via either
4272 * `err` or `result` depending on the state of `result_ok`.
4274 union LDKCResult_NoneIOErrorZPtr contents;
4276 * Whether this CResult_NoneIOErrorZ represents a success state.
4279 } LDKCResult_NoneIOErrorZ;
4284 * Details of a channel, as returned by [`ChannelManager::list_channels`] and [`ChannelManager::list_usable_channels`]
4286 typedef struct MUST_USE_STRUCT LDKChannelDetails {
4288 * A pointer to the opaque Rust object.
4289 * Nearly everywhere, inner must be non-null, however in places where
4290 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4292 LDKnativeChannelDetails *inner;
4294 * Indicates that this is the only struct which contains the same pointer.
4295 * Rust functions which take ownership of an object provided via an argument require
4296 * this to be true and invalidate the object pointed to by inner.
4299 } LDKChannelDetails;
4302 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
4303 * This corresponds to std::vector in C++
4305 typedef struct LDKCVec_ChannelDetailsZ {
4307 * The elements in the array.
4308 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4310 struct LDKChannelDetails *data;
4312 * The number of elements pointed to by `data`.
4315 } LDKCVec_ChannelDetailsZ;
4320 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
4321 * it can take multiple paths. Each path is composed of one or more hops through the network.
4323 typedef struct MUST_USE_STRUCT LDKRoute {
4325 * A pointer to the opaque Rust object.
4326 * Nearly everywhere, inner must be non-null, however in places where
4327 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4329 LDKnativeRoute *inner;
4331 * Indicates that this is the only struct which contains the same pointer.
4332 * Rust functions which take ownership of an object provided via an argument require
4333 * this to be true and invalidate the object pointed to by inner.
4341 * An Err type for failure to process messages.
4343 typedef struct MUST_USE_STRUCT LDKLightningError {
4345 * A pointer to the opaque Rust object.
4346 * Nearly everywhere, inner must be non-null, however in places where
4347 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4349 LDKnativeLightningError *inner;
4351 * Indicates that this is the only struct which contains the same pointer.
4352 * Rust functions which take ownership of an object provided via an argument require
4353 * this to be true and invalidate the object pointed to by inner.
4356 } LDKLightningError;
4359 * The contents of CResult_RouteLightningErrorZ
4361 typedef union LDKCResult_RouteLightningErrorZPtr {
4363 * A pointer to the contents in the success state.
4364 * Reading from this pointer when `result_ok` is not set is undefined.
4366 struct LDKRoute *result;
4368 * A pointer to the contents in the error state.
4369 * Reading from this pointer when `result_ok` is set is undefined.
4371 struct LDKLightningError *err;
4372 } LDKCResult_RouteLightningErrorZPtr;
4375 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
4376 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
4377 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4379 typedef struct LDKCResult_RouteLightningErrorZ {
4381 * The contents of this CResult_RouteLightningErrorZ, accessible via either
4382 * `err` or `result` depending on the state of `result_ok`.
4384 union LDKCResult_RouteLightningErrorZPtr contents;
4386 * Whether this CResult_RouteLightningErrorZ represents a success state.
4389 } LDKCResult_RouteLightningErrorZ;
4392 * A tuple of 2 elements. See the individual fields for the types contained.
4394 typedef struct LDKC2Tuple_BlindedPayInfoBlindedPathZ {
4396 * The element at position 0
4398 struct LDKBlindedPayInfo a;
4400 * The element at position 1
4402 struct LDKBlindedPath b;
4403 } LDKC2Tuple_BlindedPayInfoBlindedPathZ;
4406 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZs of arbitrary size.
4407 * This corresponds to std::vector in C++
4409 typedef struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ {
4411 * The elements in the array.
4412 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4414 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *data;
4416 * The number of elements pointed to by `data`.
4419 } LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ;
4422 * The contents of CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ
4424 typedef union LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZPtr {
4426 * A pointer to the contents in the success state.
4427 * Reading from this pointer when `result_ok` is not set is undefined.
4429 struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ *result;
4431 * Note that this value is always NULL, as there are no contents in the Err variant
4434 } LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZPtr;
4437 * A CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ represents the result of a fallible operation,
4438 * containing a crate::c_types::derived::CVec_C2Tuple_BlindedPayInfoBlindedPathZZ on success and a () on failure.
4439 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4441 typedef struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ {
4443 * The contents of this CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ, accessible via either
4444 * `err` or `result` depending on the state of `result_ok`.
4446 union LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZPtr contents;
4448 * Whether this CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ represents a success state.
4451 } LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ;
4454 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
4455 * This corresponds to std::vector in C++
4457 typedef struct LDKCVec_PublicKeyZ {
4459 * The elements in the array.
4460 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4462 struct LDKPublicKey *data;
4464 * The number of elements pointed to by `data`.
4467 } LDKCVec_PublicKeyZ;
4472 * A path for sending an [`OnionMessage`].
4474 typedef struct MUST_USE_STRUCT LDKOnionMessagePath {
4476 * A pointer to the opaque Rust object.
4477 * Nearly everywhere, inner must be non-null, however in places where
4478 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4480 LDKnativeOnionMessagePath *inner;
4482 * Indicates that this is the only struct which contains the same pointer.
4483 * Rust functions which take ownership of an object provided via an argument require
4484 * this to be true and invalidate the object pointed to by inner.
4487 } LDKOnionMessagePath;
4490 * The contents of CResult_OnionMessagePathNoneZ
4492 typedef union LDKCResult_OnionMessagePathNoneZPtr {
4494 * A pointer to the contents in the success state.
4495 * Reading from this pointer when `result_ok` is not set is undefined.
4497 struct LDKOnionMessagePath *result;
4499 * Note that this value is always NULL, as there are no contents in the Err variant
4502 } LDKCResult_OnionMessagePathNoneZPtr;
4505 * A CResult_OnionMessagePathNoneZ represents the result of a fallible operation,
4506 * containing a crate::lightning::onion_message::messenger::OnionMessagePath on success and a () on failure.
4507 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4509 typedef struct LDKCResult_OnionMessagePathNoneZ {
4511 * The contents of this CResult_OnionMessagePathNoneZ, accessible via either
4512 * `err` or `result` depending on the state of `result_ok`.
4514 union LDKCResult_OnionMessagePathNoneZPtr contents;
4516 * Whether this CResult_OnionMessagePathNoneZ represents a success state.
4519 } LDKCResult_OnionMessagePathNoneZ;
4522 * The contents of CResult_CVec_BlindedPathZNoneZ
4524 typedef union LDKCResult_CVec_BlindedPathZNoneZPtr {
4526 * A pointer to the contents in the success state.
4527 * Reading from this pointer when `result_ok` is not set is undefined.
4529 struct LDKCVec_BlindedPathZ *result;
4531 * Note that this value is always NULL, as there are no contents in the Err variant
4534 } LDKCResult_CVec_BlindedPathZNoneZPtr;
4537 * A CResult_CVec_BlindedPathZNoneZ represents the result of a fallible operation,
4538 * containing a crate::c_types::derived::CVec_BlindedPathZ on success and a () on failure.
4539 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4541 typedef struct LDKCResult_CVec_BlindedPathZNoneZ {
4543 * The contents of this CResult_CVec_BlindedPathZNoneZ, accessible via either
4544 * `err` or `result` depending on the state of `result_ok`.
4546 union LDKCResult_CVec_BlindedPathZNoneZPtr contents;
4548 * Whether this CResult_CVec_BlindedPathZNoneZ represents a success state.
4551 } LDKCResult_CVec_BlindedPathZNoneZ;
4556 * A data structure for tracking in-flight HTLCs. May be used during pathfinding to account for
4557 * in-use channel liquidity.
4559 typedef struct MUST_USE_STRUCT LDKInFlightHtlcs {
4561 * A pointer to the opaque Rust object.
4562 * Nearly everywhere, inner must be non-null, however in places where
4563 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4565 LDKnativeInFlightHtlcs *inner;
4567 * Indicates that this is the only struct which contains the same pointer.
4568 * Rust functions which take ownership of an object provided via an argument require
4569 * this to be true and invalidate the object pointed to by inner.
4575 * The contents of CResult_InFlightHtlcsDecodeErrorZ
4577 typedef union LDKCResult_InFlightHtlcsDecodeErrorZPtr {
4579 * A pointer to the contents in the success state.
4580 * Reading from this pointer when `result_ok` is not set is undefined.
4582 struct LDKInFlightHtlcs *result;
4584 * A pointer to the contents in the error state.
4585 * Reading from this pointer when `result_ok` is set is undefined.
4587 struct LDKDecodeError *err;
4588 } LDKCResult_InFlightHtlcsDecodeErrorZPtr;
4591 * A CResult_InFlightHtlcsDecodeErrorZ represents the result of a fallible operation,
4592 * containing a crate::lightning::routing::router::InFlightHtlcs on success and a crate::lightning::ln::msgs::DecodeError on failure.
4593 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4595 typedef struct LDKCResult_InFlightHtlcsDecodeErrorZ {
4597 * The contents of this CResult_InFlightHtlcsDecodeErrorZ, accessible via either
4598 * `err` or `result` depending on the state of `result_ok`.
4600 union LDKCResult_InFlightHtlcsDecodeErrorZPtr contents;
4602 * Whether this CResult_InFlightHtlcsDecodeErrorZ represents a success state.
4605 } LDKCResult_InFlightHtlcsDecodeErrorZ;
4610 * A hop in a route, and additional metadata about it. \"Hop\" is defined as a node and the channel
4613 typedef struct MUST_USE_STRUCT LDKRouteHop {
4615 * A pointer to the opaque Rust object.
4616 * Nearly everywhere, inner must be non-null, however in places where
4617 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4619 LDKnativeRouteHop *inner;
4621 * Indicates that this is the only struct which contains the same pointer.
4622 * Rust functions which take ownership of an object provided via an argument require
4623 * this to be true and invalidate the object pointed to by inner.
4629 * The contents of CResult_RouteHopDecodeErrorZ
4631 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
4633 * A pointer to the contents in the success state.
4634 * Reading from this pointer when `result_ok` is not set is undefined.
4636 struct LDKRouteHop *result;
4638 * A pointer to the contents in the error state.
4639 * Reading from this pointer when `result_ok` is set is undefined.
4641 struct LDKDecodeError *err;
4642 } LDKCResult_RouteHopDecodeErrorZPtr;
4645 * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
4646 * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
4647 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4649 typedef struct LDKCResult_RouteHopDecodeErrorZ {
4651 * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
4652 * `err` or `result` depending on the state of `result_ok`.
4654 union LDKCResult_RouteHopDecodeErrorZPtr contents;
4656 * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
4659 } LDKCResult_RouteHopDecodeErrorZ;
4664 * An encrypted payload and node id corresponding to a hop in a payment or onion message path, to
4665 * be encoded in the sender's onion packet. These hops cannot be identified by outside observers
4666 * and thus can be used to hide the identity of the recipient.
4668 typedef struct MUST_USE_STRUCT LDKBlindedHop {
4670 * A pointer to the opaque Rust object.
4671 * Nearly everywhere, inner must be non-null, however in places where
4672 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4674 LDKnativeBlindedHop *inner;
4676 * Indicates that this is the only struct which contains the same pointer.
4677 * Rust functions which take ownership of an object provided via an argument require
4678 * this to be true and invalidate the object pointed to by inner.
4684 * A dynamically-allocated array of crate::lightning::blinded_path::BlindedHops of arbitrary size.
4685 * This corresponds to std::vector in C++
4687 typedef struct LDKCVec_BlindedHopZ {
4689 * The elements in the array.
4690 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4692 struct LDKBlindedHop *data;
4694 * The number of elements pointed to by `data`.
4697 } LDKCVec_BlindedHopZ;
4702 * The blinded portion of a [`Path`], if we're routing to a recipient who provided blinded paths in
4703 * their [`Bolt12Invoice`].
4705 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
4707 typedef struct MUST_USE_STRUCT LDKBlindedTail {
4709 * A pointer to the opaque Rust object.
4710 * Nearly everywhere, inner must be non-null, however in places where
4711 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4713 LDKnativeBlindedTail *inner;
4715 * Indicates that this is the only struct which contains the same pointer.
4716 * Rust functions which take ownership of an object provided via an argument require
4717 * this to be true and invalidate the object pointed to by inner.
4723 * The contents of CResult_BlindedTailDecodeErrorZ
4725 typedef union LDKCResult_BlindedTailDecodeErrorZPtr {
4727 * A pointer to the contents in the success state.
4728 * Reading from this pointer when `result_ok` is not set is undefined.
4730 struct LDKBlindedTail *result;
4732 * A pointer to the contents in the error state.
4733 * Reading from this pointer when `result_ok` is set is undefined.
4735 struct LDKDecodeError *err;
4736 } LDKCResult_BlindedTailDecodeErrorZPtr;
4739 * A CResult_BlindedTailDecodeErrorZ represents the result of a fallible operation,
4740 * containing a crate::lightning::routing::router::BlindedTail on success and a crate::lightning::ln::msgs::DecodeError on failure.
4741 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4743 typedef struct LDKCResult_BlindedTailDecodeErrorZ {
4745 * The contents of this CResult_BlindedTailDecodeErrorZ, accessible via either
4746 * `err` or `result` depending on the state of `result_ok`.
4748 union LDKCResult_BlindedTailDecodeErrorZPtr contents;
4750 * Whether this CResult_BlindedTailDecodeErrorZ represents a success state.
4753 } LDKCResult_BlindedTailDecodeErrorZ;
4756 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
4757 * This corresponds to std::vector in C++
4759 typedef struct LDKCVec_RouteHopZ {
4761 * The elements in the array.
4762 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4764 struct LDKRouteHop *data;
4766 * The number of elements pointed to by `data`.
4769 } LDKCVec_RouteHopZ;
4772 * A dynamically-allocated array of crate::lightning::routing::router::Paths of arbitrary size.
4773 * This corresponds to std::vector in C++
4775 typedef struct LDKCVec_PathZ {
4777 * The elements in the array.
4778 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4780 struct LDKPath *data;
4782 * The number of elements pointed to by `data`.
4788 * The contents of CResult_RouteDecodeErrorZ
4790 typedef union LDKCResult_RouteDecodeErrorZPtr {
4792 * A pointer to the contents in the success state.
4793 * Reading from this pointer when `result_ok` is not set is undefined.
4795 struct LDKRoute *result;
4797 * A pointer to the contents in the error state.
4798 * Reading from this pointer when `result_ok` is set is undefined.
4800 struct LDKDecodeError *err;
4801 } LDKCResult_RouteDecodeErrorZPtr;
4804 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
4805 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
4806 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4808 typedef struct LDKCResult_RouteDecodeErrorZ {
4810 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
4811 * `err` or `result` depending on the state of `result_ok`.
4813 union LDKCResult_RouteDecodeErrorZPtr contents;
4815 * Whether this CResult_RouteDecodeErrorZ represents a success state.
4818 } LDKCResult_RouteDecodeErrorZ;
4823 * Parameters needed to find a [`Route`].
4825 * Passed to [`find_route`] and [`build_route_from_hops`].
4827 typedef struct MUST_USE_STRUCT LDKRouteParameters {
4829 * A pointer to the opaque Rust object.
4830 * Nearly everywhere, inner must be non-null, however in places where
4831 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4833 LDKnativeRouteParameters *inner;
4835 * Indicates that this is the only struct which contains the same pointer.
4836 * Rust functions which take ownership of an object provided via an argument require
4837 * this to be true and invalidate the object pointed to by inner.
4840 } LDKRouteParameters;
4843 * The contents of CResult_RouteParametersDecodeErrorZ
4845 typedef union LDKCResult_RouteParametersDecodeErrorZPtr {
4847 * A pointer to the contents in the success state.
4848 * Reading from this pointer when `result_ok` is not set is undefined.
4850 struct LDKRouteParameters *result;
4852 * A pointer to the contents in the error state.
4853 * Reading from this pointer when `result_ok` is set is undefined.
4855 struct LDKDecodeError *err;
4856 } LDKCResult_RouteParametersDecodeErrorZPtr;
4859 * A CResult_RouteParametersDecodeErrorZ represents the result of a fallible operation,
4860 * containing a crate::lightning::routing::router::RouteParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
4861 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4863 typedef struct LDKCResult_RouteParametersDecodeErrorZ {
4865 * The contents of this CResult_RouteParametersDecodeErrorZ, accessible via either
4866 * `err` or `result` depending on the state of `result_ok`.
4868 union LDKCResult_RouteParametersDecodeErrorZPtr contents;
4870 * Whether this CResult_RouteParametersDecodeErrorZ represents a success state.
4873 } LDKCResult_RouteParametersDecodeErrorZ;
4876 * A dynamically-allocated array of u64s of arbitrary size.
4877 * This corresponds to std::vector in C++
4879 typedef struct LDKCVec_u64Z {
4881 * The elements in the array.
4882 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4886 * The number of elements pointed to by `data`.
4894 * Information used to route a payment.
4896 typedef struct MUST_USE_STRUCT LDKPaymentParameters {
4898 * A pointer to the opaque Rust object.
4899 * Nearly everywhere, inner must be non-null, however in places where
4900 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4902 LDKnativePaymentParameters *inner;
4904 * Indicates that this is the only struct which contains the same pointer.
4905 * Rust functions which take ownership of an object provided via an argument require
4906 * this to be true and invalidate the object pointed to by inner.
4909 } LDKPaymentParameters;
4912 * The contents of CResult_PaymentParametersDecodeErrorZ
4914 typedef union LDKCResult_PaymentParametersDecodeErrorZPtr {
4916 * A pointer to the contents in the success state.
4917 * Reading from this pointer when `result_ok` is not set is undefined.
4919 struct LDKPaymentParameters *result;
4921 * A pointer to the contents in the error state.
4922 * Reading from this pointer when `result_ok` is set is undefined.
4924 struct LDKDecodeError *err;
4925 } LDKCResult_PaymentParametersDecodeErrorZPtr;
4928 * A CResult_PaymentParametersDecodeErrorZ represents the result of a fallible operation,
4929 * containing a crate::lightning::routing::router::PaymentParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
4930 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4932 typedef struct LDKCResult_PaymentParametersDecodeErrorZ {
4934 * The contents of this CResult_PaymentParametersDecodeErrorZ, accessible via either
4935 * `err` or `result` depending on the state of `result_ok`.
4937 union LDKCResult_PaymentParametersDecodeErrorZPtr contents;
4939 * Whether this CResult_PaymentParametersDecodeErrorZ represents a success state.
4942 } LDKCResult_PaymentParametersDecodeErrorZ;
4947 * A list of hops along a payment path terminating with a channel to the recipient.
4949 typedef struct MUST_USE_STRUCT LDKRouteHint {
4951 * A pointer to the opaque Rust object.
4952 * Nearly everywhere, inner must be non-null, however in places where
4953 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4955 LDKnativeRouteHint *inner;
4957 * Indicates that this is the only struct which contains the same pointer.
4958 * Rust functions which take ownership of an object provided via an argument require
4959 * this to be true and invalidate the object pointed to by inner.
4965 * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
4966 * This corresponds to std::vector in C++
4968 typedef struct LDKCVec_RouteHintZ {
4970 * The elements in the array.
4971 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4973 struct LDKRouteHint *data;
4975 * The number of elements pointed to by `data`.
4978 } LDKCVec_RouteHintZ;
4983 * A channel descriptor for a hop along a payment path.
4985 * While this generally comes from BOLT 11's `r` field, this struct includes more fields than are
4986 * available in BOLT 11. Thus, encoding and decoding this via `lightning-invoice` is lossy, as
4987 * fields not supported in BOLT 11 will be stripped.
4989 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
4991 * A pointer to the opaque Rust object.
4992 * Nearly everywhere, inner must be non-null, however in places where
4993 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4995 LDKnativeRouteHintHop *inner;
4997 * Indicates that this is the only struct which contains the same pointer.
4998 * Rust functions which take ownership of an object provided via an argument require
4999 * this to be true and invalidate the object pointed to by inner.
5005 * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
5006 * This corresponds to std::vector in C++
5008 typedef struct LDKCVec_RouteHintHopZ {
5010 * The elements in the array.
5011 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5013 struct LDKRouteHintHop *data;
5015 * The number of elements pointed to by `data`.
5018 } LDKCVec_RouteHintHopZ;
5021 * The contents of CResult_RouteHintDecodeErrorZ
5023 typedef union LDKCResult_RouteHintDecodeErrorZPtr {
5025 * A pointer to the contents in the success state.
5026 * Reading from this pointer when `result_ok` is not set is undefined.
5028 struct LDKRouteHint *result;
5030 * A pointer to the contents in the error state.
5031 * Reading from this pointer when `result_ok` is set is undefined.
5033 struct LDKDecodeError *err;
5034 } LDKCResult_RouteHintDecodeErrorZPtr;
5037 * A CResult_RouteHintDecodeErrorZ represents the result of a fallible operation,
5038 * containing a crate::lightning::routing::router::RouteHint on success and a crate::lightning::ln::msgs::DecodeError on failure.
5039 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5041 typedef struct LDKCResult_RouteHintDecodeErrorZ {
5043 * The contents of this CResult_RouteHintDecodeErrorZ, accessible via either
5044 * `err` or `result` depending on the state of `result_ok`.
5046 union LDKCResult_RouteHintDecodeErrorZPtr contents;
5048 * Whether this CResult_RouteHintDecodeErrorZ represents a success state.
5051 } LDKCResult_RouteHintDecodeErrorZ;
5054 * The contents of CResult_RouteHintHopDecodeErrorZ
5056 typedef union LDKCResult_RouteHintHopDecodeErrorZPtr {
5058 * A pointer to the contents in the success state.
5059 * Reading from this pointer when `result_ok` is not set is undefined.
5061 struct LDKRouteHintHop *result;
5063 * A pointer to the contents in the error state.
5064 * Reading from this pointer when `result_ok` is set is undefined.
5066 struct LDKDecodeError *err;
5067 } LDKCResult_RouteHintHopDecodeErrorZPtr;
5070 * A CResult_RouteHintHopDecodeErrorZ represents the result of a fallible operation,
5071 * containing a crate::lightning::routing::router::RouteHintHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
5072 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5074 typedef struct LDKCResult_RouteHintHopDecodeErrorZ {
5076 * The contents of this CResult_RouteHintHopDecodeErrorZ, accessible via either
5077 * `err` or `result` depending on the state of `result_ok`.
5079 union LDKCResult_RouteHintHopDecodeErrorZPtr contents;
5081 * Whether this CResult_RouteHintHopDecodeErrorZ represents a success state.
5084 } LDKCResult_RouteHintHopDecodeErrorZ;
5089 * [`ScoreLookUp`] implementation that uses a fixed penalty.
5091 typedef struct MUST_USE_STRUCT LDKFixedPenaltyScorer {
5093 * A pointer to the opaque Rust object.
5094 * Nearly everywhere, inner must be non-null, however in places where
5095 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5097 LDKnativeFixedPenaltyScorer *inner;
5099 * Indicates that this is the only struct which contains the same pointer.
5100 * Rust functions which take ownership of an object provided via an argument require
5101 * this to be true and invalidate the object pointed to by inner.
5104 } LDKFixedPenaltyScorer;
5107 * The contents of CResult_FixedPenaltyScorerDecodeErrorZ
5109 typedef union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr {
5111 * A pointer to the contents in the success state.
5112 * Reading from this pointer when `result_ok` is not set is undefined.
5114 struct LDKFixedPenaltyScorer *result;
5116 * A pointer to the contents in the error state.
5117 * Reading from this pointer when `result_ok` is set is undefined.
5119 struct LDKDecodeError *err;
5120 } LDKCResult_FixedPenaltyScorerDecodeErrorZPtr;
5123 * A CResult_FixedPenaltyScorerDecodeErrorZ represents the result of a fallible operation,
5124 * containing a crate::lightning::routing::scoring::FixedPenaltyScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
5125 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5127 typedef struct LDKCResult_FixedPenaltyScorerDecodeErrorZ {
5129 * The contents of this CResult_FixedPenaltyScorerDecodeErrorZ, accessible via either
5130 * `err` or `result` depending on the state of `result_ok`.
5132 union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr contents;
5134 * Whether this CResult_FixedPenaltyScorerDecodeErrorZ represents a success state.
5137 } LDKCResult_FixedPenaltyScorerDecodeErrorZ;
5142 * Represents the compressed public key of a node
5144 typedef struct MUST_USE_STRUCT LDKNodeId {
5146 * A pointer to the opaque Rust object.
5147 * Nearly everywhere, inner must be non-null, however in places where
5148 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5150 LDKnativeNodeId *inner;
5152 * Indicates that this is the only struct which contains the same pointer.
5153 * Rust functions which take ownership of an object provided via an argument require
5154 * this to be true and invalidate the object pointed to by inner.
5160 * A dynamically-allocated array of crate::lightning::routing::gossip::NodeIds of arbitrary size.
5161 * This corresponds to std::vector in C++
5163 typedef struct LDKCVec_NodeIdZ {
5165 * The elements in the array.
5166 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5168 struct LDKNodeId *data;
5170 * The number of elements pointed to by `data`.
5176 * A tuple of 2 elements. See the individual fields for the types contained.
5178 typedef struct LDKC2Tuple_u64u64Z {
5180 * The element at position 0
5184 * The element at position 1
5187 } LDKC2Tuple_u64u64Z;
5190 * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u64Z or not
5192 typedef enum LDKCOption_C2Tuple_u64u64ZZ_Tag {
5194 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains a crate::c_types::derived::C2Tuple_u64u64Z
5196 LDKCOption_C2Tuple_u64u64ZZ_Some,
5198 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains nothing
5200 LDKCOption_C2Tuple_u64u64ZZ_None,
5202 * Must be last for serialization purposes
5204 LDKCOption_C2Tuple_u64u64ZZ_Sentinel,
5205 } LDKCOption_C2Tuple_u64u64ZZ_Tag;
5207 typedef struct LDKCOption_C2Tuple_u64u64ZZ {
5208 LDKCOption_C2Tuple_u64u64ZZ_Tag tag;
5211 struct LDKC2Tuple_u64u64Z some;
5214 } LDKCOption_C2Tuple_u64u64ZZ;
5219 typedef struct LDKThirtyTwoU16s {
5221 * The thirty-two 16-bit integers
5227 * A tuple of 2 elements. See the individual fields for the types contained.
5229 typedef struct LDKC2Tuple_Z {
5231 * The element at position 0
5233 struct LDKThirtyTwoU16s a;
5235 * The element at position 1
5237 struct LDKThirtyTwoU16s b;
5241 * A tuple of 2 elements. See the individual fields for the types contained.
5243 typedef struct LDKC2Tuple__u1632_u1632Z {
5245 * The element at position 0
5247 struct LDKThirtyTwoU16s a;
5249 * The element at position 1
5251 struct LDKThirtyTwoU16s b;
5252 } LDKC2Tuple__u1632_u1632Z;
5255 * An enum which can either contain a crate::c_types::derived::C2Tuple__u1632_u1632Z or not
5257 typedef enum LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag {
5259 * When we're in this state, this COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ contains a crate::c_types::derived::C2Tuple__u1632_u1632Z
5261 LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Some,
5263 * When we're in this state, this COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ contains nothing
5265 LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_None,
5267 * Must be last for serialization purposes
5269 LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Sentinel,
5270 } LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag;
5272 typedef struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ {
5273 LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag tag;
5276 struct LDKC2Tuple__u1632_u1632Z some;
5279 } LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ;
5282 * An enum which can either contain a f64 or not
5284 typedef enum LDKCOption_f64Z_Tag {
5286 * When we're in this state, this COption_f64Z contains a f64
5288 LDKCOption_f64Z_Some,
5290 * When we're in this state, this COption_f64Z contains nothing
5292 LDKCOption_f64Z_None,
5294 * Must be last for serialization purposes
5296 LDKCOption_f64Z_Sentinel,
5297 } LDKCOption_f64Z_Tag;
5299 typedef struct LDKCOption_f64Z {
5300 LDKCOption_f64Z_Tag tag;
5311 * A Record, unit of logging output with Metadata to enable filtering
5312 * Module_path, file, line to inform on log's source
5314 typedef struct MUST_USE_STRUCT LDKRecord {
5316 * A pointer to the opaque Rust object.
5317 * Nearly everywhere, inner must be non-null, however in places where
5318 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5320 LDKnativeRecord *inner;
5322 * Indicates that this is the only struct which contains the same pointer.
5323 * Rust functions which take ownership of an object provided via an argument require
5324 * this to be true and invalidate the object pointed to by inner.
5330 * A trait encapsulating the operations required of a logger.
5332 typedef struct LDKLogger {
5334 * An opaque pointer which is passed to your function implementations as an argument.
5335 * This has no meaning in the LDK, and can be NULL or any other value.
5339 * Logs the [`Record`].
5341 void (*log)(const void *this_arg, struct LDKRecord record);
5343 * Frees any resources associated with this object given its this_arg pointer.
5344 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5346 void (*free)(void *this_arg);
5352 * Represents the network as nodes and channels between them
5354 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
5356 * A pointer to the opaque Rust object.
5357 * Nearly everywhere, inner must be non-null, however in places where
5358 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5360 LDKnativeNetworkGraph *inner;
5362 * Indicates that this is the only struct which contains the same pointer.
5363 * Rust functions which take ownership of an object provided via an argument require
5364 * this to be true and invalidate the object pointed to by inner.
5372 * [`ScoreLookUp`] implementation using channel success probability distributions.
5374 * Channels are tracked with upper and lower liquidity bounds - when an HTLC fails at a channel,
5375 * we learn that the upper-bound on the available liquidity is lower than the amount of the HTLC.
5376 * When a payment is forwarded through a channel (but fails later in the route), we learn the
5377 * lower-bound on the channel's available liquidity must be at least the value of the HTLC.
5379 * These bounds are then used to determine a success probability using the formula from
5380 * *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
5381 * and Stefan Richter [[1]] (i.e. `(upper_bound - payment_amount) / (upper_bound - lower_bound)`).
5383 * This probability is combined with the [`liquidity_penalty_multiplier_msat`] and
5384 * [`liquidity_penalty_amount_multiplier_msat`] parameters to calculate a concrete penalty in
5385 * milli-satoshis. The penalties, when added across all hops, have the property of being linear in
5386 * terms of the entire path's success probability. This allows the router to directly compare
5387 * penalties for different paths. See the documentation of those parameters for the exact formulas.
5389 * The liquidity bounds are decayed by halving them every [`liquidity_offset_half_life`].
5391 * Further, we track the history of our upper and lower liquidity bounds for each channel,
5392 * allowing us to assign a second penalty (using [`historical_liquidity_penalty_multiplier_msat`]
5393 * and [`historical_liquidity_penalty_amount_multiplier_msat`]) based on the same probability
5394 * formula, but using the history of a channel rather than our latest estimates for the liquidity
5397 * [1]: https://arxiv.org/abs/2107.05322
5398 * [`liquidity_penalty_multiplier_msat`]: ProbabilisticScoringFeeParameters::liquidity_penalty_multiplier_msat
5399 * [`liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringFeeParameters::liquidity_penalty_amount_multiplier_msat
5400 * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
5401 * [`historical_liquidity_penalty_multiplier_msat`]: ProbabilisticScoringFeeParameters::historical_liquidity_penalty_multiplier_msat
5402 * [`historical_liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringFeeParameters::historical_liquidity_penalty_amount_multiplier_msat
5404 typedef struct MUST_USE_STRUCT LDKProbabilisticScorer {
5406 * A pointer to the opaque Rust object.
5407 * Nearly everywhere, inner must be non-null, however in places where
5408 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5410 LDKnativeProbabilisticScorer *inner;
5412 * Indicates that this is the only struct which contains the same pointer.
5413 * Rust functions which take ownership of an object provided via an argument require
5414 * this to be true and invalidate the object pointed to by inner.
5417 } LDKProbabilisticScorer;
5420 * The contents of CResult_ProbabilisticScorerDecodeErrorZ
5422 typedef union LDKCResult_ProbabilisticScorerDecodeErrorZPtr {
5424 * A pointer to the contents in the success state.
5425 * Reading from this pointer when `result_ok` is not set is undefined.
5427 struct LDKProbabilisticScorer *result;
5429 * A pointer to the contents in the error state.
5430 * Reading from this pointer when `result_ok` is set is undefined.
5432 struct LDKDecodeError *err;
5433 } LDKCResult_ProbabilisticScorerDecodeErrorZPtr;
5436 * A CResult_ProbabilisticScorerDecodeErrorZ represents the result of a fallible operation,
5437 * containing a crate::lightning::routing::scoring::ProbabilisticScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
5438 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5440 typedef struct LDKCResult_ProbabilisticScorerDecodeErrorZ {
5442 * The contents of this CResult_ProbabilisticScorerDecodeErrorZ, accessible via either
5443 * `err` or `result` depending on the state of `result_ok`.
5445 union LDKCResult_ProbabilisticScorerDecodeErrorZPtr contents;
5447 * Whether this CResult_ProbabilisticScorerDecodeErrorZ represents a success state.
5450 } LDKCResult_ProbabilisticScorerDecodeErrorZ;
5455 * The best known block as identified by its hash and height.
5457 typedef struct MUST_USE_STRUCT LDKBestBlock {
5459 * A pointer to the opaque Rust object.
5460 * Nearly everywhere, inner must be non-null, however in places where
5461 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5463 LDKnativeBestBlock *inner;
5465 * Indicates that this is the only struct which contains the same pointer.
5466 * Rust functions which take ownership of an object provided via an argument require
5467 * this to be true and invalidate the object pointed to by inner.
5473 * The contents of CResult_BestBlockDecodeErrorZ
5475 typedef union LDKCResult_BestBlockDecodeErrorZPtr {
5477 * A pointer to the contents in the success state.
5478 * Reading from this pointer when `result_ok` is not set is undefined.
5480 struct LDKBestBlock *result;
5482 * A pointer to the contents in the error state.
5483 * Reading from this pointer when `result_ok` is set is undefined.
5485 struct LDKDecodeError *err;
5486 } LDKCResult_BestBlockDecodeErrorZPtr;
5489 * A CResult_BestBlockDecodeErrorZ represents the result of a fallible operation,
5490 * containing a crate::lightning::chain::BestBlock on success and a crate::lightning::ln::msgs::DecodeError on failure.
5491 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5493 typedef struct LDKCResult_BestBlockDecodeErrorZ {
5495 * The contents of this CResult_BestBlockDecodeErrorZ, accessible via either
5496 * `err` or `result` depending on the state of `result_ok`.
5498 union LDKCResult_BestBlockDecodeErrorZPtr contents;
5500 * Whether this CResult_BestBlockDecodeErrorZ represents a success state.
5503 } LDKCResult_BestBlockDecodeErrorZ;
5506 * A tuple of 2 elements. See the individual fields for the types contained.
5508 typedef struct LDKC2Tuple_usizeTransactionZ {
5510 * The element at position 0
5514 * The element at position 1
5516 struct LDKTransaction b;
5517 } LDKC2Tuple_usizeTransactionZ;
5520 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
5521 * This corresponds to std::vector in C++
5523 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
5525 * The elements in the array.
5526 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5528 struct LDKC2Tuple_usizeTransactionZ *data;
5530 * The number of elements pointed to by `data`.
5533 } LDKCVec_C2Tuple_usizeTransactionZZ;
5536 * A tuple of 3 elements. See the individual fields for the types contained.
5538 typedef struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ {
5540 * The element at position 0
5542 struct LDKThirtyTwoBytes a;
5544 * The element at position 1
5548 * The element at position 2
5550 struct LDKCOption_ThirtyTwoBytesZ c;
5551 } LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ;
5554 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZs of arbitrary size.
5555 * This corresponds to std::vector in C++
5557 typedef struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ {
5559 * The elements in the array.
5560 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5562 struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ *data;
5564 * The number of elements pointed to by `data`.
5567 } LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ;
5570 * The contents of CResult_ChannelMonitorUpdateStatusNoneZ
5572 typedef union LDKCResult_ChannelMonitorUpdateStatusNoneZPtr {
5574 * A pointer to the contents in the success state.
5575 * Reading from this pointer when `result_ok` is not set is undefined.
5577 enum LDKChannelMonitorUpdateStatus *result;
5579 * Note that this value is always NULL, as there are no contents in the Err variant
5582 } LDKCResult_ChannelMonitorUpdateStatusNoneZPtr;
5585 * A CResult_ChannelMonitorUpdateStatusNoneZ represents the result of a fallible operation,
5586 * containing a crate::lightning::chain::ChannelMonitorUpdateStatus on success and a () on failure.
5587 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5589 typedef struct LDKCResult_ChannelMonitorUpdateStatusNoneZ {
5591 * The contents of this CResult_ChannelMonitorUpdateStatusNoneZ, accessible via either
5592 * `err` or `result` depending on the state of `result_ok`.
5594 union LDKCResult_ChannelMonitorUpdateStatusNoneZPtr contents;
5596 * Whether this CResult_ChannelMonitorUpdateStatusNoneZ represents a success state.
5599 } LDKCResult_ChannelMonitorUpdateStatusNoneZ;
5604 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
5605 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
5606 * preimage claim backward will lead to loss of funds.
5608 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
5610 * A pointer to the opaque Rust object.
5611 * Nearly everywhere, inner must be non-null, however in places where
5612 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5614 LDKnativeHTLCUpdate *inner;
5616 * Indicates that this is the only struct which contains the same pointer.
5617 * Rust functions which take ownership of an object provided via an argument require
5618 * this to be true and invalidate the object pointed to by inner.
5626 * Struct to `Display` fields in a safe way using `PrintableString`
5628 typedef struct MUST_USE_STRUCT LDKUntrustedString {
5630 * A pointer to the opaque Rust object.
5631 * Nearly everywhere, inner must be non-null, however in places where
5632 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5634 LDKnativeUntrustedString *inner;
5636 * Indicates that this is the only struct which contains the same pointer.
5637 * Rust functions which take ownership of an object provided via an argument require
5638 * this to be true and invalidate the object pointed to by inner.
5641 } LDKUntrustedString;
5644 * The reason the channel was closed. See individual variants for more details.
5646 typedef enum LDKClosureReason_Tag {
5648 * Closure generated from receiving a peer error message.
5650 * Our counterparty may have broadcasted their latest commitment state, and we have
5653 LDKClosureReason_CounterpartyForceClosed,
5655 * Closure generated from [`ChannelManager::force_close_channel`], called by the user.
5657 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
5659 LDKClosureReason_HolderForceClosed,
5661 * The channel was closed after negotiating a cooperative close and we've now broadcasted
5662 * the cooperative close transaction. Note the shutdown may have been initiated by us.
5664 * This was only set in versions of LDK prior to 0.0.122.
5666 LDKClosureReason_LegacyCooperativeClosure,
5668 * The channel was closed after negotiating a cooperative close and we've now broadcasted
5669 * the cooperative close transaction. This indicates that the shutdown was initiated by our
5672 * In rare cases where we initiated closure immediately prior to shutting down without
5673 * persisting, this value may be provided for channels we initiated closure for.
5675 LDKClosureReason_CounterpartyInitiatedCooperativeClosure,
5677 * The channel was closed after negotiating a cooperative close and we've now broadcasted
5678 * the cooperative close transaction. This indicates that the shutdown was initiated by us.
5680 LDKClosureReason_LocallyInitiatedCooperativeClosure,
5682 * A commitment transaction was confirmed on chain, closing the channel. Most likely this
5683 * commitment transaction came from our counterparty, but it may also have come from
5684 * a copy of our own `ChannelMonitor`.
5686 LDKClosureReason_CommitmentTxConfirmed,
5688 * The funding transaction failed to confirm in a timely manner on an inbound channel.
5690 LDKClosureReason_FundingTimedOut,
5692 * Closure generated from processing an event, likely a HTLC forward/relay/reception.
5694 LDKClosureReason_ProcessingError,
5696 * The peer disconnected prior to funding completing. In this case the spec mandates that we
5697 * forget the channel entirely - we can attempt again if the peer reconnects.
5699 * This includes cases where we restarted prior to funding completion, including prior to the
5700 * initial [`ChannelMonitor`] persistence completing.
5702 * In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the
5703 * peer because of mutual incompatibility between us and our channel counterparty.
5705 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
5707 LDKClosureReason_DisconnectedPeer,
5709 * Closure generated from `ChannelManager::read` if the [`ChannelMonitor`] is newer than
5710 * the [`ChannelManager`] deserialized.
5712 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
5713 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
5715 LDKClosureReason_OutdatedChannelManager,
5717 * The counterparty requested a cooperative close of a channel that had not been funded yet.
5718 * The channel has been immediately closed.
5720 LDKClosureReason_CounterpartyCoopClosedUnfundedChannel,
5722 * Another channel in the same funding batch closed before the funding transaction
5723 * was ready to be broadcast.
5725 LDKClosureReason_FundingBatchClosure,
5727 * One of our HTLCs timed out in a channel, causing us to force close the channel.
5729 LDKClosureReason_HTLCsTimedOut,
5731 * Must be last for serialization purposes
5733 LDKClosureReason_Sentinel,
5734 } LDKClosureReason_Tag;
5736 typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
5738 * The error which the peer sent us.
5740 * Be careful about printing the peer_msg, a well-crafted message could exploit
5741 * a security vulnerability in the terminal emulator or the logging subsystem.
5742 * To be safe, use `Display` on `UntrustedString`
5744 * [`UntrustedString`]: crate::util::string::UntrustedString
5746 struct LDKUntrustedString peer_msg;
5747 } LDKClosureReason_LDKCounterpartyForceClosed_Body;
5749 typedef struct LDKClosureReason_LDKProcessingError_Body {
5751 * A developer-readable error message which we generated.
5754 } LDKClosureReason_LDKProcessingError_Body;
5756 typedef struct MUST_USE_STRUCT LDKClosureReason {
5757 LDKClosureReason_Tag tag;
5759 LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
5760 LDKClosureReason_LDKProcessingError_Body processing_error;
5767 * A unique 32-byte identifier for a channel.
5768 * Depending on how the ID is generated, several varieties are distinguished
5769 * (but all are stored as 32 bytes):
5770 * _v1_ and _temporary_.
5771 * A _v1_ channel ID is generated based on funding tx outpoint (txid & index).
5772 * A _temporary_ ID is generated randomly.
5773 * (Later revocation-point-based _v2_ is a possibility.)
5774 * The variety (context) is not stored, it is relevant only at creation.
5776 typedef struct MUST_USE_STRUCT LDKChannelId {
5778 * A pointer to the opaque Rust object.
5779 * Nearly everywhere, inner must be non-null, however in places where
5780 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5782 LDKnativeChannelId *inner;
5784 * Indicates that this is the only struct which contains the same pointer.
5785 * Rust functions which take ownership of an object provided via an argument require
5786 * this to be true and invalidate the object pointed to by inner.
5792 * An event to be processed by the ChannelManager.
5794 typedef enum LDKMonitorEvent_Tag {
5796 * A monitor event containing an HTLCUpdate.
5798 LDKMonitorEvent_HTLCEvent,
5800 * Indicates we broadcasted the channel's latest commitment transaction and thus closed the
5801 * channel. Holds information about the channel and why it was closed.
5803 LDKMonitorEvent_HolderForceClosedWithInfo,
5805 * Indicates we broadcasted the channel's latest commitment transaction and thus closed the
5808 LDKMonitorEvent_HolderForceClosed,
5810 * Indicates a [`ChannelMonitor`] update has completed. See
5811 * [`ChannelMonitorUpdateStatus::InProgress`] for more information on how this is used.
5813 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
5815 LDKMonitorEvent_Completed,
5817 * Must be last for serialization purposes
5819 LDKMonitorEvent_Sentinel,
5820 } LDKMonitorEvent_Tag;
5822 typedef struct LDKMonitorEvent_LDKHolderForceClosedWithInfo_Body {
5824 * The reason the channel was closed.
5826 struct LDKClosureReason reason;
5828 * The funding outpoint of the channel.
5830 struct LDKOutPoint outpoint;
5832 * The channel ID of the channel.
5834 struct LDKChannelId channel_id;
5835 } LDKMonitorEvent_LDKHolderForceClosedWithInfo_Body;
5837 typedef struct LDKMonitorEvent_LDKCompleted_Body {
5839 * The funding outpoint of the [`ChannelMonitor`] that was updated
5841 struct LDKOutPoint funding_txo;
5843 * The channel ID of the channel associated with the [`ChannelMonitor`]
5845 struct LDKChannelId channel_id;
5847 * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
5848 * [`ChannelMonitor::get_latest_update_id`].
5850 * Note that this should only be set to a given update's ID if all previous updates for the
5851 * same [`ChannelMonitor`] have been applied and persisted.
5853 uint64_t monitor_update_id;
5854 } LDKMonitorEvent_LDKCompleted_Body;
5856 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
5857 LDKMonitorEvent_Tag tag;
5860 struct LDKHTLCUpdate htlc_event;
5862 LDKMonitorEvent_LDKHolderForceClosedWithInfo_Body holder_force_closed_with_info;
5864 struct LDKOutPoint holder_force_closed;
5866 LDKMonitorEvent_LDKCompleted_Body completed;
5871 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
5872 * This corresponds to std::vector in C++
5874 typedef struct LDKCVec_MonitorEventZ {
5876 * The elements in the array.
5877 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5879 struct LDKMonitorEvent *data;
5881 * The number of elements pointed to by `data`.
5884 } LDKCVec_MonitorEventZ;
5887 * A tuple of 4 elements. See the individual fields for the types contained.
5889 typedef struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ {
5891 * The element at position 0
5893 struct LDKOutPoint a;
5895 * The element at position 1
5897 struct LDKChannelId b;
5899 * The element at position 2
5901 struct LDKCVec_MonitorEventZ c;
5903 * The element at position 3
5905 struct LDKPublicKey d;
5906 } LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ;
5909 * A dynamically-allocated array of crate::c_types::derived::C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZs of arbitrary size.
5910 * This corresponds to std::vector in C++
5912 typedef struct LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ {
5914 * The elements in the array.
5915 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5917 struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *data;
5919 * The number of elements pointed to by `data`.
5922 } LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ;
5927 * Features used within an `init` message.
5929 typedef struct MUST_USE_STRUCT LDKInitFeatures {
5931 * A pointer to the opaque Rust object.
5932 * Nearly everywhere, inner must be non-null, however in places where
5933 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5935 LDKnativeInitFeatures *inner;
5937 * Indicates that this is the only struct which contains the same pointer.
5938 * Rust functions which take ownership of an object provided via an argument require
5939 * this to be true and invalidate the object pointed to by inner.
5945 * The contents of CResult_InitFeaturesDecodeErrorZ
5947 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
5949 * A pointer to the contents in the success state.
5950 * Reading from this pointer when `result_ok` is not set is undefined.
5952 struct LDKInitFeatures *result;
5954 * A pointer to the contents in the error state.
5955 * Reading from this pointer when `result_ok` is set is undefined.
5957 struct LDKDecodeError *err;
5958 } LDKCResult_InitFeaturesDecodeErrorZPtr;
5961 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
5962 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5963 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5965 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
5967 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
5968 * `err` or `result` depending on the state of `result_ok`.
5970 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
5972 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
5975 } LDKCResult_InitFeaturesDecodeErrorZ;
5980 * Features used within a `channel_announcement` message.
5982 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
5984 * A pointer to the opaque Rust object.
5985 * Nearly everywhere, inner must be non-null, however in places where
5986 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5988 LDKnativeChannelFeatures *inner;
5990 * Indicates that this is the only struct which contains the same pointer.
5991 * Rust functions which take ownership of an object provided via an argument require
5992 * this to be true and invalidate the object pointed to by inner.
5995 } LDKChannelFeatures;
5998 * The contents of CResult_ChannelFeaturesDecodeErrorZ
6000 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
6002 * A pointer to the contents in the success state.
6003 * Reading from this pointer when `result_ok` is not set is undefined.
6005 struct LDKChannelFeatures *result;
6007 * A pointer to the contents in the error state.
6008 * Reading from this pointer when `result_ok` is set is undefined.
6010 struct LDKDecodeError *err;
6011 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
6014 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
6015 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6016 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6018 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
6020 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
6021 * `err` or `result` depending on the state of `result_ok`.
6023 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
6025 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
6028 } LDKCResult_ChannelFeaturesDecodeErrorZ;
6033 * Features used within a `node_announcement` message.
6035 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
6037 * A pointer to the opaque Rust object.
6038 * Nearly everywhere, inner must be non-null, however in places where
6039 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6041 LDKnativeNodeFeatures *inner;
6043 * Indicates that this is the only struct which contains the same pointer.
6044 * Rust functions which take ownership of an object provided via an argument require
6045 * this to be true and invalidate the object pointed to by inner.
6051 * The contents of CResult_NodeFeaturesDecodeErrorZ
6053 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
6055 * A pointer to the contents in the success state.
6056 * Reading from this pointer when `result_ok` is not set is undefined.
6058 struct LDKNodeFeatures *result;
6060 * A pointer to the contents in the error state.
6061 * Reading from this pointer when `result_ok` is set is undefined.
6063 struct LDKDecodeError *err;
6064 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
6067 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
6068 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6069 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6071 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
6073 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
6074 * `err` or `result` depending on the state of `result_ok`.
6076 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
6078 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
6081 } LDKCResult_NodeFeaturesDecodeErrorZ;
6086 * Features used within an invoice.
6088 typedef struct MUST_USE_STRUCT LDKBolt11InvoiceFeatures {
6090 * A pointer to the opaque Rust object.
6091 * Nearly everywhere, inner must be non-null, however in places where
6092 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6094 LDKnativeBolt11InvoiceFeatures *inner;
6096 * Indicates that this is the only struct which contains the same pointer.
6097 * Rust functions which take ownership of an object provided via an argument require
6098 * this to be true and invalidate the object pointed to by inner.
6101 } LDKBolt11InvoiceFeatures;
6104 * The contents of CResult_Bolt11InvoiceFeaturesDecodeErrorZ
6106 typedef union LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr {
6108 * A pointer to the contents in the success state.
6109 * Reading from this pointer when `result_ok` is not set is undefined.
6111 struct LDKBolt11InvoiceFeatures *result;
6113 * A pointer to the contents in the error state.
6114 * Reading from this pointer when `result_ok` is set is undefined.
6116 struct LDKDecodeError *err;
6117 } LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr;
6120 * A CResult_Bolt11InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
6121 * containing a crate::lightning::ln::features::Bolt11InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6122 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6124 typedef struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ {
6126 * The contents of this CResult_Bolt11InvoiceFeaturesDecodeErrorZ, accessible via either
6127 * `err` or `result` depending on the state of `result_ok`.
6129 union LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr contents;
6131 * Whether this CResult_Bolt11InvoiceFeaturesDecodeErrorZ represents a success state.
6134 } LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ;
6139 * Features used within an `invoice`.
6141 typedef struct MUST_USE_STRUCT LDKBolt12InvoiceFeatures {
6143 * A pointer to the opaque Rust object.
6144 * Nearly everywhere, inner must be non-null, however in places where
6145 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6147 LDKnativeBolt12InvoiceFeatures *inner;
6149 * Indicates that this is the only struct which contains the same pointer.
6150 * Rust functions which take ownership of an object provided via an argument require
6151 * this to be true and invalidate the object pointed to by inner.
6154 } LDKBolt12InvoiceFeatures;
6157 * The contents of CResult_Bolt12InvoiceFeaturesDecodeErrorZ
6159 typedef union LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr {
6161 * A pointer to the contents in the success state.
6162 * Reading from this pointer when `result_ok` is not set is undefined.
6164 struct LDKBolt12InvoiceFeatures *result;
6166 * A pointer to the contents in the error state.
6167 * Reading from this pointer when `result_ok` is set is undefined.
6169 struct LDKDecodeError *err;
6170 } LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr;
6173 * A CResult_Bolt12InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
6174 * containing a crate::lightning::ln::features::Bolt12InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6175 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6177 typedef struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ {
6179 * The contents of this CResult_Bolt12InvoiceFeaturesDecodeErrorZ, accessible via either
6180 * `err` or `result` depending on the state of `result_ok`.
6182 union LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr contents;
6184 * Whether this CResult_Bolt12InvoiceFeaturesDecodeErrorZ represents a success state.
6187 } LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ;
6192 * Features used within BOLT 4 encrypted_data_tlv and BOLT 12 blinded_payinfo
6194 typedef struct MUST_USE_STRUCT LDKBlindedHopFeatures {
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 LDKnativeBlindedHopFeatures *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 } LDKBlindedHopFeatures;
6210 * The contents of CResult_BlindedHopFeaturesDecodeErrorZ
6212 typedef union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr {
6214 * A pointer to the contents in the success state.
6215 * Reading from this pointer when `result_ok` is not set is undefined.
6217 struct LDKBlindedHopFeatures *result;
6219 * A pointer to the contents in the error state.
6220 * Reading from this pointer when `result_ok` is set is undefined.
6222 struct LDKDecodeError *err;
6223 } LDKCResult_BlindedHopFeaturesDecodeErrorZPtr;
6226 * A CResult_BlindedHopFeaturesDecodeErrorZ represents the result of a fallible operation,
6227 * containing a crate::lightning::ln::features::BlindedHopFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6228 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6230 typedef struct LDKCResult_BlindedHopFeaturesDecodeErrorZ {
6232 * The contents of this CResult_BlindedHopFeaturesDecodeErrorZ, accessible via either
6233 * `err` or `result` depending on the state of `result_ok`.
6235 union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr contents;
6237 * Whether this CResult_BlindedHopFeaturesDecodeErrorZ represents a success state.
6240 } LDKCResult_BlindedHopFeaturesDecodeErrorZ;
6245 * Features used within the channel_type field in an OpenChannel message.
6247 * A channel is always of some known \"type\", describing the transaction formats used and the exact
6248 * semantics of our interaction with our peer.
6250 * Note that because a channel is a specific type which is proposed by the opener and accepted by
6251 * the counterparty, only required features are allowed here.
6253 * This is serialized differently from other feature types - it is not prefixed by a length, and
6254 * thus must only appear inside a TLV where its length is known in advance.
6256 typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
6258 * A pointer to the opaque Rust object.
6259 * Nearly everywhere, inner must be non-null, however in places where
6260 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6262 LDKnativeChannelTypeFeatures *inner;
6264 * Indicates that this is the only struct which contains the same pointer.
6265 * Rust functions which take ownership of an object provided via an argument require
6266 * this to be true and invalidate the object pointed to by inner.
6269 } LDKChannelTypeFeatures;
6272 * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
6274 typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
6276 * A pointer to the contents in the success state.
6277 * Reading from this pointer when `result_ok` is not set is undefined.
6279 struct LDKChannelTypeFeatures *result;
6281 * A pointer to the contents in the error state.
6282 * Reading from this pointer when `result_ok` is set is undefined.
6284 struct LDKDecodeError *err;
6285 } LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr;
6288 * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
6289 * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6290 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6292 typedef struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ {
6294 * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
6295 * `err` or `result` depending on the state of `result_ok`.
6297 union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
6299 * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
6302 } LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
6307 * An identifier for an [`Offer`] built using [`DerivedMetadata`].
6309 typedef struct MUST_USE_STRUCT LDKOfferId {
6311 * A pointer to the opaque Rust object.
6312 * Nearly everywhere, inner must be non-null, however in places where
6313 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6315 LDKnativeOfferId *inner;
6317 * Indicates that this is the only struct which contains the same pointer.
6318 * Rust functions which take ownership of an object provided via an argument require
6319 * this to be true and invalidate the object pointed to by inner.
6325 * The contents of CResult_OfferIdDecodeErrorZ
6327 typedef union LDKCResult_OfferIdDecodeErrorZPtr {
6329 * A pointer to the contents in the success state.
6330 * Reading from this pointer when `result_ok` is not set is undefined.
6332 struct LDKOfferId *result;
6334 * A pointer to the contents in the error state.
6335 * Reading from this pointer when `result_ok` is set is undefined.
6337 struct LDKDecodeError *err;
6338 } LDKCResult_OfferIdDecodeErrorZPtr;
6341 * A CResult_OfferIdDecodeErrorZ represents the result of a fallible operation,
6342 * containing a crate::lightning::offers::offer::OfferId on success and a crate::lightning::ln::msgs::DecodeError on failure.
6343 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6345 typedef struct LDKCResult_OfferIdDecodeErrorZ {
6347 * The contents of this CResult_OfferIdDecodeErrorZ, accessible via either
6348 * `err` or `result` depending on the state of `result_ok`.
6350 union LDKCResult_OfferIdDecodeErrorZPtr contents;
6352 * Whether this CResult_OfferIdDecodeErrorZ represents a success state.
6355 } LDKCResult_OfferIdDecodeErrorZ;
6358 * The contents of CResult_NoneBolt12SemanticErrorZ
6360 typedef union LDKCResult_NoneBolt12SemanticErrorZPtr {
6362 * Note that this value is always NULL, as there are no contents in the OK variant
6366 * A pointer to the contents in the error state.
6367 * Reading from this pointer when `result_ok` is set is undefined.
6369 enum LDKBolt12SemanticError *err;
6370 } LDKCResult_NoneBolt12SemanticErrorZPtr;
6373 * A CResult_NoneBolt12SemanticErrorZ represents the result of a fallible operation,
6374 * containing a () on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
6375 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6377 typedef struct LDKCResult_NoneBolt12SemanticErrorZ {
6379 * The contents of this CResult_NoneBolt12SemanticErrorZ, accessible via either
6380 * `err` or `result` depending on the state of `result_ok`.
6382 union LDKCResult_NoneBolt12SemanticErrorZPtr contents;
6384 * Whether this CResult_NoneBolt12SemanticErrorZ represents a success state.
6387 } LDKCResult_NoneBolt12SemanticErrorZ;
6392 * An `Offer` is a potentially long-lived proposal for payment of a good or service.
6394 * An offer is a precursor to an [`InvoiceRequest`]. A merchant publishes an offer from which a
6395 * customer may request an [`Bolt12Invoice`] for a specific quantity and using an amount sufficient
6396 * to cover that quantity (i.e., at least `quantity * amount`). See [`Offer::amount`].
6398 * Offers may be denominated in currency other than bitcoin but are ultimately paid using the
6401 * Through the use of [`BlindedPath`]s, offers provide recipient privacy.
6403 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
6404 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
6406 typedef struct MUST_USE_STRUCT LDKOffer {
6408 * A pointer to the opaque Rust object.
6409 * Nearly everywhere, inner must be non-null, however in places where
6410 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6412 LDKnativeOffer *inner;
6414 * Indicates that this is the only struct which contains the same pointer.
6415 * Rust functions which take ownership of an object provided via an argument require
6416 * this to be true and invalidate the object pointed to by inner.
6422 * The contents of CResult_OfferBolt12SemanticErrorZ
6424 typedef union LDKCResult_OfferBolt12SemanticErrorZPtr {
6426 * A pointer to the contents in the success state.
6427 * Reading from this pointer when `result_ok` is not set is undefined.
6429 struct LDKOffer *result;
6431 * A pointer to the contents in the error state.
6432 * Reading from this pointer when `result_ok` is set is undefined.
6434 enum LDKBolt12SemanticError *err;
6435 } LDKCResult_OfferBolt12SemanticErrorZPtr;
6438 * A CResult_OfferBolt12SemanticErrorZ represents the result of a fallible operation,
6439 * containing a crate::lightning::offers::offer::Offer on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
6440 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6442 typedef struct LDKCResult_OfferBolt12SemanticErrorZ {
6444 * The contents of this CResult_OfferBolt12SemanticErrorZ, accessible via either
6445 * `err` or `result` depending on the state of `result_ok`.
6447 union LDKCResult_OfferBolt12SemanticErrorZPtr contents;
6449 * Whether this CResult_OfferBolt12SemanticErrorZ represents a success state.
6452 } LDKCResult_OfferBolt12SemanticErrorZ;
6457 * Builds an [`InvoiceRequest`] from an [`Offer`] for the \"offer to be paid\" flow.
6459 * See [module-level documentation] for usage.
6461 * [module-level documentation]: self
6463 typedef struct MUST_USE_STRUCT LDKInvoiceRequestWithDerivedPayerIdBuilder {
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 LDKnativeInvoiceRequestWithDerivedPayerIdBuilder *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 } LDKInvoiceRequestWithDerivedPayerIdBuilder;
6479 * The contents of CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ
6481 typedef union LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZPtr {
6483 * A pointer to the contents in the success state.
6484 * Reading from this pointer when `result_ok` is not set is undefined.
6486 struct LDKInvoiceRequestWithDerivedPayerIdBuilder *result;
6488 * A pointer to the contents in the error state.
6489 * Reading from this pointer when `result_ok` is set is undefined.
6491 enum LDKBolt12SemanticError *err;
6492 } LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZPtr;
6495 * A CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
6496 * containing a crate::lightning::offers::invoice_request::InvoiceRequestWithDerivedPayerIdBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
6497 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6499 typedef struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ {
6501 * The contents of this CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ, accessible via either
6502 * `err` or `result` depending on the state of `result_ok`.
6504 union LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZPtr contents;
6506 * Whether this CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ represents a success state.
6509 } LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ;
6514 * Builds an [`InvoiceRequest`] from an [`Offer`] for the \"offer to be paid\" flow.
6516 * See [module-level documentation] for usage.
6518 * [module-level documentation]: self
6520 typedef struct MUST_USE_STRUCT LDKInvoiceRequestWithExplicitPayerIdBuilder {
6522 * A pointer to the opaque Rust object.
6523 * Nearly everywhere, inner must be non-null, however in places where
6524 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6526 LDKnativeInvoiceRequestWithExplicitPayerIdBuilder *inner;
6528 * Indicates that this is the only struct which contains the same pointer.
6529 * Rust functions which take ownership of an object provided via an argument require
6530 * this to be true and invalidate the object pointed to by inner.
6533 } LDKInvoiceRequestWithExplicitPayerIdBuilder;
6536 * The contents of CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ
6538 typedef union LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZPtr {
6540 * A pointer to the contents in the success state.
6541 * Reading from this pointer when `result_ok` is not set is undefined.
6543 struct LDKInvoiceRequestWithExplicitPayerIdBuilder *result;
6545 * A pointer to the contents in the error state.
6546 * Reading from this pointer when `result_ok` is set is undefined.
6548 enum LDKBolt12SemanticError *err;
6549 } LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZPtr;
6552 * A CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
6553 * containing a crate::lightning::offers::invoice_request::InvoiceRequestWithExplicitPayerIdBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
6554 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6556 typedef struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ {
6558 * The contents of this CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ, accessible via either
6559 * `err` or `result` depending on the state of `result_ok`.
6561 union LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZPtr contents;
6563 * Whether this CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ represents a success state.
6566 } LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ;
6569 * The contents of CResult_OfferBolt12ParseErrorZ
6571 typedef union LDKCResult_OfferBolt12ParseErrorZPtr {
6573 * A pointer to the contents in the success state.
6574 * Reading from this pointer when `result_ok` is not set is undefined.
6576 struct LDKOffer *result;
6578 * A pointer to the contents in the error state.
6579 * Reading from this pointer when `result_ok` is set is undefined.
6581 struct LDKBolt12ParseError *err;
6582 } LDKCResult_OfferBolt12ParseErrorZPtr;
6585 * A CResult_OfferBolt12ParseErrorZ represents the result of a fallible operation,
6586 * containing a crate::lightning::offers::offer::Offer on success and a crate::lightning::offers::parse::Bolt12ParseError on failure.
6587 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6589 typedef struct LDKCResult_OfferBolt12ParseErrorZ {
6591 * The contents of this CResult_OfferBolt12ParseErrorZ, accessible via either
6592 * `err` or `result` depending on the state of `result_ok`.
6594 union LDKCResult_OfferBolt12ParseErrorZPtr contents;
6596 * Whether this CResult_OfferBolt12ParseErrorZ represents a success state.
6599 } LDKCResult_OfferBolt12ParseErrorZ;
6602 * The contents of CResult_NodeIdDecodeErrorZ
6604 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
6606 * A pointer to the contents in the success state.
6607 * Reading from this pointer when `result_ok` is not set is undefined.
6609 struct LDKNodeId *result;
6611 * A pointer to the contents in the error state.
6612 * Reading from this pointer when `result_ok` is set is undefined.
6614 struct LDKDecodeError *err;
6615 } LDKCResult_NodeIdDecodeErrorZPtr;
6618 * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
6619 * containing a crate::lightning::routing::gossip::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
6620 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6622 typedef struct LDKCResult_NodeIdDecodeErrorZ {
6624 * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
6625 * `err` or `result` depending on the state of `result_ok`.
6627 union LDKCResult_NodeIdDecodeErrorZPtr contents;
6629 * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
6632 } LDKCResult_NodeIdDecodeErrorZ;
6635 * The contents of CResult_PublicKeySecp256k1ErrorZ
6637 typedef union LDKCResult_PublicKeySecp256k1ErrorZPtr {
6639 * A pointer to the contents in the success state.
6640 * Reading from this pointer when `result_ok` is not set is undefined.
6642 struct LDKPublicKey *result;
6644 * A pointer to the contents in the error state.
6645 * Reading from this pointer when `result_ok` is set is undefined.
6647 enum LDKSecp256k1Error *err;
6648 } LDKCResult_PublicKeySecp256k1ErrorZPtr;
6651 * A CResult_PublicKeySecp256k1ErrorZ represents the result of a fallible operation,
6652 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
6653 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6655 typedef struct LDKCResult_PublicKeySecp256k1ErrorZ {
6657 * The contents of this CResult_PublicKeySecp256k1ErrorZ, accessible via either
6658 * `err` or `result` depending on the state of `result_ok`.
6660 union LDKCResult_PublicKeySecp256k1ErrorZPtr contents;
6662 * Whether this CResult_PublicKeySecp256k1ErrorZ represents a success state.
6665 } LDKCResult_PublicKeySecp256k1ErrorZ;
6670 * A [`channel_update`] message to be sent to or received from a peer.
6672 * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
6674 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
6676 * A pointer to the opaque Rust object.
6677 * Nearly everywhere, inner must be non-null, however in places where
6678 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6680 LDKnativeChannelUpdate *inner;
6682 * Indicates that this is the only struct which contains the same pointer.
6683 * Rust functions which take ownership of an object provided via an argument require
6684 * this to be true and invalidate the object pointed to by inner.
6690 * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
6691 * return packet by a node along the route. See [BOLT #4] for details.
6693 * [BOLT #4]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md
6695 typedef enum LDKNetworkUpdate_Tag {
6697 * An error indicating a `channel_update` messages should be applied via
6698 * [`NetworkGraph::update_channel`].
6700 LDKNetworkUpdate_ChannelUpdateMessage,
6702 * An error indicating that a channel failed to route a payment, which should be applied via
6703 * [`NetworkGraph::channel_failed_permanent`] if permanent.
6705 LDKNetworkUpdate_ChannelFailure,
6707 * An error indicating that a node failed to route a payment, which should be applied via
6708 * [`NetworkGraph::node_failed_permanent`] if permanent.
6710 LDKNetworkUpdate_NodeFailure,
6712 * Must be last for serialization purposes
6714 LDKNetworkUpdate_Sentinel,
6715 } LDKNetworkUpdate_Tag;
6717 typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
6719 * The update to apply via [`NetworkGraph::update_channel`].
6721 struct LDKChannelUpdate msg;
6722 } LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
6724 typedef struct LDKNetworkUpdate_LDKChannelFailure_Body {
6726 * The short channel id of the closed channel.
6728 uint64_t short_channel_id;
6730 * Whether the channel should be permanently removed or temporarily disabled until a new
6731 * `channel_update` message is received.
6734 } LDKNetworkUpdate_LDKChannelFailure_Body;
6736 typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
6738 * The node id of the failed node.
6740 struct LDKPublicKey node_id;
6742 * Whether the node should be permanently removed from consideration or can be restored
6743 * when a new `channel_update` message is received.
6746 } LDKNetworkUpdate_LDKNodeFailure_Body;
6748 typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
6749 LDKNetworkUpdate_Tag tag;
6751 LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
6752 LDKNetworkUpdate_LDKChannelFailure_Body channel_failure;
6753 LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
6758 * An enum which can either contain a crate::lightning::routing::gossip::NetworkUpdate or not
6760 typedef enum LDKCOption_NetworkUpdateZ_Tag {
6762 * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::gossip::NetworkUpdate
6764 LDKCOption_NetworkUpdateZ_Some,
6766 * When we're in this state, this COption_NetworkUpdateZ contains nothing
6768 LDKCOption_NetworkUpdateZ_None,
6770 * Must be last for serialization purposes
6772 LDKCOption_NetworkUpdateZ_Sentinel,
6773 } LDKCOption_NetworkUpdateZ_Tag;
6775 typedef struct LDKCOption_NetworkUpdateZ {
6776 LDKCOption_NetworkUpdateZ_Tag tag;
6779 struct LDKNetworkUpdate some;
6782 } LDKCOption_NetworkUpdateZ;
6785 * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
6787 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
6789 * A pointer to the contents in the success state.
6790 * Reading from this pointer when `result_ok` is not set is undefined.
6792 struct LDKCOption_NetworkUpdateZ *result;
6794 * A pointer to the contents in the error state.
6795 * Reading from this pointer when `result_ok` is set is undefined.
6797 struct LDKDecodeError *err;
6798 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
6801 * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
6802 * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
6803 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6805 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
6807 * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
6808 * `err` or `result` depending on the state of `result_ok`.
6810 union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
6812 * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
6815 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
6818 * The contents of CResult_TxOutUtxoLookupErrorZ
6820 typedef union LDKCResult_TxOutUtxoLookupErrorZPtr {
6822 * A pointer to the contents in the success state.
6823 * Reading from this pointer when `result_ok` is not set is undefined.
6825 struct LDKTxOut *result;
6827 * A pointer to the contents in the error state.
6828 * Reading from this pointer when `result_ok` is set is undefined.
6830 enum LDKUtxoLookupError *err;
6831 } LDKCResult_TxOutUtxoLookupErrorZPtr;
6834 * A CResult_TxOutUtxoLookupErrorZ represents the result of a fallible operation,
6835 * containing a crate::c_types::TxOut on success and a crate::lightning::routing::utxo::UtxoLookupError on failure.
6836 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6838 typedef struct LDKCResult_TxOutUtxoLookupErrorZ {
6840 * The contents of this CResult_TxOutUtxoLookupErrorZ, accessible via either
6841 * `err` or `result` depending on the state of `result_ok`.
6843 union LDKCResult_TxOutUtxoLookupErrorZPtr contents;
6845 * Whether this CResult_TxOutUtxoLookupErrorZ represents a success state.
6848 } LDKCResult_TxOutUtxoLookupErrorZ;
6853 * Represents a future resolution of a [`UtxoLookup::get_utxo`] query resolving async.
6855 * See [`UtxoResult::Async`] and [`UtxoFuture::resolve`] for more info.
6857 typedef struct MUST_USE_STRUCT LDKUtxoFuture {
6859 * A pointer to the opaque Rust object.
6860 * Nearly everywhere, inner must be non-null, however in places where
6861 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6863 LDKnativeUtxoFuture *inner;
6865 * Indicates that this is the only struct which contains the same pointer.
6866 * Rust functions which take ownership of an object provided via an argument require
6867 * this to be true and invalidate the object pointed to by inner.
6873 * The result of a [`UtxoLookup::get_utxo`] call. A call may resolve either synchronously,
6874 * returning the `Sync` variant, or asynchronously, returning an [`UtxoFuture`] in the `Async`
6877 typedef enum LDKUtxoResult_Tag {
6879 * A result which was resolved synchronously. It either includes a [`TxOut`] for the output
6880 * requested or a [`UtxoLookupError`].
6884 * A result which will be resolved asynchronously. It includes a [`UtxoFuture`], a `clone` of
6885 * which you must keep locally and call [`UtxoFuture::resolve`] on once the lookup completes.
6887 * Note that in order to avoid runaway memory usage, the number of parallel checks is limited,
6888 * but only fairly loosely. Because a pending checks block all message processing, leaving
6889 * checks pending for an extended time may cause DoS of other functions. It is recommended you
6890 * keep a tight timeout on lookups, on the order of a few seconds.
6892 LDKUtxoResult_Async,
6894 * Must be last for serialization purposes
6896 LDKUtxoResult_Sentinel,
6897 } LDKUtxoResult_Tag;
6899 typedef struct MUST_USE_STRUCT LDKUtxoResult {
6900 LDKUtxoResult_Tag tag;
6903 struct LDKCResult_TxOutUtxoLookupErrorZ sync;
6906 struct LDKUtxoFuture async;
6912 * The `UtxoLookup` trait defines behavior for accessing on-chain UTXOs.
6914 typedef struct LDKUtxoLookup {
6916 * An opaque pointer which is passed to your function implementations as an argument.
6917 * This has no meaning in the LDK, and can be NULL or any other value.
6921 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
6922 * Returns an error if `chain_hash` is for a different chain or if such a transaction output is
6925 * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id
6927 struct LDKUtxoResult (*get_utxo)(const void *this_arg, const uint8_t (*chain_hash)[32], uint64_t short_channel_id);
6929 * Frees any resources associated with this object given its this_arg pointer.
6930 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6932 void (*free)(void *this_arg);
6936 * An enum which can either contain a crate::lightning::routing::utxo::UtxoLookup or not
6938 typedef enum LDKCOption_UtxoLookupZ_Tag {
6940 * When we're in this state, this COption_UtxoLookupZ contains a crate::lightning::routing::utxo::UtxoLookup
6942 LDKCOption_UtxoLookupZ_Some,
6944 * When we're in this state, this COption_UtxoLookupZ contains nothing
6946 LDKCOption_UtxoLookupZ_None,
6948 * Must be last for serialization purposes
6950 LDKCOption_UtxoLookupZ_Sentinel,
6951 } LDKCOption_UtxoLookupZ_Tag;
6953 typedef struct LDKCOption_UtxoLookupZ {
6954 LDKCOption_UtxoLookupZ_Tag tag;
6957 struct LDKUtxoLookup some;
6960 } LDKCOption_UtxoLookupZ;
6963 * The contents of CResult_NoneLightningErrorZ
6965 typedef union LDKCResult_NoneLightningErrorZPtr {
6967 * Note that this value is always NULL, as there are no contents in the OK variant
6971 * A pointer to the contents in the error state.
6972 * Reading from this pointer when `result_ok` is set is undefined.
6974 struct LDKLightningError *err;
6975 } LDKCResult_NoneLightningErrorZPtr;
6978 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
6979 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
6980 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6982 typedef struct LDKCResult_NoneLightningErrorZ {
6984 * The contents of this CResult_NoneLightningErrorZ, accessible via either
6985 * `err` or `result` depending on the state of `result_ok`.
6987 union LDKCResult_NoneLightningErrorZPtr contents;
6989 * Whether this CResult_NoneLightningErrorZ represents a success state.
6992 } LDKCResult_NoneLightningErrorZ;
6995 * The contents of CResult_boolLightningErrorZ
6997 typedef union LDKCResult_boolLightningErrorZPtr {
6999 * A pointer to the contents in the success state.
7000 * Reading from this pointer when `result_ok` is not set is undefined.
7004 * A pointer to the contents in the error state.
7005 * Reading from this pointer when `result_ok` is set is undefined.
7007 struct LDKLightningError *err;
7008 } LDKCResult_boolLightningErrorZPtr;
7011 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
7012 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
7013 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7015 typedef struct LDKCResult_boolLightningErrorZ {
7017 * The contents of this CResult_boolLightningErrorZ, accessible via either
7018 * `err` or `result` depending on the state of `result_ok`.
7020 union LDKCResult_boolLightningErrorZPtr contents;
7022 * Whether this CResult_boolLightningErrorZ represents a success state.
7025 } LDKCResult_boolLightningErrorZ;
7030 * A [`channel_announcement`] message to be sent to or received from a peer.
7032 * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
7034 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
7036 * A pointer to the opaque Rust object.
7037 * Nearly everywhere, inner must be non-null, however in places where
7038 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7040 LDKnativeChannelAnnouncement *inner;
7042 * Indicates that this is the only struct which contains the same pointer.
7043 * Rust functions which take ownership of an object provided via an argument require
7044 * this to be true and invalidate the object pointed to by inner.
7047 } LDKChannelAnnouncement;
7050 * A tuple of 3 elements. See the individual fields for the types contained.
7052 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
7054 * The element at position 0
7056 struct LDKChannelAnnouncement a;
7058 * The element at position 1
7060 struct LDKChannelUpdate b;
7062 * The element at position 2
7064 struct LDKChannelUpdate c;
7065 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
7068 * An enum which can either contain a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ or not
7070 typedef enum LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag {
7072 * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
7074 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some,
7076 * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains nothing
7078 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None,
7080 * Must be last for serialization purposes
7082 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Sentinel,
7083 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag;
7085 typedef struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
7086 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag tag;
7089 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ some;
7092 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
7097 * An [`accept_channel`] message to be sent to or received from a peer.
7099 * Used in V1 channel establishment
7101 * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message
7103 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
7105 * A pointer to the opaque Rust object.
7106 * Nearly everywhere, inner must be non-null, however in places where
7107 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7109 LDKnativeAcceptChannel *inner;
7111 * Indicates that this is the only struct which contains the same pointer.
7112 * Rust functions which take ownership of an object provided via an argument require
7113 * this to be true and invalidate the object pointed to by inner.
7121 * An accept_channel2 message to be sent by or received from the channel accepter.
7123 * Used in V2 channel establishment
7126 typedef struct MUST_USE_STRUCT LDKAcceptChannelV2 {
7128 * A pointer to the opaque Rust object.
7129 * Nearly everywhere, inner must be non-null, however in places where
7130 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7132 LDKnativeAcceptChannelV2 *inner;
7134 * Indicates that this is the only struct which contains the same pointer.
7135 * Rust functions which take ownership of an object provided via an argument require
7136 * this to be true and invalidate the object pointed to by inner.
7139 } LDKAcceptChannelV2;
7144 * An [`open_channel`] message to be sent to or received from a peer.
7146 * Used in V1 channel establishment
7148 * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message
7150 typedef struct MUST_USE_STRUCT LDKOpenChannel {
7152 * A pointer to the opaque Rust object.
7153 * Nearly everywhere, inner must be non-null, however in places where
7154 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7156 LDKnativeOpenChannel *inner;
7158 * Indicates that this is the only struct which contains the same pointer.
7159 * Rust functions which take ownership of an object provided via an argument require
7160 * this to be true and invalidate the object pointed to by inner.
7168 * An open_channel2 message to be sent by or received from the channel initiator.
7170 * Used in V2 channel establishment
7173 typedef struct MUST_USE_STRUCT LDKOpenChannelV2 {
7175 * A pointer to the opaque Rust object.
7176 * Nearly everywhere, inner must be non-null, however in places where
7177 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7179 LDKnativeOpenChannelV2 *inner;
7181 * Indicates that this is the only struct which contains the same pointer.
7182 * Rust functions which take ownership of an object provided via an argument require
7183 * this to be true and invalidate the object pointed to by inner.
7191 * A [`funding_created`] message to be sent to or received from a peer.
7193 * Used in V1 channel establishment
7195 * [`funding_created`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_created-message
7197 typedef struct MUST_USE_STRUCT LDKFundingCreated {
7199 * A pointer to the opaque Rust object.
7200 * Nearly everywhere, inner must be non-null, however in places where
7201 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7203 LDKnativeFundingCreated *inner;
7205 * Indicates that this is the only struct which contains the same pointer.
7206 * Rust functions which take ownership of an object provided via an argument require
7207 * this to be true and invalidate the object pointed to by inner.
7210 } LDKFundingCreated;
7215 * A [`funding_signed`] message to be sent to or received from a peer.
7217 * Used in V1 channel establishment
7219 * [`funding_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_signed-message
7221 typedef struct MUST_USE_STRUCT LDKFundingSigned {
7223 * A pointer to the opaque Rust object.
7224 * Nearly everywhere, inner must be non-null, however in places where
7225 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7227 LDKnativeFundingSigned *inner;
7229 * Indicates that this is the only struct which contains the same pointer.
7230 * Rust functions which take ownership of an object provided via an argument require
7231 * this to be true and invalidate the object pointed to by inner.
7239 * An stfu (quiescence) message to be sent by or received from the stfu initiator.
7241 typedef struct MUST_USE_STRUCT LDKStfu {
7243 * A pointer to the opaque Rust object.
7244 * Nearly everywhere, inner must be non-null, however in places where
7245 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7247 LDKnativeStfu *inner;
7249 * Indicates that this is the only struct which contains the same pointer.
7250 * Rust functions which take ownership of an object provided via an argument require
7251 * this to be true and invalidate the object pointed to by inner.
7259 * A splice message to be sent by or received from the stfu initiator (splice initiator).
7261 typedef struct MUST_USE_STRUCT LDKSplice {
7263 * A pointer to the opaque Rust object.
7264 * Nearly everywhere, inner must be non-null, however in places where
7265 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7267 LDKnativeSplice *inner;
7269 * Indicates that this is the only struct which contains the same pointer.
7270 * Rust functions which take ownership of an object provided via an argument require
7271 * this to be true and invalidate the object pointed to by inner.
7279 * A splice_ack message to be received by or sent to the splice initiator.
7282 typedef struct MUST_USE_STRUCT LDKSpliceAck {
7284 * A pointer to the opaque Rust object.
7285 * Nearly everywhere, inner must be non-null, however in places where
7286 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7288 LDKnativeSpliceAck *inner;
7290 * Indicates that this is the only struct which contains the same pointer.
7291 * Rust functions which take ownership of an object provided via an argument require
7292 * this to be true and invalidate the object pointed to by inner.
7300 * A splice_locked message to be sent to or received from a peer.
7303 typedef struct MUST_USE_STRUCT LDKSpliceLocked {
7305 * A pointer to the opaque Rust object.
7306 * Nearly everywhere, inner must be non-null, however in places where
7307 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7309 LDKnativeSpliceLocked *inner;
7311 * Indicates that this is the only struct which contains the same pointer.
7312 * Rust functions which take ownership of an object provided via an argument require
7313 * this to be true and invalidate the object pointed to by inner.
7321 * A tx_add_input message for adding an input during interactive transaction construction
7324 typedef struct MUST_USE_STRUCT LDKTxAddInput {
7326 * A pointer to the opaque Rust object.
7327 * Nearly everywhere, inner must be non-null, however in places where
7328 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7330 LDKnativeTxAddInput *inner;
7332 * Indicates that this is the only struct which contains the same pointer.
7333 * Rust functions which take ownership of an object provided via an argument require
7334 * this to be true and invalidate the object pointed to by inner.
7342 * A tx_add_output message for adding an output during interactive transaction construction.
7345 typedef struct MUST_USE_STRUCT LDKTxAddOutput {
7347 * A pointer to the opaque Rust object.
7348 * Nearly everywhere, inner must be non-null, however in places where
7349 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7351 LDKnativeTxAddOutput *inner;
7353 * Indicates that this is the only struct which contains the same pointer.
7354 * Rust functions which take ownership of an object provided via an argument require
7355 * this to be true and invalidate the object pointed to by inner.
7363 * A tx_remove_input message for removing an input during interactive transaction construction.
7366 typedef struct MUST_USE_STRUCT LDKTxRemoveInput {
7368 * A pointer to the opaque Rust object.
7369 * Nearly everywhere, inner must be non-null, however in places where
7370 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7372 LDKnativeTxRemoveInput *inner;
7374 * Indicates that this is the only struct which contains the same pointer.
7375 * Rust functions which take ownership of an object provided via an argument require
7376 * this to be true and invalidate the object pointed to by inner.
7384 * A tx_remove_output message for removing an output during interactive transaction construction.
7387 typedef struct MUST_USE_STRUCT LDKTxRemoveOutput {
7389 * A pointer to the opaque Rust object.
7390 * Nearly everywhere, inner must be non-null, however in places where
7391 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7393 LDKnativeTxRemoveOutput *inner;
7395 * Indicates that this is the only struct which contains the same pointer.
7396 * Rust functions which take ownership of an object provided via an argument require
7397 * this to be true and invalidate the object pointed to by inner.
7400 } LDKTxRemoveOutput;
7405 * A tx_complete message signalling the conclusion of a peer's transaction contributions during
7406 * interactive transaction construction.
7409 typedef struct MUST_USE_STRUCT LDKTxComplete {
7411 * A pointer to the opaque Rust object.
7412 * Nearly everywhere, inner must be non-null, however in places where
7413 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7415 LDKnativeTxComplete *inner;
7417 * Indicates that this is the only struct which contains the same pointer.
7418 * Rust functions which take ownership of an object provided via an argument require
7419 * this to be true and invalidate the object pointed to by inner.
7427 * A tx_signatures message containing the sender's signatures for a transaction constructed with
7428 * interactive transaction construction.
7431 typedef struct MUST_USE_STRUCT LDKTxSignatures {
7433 * A pointer to the opaque Rust object.
7434 * Nearly everywhere, inner must be non-null, however in places where
7435 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7437 LDKnativeTxSignatures *inner;
7439 * Indicates that this is the only struct which contains the same pointer.
7440 * Rust functions which take ownership of an object provided via an argument require
7441 * this to be true and invalidate the object pointed to by inner.
7449 * A tx_init_rbf message which initiates a replacement of the transaction after it's been
7453 typedef struct MUST_USE_STRUCT LDKTxInitRbf {
7455 * A pointer to the opaque Rust object.
7456 * Nearly everywhere, inner must be non-null, however in places where
7457 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7459 LDKnativeTxInitRbf *inner;
7461 * Indicates that this is the only struct which contains the same pointer.
7462 * Rust functions which take ownership of an object provided via an argument require
7463 * this to be true and invalidate the object pointed to by inner.
7471 * A tx_ack_rbf message which acknowledges replacement of the transaction after it's been
7475 typedef struct MUST_USE_STRUCT LDKTxAckRbf {
7477 * A pointer to the opaque Rust object.
7478 * Nearly everywhere, inner must be non-null, however in places where
7479 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7481 LDKnativeTxAckRbf *inner;
7483 * Indicates that this is the only struct which contains the same pointer.
7484 * Rust functions which take ownership of an object provided via an argument require
7485 * this to be true and invalidate the object pointed to by inner.
7493 * A tx_abort message which signals the cancellation of an in-progress transaction negotiation.
7496 typedef struct MUST_USE_STRUCT LDKTxAbort {
7498 * A pointer to the opaque Rust object.
7499 * Nearly everywhere, inner must be non-null, however in places where
7500 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7502 LDKnativeTxAbort *inner;
7504 * Indicates that this is the only struct which contains the same pointer.
7505 * Rust functions which take ownership of an object provided via an argument require
7506 * this to be true and invalidate the object pointed to by inner.
7514 * A [`channel_ready`] message to be sent to or received from a peer.
7516 * [`channel_ready`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-channel_ready-message
7518 typedef struct MUST_USE_STRUCT LDKChannelReady {
7520 * A pointer to the opaque Rust object.
7521 * Nearly everywhere, inner must be non-null, however in places where
7522 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7524 LDKnativeChannelReady *inner;
7526 * Indicates that this is the only struct which contains the same pointer.
7527 * Rust functions which take ownership of an object provided via an argument require
7528 * this to be true and invalidate the object pointed to by inner.
7536 * An [`announcement_signatures`] message to be sent to or received from a peer.
7538 * [`announcement_signatures`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-announcement_signatures-message
7540 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
7542 * A pointer to the opaque Rust object.
7543 * Nearly everywhere, inner must be non-null, however in places where
7544 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7546 LDKnativeAnnouncementSignatures *inner;
7548 * Indicates that this is the only struct which contains the same pointer.
7549 * Rust functions which take ownership of an object provided via an argument require
7550 * this to be true and invalidate the object pointed to by inner.
7553 } LDKAnnouncementSignatures;
7558 * Struct used to return values from [`RevokeAndACK`] messages, containing a bunch of commitment
7559 * transaction updates if they were pending.
7561 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
7563 * A pointer to the opaque Rust object.
7564 * Nearly everywhere, inner must be non-null, however in places where
7565 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7567 LDKnativeCommitmentUpdate *inner;
7569 * Indicates that this is the only struct which contains the same pointer.
7570 * Rust functions which take ownership of an object provided via an argument require
7571 * this to be true and invalidate the object pointed to by inner.
7574 } LDKCommitmentUpdate;
7579 * A [`revoke_and_ack`] message to be sent to or received from a peer.
7581 * [`revoke_and_ack`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#completing-the-transition-to-the-updated-state-revoke_and_ack
7583 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
7585 * A pointer to the opaque Rust object.
7586 * Nearly everywhere, inner must be non-null, however in places where
7587 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7589 LDKnativeRevokeAndACK *inner;
7591 * Indicates that this is the only struct which contains the same pointer.
7592 * Rust functions which take ownership of an object provided via an argument require
7593 * this to be true and invalidate the object pointed to by inner.
7601 * A [`closing_signed`] message to be sent to or received from a peer.
7603 * [`closing_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-negotiation-closing_signed
7605 typedef struct MUST_USE_STRUCT LDKClosingSigned {
7607 * A pointer to the opaque Rust object.
7608 * Nearly everywhere, inner must be non-null, however in places where
7609 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7611 LDKnativeClosingSigned *inner;
7613 * Indicates that this is the only struct which contains the same pointer.
7614 * Rust functions which take ownership of an object provided via an argument require
7615 * this to be true and invalidate the object pointed to by inner.
7623 * A [`shutdown`] message to be sent to or received from a peer.
7625 * [`shutdown`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-initiation-shutdown
7627 typedef struct MUST_USE_STRUCT LDKShutdown {
7629 * A pointer to the opaque Rust object.
7630 * Nearly everywhere, inner must be non-null, however in places where
7631 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7633 LDKnativeShutdown *inner;
7635 * Indicates that this is the only struct which contains the same pointer.
7636 * Rust functions which take ownership of an object provided via an argument require
7637 * this to be true and invalidate the object pointed to by inner.
7645 * A [`channel_reestablish`] message to be sent to or received from a peer.
7647 * [`channel_reestablish`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#message-retransmission
7649 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
7651 * A pointer to the opaque Rust object.
7652 * Nearly everywhere, inner must be non-null, however in places where
7653 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7655 LDKnativeChannelReestablish *inner;
7657 * Indicates that this is the only struct which contains the same pointer.
7658 * Rust functions which take ownership of an object provided via an argument require
7659 * this to be true and invalidate the object pointed to by inner.
7662 } LDKChannelReestablish;
7667 * A [`node_announcement`] message to be sent to or received from a peer.
7669 * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
7671 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
7673 * A pointer to the opaque Rust object.
7674 * Nearly everywhere, inner must be non-null, however in places where
7675 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7677 LDKnativeNodeAnnouncement *inner;
7679 * Indicates that this is the only struct which contains the same pointer.
7680 * Rust functions which take ownership of an object provided via an argument require
7681 * this to be true and invalidate the object pointed to by inner.
7684 } LDKNodeAnnouncement;
7689 * An [`error`] message to be sent to or received from a peer.
7691 * [`error`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
7693 typedef struct MUST_USE_STRUCT LDKErrorMessage {
7695 * A pointer to the opaque Rust object.
7696 * Nearly everywhere, inner must be non-null, however in places where
7697 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7699 LDKnativeErrorMessage *inner;
7701 * Indicates that this is the only struct which contains the same pointer.
7702 * Rust functions which take ownership of an object provided via an argument require
7703 * this to be true and invalidate the object pointed to by inner.
7711 * A [`warning`] message to be sent to or received from a peer.
7713 * [`warning`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
7715 typedef struct MUST_USE_STRUCT LDKWarningMessage {
7717 * A pointer to the opaque Rust object.
7718 * Nearly everywhere, inner must be non-null, however in places where
7719 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7721 LDKnativeWarningMessage *inner;
7723 * Indicates that this is the only struct which contains the same pointer.
7724 * Rust functions which take ownership of an object provided via an argument require
7725 * this to be true and invalidate the object pointed to by inner.
7728 } LDKWarningMessage;
7731 * Used to put an error message in a [`LightningError`].
7733 typedef enum LDKErrorAction_Tag {
7735 * The peer took some action which made us think they were useless. Disconnect them.
7737 LDKErrorAction_DisconnectPeer,
7739 * The peer did something incorrect. Tell them without closing any channels and disconnect them.
7741 LDKErrorAction_DisconnectPeerWithWarning,
7743 * The peer did something harmless that we weren't able to process, just log and ignore
7745 LDKErrorAction_IgnoreError,
7747 * The peer did something harmless that we weren't able to meaningfully process.
7748 * If the error is logged, log it at the given level.
7750 LDKErrorAction_IgnoreAndLog,
7752 * The peer provided us with a gossip message which we'd already seen. In most cases this
7753 * should be ignored, but it may result in the message being forwarded if it is a duplicate of
7754 * our own channel announcements.
7756 LDKErrorAction_IgnoreDuplicateGossip,
7758 * The peer did something incorrect. Tell them.
7760 LDKErrorAction_SendErrorMessage,
7762 * The peer did something incorrect. Tell them without closing any channels.
7764 LDKErrorAction_SendWarningMessage,
7766 * Must be last for serialization purposes
7768 LDKErrorAction_Sentinel,
7769 } LDKErrorAction_Tag;
7771 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
7773 * An error message which we should make an effort to send before we disconnect.
7775 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
7777 struct LDKErrorMessage msg;
7778 } LDKErrorAction_LDKDisconnectPeer_Body;
7780 typedef struct LDKErrorAction_LDKDisconnectPeerWithWarning_Body {
7782 * A warning message which we should make an effort to send before we disconnect.
7784 struct LDKWarningMessage msg;
7785 } LDKErrorAction_LDKDisconnectPeerWithWarning_Body;
7787 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
7789 * The message to send.
7791 struct LDKErrorMessage msg;
7792 } LDKErrorAction_LDKSendErrorMessage_Body;
7794 typedef struct LDKErrorAction_LDKSendWarningMessage_Body {
7796 * The message to send.
7798 struct LDKWarningMessage msg;
7800 * The peer may have done something harmless that we weren't able to meaningfully process,
7801 * though we should still tell them about it.
7802 * If this event is logged, log it at the given level.
7804 enum LDKLevel log_level;
7805 } LDKErrorAction_LDKSendWarningMessage_Body;
7807 typedef struct MUST_USE_STRUCT LDKErrorAction {
7808 LDKErrorAction_Tag tag;
7810 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
7811 LDKErrorAction_LDKDisconnectPeerWithWarning_Body disconnect_peer_with_warning;
7813 enum LDKLevel ignore_and_log;
7815 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
7816 LDKErrorAction_LDKSendWarningMessage_Body send_warning_message;
7823 * A [`query_channel_range`] message is used to query a peer for channel
7824 * UTXOs in a range of blocks. The recipient of a query makes a best
7825 * effort to reply to the query using one or more [`ReplyChannelRange`]
7828 * [`query_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
7830 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
7832 * A pointer to the opaque Rust object.
7833 * Nearly everywhere, inner must be non-null, however in places where
7834 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7836 LDKnativeQueryChannelRange *inner;
7838 * Indicates that this is the only struct which contains the same pointer.
7839 * Rust functions which take ownership of an object provided via an argument require
7840 * this to be true and invalidate the object pointed to by inner.
7843 } LDKQueryChannelRange;
7848 * A [`query_short_channel_ids`] message is used to query a peer for
7849 * routing gossip messages related to one or more `short_channel_id`s.
7851 * The query recipient will reply with the latest, if available,
7852 * [`ChannelAnnouncement`], [`ChannelUpdate`] and [`NodeAnnouncement`] messages
7853 * it maintains for the requested `short_channel_id`s followed by a
7854 * [`ReplyShortChannelIdsEnd`] message. The `short_channel_id`s sent in
7855 * this query are encoded. We only support `encoding_type=0` uncompressed
7856 * serialization and do not support `encoding_type=1` zlib serialization.
7858 * [`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
7860 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
7862 * A pointer to the opaque Rust object.
7863 * Nearly everywhere, inner must be non-null, however in places where
7864 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7866 LDKnativeQueryShortChannelIds *inner;
7868 * Indicates that this is the only struct which contains the same pointer.
7869 * Rust functions which take ownership of an object provided via an argument require
7870 * this to be true and invalidate the object pointed to by inner.
7873 } LDKQueryShortChannelIds;
7878 * A [`reply_channel_range`] message is a reply to a [`QueryChannelRange`]
7881 * Multiple `reply_channel_range` messages can be sent in reply
7882 * to a single [`QueryChannelRange`] message. The query recipient makes a
7883 * best effort to respond based on their local network view which may
7884 * not be a perfect view of the network. The `short_channel_id`s in the
7885 * reply are encoded. We only support `encoding_type=0` uncompressed
7886 * serialization and do not support `encoding_type=1` zlib serialization.
7888 * [`reply_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
7890 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
7892 * A pointer to the opaque Rust object.
7893 * Nearly everywhere, inner must be non-null, however in places where
7894 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7896 LDKnativeReplyChannelRange *inner;
7898 * Indicates that this is the only struct which contains the same pointer.
7899 * Rust functions which take ownership of an object provided via an argument require
7900 * this to be true and invalidate the object pointed to by inner.
7903 } LDKReplyChannelRange;
7908 * A [`gossip_timestamp_filter`] message is used by a node to request
7909 * gossip relay for messages in the requested time range when the
7910 * `gossip_queries` feature has been negotiated.
7912 * [`gossip_timestamp_filter`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-gossip_timestamp_filter-message
7914 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
7916 * A pointer to the opaque Rust object.
7917 * Nearly everywhere, inner must be non-null, however in places where
7918 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7920 LDKnativeGossipTimestampFilter *inner;
7922 * Indicates that this is the only struct which contains the same pointer.
7923 * Rust functions which take ownership of an object provided via an argument require
7924 * this to be true and invalidate the object pointed to by inner.
7927 } LDKGossipTimestampFilter;
7930 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
7931 * broadcast to most peers).
7932 * These events are handled by PeerManager::process_events if you are using a PeerManager.
7934 typedef enum LDKMessageSendEvent_Tag {
7936 * Used to indicate that we've accepted a channel open and should send the accept_channel
7937 * message provided to the given peer.
7939 LDKMessageSendEvent_SendAcceptChannel,
7941 * Used to indicate that we've accepted a V2 channel open and should send the accept_channel2
7942 * message provided to the given peer.
7944 LDKMessageSendEvent_SendAcceptChannelV2,
7946 * Used to indicate that we've initiated a channel open and should send the open_channel
7947 * message provided to the given peer.
7949 LDKMessageSendEvent_SendOpenChannel,
7951 * Used to indicate that we've initiated a V2 channel open and should send the open_channel2
7952 * message provided to the given peer.
7954 LDKMessageSendEvent_SendOpenChannelV2,
7956 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
7958 LDKMessageSendEvent_SendFundingCreated,
7960 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
7962 LDKMessageSendEvent_SendFundingSigned,
7964 * Used to indicate that a stfu message should be sent to the peer with the given node id.
7966 LDKMessageSendEvent_SendStfu,
7968 * Used to indicate that a splice message should be sent to the peer with the given node id.
7970 LDKMessageSendEvent_SendSplice,
7972 * Used to indicate that a splice_ack message should be sent to the peer with the given node id.
7974 LDKMessageSendEvent_SendSpliceAck,
7976 * Used to indicate that a splice_locked message should be sent to the peer with the given node id.
7978 LDKMessageSendEvent_SendSpliceLocked,
7980 * Used to indicate that a tx_add_input message should be sent to the peer with the given node_id.
7982 LDKMessageSendEvent_SendTxAddInput,
7984 * Used to indicate that a tx_add_output message should be sent to the peer with the given node_id.
7986 LDKMessageSendEvent_SendTxAddOutput,
7988 * Used to indicate that a tx_remove_input message should be sent to the peer with the given node_id.
7990 LDKMessageSendEvent_SendTxRemoveInput,
7992 * Used to indicate that a tx_remove_output message should be sent to the peer with the given node_id.
7994 LDKMessageSendEvent_SendTxRemoveOutput,
7996 * Used to indicate that a tx_complete message should be sent to the peer with the given node_id.
7998 LDKMessageSendEvent_SendTxComplete,
8000 * Used to indicate that a tx_signatures message should be sent to the peer with the given node_id.
8002 LDKMessageSendEvent_SendTxSignatures,
8004 * Used to indicate that a tx_init_rbf message should be sent to the peer with the given node_id.
8006 LDKMessageSendEvent_SendTxInitRbf,
8008 * Used to indicate that a tx_ack_rbf message should be sent to the peer with the given node_id.
8010 LDKMessageSendEvent_SendTxAckRbf,
8012 * Used to indicate that a tx_abort message should be sent to the peer with the given node_id.
8014 LDKMessageSendEvent_SendTxAbort,
8016 * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
8018 LDKMessageSendEvent_SendChannelReady,
8020 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
8022 LDKMessageSendEvent_SendAnnouncementSignatures,
8024 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
8025 * message should be sent to the peer with the given node_id.
8027 LDKMessageSendEvent_UpdateHTLCs,
8029 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
8031 LDKMessageSendEvent_SendRevokeAndACK,
8033 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
8035 LDKMessageSendEvent_SendClosingSigned,
8037 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
8039 LDKMessageSendEvent_SendShutdown,
8041 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
8043 LDKMessageSendEvent_SendChannelReestablish,
8045 * Used to send a channel_announcement and channel_update to a specific peer, likely on
8046 * initial connection to ensure our peers know about our channels.
8048 LDKMessageSendEvent_SendChannelAnnouncement,
8050 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
8051 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
8053 * Note that after doing so, you very likely (unless you did so very recently) want to
8054 * broadcast a node_announcement (e.g. via [`PeerManager::broadcast_node_announcement`]). This
8055 * ensures that any nodes which see our channel_announcement also have a relevant
8056 * node_announcement, including relevant feature flags which may be important for routing
8059 * [`PeerManager::broadcast_node_announcement`]: crate::ln::peer_handler::PeerManager::broadcast_node_announcement
8061 LDKMessageSendEvent_BroadcastChannelAnnouncement,
8063 * Used to indicate that a channel_update should be broadcast to all peers.
8065 LDKMessageSendEvent_BroadcastChannelUpdate,
8067 * Used to indicate that a node_announcement should be broadcast to all peers.
8069 LDKMessageSendEvent_BroadcastNodeAnnouncement,
8071 * Used to indicate that a channel_update should be sent to a single peer.
8072 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
8073 * private channel and we shouldn't be informing all of our peers of channel parameters.
8075 LDKMessageSendEvent_SendChannelUpdate,
8077 * Broadcast an error downstream to be handled
8079 LDKMessageSendEvent_HandleError,
8081 * Query a peer for channels with funding transaction UTXOs in a block range.
8083 LDKMessageSendEvent_SendChannelRangeQuery,
8085 * Request routing gossip messages from a peer for a list of channels identified by
8086 * their short_channel_ids.
8088 LDKMessageSendEvent_SendShortIdsQuery,
8090 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
8091 * emitted during processing of the query.
8093 LDKMessageSendEvent_SendReplyChannelRange,
8095 * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
8096 * enable receiving gossip messages from the peer.
8098 LDKMessageSendEvent_SendGossipTimestampFilter,
8100 * Must be last for serialization purposes
8102 LDKMessageSendEvent_Sentinel,
8103 } LDKMessageSendEvent_Tag;
8105 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
8107 * The node_id of the node which should receive this message
8109 struct LDKPublicKey node_id;
8111 * The message which should be sent.
8113 struct LDKAcceptChannel msg;
8114 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
8116 typedef struct LDKMessageSendEvent_LDKSendAcceptChannelV2_Body {
8118 * The node_id of the node which should receive this message
8120 struct LDKPublicKey node_id;
8122 * The message which should be sent.
8124 struct LDKAcceptChannelV2 msg;
8125 } LDKMessageSendEvent_LDKSendAcceptChannelV2_Body;
8127 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
8129 * The node_id of the node which should receive this message
8131 struct LDKPublicKey node_id;
8133 * The message which should be sent.
8135 struct LDKOpenChannel msg;
8136 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
8138 typedef struct LDKMessageSendEvent_LDKSendOpenChannelV2_Body {
8140 * The node_id of the node which should receive this message
8142 struct LDKPublicKey node_id;
8144 * The message which should be sent.
8146 struct LDKOpenChannelV2 msg;
8147 } LDKMessageSendEvent_LDKSendOpenChannelV2_Body;
8149 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
8151 * The node_id of the node which should receive this message
8153 struct LDKPublicKey node_id;
8155 * The message which should be sent.
8157 struct LDKFundingCreated msg;
8158 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
8160 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
8162 * The node_id of the node which should receive this message
8164 struct LDKPublicKey node_id;
8166 * The message which should be sent.
8168 struct LDKFundingSigned msg;
8169 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
8171 typedef struct LDKMessageSendEvent_LDKSendStfu_Body {
8173 * The node_id of the node which should receive this message
8175 struct LDKPublicKey node_id;
8177 * The message which should be sent.
8180 } LDKMessageSendEvent_LDKSendStfu_Body;
8182 typedef struct LDKMessageSendEvent_LDKSendSplice_Body {
8184 * The node_id of the node which should receive this message
8186 struct LDKPublicKey node_id;
8188 * The message which should be sent.
8190 struct LDKSplice msg;
8191 } LDKMessageSendEvent_LDKSendSplice_Body;
8193 typedef struct LDKMessageSendEvent_LDKSendSpliceAck_Body {
8195 * The node_id of the node which should receive this message
8197 struct LDKPublicKey node_id;
8199 * The message which should be sent.
8201 struct LDKSpliceAck msg;
8202 } LDKMessageSendEvent_LDKSendSpliceAck_Body;
8204 typedef struct LDKMessageSendEvent_LDKSendSpliceLocked_Body {
8206 * The node_id of the node which should receive this message
8208 struct LDKPublicKey node_id;
8210 * The message which should be sent.
8212 struct LDKSpliceLocked msg;
8213 } LDKMessageSendEvent_LDKSendSpliceLocked_Body;
8215 typedef struct LDKMessageSendEvent_LDKSendTxAddInput_Body {
8217 * The node_id of the node which should receive this message
8219 struct LDKPublicKey node_id;
8221 * The message which should be sent.
8223 struct LDKTxAddInput msg;
8224 } LDKMessageSendEvent_LDKSendTxAddInput_Body;
8226 typedef struct LDKMessageSendEvent_LDKSendTxAddOutput_Body {
8228 * The node_id of the node which should receive this message
8230 struct LDKPublicKey node_id;
8232 * The message which should be sent.
8234 struct LDKTxAddOutput msg;
8235 } LDKMessageSendEvent_LDKSendTxAddOutput_Body;
8237 typedef struct LDKMessageSendEvent_LDKSendTxRemoveInput_Body {
8239 * The node_id of the node which should receive this message
8241 struct LDKPublicKey node_id;
8243 * The message which should be sent.
8245 struct LDKTxRemoveInput msg;
8246 } LDKMessageSendEvent_LDKSendTxRemoveInput_Body;
8248 typedef struct LDKMessageSendEvent_LDKSendTxRemoveOutput_Body {
8250 * The node_id of the node which should receive this message
8252 struct LDKPublicKey node_id;
8254 * The message which should be sent.
8256 struct LDKTxRemoveOutput msg;
8257 } LDKMessageSendEvent_LDKSendTxRemoveOutput_Body;
8259 typedef struct LDKMessageSendEvent_LDKSendTxComplete_Body {
8261 * The node_id of the node which should receive this message
8263 struct LDKPublicKey node_id;
8265 * The message which should be sent.
8267 struct LDKTxComplete msg;
8268 } LDKMessageSendEvent_LDKSendTxComplete_Body;
8270 typedef struct LDKMessageSendEvent_LDKSendTxSignatures_Body {
8272 * The node_id of the node which should receive this message
8274 struct LDKPublicKey node_id;
8276 * The message which should be sent.
8278 struct LDKTxSignatures msg;
8279 } LDKMessageSendEvent_LDKSendTxSignatures_Body;
8281 typedef struct LDKMessageSendEvent_LDKSendTxInitRbf_Body {
8283 * The node_id of the node which should receive this message
8285 struct LDKPublicKey node_id;
8287 * The message which should be sent.
8289 struct LDKTxInitRbf msg;
8290 } LDKMessageSendEvent_LDKSendTxInitRbf_Body;
8292 typedef struct LDKMessageSendEvent_LDKSendTxAckRbf_Body {
8294 * The node_id of the node which should receive this message
8296 struct LDKPublicKey node_id;
8298 * The message which should be sent.
8300 struct LDKTxAckRbf msg;
8301 } LDKMessageSendEvent_LDKSendTxAckRbf_Body;
8303 typedef struct LDKMessageSendEvent_LDKSendTxAbort_Body {
8305 * The node_id of the node which should receive this message
8307 struct LDKPublicKey node_id;
8309 * The message which should be sent.
8311 struct LDKTxAbort msg;
8312 } LDKMessageSendEvent_LDKSendTxAbort_Body;
8314 typedef struct LDKMessageSendEvent_LDKSendChannelReady_Body {
8316 * The node_id of the node which should receive these message(s)
8318 struct LDKPublicKey node_id;
8320 * The channel_ready message which should be sent.
8322 struct LDKChannelReady msg;
8323 } LDKMessageSendEvent_LDKSendChannelReady_Body;
8325 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
8327 * The node_id of the node which should receive these message(s)
8329 struct LDKPublicKey node_id;
8331 * The announcement_signatures message which should be sent.
8333 struct LDKAnnouncementSignatures msg;
8334 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
8336 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
8338 * The node_id of the node which should receive these message(s)
8340 struct LDKPublicKey node_id;
8342 * The update messages which should be sent. ALL messages in the struct should be sent!
8344 struct LDKCommitmentUpdate updates;
8345 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
8347 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
8349 * The node_id of the node which should receive this message
8351 struct LDKPublicKey node_id;
8353 * The message which should be sent.
8355 struct LDKRevokeAndACK msg;
8356 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
8358 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
8360 * The node_id of the node which should receive this message
8362 struct LDKPublicKey node_id;
8364 * The message which should be sent.
8366 struct LDKClosingSigned msg;
8367 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
8369 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
8371 * The node_id of the node which should receive this message
8373 struct LDKPublicKey node_id;
8375 * The message which should be sent.
8377 struct LDKShutdown msg;
8378 } LDKMessageSendEvent_LDKSendShutdown_Body;
8380 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
8382 * The node_id of the node which should receive this message
8384 struct LDKPublicKey node_id;
8386 * The message which should be sent.
8388 struct LDKChannelReestablish msg;
8389 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
8391 typedef struct LDKMessageSendEvent_LDKSendChannelAnnouncement_Body {
8393 * The node_id of the node which should receive this message
8395 struct LDKPublicKey node_id;
8397 * The channel_announcement which should be sent.
8399 struct LDKChannelAnnouncement msg;
8401 * The followup channel_update which should be sent.
8403 struct LDKChannelUpdate update_msg;
8404 } LDKMessageSendEvent_LDKSendChannelAnnouncement_Body;
8406 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
8408 * The channel_announcement which should be sent.
8410 struct LDKChannelAnnouncement msg;
8412 * The followup channel_update which should be sent.
8414 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
8416 struct LDKChannelUpdate update_msg;
8417 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
8419 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
8421 * The channel_update which should be sent.
8423 struct LDKChannelUpdate msg;
8424 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
8426 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
8428 * The node_announcement which should be sent.
8430 struct LDKNodeAnnouncement msg;
8431 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
8433 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
8435 * The node_id of the node which should receive this message
8437 struct LDKPublicKey node_id;
8439 * The channel_update which should be sent.
8441 struct LDKChannelUpdate msg;
8442 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
8444 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
8446 * The node_id of the node which should receive this message
8448 struct LDKPublicKey node_id;
8450 * The action which should be taken.
8452 struct LDKErrorAction action;
8453 } LDKMessageSendEvent_LDKHandleError_Body;
8455 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
8457 * The node_id of this message recipient
8459 struct LDKPublicKey node_id;
8461 * The query_channel_range which should be sent.
8463 struct LDKQueryChannelRange msg;
8464 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
8466 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
8468 * The node_id of this message recipient
8470 struct LDKPublicKey node_id;
8472 * The query_short_channel_ids which should be sent.
8474 struct LDKQueryShortChannelIds msg;
8475 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
8477 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
8479 * The node_id of this message recipient
8481 struct LDKPublicKey node_id;
8483 * The reply_channel_range which should be sent.
8485 struct LDKReplyChannelRange msg;
8486 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
8488 typedef struct LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body {
8490 * The node_id of this message recipient
8492 struct LDKPublicKey node_id;
8494 * The gossip_timestamp_filter which should be sent.
8496 struct LDKGossipTimestampFilter msg;
8497 } LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body;
8499 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
8500 LDKMessageSendEvent_Tag tag;
8502 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
8503 LDKMessageSendEvent_LDKSendAcceptChannelV2_Body send_accept_channel_v2;
8504 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
8505 LDKMessageSendEvent_LDKSendOpenChannelV2_Body send_open_channel_v2;
8506 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
8507 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
8508 LDKMessageSendEvent_LDKSendStfu_Body send_stfu;
8509 LDKMessageSendEvent_LDKSendSplice_Body send_splice;
8510 LDKMessageSendEvent_LDKSendSpliceAck_Body send_splice_ack;
8511 LDKMessageSendEvent_LDKSendSpliceLocked_Body send_splice_locked;
8512 LDKMessageSendEvent_LDKSendTxAddInput_Body send_tx_add_input;
8513 LDKMessageSendEvent_LDKSendTxAddOutput_Body send_tx_add_output;
8514 LDKMessageSendEvent_LDKSendTxRemoveInput_Body send_tx_remove_input;
8515 LDKMessageSendEvent_LDKSendTxRemoveOutput_Body send_tx_remove_output;
8516 LDKMessageSendEvent_LDKSendTxComplete_Body send_tx_complete;
8517 LDKMessageSendEvent_LDKSendTxSignatures_Body send_tx_signatures;
8518 LDKMessageSendEvent_LDKSendTxInitRbf_Body send_tx_init_rbf;
8519 LDKMessageSendEvent_LDKSendTxAckRbf_Body send_tx_ack_rbf;
8520 LDKMessageSendEvent_LDKSendTxAbort_Body send_tx_abort;
8521 LDKMessageSendEvent_LDKSendChannelReady_Body send_channel_ready;
8522 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
8523 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
8524 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
8525 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
8526 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
8527 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
8528 LDKMessageSendEvent_LDKSendChannelAnnouncement_Body send_channel_announcement;
8529 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
8530 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
8531 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
8532 LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
8533 LDKMessageSendEvent_LDKHandleError_Body handle_error;
8534 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
8535 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
8536 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
8537 LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body send_gossip_timestamp_filter;
8539 } LDKMessageSendEvent;
8542 * A dynamically-allocated array of crate::lightning::events::MessageSendEvents of arbitrary size.
8543 * This corresponds to std::vector in C++
8545 typedef struct LDKCVec_MessageSendEventZ {
8547 * The elements in the array.
8548 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8550 struct LDKMessageSendEvent *data;
8552 * The number of elements pointed to by `data`.
8555 } LDKCVec_MessageSendEventZ;
8560 * Details about one direction of a channel as received within a [`ChannelUpdate`].
8562 typedef struct MUST_USE_STRUCT LDKChannelUpdateInfo {
8564 * A pointer to the opaque Rust object.
8565 * Nearly everywhere, inner must be non-null, however in places where
8566 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8568 LDKnativeChannelUpdateInfo *inner;
8570 * Indicates that this is the only struct which contains the same pointer.
8571 * Rust functions which take ownership of an object provided via an argument require
8572 * this to be true and invalidate the object pointed to by inner.
8575 } LDKChannelUpdateInfo;
8578 * The contents of CResult_ChannelUpdateInfoDecodeErrorZ
8580 typedef union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr {
8582 * A pointer to the contents in the success state.
8583 * Reading from this pointer when `result_ok` is not set is undefined.
8585 struct LDKChannelUpdateInfo *result;
8587 * A pointer to the contents in the error state.
8588 * Reading from this pointer when `result_ok` is set is undefined.
8590 struct LDKDecodeError *err;
8591 } LDKCResult_ChannelUpdateInfoDecodeErrorZPtr;
8594 * A CResult_ChannelUpdateInfoDecodeErrorZ represents the result of a fallible operation,
8595 * containing a crate::lightning::routing::gossip::ChannelUpdateInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8596 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8598 typedef struct LDKCResult_ChannelUpdateInfoDecodeErrorZ {
8600 * The contents of this CResult_ChannelUpdateInfoDecodeErrorZ, accessible via either
8601 * `err` or `result` depending on the state of `result_ok`.
8603 union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr contents;
8605 * Whether this CResult_ChannelUpdateInfoDecodeErrorZ represents a success state.
8608 } LDKCResult_ChannelUpdateInfoDecodeErrorZ;
8613 * Details about a channel (both directions).
8614 * Received within a channel announcement.
8616 typedef struct MUST_USE_STRUCT LDKChannelInfo {
8618 * A pointer to the opaque Rust object.
8619 * Nearly everywhere, inner must be non-null, however in places where
8620 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8622 LDKnativeChannelInfo *inner;
8624 * Indicates that this is the only struct which contains the same pointer.
8625 * Rust functions which take ownership of an object provided via an argument require
8626 * this to be true and invalidate the object pointed to by inner.
8632 * The contents of CResult_ChannelInfoDecodeErrorZ
8634 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
8636 * A pointer to the contents in the success state.
8637 * Reading from this pointer when `result_ok` is not set is undefined.
8639 struct LDKChannelInfo *result;
8641 * A pointer to the contents in the error state.
8642 * Reading from this pointer when `result_ok` is set is undefined.
8644 struct LDKDecodeError *err;
8645 } LDKCResult_ChannelInfoDecodeErrorZPtr;
8648 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
8649 * containing a crate::lightning::routing::gossip::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8650 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8652 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
8654 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
8655 * `err` or `result` depending on the state of `result_ok`.
8657 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
8659 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
8662 } LDKCResult_ChannelInfoDecodeErrorZ;
8667 * Fees for routing via a given channel or a node
8669 typedef struct MUST_USE_STRUCT LDKRoutingFees {
8671 * A pointer to the opaque Rust object.
8672 * Nearly everywhere, inner must be non-null, however in places where
8673 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8675 LDKnativeRoutingFees *inner;
8677 * Indicates that this is the only struct which contains the same pointer.
8678 * Rust functions which take ownership of an object provided via an argument require
8679 * this to be true and invalidate the object pointed to by inner.
8685 * The contents of CResult_RoutingFeesDecodeErrorZ
8687 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
8689 * A pointer to the contents in the success state.
8690 * Reading from this pointer when `result_ok` is not set is undefined.
8692 struct LDKRoutingFees *result;
8694 * A pointer to the contents in the error state.
8695 * Reading from this pointer when `result_ok` is set is undefined.
8697 struct LDKDecodeError *err;
8698 } LDKCResult_RoutingFeesDecodeErrorZPtr;
8701 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
8702 * containing a crate::lightning::routing::gossip::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
8703 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8705 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
8707 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
8708 * `err` or `result` depending on the state of `result_ok`.
8710 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
8712 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
8715 } LDKCResult_RoutingFeesDecodeErrorZ;
8718 * A 4-byte byte array.
8720 typedef struct LDKFourBytes {
8728 * A 12-byte byte array.
8730 typedef struct LDKTwelveBytes {
8740 * Represents a hostname for serialization purposes.
8741 * Only the character set and length will be validated.
8742 * The character set consists of ASCII alphanumeric characters, hyphens, and periods.
8743 * Its length is guaranteed to be representable by a single byte.
8744 * This serialization is used by [`BOLT 7`] hostnames.
8746 * [`BOLT 7`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md
8748 typedef struct MUST_USE_STRUCT LDKHostname {
8750 * A pointer to the opaque Rust object.
8751 * Nearly everywhere, inner must be non-null, however in places where
8752 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8754 LDKnativeHostname *inner;
8756 * Indicates that this is the only struct which contains the same pointer.
8757 * Rust functions which take ownership of an object provided via an argument require
8758 * this to be true and invalidate the object pointed to by inner.
8764 * An address which can be used to connect to a remote peer.
8766 typedef enum LDKSocketAddress_Tag {
8768 * An IPv4 address and port on which the peer is listening.
8770 LDKSocketAddress_TcpIpV4,
8772 * An IPv6 address and port on which the peer is listening.
8774 LDKSocketAddress_TcpIpV6,
8776 * An old-style Tor onion address/port on which the peer is listening.
8778 * This field is deprecated and the Tor network generally no longer supports V2 Onion
8779 * addresses. Thus, the details are not parsed here.
8781 LDKSocketAddress_OnionV2,
8783 * A new-style Tor onion address/port on which the peer is listening.
8785 * To create the human-readable \"hostname\", concatenate the ED25519 pubkey, checksum, and version,
8786 * wrap as base32 and append \".onion\".
8788 LDKSocketAddress_OnionV3,
8790 * A hostname/port on which the peer is listening.
8792 LDKSocketAddress_Hostname,
8794 * Must be last for serialization purposes
8796 LDKSocketAddress_Sentinel,
8797 } LDKSocketAddress_Tag;
8799 typedef struct LDKSocketAddress_LDKTcpIpV4_Body {
8801 * The 4-byte IPv4 address
8803 struct LDKFourBytes addr;
8805 * The port on which the node is listening
8808 } LDKSocketAddress_LDKTcpIpV4_Body;
8810 typedef struct LDKSocketAddress_LDKTcpIpV6_Body {
8812 * The 16-byte IPv6 address
8814 struct LDKSixteenBytes addr;
8816 * The port on which the node is listening
8819 } LDKSocketAddress_LDKTcpIpV6_Body;
8821 typedef struct LDKSocketAddress_LDKOnionV3_Body {
8823 * The ed25519 long-term public key of the peer
8825 struct LDKThirtyTwoBytes ed25519_pubkey;
8827 * The checksum of the pubkey and version, as included in the onion address
8831 * The version byte, as defined by the Tor Onion v3 spec.
8835 * The port on which the node is listening
8838 } LDKSocketAddress_LDKOnionV3_Body;
8840 typedef struct LDKSocketAddress_LDKHostname_Body {
8842 * The hostname on which the node is listening.
8844 struct LDKHostname hostname;
8846 * The port on which the node is listening.
8849 } LDKSocketAddress_LDKHostname_Body;
8851 typedef struct MUST_USE_STRUCT LDKSocketAddress {
8852 LDKSocketAddress_Tag tag;
8854 LDKSocketAddress_LDKTcpIpV4_Body tcp_ip_v4;
8855 LDKSocketAddress_LDKTcpIpV6_Body tcp_ip_v6;
8857 struct LDKTwelveBytes onion_v2;
8859 LDKSocketAddress_LDKOnionV3_Body onion_v3;
8860 LDKSocketAddress_LDKHostname_Body hostname;
8865 * A dynamically-allocated array of crate::lightning::ln::msgs::SocketAddresss of arbitrary size.
8866 * This corresponds to std::vector in C++
8868 typedef struct LDKCVec_SocketAddressZ {
8870 * The elements in the array.
8871 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8873 struct LDKSocketAddress *data;
8875 * The number of elements pointed to by `data`.
8878 } LDKCVec_SocketAddressZ;
8883 * Information received in the latest node_announcement from this node.
8885 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
8887 * A pointer to the opaque Rust object.
8888 * Nearly everywhere, inner must be non-null, however in places where
8889 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8891 LDKnativeNodeAnnouncementInfo *inner;
8893 * Indicates that this is the only struct which contains the same pointer.
8894 * Rust functions which take ownership of an object provided via an argument require
8895 * this to be true and invalidate the object pointed to by inner.
8898 } LDKNodeAnnouncementInfo;
8901 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
8903 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
8905 * A pointer to the contents in the success state.
8906 * Reading from this pointer when `result_ok` is not set is undefined.
8908 struct LDKNodeAnnouncementInfo *result;
8910 * A pointer to the contents in the error state.
8911 * Reading from this pointer when `result_ok` is set is undefined.
8913 struct LDKDecodeError *err;
8914 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
8917 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
8918 * containing a crate::lightning::routing::gossip::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8919 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8921 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
8923 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
8924 * `err` or `result` depending on the state of `result_ok`.
8926 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
8928 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
8931 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
8936 * A user-defined name for a node, which may be used when displaying the node in a graph.
8938 * Since node aliases are provided by third parties, they are a potential avenue for injection
8939 * attacks. Care must be taken when processing.
8941 typedef struct MUST_USE_STRUCT LDKNodeAlias {
8943 * A pointer to the opaque Rust object.
8944 * Nearly everywhere, inner must be non-null, however in places where
8945 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8947 LDKnativeNodeAlias *inner;
8949 * Indicates that this is the only struct which contains the same pointer.
8950 * Rust functions which take ownership of an object provided via an argument require
8951 * this to be true and invalidate the object pointed to by inner.
8957 * The contents of CResult_NodeAliasDecodeErrorZ
8959 typedef union LDKCResult_NodeAliasDecodeErrorZPtr {
8961 * A pointer to the contents in the success state.
8962 * Reading from this pointer when `result_ok` is not set is undefined.
8964 struct LDKNodeAlias *result;
8966 * A pointer to the contents in the error state.
8967 * Reading from this pointer when `result_ok` is set is undefined.
8969 struct LDKDecodeError *err;
8970 } LDKCResult_NodeAliasDecodeErrorZPtr;
8973 * A CResult_NodeAliasDecodeErrorZ represents the result of a fallible operation,
8974 * containing a crate::lightning::routing::gossip::NodeAlias on success and a crate::lightning::ln::msgs::DecodeError on failure.
8975 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8977 typedef struct LDKCResult_NodeAliasDecodeErrorZ {
8979 * The contents of this CResult_NodeAliasDecodeErrorZ, accessible via either
8980 * `err` or `result` depending on the state of `result_ok`.
8982 union LDKCResult_NodeAliasDecodeErrorZPtr contents;
8984 * Whether this CResult_NodeAliasDecodeErrorZ represents a success state.
8987 } LDKCResult_NodeAliasDecodeErrorZ;
8992 * Details about a node in the network, known from the network announcement.
8994 typedef struct MUST_USE_STRUCT LDKNodeInfo {
8996 * A pointer to the opaque Rust object.
8997 * Nearly everywhere, inner must be non-null, however in places where
8998 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9000 LDKnativeNodeInfo *inner;
9002 * Indicates that this is the only struct which contains the same pointer.
9003 * Rust functions which take ownership of an object provided via an argument require
9004 * this to be true and invalidate the object pointed to by inner.
9010 * The contents of CResult_NodeInfoDecodeErrorZ
9012 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
9014 * A pointer to the contents in the success state.
9015 * Reading from this pointer when `result_ok` is not set is undefined.
9017 struct LDKNodeInfo *result;
9019 * A pointer to the contents in the error state.
9020 * Reading from this pointer when `result_ok` is set is undefined.
9022 struct LDKDecodeError *err;
9023 } LDKCResult_NodeInfoDecodeErrorZPtr;
9026 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
9027 * containing a crate::lightning::routing::gossip::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
9028 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9030 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
9032 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
9033 * `err` or `result` depending on the state of `result_ok`.
9035 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
9037 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
9040 } LDKCResult_NodeInfoDecodeErrorZ;
9043 * The contents of CResult_NetworkGraphDecodeErrorZ
9045 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
9047 * A pointer to the contents in the success state.
9048 * Reading from this pointer when `result_ok` is not set is undefined.
9050 struct LDKNetworkGraph *result;
9052 * A pointer to the contents in the error state.
9053 * Reading from this pointer when `result_ok` is set is undefined.
9055 struct LDKDecodeError *err;
9056 } LDKCResult_NetworkGraphDecodeErrorZPtr;
9059 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
9060 * containing a crate::lightning::routing::gossip::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
9061 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9063 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
9065 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
9066 * `err` or `result` depending on the state of `result_ok`.
9068 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
9070 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
9073 } LDKCResult_NetworkGraphDecodeErrorZ;
9076 * An enum which can either contain a crate::c_types::derived::CVec_SocketAddressZ or not
9078 typedef enum LDKCOption_CVec_SocketAddressZZ_Tag {
9080 * When we're in this state, this COption_CVec_SocketAddressZZ contains a crate::c_types::derived::CVec_SocketAddressZ
9082 LDKCOption_CVec_SocketAddressZZ_Some,
9084 * When we're in this state, this COption_CVec_SocketAddressZZ contains nothing
9086 LDKCOption_CVec_SocketAddressZZ_None,
9088 * Must be last for serialization purposes
9090 LDKCOption_CVec_SocketAddressZZ_Sentinel,
9091 } LDKCOption_CVec_SocketAddressZZ_Tag;
9093 typedef struct LDKCOption_CVec_SocketAddressZZ {
9094 LDKCOption_CVec_SocketAddressZZ_Tag tag;
9097 struct LDKCVec_SocketAddressZ some;
9100 } LDKCOption_CVec_SocketAddressZZ;
9103 * The contents of CResult_u64ShortChannelIdErrorZ
9105 typedef union LDKCResult_u64ShortChannelIdErrorZPtr {
9107 * A pointer to the contents in the success state.
9108 * Reading from this pointer when `result_ok` is not set is undefined.
9112 * A pointer to the contents in the error state.
9113 * Reading from this pointer when `result_ok` is set is undefined.
9115 enum LDKShortChannelIdError *err;
9116 } LDKCResult_u64ShortChannelIdErrorZPtr;
9119 * A CResult_u64ShortChannelIdErrorZ represents the result of a fallible operation,
9120 * containing a u64 on success and a crate::lightning::util::scid_utils::ShortChannelIdError on failure.
9121 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9123 typedef struct LDKCResult_u64ShortChannelIdErrorZ {
9125 * The contents of this CResult_u64ShortChannelIdErrorZ, accessible via either
9126 * `err` or `result` depending on the state of `result_ok`.
9128 union LDKCResult_u64ShortChannelIdErrorZPtr contents;
9130 * Whether this CResult_u64ShortChannelIdErrorZ represents a success state.
9133 } LDKCResult_u64ShortChannelIdErrorZ;
9138 * Information about an incoming HTLC, including the [`PendingHTLCRouting`] describing where it
9141 typedef struct MUST_USE_STRUCT LDKPendingHTLCInfo {
9143 * A pointer to the opaque Rust object.
9144 * Nearly everywhere, inner must be non-null, however in places where
9145 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9147 LDKnativePendingHTLCInfo *inner;
9149 * Indicates that this is the only struct which contains the same pointer.
9150 * Rust functions which take ownership of an object provided via an argument require
9151 * this to be true and invalidate the object pointed to by inner.
9154 } LDKPendingHTLCInfo;
9159 * Invalid inbound onion payment.
9161 typedef struct MUST_USE_STRUCT LDKInboundHTLCErr {
9163 * A pointer to the opaque Rust object.
9164 * Nearly everywhere, inner must be non-null, however in places where
9165 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9167 LDKnativeInboundHTLCErr *inner;
9169 * Indicates that this is the only struct which contains the same pointer.
9170 * Rust functions which take ownership of an object provided via an argument require
9171 * this to be true and invalidate the object pointed to by inner.
9174 } LDKInboundHTLCErr;
9177 * The contents of CResult_PendingHTLCInfoInboundHTLCErrZ
9179 typedef union LDKCResult_PendingHTLCInfoInboundHTLCErrZPtr {
9181 * A pointer to the contents in the success state.
9182 * Reading from this pointer when `result_ok` is not set is undefined.
9184 struct LDKPendingHTLCInfo *result;
9186 * A pointer to the contents in the error state.
9187 * Reading from this pointer when `result_ok` is set is undefined.
9189 struct LDKInboundHTLCErr *err;
9190 } LDKCResult_PendingHTLCInfoInboundHTLCErrZPtr;
9193 * A CResult_PendingHTLCInfoInboundHTLCErrZ represents the result of a fallible operation,
9194 * containing a crate::lightning::ln::channelmanager::PendingHTLCInfo on success and a crate::lightning::ln::onion_payment::InboundHTLCErr on failure.
9195 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9197 typedef struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ {
9199 * The contents of this CResult_PendingHTLCInfoInboundHTLCErrZ, accessible via either
9200 * `err` or `result` depending on the state of `result_ok`.
9202 union LDKCResult_PendingHTLCInfoInboundHTLCErrZPtr contents;
9204 * Whether this CResult_PendingHTLCInfoInboundHTLCErrZ represents a success state.
9207 } LDKCResult_PendingHTLCInfoInboundHTLCErrZ;
9210 * A dynamically-allocated array of crate::lightning::ln::chan_utils::HTLCOutputInCommitments of arbitrary size.
9211 * This corresponds to std::vector in C++
9213 typedef struct LDKCVec_HTLCOutputInCommitmentZ {
9215 * The elements in the array.
9216 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9218 struct LDKHTLCOutputInCommitment *data;
9220 * The number of elements pointed to by `data`.
9223 } LDKCVec_HTLCOutputInCommitmentZ;
9226 * A dynamically-allocated array of crate::lightning::sign::HTLCDescriptors of arbitrary size.
9227 * This corresponds to std::vector in C++
9229 typedef struct LDKCVec_HTLCDescriptorZ {
9231 * The elements in the array.
9232 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9234 struct LDKHTLCDescriptor *data;
9236 * The number of elements pointed to by `data`.
9239 } LDKCVec_HTLCDescriptorZ;
9244 * An unspent transaction output that is available to spend resulting from a successful
9245 * [`CoinSelection`] attempt.
9247 typedef struct MUST_USE_STRUCT LDKUtxo {
9249 * A pointer to the opaque Rust object.
9250 * Nearly everywhere, inner must be non-null, however in places where
9251 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9253 LDKnativeUtxo *inner;
9255 * Indicates that this is the only struct which contains the same pointer.
9256 * Rust functions which take ownership of an object provided via an argument require
9257 * this to be true and invalidate the object pointed to by inner.
9263 * A dynamically-allocated array of crate::lightning::events::bump_transaction::Utxos of arbitrary size.
9264 * This corresponds to std::vector in C++
9266 typedef struct LDKCVec_UtxoZ {
9268 * The elements in the array.
9269 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9271 struct LDKUtxo *data;
9273 * The number of elements pointed to by `data`.
9279 * An enum which can either contain a crate::c_types::TxOut or not
9281 typedef enum LDKCOption_TxOutZ_Tag {
9283 * When we're in this state, this COption_TxOutZ contains a crate::c_types::TxOut
9285 LDKCOption_TxOutZ_Some,
9287 * When we're in this state, this COption_TxOutZ contains nothing
9289 LDKCOption_TxOutZ_None,
9291 * Must be last for serialization purposes
9293 LDKCOption_TxOutZ_Sentinel,
9294 } LDKCOption_TxOutZ_Tag;
9296 typedef struct LDKCOption_TxOutZ {
9297 LDKCOption_TxOutZ_Tag tag;
9300 struct LDKTxOut some;
9303 } LDKCOption_TxOutZ;
9308 * An input that must be included in a transaction when performing coin selection through
9309 * [`CoinSelectionSource::select_confirmed_utxos`]. It is guaranteed to be a SegWit input, so it
9310 * must have an empty [`TxIn::script_sig`] when spent.
9312 typedef struct MUST_USE_STRUCT LDKInput {
9314 * A pointer to the opaque Rust object.
9315 * Nearly everywhere, inner must be non-null, however in places where
9316 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9318 LDKnativeInput *inner;
9320 * Indicates that this is the only struct which contains the same pointer.
9321 * Rust functions which take ownership of an object provided via an argument require
9322 * this to be true and invalidate the object pointed to by inner.
9328 * A dynamically-allocated array of crate::lightning::events::bump_transaction::Inputs of arbitrary size.
9329 * This corresponds to std::vector in C++
9331 typedef struct LDKCVec_InputZ {
9333 * The elements in the array.
9334 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9336 struct LDKInput *data;
9338 * The number of elements pointed to by `data`.
9346 * The result of a successful coin selection attempt for a transaction requiring additional UTXOs
9347 * to cover its fees.
9349 typedef struct MUST_USE_STRUCT LDKCoinSelection {
9351 * A pointer to the opaque Rust object.
9352 * Nearly everywhere, inner must be non-null, however in places where
9353 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9355 LDKnativeCoinSelection *inner;
9357 * Indicates that this is the only struct which contains the same pointer.
9358 * Rust functions which take ownership of an object provided via an argument require
9359 * this to be true and invalidate the object pointed to by inner.
9365 * The contents of CResult_CoinSelectionNoneZ
9367 typedef union LDKCResult_CoinSelectionNoneZPtr {
9369 * A pointer to the contents in the success state.
9370 * Reading from this pointer when `result_ok` is not set is undefined.
9372 struct LDKCoinSelection *result;
9374 * Note that this value is always NULL, as there are no contents in the Err variant
9377 } LDKCResult_CoinSelectionNoneZPtr;
9380 * A CResult_CoinSelectionNoneZ represents the result of a fallible operation,
9381 * containing a crate::lightning::events::bump_transaction::CoinSelection on success and a () on failure.
9382 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9384 typedef struct LDKCResult_CoinSelectionNoneZ {
9386 * The contents of this CResult_CoinSelectionNoneZ, accessible via either
9387 * `err` or `result` depending on the state of `result_ok`.
9389 union LDKCResult_CoinSelectionNoneZPtr contents;
9391 * Whether this CResult_CoinSelectionNoneZ represents a success state.
9394 } LDKCResult_CoinSelectionNoneZ;
9397 * The contents of CResult_CVec_UtxoZNoneZ
9399 typedef union LDKCResult_CVec_UtxoZNoneZPtr {
9401 * A pointer to the contents in the success state.
9402 * Reading from this pointer when `result_ok` is not set is undefined.
9404 struct LDKCVec_UtxoZ *result;
9406 * Note that this value is always NULL, as there are no contents in the Err variant
9409 } LDKCResult_CVec_UtxoZNoneZPtr;
9412 * A CResult_CVec_UtxoZNoneZ represents the result of a fallible operation,
9413 * containing a crate::c_types::derived::CVec_UtxoZ on success and a () on failure.
9414 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9416 typedef struct LDKCResult_CVec_UtxoZNoneZ {
9418 * The contents of this CResult_CVec_UtxoZNoneZ, accessible via either
9419 * `err` or `result` depending on the state of `result_ok`.
9421 union LDKCResult_CVec_UtxoZNoneZPtr contents;
9423 * Whether this CResult_CVec_UtxoZNoneZ represents a success state.
9426 } LDKCResult_CVec_UtxoZNoneZ;
9431 * An unknown payment context.
9433 typedef struct MUST_USE_STRUCT LDKUnknownPaymentContext {
9435 * A pointer to the opaque Rust object.
9436 * Nearly everywhere, inner must be non-null, however in places where
9437 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9439 LDKnativeUnknownPaymentContext *inner;
9441 * Indicates that this is the only struct which contains the same pointer.
9442 * Rust functions which take ownership of an object provided via an argument require
9443 * this to be true and invalidate the object pointed to by inner.
9446 } LDKUnknownPaymentContext;
9451 * The context of a payment made for an invoice requested from a BOLT 12 [`Offer`].
9453 * [`Offer`]: crate::offers::offer::Offer
9455 typedef struct MUST_USE_STRUCT LDKBolt12OfferContext {
9457 * A pointer to the opaque Rust object.
9458 * Nearly everywhere, inner must be non-null, however in places where
9459 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9461 LDKnativeBolt12OfferContext *inner;
9463 * Indicates that this is the only struct which contains the same pointer.
9464 * Rust functions which take ownership of an object provided via an argument require
9465 * this to be true and invalidate the object pointed to by inner.
9468 } LDKBolt12OfferContext;
9473 * The context of a payment made for an invoice sent for a BOLT 12 [`Refund`].
9475 * [`Refund`]: crate::offers::refund::Refund
9477 typedef struct MUST_USE_STRUCT LDKBolt12RefundContext {
9479 * A pointer to the opaque Rust object.
9480 * Nearly everywhere, inner must be non-null, however in places where
9481 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9483 LDKnativeBolt12RefundContext *inner;
9485 * Indicates that this is the only struct which contains the same pointer.
9486 * Rust functions which take ownership of an object provided via an argument require
9487 * this to be true and invalidate the object pointed to by inner.
9490 } LDKBolt12RefundContext;
9493 * The context of an inbound payment, which is included in a [`BlindedPath`] via [`ReceiveTlvs`]
9494 * and surfaced in [`PaymentPurpose`].
9496 * [`BlindedPath`]: crate::blinded_path::BlindedPath
9497 * [`PaymentPurpose`]: crate::events::PaymentPurpose
9499 typedef enum LDKPaymentContext_Tag {
9501 * The payment context was unknown.
9503 LDKPaymentContext_Unknown,
9505 * The payment was made for an invoice requested from a BOLT 12 [`Offer`].
9507 * [`Offer`]: crate::offers::offer::Offer
9509 LDKPaymentContext_Bolt12Offer,
9511 * The payment was made for an invoice sent for a BOLT 12 [`Refund`].
9513 * [`Refund`]: crate::offers::refund::Refund
9515 LDKPaymentContext_Bolt12Refund,
9517 * Must be last for serialization purposes
9519 LDKPaymentContext_Sentinel,
9520 } LDKPaymentContext_Tag;
9522 typedef struct MUST_USE_STRUCT LDKPaymentContext {
9523 LDKPaymentContext_Tag tag;
9526 struct LDKUnknownPaymentContext unknown;
9529 struct LDKBolt12OfferContext bolt12_offer;
9532 struct LDKBolt12RefundContext bolt12_refund;
9535 } LDKPaymentContext;
9538 * An enum which can either contain a crate::lightning::blinded_path::payment::PaymentContext or not
9540 typedef enum LDKCOption_PaymentContextZ_Tag {
9542 * When we're in this state, this COption_PaymentContextZ contains a crate::lightning::blinded_path::payment::PaymentContext
9544 LDKCOption_PaymentContextZ_Some,
9546 * When we're in this state, this COption_PaymentContextZ contains nothing
9548 LDKCOption_PaymentContextZ_None,
9550 * Must be last for serialization purposes
9552 LDKCOption_PaymentContextZ_Sentinel,
9553 } LDKCOption_PaymentContextZ_Tag;
9555 typedef struct LDKCOption_PaymentContextZ {
9556 LDKCOption_PaymentContextZ_Tag tag;
9559 struct LDKPaymentContext some;
9562 } LDKCOption_PaymentContextZ;
9565 * A tuple of 2 elements. See the individual fields for the types contained.
9567 typedef struct LDKC2Tuple_u64u16Z {
9569 * The element at position 0
9573 * The element at position 1
9576 } LDKC2Tuple_u64u16Z;
9579 * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u16Z or not
9581 typedef enum LDKCOption_C2Tuple_u64u16ZZ_Tag {
9583 * When we're in this state, this COption_C2Tuple_u64u16ZZ contains a crate::c_types::derived::C2Tuple_u64u16Z
9585 LDKCOption_C2Tuple_u64u16ZZ_Some,
9587 * When we're in this state, this COption_C2Tuple_u64u16ZZ contains nothing
9589 LDKCOption_C2Tuple_u64u16ZZ_None,
9591 * Must be last for serialization purposes
9593 LDKCOption_C2Tuple_u64u16ZZ_Sentinel,
9594 } LDKCOption_C2Tuple_u64u16ZZ_Tag;
9596 typedef struct LDKCOption_C2Tuple_u64u16ZZ {
9597 LDKCOption_C2Tuple_u64u16ZZ_Tag tag;
9600 struct LDKC2Tuple_u64u16Z some;
9603 } LDKCOption_C2Tuple_u64u16ZZ;
9606 * An enum which can either contain a crate::lightning::ln::channelmanager::ChannelShutdownState or not
9608 typedef enum LDKCOption_ChannelShutdownStateZ_Tag {
9610 * When we're in this state, this COption_ChannelShutdownStateZ contains a crate::lightning::ln::channelmanager::ChannelShutdownState
9612 LDKCOption_ChannelShutdownStateZ_Some,
9614 * When we're in this state, this COption_ChannelShutdownStateZ contains nothing
9616 LDKCOption_ChannelShutdownStateZ_None,
9618 * Must be last for serialization purposes
9620 LDKCOption_ChannelShutdownStateZ_Sentinel,
9621 } LDKCOption_ChannelShutdownStateZ_Tag;
9623 typedef struct LDKCOption_ChannelShutdownStateZ {
9624 LDKCOption_ChannelShutdownStateZ_Tag tag;
9627 enum LDKChannelShutdownState some;
9630 } LDKCOption_ChannelShutdownStateZ;
9633 * The contents of CResult_ChannelIdAPIErrorZ
9635 typedef union LDKCResult_ChannelIdAPIErrorZPtr {
9637 * A pointer to the contents in the success state.
9638 * Reading from this pointer when `result_ok` is not set is undefined.
9640 struct LDKChannelId *result;
9642 * A pointer to the contents in the error state.
9643 * Reading from this pointer when `result_ok` is set is undefined.
9645 struct LDKAPIError *err;
9646 } LDKCResult_ChannelIdAPIErrorZPtr;
9649 * A CResult_ChannelIdAPIErrorZ represents the result of a fallible operation,
9650 * containing a crate::lightning::ln::types::ChannelId on success and a crate::lightning::util::errors::APIError on failure.
9651 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9653 typedef struct LDKCResult_ChannelIdAPIErrorZ {
9655 * The contents of this CResult_ChannelIdAPIErrorZ, accessible via either
9656 * `err` or `result` depending on the state of `result_ok`.
9658 union LDKCResult_ChannelIdAPIErrorZPtr contents;
9660 * Whether this CResult_ChannelIdAPIErrorZ represents a success state.
9663 } LDKCResult_ChannelIdAPIErrorZ;
9666 * Used by [`ChannelManager::list_recent_payments`] to express the status of recent payments.
9667 * These include payments that have yet to find a successful path, or have unresolved HTLCs.
9669 typedef enum LDKRecentPaymentDetails_Tag {
9671 * When an invoice was requested and thus a payment has not yet been sent.
9673 LDKRecentPaymentDetails_AwaitingInvoice,
9675 * When a payment is still being sent and awaiting successful delivery.
9677 LDKRecentPaymentDetails_Pending,
9679 * When a pending payment is fulfilled, we continue tracking it until all pending HTLCs have
9680 * been resolved. Upon receiving [`Event::PaymentSent`], we delay for a few minutes before the
9681 * payment is removed from tracking.
9683 LDKRecentPaymentDetails_Fulfilled,
9685 * After a payment's retries are exhausted per the provided [`Retry`], or it is explicitly
9686 * abandoned via [`ChannelManager::abandon_payment`], it is marked as abandoned until all
9687 * pending HTLCs for this payment resolve and an [`Event::PaymentFailed`] is generated.
9689 LDKRecentPaymentDetails_Abandoned,
9691 * Must be last for serialization purposes
9693 LDKRecentPaymentDetails_Sentinel,
9694 } LDKRecentPaymentDetails_Tag;
9696 typedef struct LDKRecentPaymentDetails_LDKAwaitingInvoice_Body {
9698 * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
9699 * a payment and ensure idempotency in LDK.
9701 struct LDKThirtyTwoBytes payment_id;
9702 } LDKRecentPaymentDetails_LDKAwaitingInvoice_Body;
9704 typedef struct LDKRecentPaymentDetails_LDKPending_Body {
9706 * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
9707 * a payment and ensure idempotency in LDK.
9709 struct LDKThirtyTwoBytes payment_id;
9711 * Hash of the payment that is currently being sent but has yet to be fulfilled or
9714 struct LDKThirtyTwoBytes payment_hash;
9716 * Total amount (in msat, excluding fees) across all paths for this payment,
9717 * not just the amount currently inflight.
9719 uint64_t total_msat;
9720 } LDKRecentPaymentDetails_LDKPending_Body;
9722 typedef struct LDKRecentPaymentDetails_LDKFulfilled_Body {
9724 * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
9725 * a payment and ensure idempotency in LDK.
9727 struct LDKThirtyTwoBytes payment_id;
9729 * Hash of the payment that was claimed. `None` for serializations of [`ChannelManager`]
9730 * made before LDK version 0.0.104.
9732 struct LDKCOption_ThirtyTwoBytesZ payment_hash;
9733 } LDKRecentPaymentDetails_LDKFulfilled_Body;
9735 typedef struct LDKRecentPaymentDetails_LDKAbandoned_Body {
9737 * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
9738 * a payment and ensure idempotency in LDK.
9740 struct LDKThirtyTwoBytes payment_id;
9742 * Hash of the payment that we have given up trying to send.
9744 struct LDKThirtyTwoBytes payment_hash;
9745 } LDKRecentPaymentDetails_LDKAbandoned_Body;
9747 typedef struct MUST_USE_STRUCT LDKRecentPaymentDetails {
9748 LDKRecentPaymentDetails_Tag tag;
9750 LDKRecentPaymentDetails_LDKAwaitingInvoice_Body awaiting_invoice;
9751 LDKRecentPaymentDetails_LDKPending_Body pending;
9752 LDKRecentPaymentDetails_LDKFulfilled_Body fulfilled;
9753 LDKRecentPaymentDetails_LDKAbandoned_Body abandoned;
9755 } LDKRecentPaymentDetails;
9758 * A dynamically-allocated array of crate::lightning::ln::channelmanager::RecentPaymentDetailss of arbitrary size.
9759 * This corresponds to std::vector in C++
9761 typedef struct LDKCVec_RecentPaymentDetailsZ {
9763 * The elements in the array.
9764 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9766 struct LDKRecentPaymentDetails *data;
9768 * The number of elements pointed to by `data`.
9771 } LDKCVec_RecentPaymentDetailsZ;
9774 * If a payment fails to send with [`ChannelManager::send_payment_with_route`], it can be in one
9775 * of several states. This enum is returned as the Err() type describing which state the payment
9776 * is in, see the description of individual enum states for more.
9778 * [`ChannelManager::send_payment_with_route`]: crate::ln::channelmanager::ChannelManager::send_payment_with_route
9780 typedef enum LDKPaymentSendFailure_Tag {
9782 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
9783 * send the payment at all.
9785 * You can freely resend the payment in full (with the parameter error fixed).
9787 * Because the payment failed outright, no payment tracking is done and no
9788 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
9790 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
9791 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
9793 LDKPaymentSendFailure_ParameterError,
9795 * A parameter in a single path which was passed to send_payment was invalid, preventing us
9796 * from attempting to send the payment at all.
9798 * You can freely resend the payment in full (with the parameter error fixed).
9800 * Because the payment failed outright, no payment tracking is done and no
9801 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
9803 * The results here are ordered the same as the paths in the route object which was passed to
9806 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
9807 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
9809 LDKPaymentSendFailure_PathParameterError,
9811 * All paths which were attempted failed to send, with no channel state change taking place.
9812 * You can freely resend the payment in full (though you probably want to do so over different
9813 * paths than the ones selected).
9815 * Because the payment failed outright, no payment tracking is done and no
9816 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
9818 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
9819 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
9821 LDKPaymentSendFailure_AllFailedResendSafe,
9823 * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
9824 * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
9826 * [`PaymentId`]: crate::ln::channelmanager::PaymentId
9827 * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
9828 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
9830 LDKPaymentSendFailure_DuplicatePayment,
9832 * Some paths that were attempted failed to send, though some paths may have succeeded. At least
9833 * some paths have irrevocably committed to the HTLC.
9835 * The results here are ordered the same as the paths in the route object that was passed to
9838 * Any entries that contain `Err(APIError::MonitorUpdateInprogress)` will send once a
9839 * [`MonitorEvent::Completed`] is provided for the next-hop channel with the latest update_id.
9841 * [`MonitorEvent::Completed`]: crate::chain::channelmonitor::MonitorEvent::Completed
9843 LDKPaymentSendFailure_PartialFailure,
9845 * Must be last for serialization purposes
9847 LDKPaymentSendFailure_Sentinel,
9848 } LDKPaymentSendFailure_Tag;
9850 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
9852 * The errors themselves, in the same order as the paths from the route.
9854 struct LDKCVec_CResult_NoneAPIErrorZZ results;
9856 * If some paths failed without irrevocably committing to the new HTLC(s), this will
9857 * contain a [`RouteParameters`] object for the failing paths.
9859 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
9861 struct LDKRouteParameters failed_paths_retry;
9863 * The payment id for the payment, which is now at least partially pending.
9865 struct LDKThirtyTwoBytes payment_id;
9866 } LDKPaymentSendFailure_LDKPartialFailure_Body;
9868 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
9869 LDKPaymentSendFailure_Tag tag;
9872 struct LDKAPIError parameter_error;
9875 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
9878 struct LDKCVec_APIErrorZ all_failed_resend_safe;
9880 LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
9882 } LDKPaymentSendFailure;
9885 * The contents of CResult_NonePaymentSendFailureZ
9887 typedef union LDKCResult_NonePaymentSendFailureZPtr {
9889 * Note that this value is always NULL, as there are no contents in the OK variant
9893 * A pointer to the contents in the error state.
9894 * Reading from this pointer when `result_ok` is set is undefined.
9896 struct LDKPaymentSendFailure *err;
9897 } LDKCResult_NonePaymentSendFailureZPtr;
9900 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
9901 * containing a () on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
9902 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9904 typedef struct LDKCResult_NonePaymentSendFailureZ {
9906 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
9907 * `err` or `result` depending on the state of `result_ok`.
9909 union LDKCResult_NonePaymentSendFailureZPtr contents;
9911 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
9914 } LDKCResult_NonePaymentSendFailureZ;
9917 * The contents of CResult_NoneRetryableSendFailureZ
9919 typedef union LDKCResult_NoneRetryableSendFailureZPtr {
9921 * Note that this value is always NULL, as there are no contents in the OK variant
9925 * A pointer to the contents in the error state.
9926 * Reading from this pointer when `result_ok` is set is undefined.
9928 enum LDKRetryableSendFailure *err;
9929 } LDKCResult_NoneRetryableSendFailureZPtr;
9932 * A CResult_NoneRetryableSendFailureZ represents the result of a fallible operation,
9933 * containing a () on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
9934 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9936 typedef struct LDKCResult_NoneRetryableSendFailureZ {
9938 * The contents of this CResult_NoneRetryableSendFailureZ, accessible via either
9939 * `err` or `result` depending on the state of `result_ok`.
9941 union LDKCResult_NoneRetryableSendFailureZPtr contents;
9943 * Whether this CResult_NoneRetryableSendFailureZ represents a success state.
9946 } LDKCResult_NoneRetryableSendFailureZ;
9949 * The contents of CResult_ThirtyTwoBytesPaymentSendFailureZ
9951 typedef union LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr {
9953 * A pointer to the contents in the success state.
9954 * Reading from this pointer when `result_ok` is not set is undefined.
9956 struct LDKThirtyTwoBytes *result;
9958 * A pointer to the contents in the error state.
9959 * Reading from this pointer when `result_ok` is set is undefined.
9961 struct LDKPaymentSendFailure *err;
9962 } LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr;
9965 * A CResult_ThirtyTwoBytesPaymentSendFailureZ represents the result of a fallible operation,
9966 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
9967 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9969 typedef struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ {
9971 * The contents of this CResult_ThirtyTwoBytesPaymentSendFailureZ, accessible via either
9972 * `err` or `result` depending on the state of `result_ok`.
9974 union LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr contents;
9976 * Whether this CResult_ThirtyTwoBytesPaymentSendFailureZ represents a success state.
9979 } LDKCResult_ThirtyTwoBytesPaymentSendFailureZ;
9982 * The contents of CResult_ThirtyTwoBytesRetryableSendFailureZ
9984 typedef union LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr {
9986 * A pointer to the contents in the success state.
9987 * Reading from this pointer when `result_ok` is not set is undefined.
9989 struct LDKThirtyTwoBytes *result;
9991 * A pointer to the contents in the error state.
9992 * Reading from this pointer when `result_ok` is set is undefined.
9994 enum LDKRetryableSendFailure *err;
9995 } LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr;
9998 * A CResult_ThirtyTwoBytesRetryableSendFailureZ represents the result of a fallible operation,
9999 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
10000 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10002 typedef struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ {
10004 * The contents of this CResult_ThirtyTwoBytesRetryableSendFailureZ, accessible via either
10005 * `err` or `result` depending on the state of `result_ok`.
10007 union LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr contents;
10009 * Whether this CResult_ThirtyTwoBytesRetryableSendFailureZ represents a success state.
10012 } LDKCResult_ThirtyTwoBytesRetryableSendFailureZ;
10015 * A tuple of 2 elements. See the individual fields for the types contained.
10017 typedef struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ {
10019 * The element at position 0
10021 struct LDKThirtyTwoBytes a;
10023 * The element at position 1
10025 struct LDKThirtyTwoBytes b;
10026 } LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ;
10029 * The contents of CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ
10031 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr {
10033 * A pointer to the contents in the success state.
10034 * Reading from this pointer when `result_ok` is not set is undefined.
10036 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *result;
10038 * A pointer to the contents in the error state.
10039 * Reading from this pointer when `result_ok` is set is undefined.
10041 struct LDKPaymentSendFailure *err;
10042 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr;
10045 * A CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ represents the result of a fallible operation,
10046 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
10047 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10049 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ {
10051 * The contents of this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ, accessible via either
10052 * `err` or `result` depending on the state of `result_ok`.
10054 union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr contents;
10056 * Whether this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ represents a success state.
10059 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ;
10062 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZs of arbitrary size.
10063 * This corresponds to std::vector in C++
10065 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ {
10067 * The elements in the array.
10068 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10070 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *data;
10072 * The number of elements pointed to by `data`.
10075 } LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ;
10078 * Indicates that we failed to send a payment probe. Further errors may be surfaced later via
10079 * [`Event::ProbeFailed`].
10081 * [`Event::ProbeFailed`]: crate::events::Event::ProbeFailed
10083 typedef enum LDKProbeSendFailure_Tag {
10085 * We were unable to find a route to the destination.
10087 LDKProbeSendFailure_RouteNotFound,
10089 * We failed to send the payment probes.
10091 LDKProbeSendFailure_SendingFailed,
10093 * Must be last for serialization purposes
10095 LDKProbeSendFailure_Sentinel,
10096 } LDKProbeSendFailure_Tag;
10098 typedef struct MUST_USE_STRUCT LDKProbeSendFailure {
10099 LDKProbeSendFailure_Tag tag;
10102 struct LDKPaymentSendFailure sending_failed;
10105 } LDKProbeSendFailure;
10108 * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ
10110 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr {
10112 * A pointer to the contents in the success state.
10113 * Reading from this pointer when `result_ok` is not set is undefined.
10115 struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ *result;
10117 * A pointer to the contents in the error state.
10118 * Reading from this pointer when `result_ok` is set is undefined.
10120 struct LDKProbeSendFailure *err;
10121 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr;
10124 * A CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ represents the result of a fallible operation,
10125 * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ on success and a crate::lightning::ln::outbound_payment::ProbeSendFailure on failure.
10126 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10128 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ {
10130 * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ, accessible via either
10131 * `err` or `result` depending on the state of `result_ok`.
10133 union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr contents;
10135 * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ represents a success state.
10138 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ;
10141 * A tuple of 2 elements. See the individual fields for the types contained.
10143 typedef struct LDKC2Tuple_ChannelIdPublicKeyZ {
10145 * The element at position 0
10147 struct LDKChannelId a;
10149 * The element at position 1
10151 struct LDKPublicKey b;
10152 } LDKC2Tuple_ChannelIdPublicKeyZ;
10155 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ChannelIdPublicKeyZs of arbitrary size.
10156 * This corresponds to std::vector in C++
10158 typedef struct LDKCVec_C2Tuple_ChannelIdPublicKeyZZ {
10160 * The elements in the array.
10161 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10163 struct LDKC2Tuple_ChannelIdPublicKeyZ *data;
10165 * The number of elements pointed to by `data`.
10168 } LDKCVec_C2Tuple_ChannelIdPublicKeyZZ;
10171 * A dynamically-allocated array of crate::lightning::ln::types::ChannelIds of arbitrary size.
10172 * This corresponds to std::vector in C++
10174 typedef struct LDKCVec_ChannelIdZ {
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 LDKChannelId *data;
10181 * The number of elements pointed to by `data`.
10184 } LDKCVec_ChannelIdZ;
10189 * Builds an [`Offer`] for the \"offer to be paid\" flow.
10191 * See [module-level documentation] for usage.
10193 * [module-level documentation]: self
10195 typedef struct MUST_USE_STRUCT LDKOfferWithDerivedMetadataBuilder {
10197 * A pointer to the opaque Rust object.
10198 * Nearly everywhere, inner must be non-null, however in places where
10199 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10201 LDKnativeOfferWithDerivedMetadataBuilder *inner;
10203 * Indicates that this is the only struct which contains the same pointer.
10204 * Rust functions which take ownership of an object provided via an argument require
10205 * this to be true and invalidate the object pointed to by inner.
10208 } LDKOfferWithDerivedMetadataBuilder;
10211 * The contents of CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ
10213 typedef union LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZPtr {
10215 * A pointer to the contents in the success state.
10216 * Reading from this pointer when `result_ok` is not set is undefined.
10218 struct LDKOfferWithDerivedMetadataBuilder *result;
10220 * A pointer to the contents in the error state.
10221 * Reading from this pointer when `result_ok` is set is undefined.
10223 enum LDKBolt12SemanticError *err;
10224 } LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZPtr;
10227 * A CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
10228 * containing a crate::lightning::offers::offer::OfferWithDerivedMetadataBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
10229 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10231 typedef struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ {
10233 * The contents of this CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ, accessible via either
10234 * `err` or `result` depending on the state of `result_ok`.
10236 union LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZPtr contents;
10238 * Whether this CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ represents a success state.
10241 } LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ;
10244 * An enum which can either contain a crate::c_types::Str or not
10246 typedef enum LDKCOption_StrZ_Tag {
10248 * When we're in this state, this COption_StrZ contains a crate::c_types::Str
10250 LDKCOption_StrZ_Some,
10252 * When we're in this state, this COption_StrZ contains nothing
10254 LDKCOption_StrZ_None,
10256 * Must be last for serialization purposes
10258 LDKCOption_StrZ_Sentinel,
10259 } LDKCOption_StrZ_Tag;
10261 typedef struct LDKCOption_StrZ {
10262 LDKCOption_StrZ_Tag tag;
10265 struct LDKStr some;
10271 * The contents of CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ
10273 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr {
10275 * A pointer to the contents in the success state.
10276 * Reading from this pointer when `result_ok` is not set is undefined.
10278 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *result;
10280 * Note that this value is always NULL, as there are no contents in the Err variant
10283 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr;
10286 * A CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ represents the result of a fallible operation,
10287 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ on success and a () on failure.
10288 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10290 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ {
10292 * The contents of this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ, accessible via either
10293 * `err` or `result` depending on the state of `result_ok`.
10295 union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr contents;
10297 * Whether this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ represents a success state.
10300 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ;
10303 * The contents of CResult_ThirtyTwoBytesAPIErrorZ
10305 typedef union LDKCResult_ThirtyTwoBytesAPIErrorZPtr {
10307 * A pointer to the contents in the success state.
10308 * Reading from this pointer when `result_ok` is not set is undefined.
10310 struct LDKThirtyTwoBytes *result;
10312 * A pointer to the contents in the error state.
10313 * Reading from this pointer when `result_ok` is set is undefined.
10315 struct LDKAPIError *err;
10316 } LDKCResult_ThirtyTwoBytesAPIErrorZPtr;
10319 * A CResult_ThirtyTwoBytesAPIErrorZ represents the result of a fallible operation,
10320 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
10321 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10323 typedef struct LDKCResult_ThirtyTwoBytesAPIErrorZ {
10325 * The contents of this CResult_ThirtyTwoBytesAPIErrorZ, accessible via either
10326 * `err` or `result` depending on the state of `result_ok`.
10328 union LDKCResult_ThirtyTwoBytesAPIErrorZPtr contents;
10330 * Whether this CResult_ThirtyTwoBytesAPIErrorZ represents a success state.
10333 } LDKCResult_ThirtyTwoBytesAPIErrorZ;
10338 * An `InvoiceRequest` is a request for a [`Bolt12Invoice`] formulated from an [`Offer`].
10340 * An offer may provide choices such as quantity, amount, chain, features, etc. An invoice request
10341 * specifies these such that its recipient can send an invoice for payment.
10343 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
10344 * [`Offer`]: crate::offers::offer::Offer
10346 typedef struct MUST_USE_STRUCT LDKInvoiceRequest {
10348 * A pointer to the opaque Rust object.
10349 * Nearly everywhere, inner must be non-null, however in places where
10350 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10352 LDKnativeInvoiceRequest *inner;
10354 * Indicates that this is the only struct which contains the same pointer.
10355 * Rust functions which take ownership of an object provided via an argument require
10356 * this to be true and invalidate the object pointed to by inner.
10359 } LDKInvoiceRequest;
10364 * An error in response to an [`InvoiceRequest`] or an [`Bolt12Invoice`].
10366 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
10367 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
10369 typedef struct MUST_USE_STRUCT LDKInvoiceError {
10371 * A pointer to the opaque Rust object.
10372 * Nearly everywhere, inner must be non-null, however in places where
10373 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10375 LDKnativeInvoiceError *inner;
10377 * Indicates that this is the only struct which contains the same pointer.
10378 * Rust functions which take ownership of an object provided via an argument require
10379 * this to be true and invalidate the object pointed to by inner.
10385 * Possible BOLT 12 Offers messages sent and received via an [`OnionMessage`].
10387 * [`OnionMessage`]: crate::ln::msgs::OnionMessage
10389 typedef enum LDKOffersMessage_Tag {
10391 * A request for a [`Bolt12Invoice`] for a particular [`Offer`].
10393 * [`Offer`]: crate::offers::offer::Offer
10395 LDKOffersMessage_InvoiceRequest,
10397 * A [`Bolt12Invoice`] sent in response to an [`InvoiceRequest`] or a [`Refund`].
10399 * [`Refund`]: crate::offers::refund::Refund
10401 LDKOffersMessage_Invoice,
10403 * An error from handling an [`OffersMessage`].
10405 LDKOffersMessage_InvoiceError,
10407 * Must be last for serialization purposes
10409 LDKOffersMessage_Sentinel,
10410 } LDKOffersMessage_Tag;
10412 typedef struct MUST_USE_STRUCT LDKOffersMessage {
10413 LDKOffersMessage_Tag tag;
10416 struct LDKInvoiceRequest invoice_request;
10419 struct LDKBolt12Invoice invoice;
10422 struct LDKInvoiceError invoice_error;
10425 } LDKOffersMessage;
10428 * An enum which can either contain a crate::lightning::onion_message::offers::OffersMessage or not
10430 typedef enum LDKCOption_OffersMessageZ_Tag {
10432 * When we're in this state, this COption_OffersMessageZ contains a crate::lightning::onion_message::offers::OffersMessage
10434 LDKCOption_OffersMessageZ_Some,
10436 * When we're in this state, this COption_OffersMessageZ contains nothing
10438 LDKCOption_OffersMessageZ_None,
10440 * Must be last for serialization purposes
10442 LDKCOption_OffersMessageZ_Sentinel,
10443 } LDKCOption_OffersMessageZ_Tag;
10445 typedef struct LDKCOption_OffersMessageZ {
10446 LDKCOption_OffersMessageZ_Tag tag;
10449 struct LDKOffersMessage some;
10452 } LDKCOption_OffersMessageZ;
10455 * The destination of an onion message.
10457 typedef enum LDKDestination_Tag {
10459 * We're sending this onion message to a node.
10461 LDKDestination_Node,
10463 * We're sending this onion message to a blinded path.
10465 LDKDestination_BlindedPath,
10467 * Must be last for serialization purposes
10469 LDKDestination_Sentinel,
10470 } LDKDestination_Tag;
10472 typedef struct MUST_USE_STRUCT LDKDestination {
10473 LDKDestination_Tag tag;
10476 struct LDKPublicKey node;
10479 struct LDKBlindedPath blinded_path;
10485 * A tuple of 3 elements. See the individual fields for the types contained.
10487 typedef struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ {
10489 * The element at position 0
10491 struct LDKOffersMessage a;
10493 * The element at position 1
10495 struct LDKDestination b;
10497 * The element at position 2
10499 struct LDKBlindedPath c;
10500 } LDKC3Tuple_OffersMessageDestinationBlindedPathZ;
10503 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OffersMessageDestinationBlindedPathZs of arbitrary size.
10504 * This corresponds to std::vector in C++
10506 typedef struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ {
10508 * The elements in the array.
10509 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10511 struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ *data;
10513 * The number of elements pointed to by `data`.
10516 } LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ;
10521 * Information needed for constructing an invoice route hint for this channel.
10523 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
10525 * A pointer to the opaque Rust object.
10526 * Nearly everywhere, inner must be non-null, however in places where
10527 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10529 LDKnativeCounterpartyForwardingInfo *inner;
10531 * Indicates that this is the only struct which contains the same pointer.
10532 * Rust functions which take ownership of an object provided via an argument require
10533 * this to be true and invalidate the object pointed to by inner.
10536 } LDKCounterpartyForwardingInfo;
10539 * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
10541 typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
10543 * A pointer to the contents in the success state.
10544 * Reading from this pointer when `result_ok` is not set is undefined.
10546 struct LDKCounterpartyForwardingInfo *result;
10548 * A pointer to the contents in the error state.
10549 * Reading from this pointer when `result_ok` is set is undefined.
10551 struct LDKDecodeError *err;
10552 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
10555 * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
10556 * containing a crate::lightning::ln::channelmanager::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
10557 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10559 typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
10561 * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
10562 * `err` or `result` depending on the state of `result_ok`.
10564 union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
10566 * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
10569 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
10574 * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
10575 * to better separate parameters.
10577 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
10579 * A pointer to the opaque Rust object.
10580 * Nearly everywhere, inner must be non-null, however in places where
10581 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10583 LDKnativeChannelCounterparty *inner;
10585 * Indicates that this is the only struct which contains the same pointer.
10586 * Rust functions which take ownership of an object provided via an argument require
10587 * this to be true and invalidate the object pointed to by inner.
10590 } LDKChannelCounterparty;
10593 * The contents of CResult_ChannelCounterpartyDecodeErrorZ
10595 typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
10597 * A pointer to the contents in the success state.
10598 * Reading from this pointer when `result_ok` is not set is undefined.
10600 struct LDKChannelCounterparty *result;
10602 * A pointer to the contents in the error state.
10603 * Reading from this pointer when `result_ok` is set is undefined.
10605 struct LDKDecodeError *err;
10606 } LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
10609 * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
10610 * containing a crate::lightning::ln::channelmanager::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
10611 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10613 typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
10615 * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
10616 * `err` or `result` depending on the state of `result_ok`.
10618 union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
10620 * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
10623 } LDKCResult_ChannelCounterpartyDecodeErrorZ;
10626 * The contents of CResult_ChannelDetailsDecodeErrorZ
10628 typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
10630 * A pointer to the contents in the success state.
10631 * Reading from this pointer when `result_ok` is not set is undefined.
10633 struct LDKChannelDetails *result;
10635 * A pointer to the contents in the error state.
10636 * Reading from this pointer when `result_ok` is set is undefined.
10638 struct LDKDecodeError *err;
10639 } LDKCResult_ChannelDetailsDecodeErrorZPtr;
10642 * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
10643 * containing a crate::lightning::ln::channelmanager::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
10644 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10646 typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
10648 * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
10649 * `err` or `result` depending on the state of `result_ok`.
10651 union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
10653 * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
10656 } LDKCResult_ChannelDetailsDecodeErrorZ;
10661 * Route hints used in constructing invoices for [phantom node payents].
10663 * [phantom node payments]: crate::sign::PhantomKeysManager
10665 typedef struct MUST_USE_STRUCT LDKPhantomRouteHints {
10667 * A pointer to the opaque Rust object.
10668 * Nearly everywhere, inner must be non-null, however in places where
10669 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10671 LDKnativePhantomRouteHints *inner;
10673 * Indicates that this is the only struct which contains the same pointer.
10674 * Rust functions which take ownership of an object provided via an argument require
10675 * this to be true and invalidate the object pointed to by inner.
10678 } LDKPhantomRouteHints;
10681 * The contents of CResult_PhantomRouteHintsDecodeErrorZ
10683 typedef union LDKCResult_PhantomRouteHintsDecodeErrorZPtr {
10685 * A pointer to the contents in the success state.
10686 * Reading from this pointer when `result_ok` is not set is undefined.
10688 struct LDKPhantomRouteHints *result;
10690 * A pointer to the contents in the error state.
10691 * Reading from this pointer when `result_ok` is set is undefined.
10693 struct LDKDecodeError *err;
10694 } LDKCResult_PhantomRouteHintsDecodeErrorZPtr;
10697 * A CResult_PhantomRouteHintsDecodeErrorZ represents the result of a fallible operation,
10698 * containing a crate::lightning::ln::channelmanager::PhantomRouteHints on success and a crate::lightning::ln::msgs::DecodeError on failure.
10699 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10701 typedef struct LDKCResult_PhantomRouteHintsDecodeErrorZ {
10703 * The contents of this CResult_PhantomRouteHintsDecodeErrorZ, accessible via either
10704 * `err` or `result` depending on the state of `result_ok`.
10706 union LDKCResult_PhantomRouteHintsDecodeErrorZPtr contents;
10708 * Whether this CResult_PhantomRouteHintsDecodeErrorZ represents a success state.
10711 } LDKCResult_PhantomRouteHintsDecodeErrorZ;
10716 * Information used to forward or fail this HTLC that is being forwarded within a blinded path.
10718 typedef struct MUST_USE_STRUCT LDKBlindedForward {
10720 * A pointer to the opaque Rust object.
10721 * Nearly everywhere, inner must be non-null, however in places where
10722 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10724 LDKnativeBlindedForward *inner;
10726 * Indicates that this is the only struct which contains the same pointer.
10727 * Rust functions which take ownership of an object provided via an argument require
10728 * this to be true and invalidate the object pointed to by inner.
10731 } LDKBlindedForward;
10734 * The contents of CResult_BlindedForwardDecodeErrorZ
10736 typedef union LDKCResult_BlindedForwardDecodeErrorZPtr {
10738 * A pointer to the contents in the success state.
10739 * Reading from this pointer when `result_ok` is not set is undefined.
10741 struct LDKBlindedForward *result;
10743 * A pointer to the contents in the error state.
10744 * Reading from this pointer when `result_ok` is set is undefined.
10746 struct LDKDecodeError *err;
10747 } LDKCResult_BlindedForwardDecodeErrorZPtr;
10750 * A CResult_BlindedForwardDecodeErrorZ represents the result of a fallible operation,
10751 * containing a crate::lightning::ln::channelmanager::BlindedForward on success and a crate::lightning::ln::msgs::DecodeError on failure.
10752 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10754 typedef struct LDKCResult_BlindedForwardDecodeErrorZ {
10756 * The contents of this CResult_BlindedForwardDecodeErrorZ, accessible via either
10757 * `err` or `result` depending on the state of `result_ok`.
10759 union LDKCResult_BlindedForwardDecodeErrorZPtr contents;
10761 * Whether this CResult_BlindedForwardDecodeErrorZ represents a success state.
10764 } LDKCResult_BlindedForwardDecodeErrorZ;
10769 * BOLT 4 onion packet including hop data for the next peer.
10771 typedef struct MUST_USE_STRUCT LDKOnionPacket {
10773 * A pointer to the opaque Rust object.
10774 * Nearly everywhere, inner must be non-null, however in places where
10775 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10777 LDKnativeOnionPacket *inner;
10779 * Indicates that this is the only struct which contains the same pointer.
10780 * Rust functions which take ownership of an object provided via an argument require
10781 * this to be true and invalidate the object pointed to by inner.
10789 * Information communicated in the onion to the recipient for multi-part tracking and proof that
10790 * the payment is associated with an invoice.
10792 typedef struct MUST_USE_STRUCT LDKFinalOnionHopData {
10794 * A pointer to the opaque Rust object.
10795 * Nearly everywhere, inner must be non-null, however in places where
10796 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10798 LDKnativeFinalOnionHopData *inner;
10800 * Indicates that this is the only struct which contains the same pointer.
10801 * Rust functions which take ownership of an object provided via an argument require
10802 * this to be true and invalidate the object pointed to by inner.
10805 } LDKFinalOnionHopData;
10808 * Information about where a received HTLC('s onion) has indicated the HTLC should go.
10810 typedef enum LDKPendingHTLCRouting_Tag {
10812 * An HTLC which should be forwarded on to another node.
10814 LDKPendingHTLCRouting_Forward,
10816 * The onion indicates that this is a payment for an invoice (supposedly) generated by us.
10818 * Note that at this point, we have not checked that the invoice being paid was actually
10819 * generated by us, but rather it's claiming to pay an invoice of ours.
10821 LDKPendingHTLCRouting_Receive,
10823 * The onion indicates that this is for payment to us but which contains the preimage for
10824 * claiming included, and is unrelated to any invoice we'd previously generated (aka a
10825 * \"keysend\" or \"spontaneous\" payment).
10827 LDKPendingHTLCRouting_ReceiveKeysend,
10829 * Must be last for serialization purposes
10831 LDKPendingHTLCRouting_Sentinel,
10832 } LDKPendingHTLCRouting_Tag;
10834 typedef struct LDKPendingHTLCRouting_LDKForward_Body {
10836 * The onion which should be included in the forwarded HTLC, telling the next hop what to
10837 * do with the HTLC.
10839 struct LDKOnionPacket onion_packet;
10841 * The short channel ID of the channel which we were instructed to forward this HTLC to.
10843 * This could be a real on-chain SCID, an SCID alias, or some other SCID which has meaning
10844 * to the receiving node, such as one returned from
10845 * [`ChannelManager::get_intercept_scid`] or [`ChannelManager::get_phantom_scid`].
10847 uint64_t short_channel_id;
10849 * Set if this HTLC is being forwarded within a blinded path.
10851 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
10853 struct LDKBlindedForward blinded;
10854 } LDKPendingHTLCRouting_LDKForward_Body;
10856 typedef struct LDKPendingHTLCRouting_LDKReceive_Body {
10858 * Information about the amount the sender intended to pay and (potential) proof that this
10859 * is a payment for an invoice we generated. This proof of payment is is also used for
10860 * linking MPP parts of a larger payment.
10862 struct LDKFinalOnionHopData payment_data;
10864 * Additional data which we (allegedly) instructed the sender to include in the onion.
10866 * For HTLCs received by LDK, this will ultimately be exposed in
10867 * [`Event::PaymentClaimable::onion_fields`] as
10868 * [`RecipientOnionFields::payment_metadata`].
10870 struct LDKCOption_CVec_u8ZZ payment_metadata;
10872 * The context of the payment included by the recipient in a blinded path, or `None` if a
10873 * blinded path was not used.
10875 * Used in part to determine the [`events::PaymentPurpose`].
10877 struct LDKCOption_PaymentContextZ payment_context;
10879 * CLTV expiry of the received HTLC.
10881 * Used to track when we should expire pending HTLCs that go unclaimed.
10883 uint32_t incoming_cltv_expiry;
10885 * If the onion had forwarding instructions to one of our phantom node SCIDs, this will
10886 * provide the onion shared secret used to decrypt the next level of forwarding
10889 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
10891 struct LDKThirtyTwoBytes phantom_shared_secret;
10893 * Custom TLVs which were set by the sender.
10895 * For HTLCs received by LDK, this will ultimately be exposed in
10896 * [`Event::PaymentClaimable::onion_fields`] as
10897 * [`RecipientOnionFields::custom_tlvs`].
10899 struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs;
10901 * Set if this HTLC is the final hop in a multi-hop blinded path.
10903 bool requires_blinded_error;
10904 } LDKPendingHTLCRouting_LDKReceive_Body;
10906 typedef struct LDKPendingHTLCRouting_LDKReceiveKeysend_Body {
10908 * Information about the amount the sender intended to pay and possibly a token to
10909 * associate MPP parts of a larger payment.
10911 * This will only be filled in if receiving MPP keysend payments is enabled, and it being
10912 * present will cause deserialization to fail on versions of LDK prior to 0.0.116.
10914 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
10916 struct LDKFinalOnionHopData payment_data;
10918 * Preimage for this onion payment. This preimage is provided by the sender and will be
10919 * used to settle the spontaneous payment.
10921 struct LDKThirtyTwoBytes payment_preimage;
10923 * Additional data which we (allegedly) instructed the sender to include in the onion.
10925 * For HTLCs received by LDK, this will ultimately bubble back up as
10926 * [`RecipientOnionFields::payment_metadata`].
10928 struct LDKCOption_CVec_u8ZZ payment_metadata;
10930 * CLTV expiry of the received HTLC.
10932 * Used to track when we should expire pending HTLCs that go unclaimed.
10934 uint32_t incoming_cltv_expiry;
10936 * Custom TLVs which were set by the sender.
10938 * For HTLCs received by LDK, these will ultimately bubble back up as
10939 * [`RecipientOnionFields::custom_tlvs`].
10941 struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs;
10943 * Set if this HTLC is the final hop in a multi-hop blinded path.
10945 bool requires_blinded_error;
10946 } LDKPendingHTLCRouting_LDKReceiveKeysend_Body;
10948 typedef struct MUST_USE_STRUCT LDKPendingHTLCRouting {
10949 LDKPendingHTLCRouting_Tag tag;
10951 LDKPendingHTLCRouting_LDKForward_Body forward;
10952 LDKPendingHTLCRouting_LDKReceive_Body receive;
10953 LDKPendingHTLCRouting_LDKReceiveKeysend_Body receive_keysend;
10955 } LDKPendingHTLCRouting;
10958 * The contents of CResult_PendingHTLCRoutingDecodeErrorZ
10960 typedef union LDKCResult_PendingHTLCRoutingDecodeErrorZPtr {
10962 * A pointer to the contents in the success state.
10963 * Reading from this pointer when `result_ok` is not set is undefined.
10965 struct LDKPendingHTLCRouting *result;
10967 * A pointer to the contents in the error state.
10968 * Reading from this pointer when `result_ok` is set is undefined.
10970 struct LDKDecodeError *err;
10971 } LDKCResult_PendingHTLCRoutingDecodeErrorZPtr;
10974 * A CResult_PendingHTLCRoutingDecodeErrorZ represents the result of a fallible operation,
10975 * containing a crate::lightning::ln::channelmanager::PendingHTLCRouting on success and a crate::lightning::ln::msgs::DecodeError on failure.
10976 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10978 typedef struct LDKCResult_PendingHTLCRoutingDecodeErrorZ {
10980 * The contents of this CResult_PendingHTLCRoutingDecodeErrorZ, accessible via either
10981 * `err` or `result` depending on the state of `result_ok`.
10983 union LDKCResult_PendingHTLCRoutingDecodeErrorZPtr contents;
10985 * Whether this CResult_PendingHTLCRoutingDecodeErrorZ represents a success state.
10988 } LDKCResult_PendingHTLCRoutingDecodeErrorZ;
10991 * The contents of CResult_PendingHTLCInfoDecodeErrorZ
10993 typedef union LDKCResult_PendingHTLCInfoDecodeErrorZPtr {
10995 * A pointer to the contents in the success state.
10996 * Reading from this pointer when `result_ok` is not set is undefined.
10998 struct LDKPendingHTLCInfo *result;
11000 * A pointer to the contents in the error state.
11001 * Reading from this pointer when `result_ok` is set is undefined.
11003 struct LDKDecodeError *err;
11004 } LDKCResult_PendingHTLCInfoDecodeErrorZPtr;
11007 * A CResult_PendingHTLCInfoDecodeErrorZ represents the result of a fallible operation,
11008 * containing a crate::lightning::ln::channelmanager::PendingHTLCInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
11009 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11011 typedef struct LDKCResult_PendingHTLCInfoDecodeErrorZ {
11013 * The contents of this CResult_PendingHTLCInfoDecodeErrorZ, accessible via either
11014 * `err` or `result` depending on the state of `result_ok`.
11016 union LDKCResult_PendingHTLCInfoDecodeErrorZPtr contents;
11018 * Whether this CResult_PendingHTLCInfoDecodeErrorZ represents a success state.
11021 } LDKCResult_PendingHTLCInfoDecodeErrorZ;
11024 * The contents of CResult_BlindedFailureDecodeErrorZ
11026 typedef union LDKCResult_BlindedFailureDecodeErrorZPtr {
11028 * A pointer to the contents in the success state.
11029 * Reading from this pointer when `result_ok` is not set is undefined.
11031 enum LDKBlindedFailure *result;
11033 * A pointer to the contents in the error state.
11034 * Reading from this pointer when `result_ok` is set is undefined.
11036 struct LDKDecodeError *err;
11037 } LDKCResult_BlindedFailureDecodeErrorZPtr;
11040 * A CResult_BlindedFailureDecodeErrorZ represents the result of a fallible operation,
11041 * containing a crate::lightning::ln::channelmanager::BlindedFailure on success and a crate::lightning::ln::msgs::DecodeError on failure.
11042 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11044 typedef struct LDKCResult_BlindedFailureDecodeErrorZ {
11046 * The contents of this CResult_BlindedFailureDecodeErrorZ, accessible via either
11047 * `err` or `result` depending on the state of `result_ok`.
11049 union LDKCResult_BlindedFailureDecodeErrorZPtr contents;
11051 * Whether this CResult_BlindedFailureDecodeErrorZ represents a success state.
11054 } LDKCResult_BlindedFailureDecodeErrorZ;
11057 * The contents of CResult_ChannelShutdownStateDecodeErrorZ
11059 typedef union LDKCResult_ChannelShutdownStateDecodeErrorZPtr {
11061 * A pointer to the contents in the success state.
11062 * Reading from this pointer when `result_ok` is not set is undefined.
11064 enum LDKChannelShutdownState *result;
11066 * A pointer to the contents in the error state.
11067 * Reading from this pointer when `result_ok` is set is undefined.
11069 struct LDKDecodeError *err;
11070 } LDKCResult_ChannelShutdownStateDecodeErrorZPtr;
11073 * A CResult_ChannelShutdownStateDecodeErrorZ represents the result of a fallible operation,
11074 * containing a crate::lightning::ln::channelmanager::ChannelShutdownState on success and a crate::lightning::ln::msgs::DecodeError on failure.
11075 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11077 typedef struct LDKCResult_ChannelShutdownStateDecodeErrorZ {
11079 * The contents of this CResult_ChannelShutdownStateDecodeErrorZ, accessible via either
11080 * `err` or `result` depending on the state of `result_ok`.
11082 union LDKCResult_ChannelShutdownStateDecodeErrorZPtr contents;
11084 * Whether this CResult_ChannelShutdownStateDecodeErrorZ represents a success state.
11087 } LDKCResult_ChannelShutdownStateDecodeErrorZ;
11092 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
11093 * on-chain transactions to ensure no loss of funds occurs.
11095 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
11096 * information and are actively monitoring the chain.
11098 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
11099 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
11100 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
11101 * returned block hash and the the current chain and then reconnecting blocks to get to the
11102 * best chain) upon deserializing the object!
11104 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
11106 * A pointer to the opaque Rust object.
11107 * Nearly everywhere, inner must be non-null, however in places where
11108 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11110 LDKnativeChannelMonitor *inner;
11112 * Indicates that this is the only struct which contains the same pointer.
11113 * Rust functions which take ownership of an object provided via an argument require
11114 * this to be true and invalidate the object pointed to by inner.
11117 } LDKChannelMonitor;
11120 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
11121 * This corresponds to std::vector in C++
11123 typedef struct LDKCVec_ChannelMonitorZ {
11125 * The elements in the array.
11126 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11128 struct LDKChannelMonitor *data;
11130 * The number of elements pointed to by `data`.
11133 } LDKCVec_ChannelMonitorZ;
11138 * An update generated by the underlying channel itself which contains some new information the
11139 * [`ChannelMonitor`] should be made aware of.
11141 * Because this represents only a small number of updates to the underlying state, it is generally
11142 * much smaller than a full [`ChannelMonitor`]. However, for large single commitment transaction
11143 * updates (e.g. ones during which there are hundreds of HTLCs pending on the commitment
11144 * transaction), a single update may reach upwards of 1 MiB in serialized size.
11146 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
11148 * A pointer to the opaque Rust object.
11149 * Nearly everywhere, inner must be non-null, however in places where
11150 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11152 LDKnativeChannelMonitorUpdate *inner;
11154 * Indicates that this is the only struct which contains the same pointer.
11155 * Rust functions which take ownership of an object provided via an argument require
11156 * this to be true and invalidate the object pointed to by inner.
11159 } LDKChannelMonitorUpdate;
11162 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
11163 * blocks are connected and disconnected.
11165 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
11166 * responsible for maintaining a set of monitors such that they can be updated as channel state
11167 * changes. On each update, *all copies* of a [`ChannelMonitor`] must be updated and the update
11168 * persisted to disk to ensure that the latest [`ChannelMonitor`] state can be reloaded if the
11169 * application crashes.
11171 * See method documentation and [`ChannelMonitorUpdateStatus`] for specific requirements.
11173 typedef struct LDKWatch {
11175 * An opaque pointer which is passed to your function implementations as an argument.
11176 * This has no meaning in the LDK, and can be NULL or any other value.
11180 * Watches a channel identified by `funding_txo` using `monitor`.
11182 * Implementations are responsible for watching the chain for the funding transaction along
11183 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
11184 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
11186 * A return of `Err(())` indicates that the channel should immediately be force-closed without
11187 * broadcasting the funding transaction.
11189 * If the given `funding_txo` has previously been registered via `watch_channel`, `Err(())`
11190 * must be returned.
11192 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
11193 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
11194 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
11196 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
11198 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
11200 * Implementations must call [`ChannelMonitor::update_monitor`] with the given update. This
11201 * may fail (returning an `Err(())`), in which case this should return
11202 * [`ChannelMonitorUpdateStatus::InProgress`] (and the update should never complete). This
11203 * generally implies the channel has been closed (either by the funding outpoint being spent
11204 * on-chain or the [`ChannelMonitor`] having decided to do so and broadcasted a transaction),
11205 * and the [`ChannelManager`] state will be updated once it sees the funding spend on-chain.
11207 * In general, persistence failures should be retried after returning
11208 * [`ChannelMonitorUpdateStatus::InProgress`] and eventually complete. If a failure truly
11209 * cannot be retried, the node should shut down immediately after returning
11210 * [`ChannelMonitorUpdateStatus::UnrecoverableError`], see its documentation for more info.
11212 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
11214 enum LDKChannelMonitorUpdateStatus (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, const struct LDKChannelMonitorUpdate *NONNULL_PTR update);
11216 * Returns any monitor events since the last call. Subsequent calls must only return new
11219 * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
11220 * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
11223 * For details on asynchronous [`ChannelMonitor`] updating and returning
11224 * [`MonitorEvent::Completed`] here, see [`ChannelMonitorUpdateStatus::InProgress`].
11226 struct LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ (*release_pending_monitor_events)(const void *this_arg);
11228 * Frees any resources associated with this object given its this_arg pointer.
11229 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11231 void (*free)(void *this_arg);
11235 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
11236 * This corresponds to std::vector in C++
11238 typedef struct LDKCVec_TransactionZ {
11240 * The elements in the array.
11241 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11243 struct LDKTransaction *data;
11245 * The number of elements pointed to by `data`.
11248 } LDKCVec_TransactionZ;
11251 * An interface to send a transaction to the Bitcoin network.
11253 typedef struct LDKBroadcasterInterface {
11255 * An opaque pointer which is passed to your function implementations as an argument.
11256 * This has no meaning in the LDK, and can be NULL or any other value.
11260 * Sends a list of transactions out to (hopefully) be mined.
11261 * This only needs to handle the actual broadcasting of transactions, LDK will automatically
11262 * rebroadcast transactions that haven't made it into a block.
11264 * In some cases LDK may attempt to broadcast a transaction which double-spends another
11265 * and this isn't a bug and can be safely ignored.
11267 * If more than one transaction is given, these transactions should be considered to be a
11268 * package and broadcast together. Some of the transactions may or may not depend on each other,
11269 * be sure to manage both cases correctly.
11271 * Bitcoin transaction packages are defined in BIP 331 and here:
11272 * <https://github.com/bitcoin/bitcoin/blob/master/doc/policy/packages.md>
11274 void (*broadcast_transactions)(const void *this_arg, struct LDKCVec_TransactionZ txs);
11276 * Frees any resources associated with this object given its this_arg pointer.
11277 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11279 void (*free)(void *this_arg);
11280 } LDKBroadcasterInterface;
11283 * A trait that describes a source of entropy.
11285 typedef struct LDKEntropySource {
11287 * An opaque pointer which is passed to your function implementations as an argument.
11288 * This has no meaning in the LDK, and can be NULL or any other value.
11292 * Gets a unique, cryptographically-secure, random 32-byte value. This method must return a
11293 * different value each time it is called.
11295 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
11297 * Frees any resources associated with this object given its this_arg pointer.
11298 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11300 void (*free)(void *this_arg);
11301 } LDKEntropySource;
11306 * A semantically valid [`InvoiceRequest`] that hasn't been signed.
11310 * This is serialized as a TLV stream, which includes TLV records from the originating message. As
11311 * such, it may include unknown, odd TLV records.
11313 typedef struct MUST_USE_STRUCT LDKUnsignedInvoiceRequest {
11315 * A pointer to the opaque Rust object.
11316 * Nearly everywhere, inner must be non-null, however in places where
11317 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11319 LDKnativeUnsignedInvoiceRequest *inner;
11321 * Indicates that this is the only struct which contains the same pointer.
11322 * Rust functions which take ownership of an object provided via an argument require
11323 * this to be true and invalidate the object pointed to by inner.
11326 } LDKUnsignedInvoiceRequest;
11331 * The unsigned part of a [`channel_update`] message.
11333 * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
11335 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
11337 * A pointer to the opaque Rust object.
11338 * Nearly everywhere, inner must be non-null, however in places where
11339 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11341 LDKnativeUnsignedChannelUpdate *inner;
11343 * Indicates that this is the only struct which contains the same pointer.
11344 * Rust functions which take ownership of an object provided via an argument require
11345 * this to be true and invalidate the object pointed to by inner.
11348 } LDKUnsignedChannelUpdate;
11353 * The unsigned part of a [`node_announcement`] message.
11355 * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
11357 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
11359 * A pointer to the opaque Rust object.
11360 * Nearly everywhere, inner must be non-null, however in places where
11361 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11363 LDKnativeUnsignedNodeAnnouncement *inner;
11365 * Indicates that this is the only struct which contains the same pointer.
11366 * Rust functions which take ownership of an object provided via an argument require
11367 * this to be true and invalidate the object pointed to by inner.
11370 } LDKUnsignedNodeAnnouncement;
11373 * Represents the set of gossip messages that require a signature from a node's identity key.
11375 typedef enum LDKUnsignedGossipMessage_Tag {
11377 * An unsigned channel announcement.
11379 LDKUnsignedGossipMessage_ChannelAnnouncement,
11381 * An unsigned channel update.
11383 LDKUnsignedGossipMessage_ChannelUpdate,
11385 * An unsigned node announcement.
11387 LDKUnsignedGossipMessage_NodeAnnouncement,
11389 * Must be last for serialization purposes
11391 LDKUnsignedGossipMessage_Sentinel,
11392 } LDKUnsignedGossipMessage_Tag;
11394 typedef struct MUST_USE_STRUCT LDKUnsignedGossipMessage {
11395 LDKUnsignedGossipMessage_Tag tag;
11398 struct LDKUnsignedChannelAnnouncement channel_announcement;
11401 struct LDKUnsignedChannelUpdate channel_update;
11404 struct LDKUnsignedNodeAnnouncement node_announcement;
11407 } LDKUnsignedGossipMessage;
11410 * A trait that can handle cryptographic operations at the scope level of a node.
11412 typedef struct LDKNodeSigner {
11414 * An opaque pointer which is passed to your function implementations as an argument.
11415 * This has no meaning in the LDK, and can be NULL or any other value.
11419 * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
11421 * If the implementor of this trait supports [phantom node payments], then every node that is
11422 * intended to be included in the phantom invoice route hints must return the same value from
11425 * This method must return the same value each time it is called.
11427 * [phantom node payments]: PhantomKeysManager
11429 struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
11431 * Get node id based on the provided [`Recipient`].
11433 * This method must return the same value each time it is called with a given [`Recipient`]
11436 * Errors if the [`Recipient`] variant is not supported by the implementation.
11438 struct LDKCResult_PublicKeyNoneZ (*get_node_id)(const void *this_arg, enum LDKRecipient recipient);
11440 * Gets the ECDH shared secret of our node secret and `other_key`, multiplying by `tweak` if
11441 * one is provided. Note that this tweak can be applied to `other_key` instead of our node
11442 * secret, though this is less efficient.
11444 * Note that if this fails while attempting to forward an HTLC, LDK will panic. The error
11445 * should be resolved to allow LDK to resume forwarding HTLCs.
11447 * Errors if the [`Recipient`] variant is not supported by the implementation.
11449 struct LDKCResult_ThirtyTwoBytesNoneZ (*ecdh)(const void *this_arg, enum LDKRecipient recipient, struct LDKPublicKey other_key, struct LDKCOption_BigEndianScalarZ tweak);
11453 * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of
11454 * this trait to parse the invoice and make sure they're signing what they expect, rather than
11455 * blindly signing the hash.
11457 * The `hrp_bytes` are ASCII bytes, while the `invoice_data` is base32.
11459 * The secret key used to sign the invoice is dependent on the [`Recipient`].
11461 * Errors if the [`Recipient`] variant is not supported by the implementation.
11463 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z invoice_data, enum LDKRecipient recipient);
11465 * Signs the [`TaggedHash`] of a BOLT 12 invoice request.
11467 * May be called by a function passed to [`UnsignedInvoiceRequest::sign`] where
11468 * `invoice_request` is the callee.
11470 * Implementors may check that the `invoice_request` is expected rather than blindly signing
11471 * the tagged hash. An `Ok` result should sign `invoice_request.tagged_hash().as_digest()` with
11472 * the node's signing key or an ephemeral key to preserve privacy, whichever is associated with
11473 * [`UnsignedInvoiceRequest::payer_id`].
11475 * [`TaggedHash`]: crate::offers::merkle::TaggedHash
11477 struct LDKCResult_SchnorrSignatureNoneZ (*sign_bolt12_invoice_request)(const void *this_arg, const struct LDKUnsignedInvoiceRequest *NONNULL_PTR invoice_request);
11479 * Signs the [`TaggedHash`] of a BOLT 12 invoice.
11481 * May be called by a function passed to [`UnsignedBolt12Invoice::sign`] where `invoice` is the
11484 * Implementors may check that the `invoice` is expected rather than blindly signing the tagged
11485 * hash. An `Ok` result should sign `invoice.tagged_hash().as_digest()` with the node's signing
11486 * key or an ephemeral key to preserve privacy, whichever is associated with
11487 * [`UnsignedBolt12Invoice::signing_pubkey`].
11489 * [`TaggedHash`]: crate::offers::merkle::TaggedHash
11491 struct LDKCResult_SchnorrSignatureNoneZ (*sign_bolt12_invoice)(const void *this_arg, const struct LDKUnsignedBolt12Invoice *NONNULL_PTR invoice);
11493 * Sign a gossip message.
11495 * Note that if this fails, LDK may panic and the message will not be broadcast to the network
11496 * or a possible channel counterparty. If LDK panics, the error should be resolved to allow the
11497 * message to be broadcast, as otherwise it may prevent one from receiving funds over the
11498 * corresponding channel.
11500 struct LDKCResult_ECDSASignatureNoneZ (*sign_gossip_message)(const void *this_arg, struct LDKUnsignedGossipMessage msg);
11502 * Frees any resources associated with this object given its this_arg pointer.
11503 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11505 void (*free)(void *this_arg);
11509 * A trait that can return signer instances for individual channels.
11511 typedef struct LDKSignerProvider {
11513 * An opaque pointer which is passed to your function implementations as an argument.
11514 * This has no meaning in the LDK, and can be NULL or any other value.
11518 * Generates a unique `channel_keys_id` that can be used to obtain a [`Self::EcdsaSigner`] through
11519 * [`SignerProvider::derive_channel_signer`]. The `user_channel_id` is provided to allow
11520 * implementations of [`SignerProvider`] to maintain a mapping between itself and the generated
11521 * `channel_keys_id`.
11523 * This method must return a different value each time it is called.
11525 struct LDKThirtyTwoBytes (*generate_channel_keys_id)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis, struct LDKU128 user_channel_id);
11527 * Derives the private key material backing a `Signer`.
11529 * To derive a new `Signer`, a fresh `channel_keys_id` should be obtained through
11530 * [`SignerProvider::generate_channel_keys_id`]. Otherwise, an existing `Signer` can be
11531 * re-derived from its `channel_keys_id`, which can be obtained through its trait method
11532 * [`ChannelSigner::channel_keys_id`].
11534 struct LDKWriteableEcdsaChannelSigner (*derive_channel_signer)(const void *this_arg, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id);
11536 * Reads a [`Signer`] for this [`SignerProvider`] from the given input stream.
11537 * This is only called during deserialization of other objects which contain
11538 * [`WriteableEcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s).
11539 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
11540 * contain no versioning scheme. You may wish to include your own version prefix and ensure
11541 * you've read all of the provided bytes to ensure no corruption occurred.
11543 * This method is slowly being phased out -- it will only be called when reading objects
11544 * written by LDK versions prior to 0.0.113.
11546 * [`Signer`]: Self::EcdsaSigner
11547 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
11548 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
11550 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
11552 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
11554 * If this function returns an error, this will result in a channel failing to open.
11556 * This method should return a different value each time it is called, to avoid linking
11557 * on-chain funds across channels as controlled to the same user. `channel_keys_id` may be
11558 * used to derive a unique value for each channel.
11560 struct LDKCResult_CVec_u8ZNoneZ (*get_destination_script)(const void *this_arg, struct LDKThirtyTwoBytes channel_keys_id);
11562 * Get a script pubkey which we will send funds to when closing a channel.
11564 * If this function returns an error, this will result in a channel failing to open or close.
11565 * In the event of a failure when the counterparty is initiating a close, this can result in a
11566 * channel force close.
11568 * This method should return a different value each time it is called, to avoid linking
11569 * on-chain funds across channels as controlled to the same user.
11571 struct LDKCResult_ShutdownScriptNoneZ (*get_shutdown_scriptpubkey)(const void *this_arg);
11573 * Frees any resources associated with this object given its this_arg pointer.
11574 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11576 void (*free)(void *this_arg);
11577 } LDKSignerProvider;
11580 * A trait which should be implemented to provide feerate information on a number of time
11583 * If access to a local mempool is not feasible, feerate estimates should be fetched from a set of
11584 * third-parties hosting them. Note that this enables them to affect the propagation of your
11585 * pre-signed transactions at any time and therefore endangers the safety of channels funds. It
11586 * should be considered carefully as a deployment.
11588 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
11589 * called from inside the library in response to chain events, P2P events, or timer events).
11591 * LDK may generate a substantial number of fee-estimation calls in some cases. You should
11592 * pre-calculate and cache the fee estimate results to ensure you don't substantially slow HTLC
11595 typedef struct LDKFeeEstimator {
11597 * An opaque pointer which is passed to your function implementations as an argument.
11598 * This has no meaning in the LDK, and can be NULL or any other value.
11602 * Gets estimated satoshis of fee required per 1000 Weight-Units.
11604 * LDK will wrap this method and ensure that the value returned is no smaller than 253
11605 * (ie 1 satoshi-per-byte rounded up to ensure later round-downs don't put us below 1 satoshi-per-byte).
11607 * The following unit conversions can be used to convert to sats/KW:
11608 * * satoshis-per-byte * 250
11609 * * satoshis-per-kbyte / 4
11611 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
11613 * Frees any resources associated with this object given its this_arg pointer.
11614 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11616 void (*free)(void *this_arg);
11622 * Data to construct a [`BlindedHop`] for receiving a payment. This payload is custom to LDK and
11623 * may not be valid if received by another lightning implementation.
11625 typedef struct MUST_USE_STRUCT LDKReceiveTlvs {
11627 * A pointer to the opaque Rust object.
11628 * Nearly everywhere, inner must be non-null, however in places where
11629 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11631 LDKnativeReceiveTlvs *inner;
11633 * Indicates that this is the only struct which contains the same pointer.
11634 * Rust functions which take ownership of an object provided via an argument require
11635 * this to be true and invalidate the object pointed to by inner.
11641 * A trait defining behavior for routing an [`OnionMessage`].
11643 typedef struct LDKMessageRouter {
11645 * An opaque pointer which is passed to your function implementations as an argument.
11646 * This has no meaning in the LDK, and can be NULL or any other value.
11650 * Returns a route for sending an [`OnionMessage`] to the given [`Destination`].
11652 struct LDKCResult_OnionMessagePathNoneZ (*find_path)(const void *this_arg, struct LDKPublicKey sender, struct LDKCVec_PublicKeyZ peers, struct LDKDestination destination);
11654 * Creates [`BlindedPath`]s to the `recipient` node. The nodes in `peers` are assumed to be
11655 * direct peers with the `recipient`.
11657 struct LDKCResult_CVec_BlindedPathZNoneZ (*create_blinded_paths)(const void *this_arg, struct LDKPublicKey recipient, struct LDKCVec_PublicKeyZ peers);
11659 * Frees any resources associated with this object given its this_arg pointer.
11660 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11662 void (*free)(void *this_arg);
11663 } LDKMessageRouter;
11666 * A trait defining behavior for routing a payment.
11668 typedef struct LDKRouter {
11670 * An opaque pointer which is passed to your function implementations as an argument.
11671 * This has no meaning in the LDK, and can be NULL or any other value.
11675 * Finds a [`Route`] for a payment between the given `payer` and a payee.
11677 * The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
11678 * and [`RouteParameters::final_value_msat`], respectively.
11680 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
11682 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);
11684 * Finds a [`Route`] for a payment between the given `payer` and a payee.
11686 * The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
11687 * and [`RouteParameters::final_value_msat`], respectively.
11689 * Includes a [`PaymentHash`] and a [`PaymentId`] to be able to correlate the request with a specific
11692 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
11694 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);
11696 * Creates [`BlindedPath`]s for payment to the `recipient` node. The channels in `first_hops`
11697 * are assumed to be with the `recipient`'s peers. The payment secret and any constraints are
11700 struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ (*create_blinded_payment_paths)(const void *this_arg, struct LDKPublicKey recipient, struct LDKCVec_ChannelDetailsZ first_hops, struct LDKReceiveTlvs tlvs, uint64_t amount_msats);
11702 * Implementation of MessageRouter for this object.
11704 struct LDKMessageRouter MessageRouter;
11706 * Frees any resources associated with this object given its this_arg pointer.
11707 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11709 void (*free)(void *this_arg);
11715 * A lightning node's channel state machine and payment management logic, which facilitates
11716 * sending, forwarding, and receiving payments through lightning channels.
11718 * [`ChannelManager`] is parameterized by a number of components to achieve this.
11719 * - [`chain::Watch`] (typically [`ChainMonitor`]) for on-chain monitoring and enforcement of each
11721 * - [`BroadcasterInterface`] for broadcasting transactions related to opening, funding, and
11723 * - [`EntropySource`] for providing random data needed for cryptographic operations
11724 * - [`NodeSigner`] for cryptographic operations scoped to the node
11725 * - [`SignerProvider`] for providing signers whose operations are scoped to individual channels
11726 * - [`FeeEstimator`] to determine transaction fee rates needed to have a transaction mined in a
11728 * - [`Router`] for finding payment paths when initiating and retrying payments
11729 * - [`Logger`] for logging operational information of varying degrees
11731 * Additionally, it implements the following traits:
11732 * - [`ChannelMessageHandler`] to handle off-chain channel activity from peers
11733 * - [`MessageSendEventsProvider`] to similarly send such messages to peers
11734 * - [`OffersMessageHandler`] for BOLT 12 message handling and sending
11735 * - [`EventsProvider`] to generate user-actionable [`Event`]s
11736 * - [`chain::Listen`] and [`chain::Confirm`] for notification of on-chain activity
11738 * Thus, [`ChannelManager`] is typically used to parameterize a [`MessageHandler`] and an
11739 * [`OnionMessenger`]. The latter is required to support BOLT 12 functionality.
11741 * # `ChannelManager` vs `ChannelMonitor`
11743 * It's important to distinguish between the *off-chain* management and *on-chain* enforcement of
11744 * lightning channels. [`ChannelManager`] exchanges messages with peers to manage the off-chain
11745 * state of each channel. During this process, it generates a [`ChannelMonitor`] for each channel
11746 * and a [`ChannelMonitorUpdate`] for each relevant change, notifying its parameterized
11747 * [`chain::Watch`] of them.
11749 * An implementation of [`chain::Watch`], such as [`ChainMonitor`], is responsible for aggregating
11750 * these [`ChannelMonitor`]s and applying any [`ChannelMonitorUpdate`]s to them. It then monitors
11751 * for any pertinent on-chain activity, enforcing claims as needed.
11753 * This division of off-chain management and on-chain enforcement allows for interesting node
11754 * setups. For instance, on-chain enforcement could be moved to a separate host or have added
11755 * redundancy, possibly as a watchtower. See [`chain::Watch`] for the relevant interface.
11759 * Use [`ChannelManager::new`] with the most recent [`BlockHash`] when creating a fresh instance.
11760 * Otherwise, if restarting, construct [`ChannelManagerReadArgs`] with the necessary parameters and
11761 * references to any deserialized [`ChannelMonitor`]s that were previously persisted. Use this to
11762 * deserialize the [`ChannelManager`] and feed it any new chain data since it was last online, as
11763 * detailed in the [`ChannelManagerReadArgs`] documentation.
11766 * use bitcoin::BlockHash;
11767 * use bitcoin::network::constants::Network;
11768 * use lightning::chain::BestBlock;
11769 * # use lightning::chain::channelmonitor::ChannelMonitor;
11770 * use lightning::ln::channelmanager::{ChainParameters, ChannelManager, ChannelManagerReadArgs};
11771 * # use lightning::routing::gossip::NetworkGraph;
11772 * use lightning::util::config::UserConfig;
11773 * use lightning::util::ser::ReadableArgs;
11775 * # fn read_channel_monitors() -> Vec<ChannelMonitor<lightning::sign::InMemorySigner>> { vec![] }
11778 * # L: lightning::util::logger::Logger,
11779 * # ES: lightning::sign::EntropySource,
11780 * # S: for <'b> lightning::routing::scoring::LockableScore<'b, ScoreLookUp = SL>,
11781 * # SL: lightning::routing::scoring::ScoreLookUp<ScoreParams = SP>,
11783 * # R: lightning::io::Read,
11785 * # fee_estimator: &dyn lightning::chain::chaininterface::FeeEstimator,
11786 * # chain_monitor: &dyn lightning::chain::Watch<lightning::sign::InMemorySigner>,
11787 * # tx_broadcaster: &dyn lightning::chain::chaininterface::BroadcasterInterface,
11788 * # router: &lightning::routing::router::DefaultRouter<&NetworkGraph<&'a L>, &'a L, &ES, &S, SP, SL>,
11790 * # entropy_source: &ES,
11791 * # node_signer: &dyn lightning::sign::NodeSigner,
11792 * # signer_provider: &lightning::sign::DynSignerProvider,
11793 * # best_block: lightning::chain::BestBlock,
11794 * # current_timestamp: u32,
11796 * # ) -> Result<(), lightning::ln::msgs::DecodeError> {
11797 * // Fresh start with no channels
11798 * let params = ChainParameters {
11799 * network: Network::Bitcoin,
11802 * let default_config = UserConfig::default();
11803 * let channel_manager = ChannelManager::new(
11804 * fee_estimator, chain_monitor, tx_broadcaster, router, logger, entropy_source, node_signer,
11805 * signer_provider, default_config, params, current_timestamp
11808 * // Restart from deserialized data
11809 * let mut channel_monitors = read_channel_monitors();
11810 * let args = ChannelManagerReadArgs::new(
11811 * entropy_source, node_signer, signer_provider, fee_estimator, chain_monitor, tx_broadcaster,
11812 * router, logger, default_config, channel_monitors.iter_mut().collect()
11814 * let (block_hash, channel_manager) =
11815 * <(BlockHash, ChannelManager<_, _, _, _, _, _, _, _>)>::read(&mut reader, args)?;
11817 * // Update the ChannelManager and ChannelMonitors with the latest chain data
11820 * // Move the monitors to the ChannelManager's chain::Watch parameter
11821 * for monitor in channel_monitors {
11822 * chain_monitor.watch_channel(monitor.get_funding_txo().0, monitor);
11830 * The following is required for [`ChannelManager`] to function properly:
11831 * - Handle messages from peers using its [`ChannelMessageHandler`] implementation (typically
11832 * called by [`PeerManager::read_event`] when processing network I/O)
11833 * - Send messages to peers obtained via its [`MessageSendEventsProvider`] implementation
11834 * (typically initiated when [`PeerManager::process_events`] is called)
11835 * - Feed on-chain activity using either its [`chain::Listen`] or [`chain::Confirm`] implementation
11836 * as documented by those traits
11837 * - Perform any periodic channel and payment checks by calling [`timer_tick_occurred`] roughly
11839 * - Persist to disk whenever [`get_and_clear_needs_persistence`] returns `true` using a
11840 * [`Persister`] such as a [`KVStore`] implementation
11841 * - Handle [`Event`]s obtained via its [`EventsProvider`] implementation
11843 * The [`Future`] returned by [`get_event_or_persistence_needed_future`] is useful in determining
11844 * when the last two requirements need to be checked.
11846 * The [`lightning-block-sync`] and [`lightning-transaction-sync`] crates provide utilities that
11847 * simplify feeding in on-chain activity using the [`chain::Listen`] and [`chain::Confirm`] traits,
11848 * respectively. The remaining requirements can be met using the [`lightning-background-processor`]
11849 * crate. For languages other than Rust, the availability of similar utilities may vary.
11853 * [`ChannelManager`]'s primary function involves managing a channel state. Without channels,
11854 * payments can't be sent. Use [`list_channels`] or [`list_usable_channels`] for a snapshot of the
11855 * currently open channels.
11858 * # use lightning::ln::channelmanager::AChannelManager;
11860 * # fn example<T: AChannelManager>(channel_manager: T) {
11861 * # let channel_manager = channel_manager.get_cm();
11862 * let channels = channel_manager.list_usable_channels();
11863 * for details in channels {
11864 * println!(\"{:?}\", details);
11869 * Each channel is identified using a [`ChannelId`], which will change throughout the channel's
11870 * life cycle. Additionally, channels are assigned a `user_channel_id`, which is given in
11871 * [`Event`]s associated with the channel and serves as a fixed identifier but is otherwise unused
11872 * by [`ChannelManager`].
11874 * ## Opening Channels
11876 * To an open a channel with a peer, call [`create_channel`]. This will initiate the process of
11877 * opening an outbound channel, which requires self-funding when handling
11878 * [`Event::FundingGenerationReady`].
11881 * # use bitcoin::{ScriptBuf, Transaction};
11882 * # use bitcoin::secp256k1::PublicKey;
11883 * # use lightning::ln::channelmanager::AChannelManager;
11884 * # use lightning::events::{Event, EventsProvider};
11887 * # fn create_funding_transaction(
11888 * # &self, _amount_sats: u64, _output_script: ScriptBuf
11889 * # ) -> Transaction;
11892 * # fn example<T: AChannelManager, W: Wallet>(channel_manager: T, wallet: W, peer_id: PublicKey) {
11893 * # let channel_manager = channel_manager.get_cm();
11894 * let value_sats = 1_000_000;
11895 * let push_msats = 10_000_000;
11896 * match channel_manager.create_channel(peer_id, value_sats, push_msats, 42, None, None) {
11897 * Ok(channel_id) => println!(\"Opening channel {}\", channel_id),
11898 * Err(e) => println!(\"Error opening channel: {:?}\", e),
11901 * // On the event processing thread once the peer has responded
11902 * channel_manager.process_pending_events(&|event| match event {
11903 * Event::FundingGenerationReady {
11904 * temporary_channel_id, counterparty_node_id, channel_value_satoshis, output_script,
11905 * user_channel_id, ..
11907 * assert_eq!(user_channel_id, 42);
11908 * let funding_transaction = wallet.create_funding_transaction(
11909 * channel_value_satoshis, output_script
11911 * match channel_manager.funding_transaction_generated(
11912 * &temporary_channel_id, &counterparty_node_id, funding_transaction
11914 * Ok(()) => println!(\"Funding channel {}\", temporary_channel_id),
11915 * Err(e) => println!(\"Error funding channel {}: {:?}\", temporary_channel_id, e),
11918 * Event::ChannelPending { channel_id, user_channel_id, former_temporary_channel_id, .. } => {
11919 * assert_eq!(user_channel_id, 42);
11921 * \"Channel {} now {} pending (funding transaction has been broadcasted)\", channel_id,
11922 * former_temporary_channel_id.unwrap()
11925 * Event::ChannelReady { channel_id, user_channel_id, .. } => {
11926 * assert_eq!(user_channel_id, 42);
11927 * println!(\"Channel {} ready\", channel_id);
11935 * ## Accepting Channels
11937 * Inbound channels are initiated by peers and are automatically accepted unless [`ChannelManager`]
11938 * has [`UserConfig::manually_accept_inbound_channels`] set. In that case, the channel may be
11939 * either accepted or rejected when handling [`Event::OpenChannelRequest`].
11942 * # use bitcoin::secp256k1::PublicKey;
11943 * # use lightning::ln::channelmanager::AChannelManager;
11944 * # use lightning::events::{Event, EventsProvider};
11946 * # fn is_trusted(counterparty_node_id: PublicKey) -> bool {
11948 * # unimplemented!()
11951 * # fn example<T: AChannelManager>(channel_manager: T) {
11952 * # let channel_manager = channel_manager.get_cm();
11953 * channel_manager.process_pending_events(&|event| match event {
11954 * Event::OpenChannelRequest { temporary_channel_id, counterparty_node_id, .. } => {
11955 * if !is_trusted(counterparty_node_id) {
11956 * match channel_manager.force_close_without_broadcasting_txn(
11957 * &temporary_channel_id, &counterparty_node_id
11959 * Ok(()) => println!(\"Rejecting channel {}\", temporary_channel_id),
11960 * Err(e) => println!(\"Error rejecting channel {}: {:?}\", temporary_channel_id, e),
11965 * let user_channel_id = 43;
11966 * match channel_manager.accept_inbound_channel(
11967 * &temporary_channel_id, &counterparty_node_id, user_channel_id
11969 * Ok(()) => println!(\"Accepting channel {}\", temporary_channel_id),
11970 * Err(e) => println!(\"Error accepting channel {}: {:?}\", temporary_channel_id, e),
11979 * ## Closing Channels
11981 * There are two ways to close a channel: either cooperatively using [`close_channel`] or
11982 * unilaterally using [`force_close_broadcasting_latest_txn`]. The former is ideal as it makes for
11983 * lower fees and immediate access to funds. However, the latter may be necessary if the
11984 * counterparty isn't behaving properly or has gone offline. [`Event::ChannelClosed`] is generated
11985 * once the channel has been closed successfully.
11988 * # use bitcoin::secp256k1::PublicKey;
11989 * # use lightning::ln::types::ChannelId;
11990 * # use lightning::ln::channelmanager::AChannelManager;
11991 * # use lightning::events::{Event, EventsProvider};
11993 * # fn example<T: AChannelManager>(
11994 * # channel_manager: T, channel_id: ChannelId, counterparty_node_id: PublicKey
11996 * # let channel_manager = channel_manager.get_cm();
11997 * match channel_manager.close_channel(&channel_id, &counterparty_node_id) {
11998 * Ok(()) => println!(\"Closing channel {}\", channel_id),
11999 * Err(e) => println!(\"Error closing channel {}: {:?}\", channel_id, e),
12002 * // On the event processing thread
12003 * channel_manager.process_pending_events(&|event| match event {
12004 * Event::ChannelClosed { channel_id, user_channel_id, .. } => {
12005 * assert_eq!(user_channel_id, 42);
12006 * println!(\"Channel {} closed\", channel_id);
12016 * [`ChannelManager`] is responsible for sending, forwarding, and receiving payments through its
12017 * channels. A payment is typically initiated from a [BOLT 11] invoice or a [BOLT 12] offer, though
12018 * spontaneous (i.e., keysend) payments are also possible. Incoming payments don't require
12019 * maintaining any additional state as [`ChannelManager`] can reconstruct the [`PaymentPreimage`]
12020 * from the [`PaymentSecret`]. Sending payments, however, require tracking in order to retry failed
12023 * After a payment is initiated, it will appear in [`list_recent_payments`] until a short time
12024 * after either an [`Event::PaymentSent`] or [`Event::PaymentFailed`] is handled. Failed HTLCs
12025 * for a payment will be retried according to the payment's [`Retry`] strategy or until
12026 * [`abandon_payment`] is called.
12028 * ## BOLT 11 Invoices
12030 * The [`lightning-invoice`] crate is useful for creating BOLT 11 invoices. Specifically, use the
12031 * functions in its `utils` module for constructing invoices that are compatible with
12032 * [`ChannelManager`]. These functions serve as a convenience for building invoices with the
12033 * [`PaymentHash`] and [`PaymentSecret`] returned from [`create_inbound_payment`]. To provide your
12034 * own [`PaymentHash`], use [`create_inbound_payment_for_hash`] or the corresponding functions in
12035 * the [`lightning-invoice`] `utils` module.
12037 * [`ChannelManager`] generates an [`Event::PaymentClaimable`] once the full payment has been
12038 * received. Call [`claim_funds`] to release the [`PaymentPreimage`], which in turn will result in
12039 * an [`Event::PaymentClaimed`].
12042 * # use lightning::events::{Event, EventsProvider, PaymentPurpose};
12043 * # use lightning::ln::channelmanager::AChannelManager;
12045 * # fn example<T: AChannelManager>(channel_manager: T) {
12046 * # let channel_manager = channel_manager.get_cm();
12047 * // Or use utils::create_invoice_from_channelmanager
12048 * let known_payment_hash = match channel_manager.create_inbound_payment(
12049 * Some(10_000_000), 3600, None
12051 * Ok((payment_hash, _payment_secret)) => {
12052 * println!(\"Creating inbound payment {}\", payment_hash);
12055 * Err(()) => panic!(\"Error creating inbound payment\"),
12058 * // On the event processing thread
12059 * channel_manager.process_pending_events(&|event| match event {
12060 * Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose {
12061 * PaymentPurpose::Bolt11InvoicePayment { payment_preimage: Some(payment_preimage), .. } => {
12062 * assert_eq!(payment_hash, known_payment_hash);
12063 * println!(\"Claiming payment {}\", payment_hash);
12064 * channel_manager.claim_funds(payment_preimage);
12066 * PaymentPurpose::Bolt11InvoicePayment { payment_preimage: None, .. } => {
12067 * println!(\"Unknown payment hash: {}\", payment_hash);
12069 * PaymentPurpose::SpontaneousPayment(payment_preimage) => {
12070 * assert_ne!(payment_hash, known_payment_hash);
12071 * println!(\"Claiming spontaneous payment {}\", payment_hash);
12072 * channel_manager.claim_funds(payment_preimage);
12077 * Event::PaymentClaimed { payment_hash, amount_msat, .. } => {
12078 * assert_eq!(payment_hash, known_payment_hash);
12079 * println!(\"Claimed {} msats\", amount_msat);
12087 * For paying an invoice, [`lightning-invoice`] provides a `payment` module with convenience
12088 * functions for use with [`send_payment`].
12091 * # use lightning::events::{Event, EventsProvider};
12092 * # use lightning::ln::types::PaymentHash;
12093 * # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, RecipientOnionFields, Retry};
12094 * # use lightning::routing::router::RouteParameters;
12096 * # fn example<T: AChannelManager>(
12097 * # channel_manager: T, payment_hash: PaymentHash, recipient_onion: RecipientOnionFields,
12098 * # route_params: RouteParameters, retry: Retry
12100 * # let channel_manager = channel_manager.get_cm();
12101 * // let (payment_hash, recipient_onion, route_params) =
12102 * // payment::payment_parameters_from_invoice(&invoice);
12103 * let payment_id = PaymentId([42; 32]);
12104 * match channel_manager.send_payment(
12105 * payment_hash, recipient_onion, payment_id, route_params, retry
12107 * Ok(()) => println!(\"Sending payment with hash {}\", payment_hash),
12108 * Err(e) => println!(\"Failed sending payment with hash {}: {:?}\", payment_hash, e),
12111 * let expected_payment_id = payment_id;
12112 * let expected_payment_hash = payment_hash;
12114 * channel_manager.list_recent_payments().iter().find(|details| matches!(
12116 * RecentPaymentDetails::Pending {
12117 * payment_id: expected_payment_id,
12118 * payment_hash: expected_payment_hash,
12124 * // On the event processing thread
12125 * channel_manager.process_pending_events(&|event| match event {
12126 * Event::PaymentSent { payment_hash, .. } => println!(\"Paid {}\", payment_hash),
12127 * Event::PaymentFailed { payment_hash, .. } => println!(\"Failed paying {}\", payment_hash),
12134 * ## BOLT 12 Offers
12136 * The [`offers`] module is useful for creating BOLT 12 offers. An [`Offer`] is a precursor to a
12137 * [`Bolt12Invoice`], which must first be requested by the payer. The interchange of these messages
12138 * as defined in the specification is handled by [`ChannelManager`] and its implementation of
12139 * [`OffersMessageHandler`]. However, this only works with an [`Offer`] created using a builder
12140 * returned by [`create_offer_builder`]. With this approach, BOLT 12 offers and invoices are
12141 * stateless just as BOLT 11 invoices are.
12144 * # use lightning::events::{Event, EventsProvider, PaymentPurpose};
12145 * # use lightning::ln::channelmanager::AChannelManager;
12146 * # use lightning::offers::parse::Bolt12SemanticError;
12148 * # fn example<T: AChannelManager>(channel_manager: T) -> Result<(), Bolt12SemanticError> {
12149 * # let channel_manager = channel_manager.get_cm();
12150 * let offer = channel_manager
12151 * .create_offer_builder()?
12153 * # // Needed for compiling for c_bindings
12154 * # let builder: lightning::offers::offer::OfferBuilder<_, _> = offer.into();
12155 * # let offer = builder
12156 * .description(\"coffee\".to_string())
12157 * .amount_msats(10_000_000)
12159 * let bech32_offer = offer.to_string();
12161 * // On the event processing thread
12162 * channel_manager.process_pending_events(&|event| match event {
12163 * Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose {
12164 * PaymentPurpose::Bolt12OfferPayment { payment_preimage: Some(payment_preimage), .. } => {
12165 * println!(\"Claiming payment {}\", payment_hash);
12166 * channel_manager.claim_funds(payment_preimage);
12168 * PaymentPurpose::Bolt12OfferPayment { payment_preimage: None, .. } => {
12169 * println!(\"Unknown payment hash: {}\", payment_hash);
12174 * Event::PaymentClaimed { payment_hash, amount_msat, .. } => {
12175 * println!(\"Claimed {} msats\", amount_msat);
12184 * Use [`pay_for_offer`] to initiated payment, which sends an [`InvoiceRequest`] for an [`Offer`]
12185 * and pays the [`Bolt12Invoice`] response. In addition to success and failure events,
12186 * [`ChannelManager`] may also generate an [`Event::InvoiceRequestFailed`].
12189 * # use lightning::events::{Event, EventsProvider};
12190 * # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, Retry};
12191 * # use lightning::offers::offer::Offer;
12193 * # fn example<T: AChannelManager>(
12194 * # channel_manager: T, offer: &Offer, quantity: Option<u64>, amount_msats: Option<u64>,
12195 * # payer_note: Option<String>, retry: Retry, max_total_routing_fee_msat: Option<u64>
12197 * # let channel_manager = channel_manager.get_cm();
12198 * let payment_id = PaymentId([42; 32]);
12199 * match channel_manager.pay_for_offer(
12200 * offer, quantity, amount_msats, payer_note, payment_id, retry, max_total_routing_fee_msat
12202 * Ok(()) => println!(\"Requesting invoice for offer\"),
12203 * Err(e) => println!(\"Unable to request invoice for offer: {:?}\", e),
12206 * // First the payment will be waiting on an invoice
12207 * let expected_payment_id = payment_id;
12209 * channel_manager.list_recent_payments().iter().find(|details| matches!(
12211 * RecentPaymentDetails::AwaitingInvoice { payment_id: expected_payment_id }
12215 * // Once the invoice is received, a payment will be sent
12217 * channel_manager.list_recent_payments().iter().find(|details| matches!(
12219 * RecentPaymentDetails::Pending { payment_id: expected_payment_id, .. }
12223 * // On the event processing thread
12224 * channel_manager.process_pending_events(&|event| match event {
12225 * Event::PaymentSent { payment_id: Some(payment_id), .. } => println!(\"Paid {}\", payment_id),
12226 * Event::PaymentFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id),
12227 * Event::InvoiceRequestFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id),
12234 * ## BOLT 12 Refunds
12236 * A [`Refund`] is a request for an invoice to be paid. Like *paying* for an [`Offer`], *creating*
12237 * a [`Refund`] involves maintaining state since it represents a future outbound payment.
12238 * Therefore, use [`create_refund_builder`] when creating one, otherwise [`ChannelManager`] will
12239 * refuse to pay any corresponding [`Bolt12Invoice`] that it receives.
12242 * # use core::time::Duration;
12243 * # use lightning::events::{Event, EventsProvider};
12244 * # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, Retry};
12245 * # use lightning::offers::parse::Bolt12SemanticError;
12247 * # fn example<T: AChannelManager>(
12248 * # channel_manager: T, amount_msats: u64, absolute_expiry: Duration, retry: Retry,
12249 * # max_total_routing_fee_msat: Option<u64>
12250 * # ) -> Result<(), Bolt12SemanticError> {
12251 * # let channel_manager = channel_manager.get_cm();
12252 * let payment_id = PaymentId([42; 32]);
12253 * let refund = channel_manager
12254 * .create_refund_builder(
12255 * amount_msats, absolute_expiry, payment_id, retry, max_total_routing_fee_msat
12258 * # // Needed for compiling for c_bindings
12259 * # let builder: lightning::offers::refund::RefundBuilder<_> = refund.into();
12260 * # let refund = builder
12261 * .description(\"coffee\".to_string())
12262 * .payer_note(\"refund for order 1234\".to_string())
12264 * let bech32_refund = refund.to_string();
12266 * // First the payment will be waiting on an invoice
12267 * let expected_payment_id = payment_id;
12269 * channel_manager.list_recent_payments().iter().find(|details| matches!(
12271 * RecentPaymentDetails::AwaitingInvoice { payment_id: expected_payment_id }
12275 * // Once the invoice is received, a payment will be sent
12277 * channel_manager.list_recent_payments().iter().find(|details| matches!(
12279 * RecentPaymentDetails::Pending { payment_id: expected_payment_id, .. }
12283 * // On the event processing thread
12284 * channel_manager.process_pending_events(&|event| match event {
12285 * Event::PaymentSent { payment_id: Some(payment_id), .. } => println!(\"Paid {}\", payment_id),
12286 * Event::PaymentFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id),
12294 * Use [`request_refund_payment`] to send a [`Bolt12Invoice`] for receiving the refund. Similar to
12295 * *creating* an [`Offer`], this is stateless as it represents an inbound payment.
12298 * # use lightning::events::{Event, EventsProvider, PaymentPurpose};
12299 * # use lightning::ln::channelmanager::AChannelManager;
12300 * # use lightning::offers::refund::Refund;
12302 * # fn example<T: AChannelManager>(channel_manager: T, refund: &Refund) {
12303 * # let channel_manager = channel_manager.get_cm();
12304 * let known_payment_hash = match channel_manager.request_refund_payment(refund) {
12306 * let payment_hash = invoice.payment_hash();
12307 * println!(\"Requesting refund payment {}\", payment_hash);
12310 * Err(e) => panic!(\"Unable to request payment for refund: {:?}\", e),
12313 * // On the event processing thread
12314 * channel_manager.process_pending_events(&|event| match event {
12315 * Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose {
12316 * \tPaymentPurpose::Bolt12RefundPayment { payment_preimage: Some(payment_preimage), .. } => {
12317 * assert_eq!(payment_hash, known_payment_hash);
12318 * println!(\"Claiming payment {}\", payment_hash);
12319 * channel_manager.claim_funds(payment_preimage);
12321 * \tPaymentPurpose::Bolt12RefundPayment { payment_preimage: None, .. } => {
12322 * println!(\"Unknown payment hash: {}\", payment_hash);
12327 * Event::PaymentClaimed { payment_hash, amount_msat, .. } => {
12328 * assert_eq!(payment_hash, known_payment_hash);
12329 * println!(\"Claimed {} msats\", amount_msat);
12339 * Implements [`Writeable`] to write out all channel state to disk. Implies [`peer_disconnected`] for
12340 * all peers during write/read (though does not modify this instance, only the instance being
12341 * serialized). This will result in any channels which have not yet exchanged [`funding_created`] (i.e.,
12342 * called [`funding_transaction_generated`] for outbound channels) being closed.
12344 * Note that you can be a bit lazier about writing out `ChannelManager` than you can be with
12345 * [`ChannelMonitor`]. With [`ChannelMonitor`] you MUST durably write each
12346 * [`ChannelMonitorUpdate`] before returning from
12347 * [`chain::Watch::watch_channel`]/[`update_channel`] or before completing async writes. With
12348 * `ChannelManager`s, writing updates happens out-of-band (and will prevent any other
12349 * `ChannelManager` operations from occurring during the serialization process). If the
12350 * deserialized version is out-of-date compared to the [`ChannelMonitor`] passed by reference to
12351 * [`read`], those channels will be force-closed based on the `ChannelMonitor` state and no funds
12352 * will be lost (modulo on-chain transaction fees).
12354 * Note that the deserializer is only implemented for `(`[`BlockHash`]`, `[`ChannelManager`]`)`, which
12355 * tells you the last block hash which was connected. You should get the best block tip before using the manager.
12356 * See [`chain::Listen`] and [`chain::Confirm`] for more details.
12358 * # `ChannelUpdate` Messages
12360 * Note that `ChannelManager` is responsible for tracking liveness of its channels and generating
12361 * [`ChannelUpdate`] messages informing peers that the channel is temporarily disabled. To avoid
12362 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
12363 * offline for a full minute. In order to track this, you must call
12364 * [`timer_tick_occurred`] roughly once per minute, though it doesn't have to be perfect.
12368 * To avoid trivial DoS issues, `ChannelManager` limits the number of inbound connections and
12369 * inbound channels without confirmed funding transactions. This may result in nodes which we do
12370 * not have a channel with being unable to connect to us or open new channels with us if we have
12371 * many peers with unfunded channels.
12373 * Because it is an indication of trust, inbound channels which we've accepted as 0conf are
12374 * exempted from the count of unfunded channels. Similarly, outbound channels and connections are
12375 * never limited. Please ensure you limit the count of such channels yourself.
12379 * Rather than using a plain `ChannelManager`, it is preferable to use either a [`SimpleArcChannelManager`]
12380 * a [`SimpleRefChannelManager`], for conciseness. See their documentation for more details, but
12381 * essentially you should default to using a [`SimpleRefChannelManager`], and use a
12382 * [`SimpleArcChannelManager`] when you require a `ChannelManager` with a static lifetime, such as when
12383 * you're using lightning-net-tokio.
12385 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
12386 * [`MessageHandler`]: crate::ln::peer_handler::MessageHandler
12387 * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
12388 * [`PeerManager::read_event`]: crate::ln::peer_handler::PeerManager::read_event
12389 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
12390 * [`timer_tick_occurred`]: Self::timer_tick_occurred
12391 * [`get_and_clear_needs_persistence`]: Self::get_and_clear_needs_persistence
12392 * [`Persister`]: crate::util::persist::Persister
12393 * [`KVStore`]: crate::util::persist::KVStore
12394 * [`get_event_or_persistence_needed_future`]: Self::get_event_or_persistence_needed_future
12395 * [`lightning-block-sync`]: https://docs.rs/lightning_block_sync/latest/lightning_block_sync
12396 * [`lightning-transaction-sync`]: https://docs.rs/lightning_transaction_sync/latest/lightning_transaction_sync
12397 * [`lightning-background-processor`]: https://docs.rs/lightning_background_processor/lightning_background_processor
12398 * [`list_channels`]: Self::list_channels
12399 * [`list_usable_channels`]: Self::list_usable_channels
12400 * [`create_channel`]: Self::create_channel
12401 * [`close_channel`]: Self::force_close_broadcasting_latest_txn
12402 * [`force_close_broadcasting_latest_txn`]: Self::force_close_broadcasting_latest_txn
12403 * [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md
12404 * [BOLT 12]: https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md
12405 * [`list_recent_payments`]: Self::list_recent_payments
12406 * [`abandon_payment`]: Self::abandon_payment
12407 * [`lightning-invoice`]: https://docs.rs/lightning_invoice/latest/lightning_invoice
12408 * [`create_inbound_payment`]: Self::create_inbound_payment
12409 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
12410 * [`claim_funds`]: Self::claim_funds
12411 * [`send_payment`]: Self::send_payment
12412 * [`offers`]: crate::offers
12413 * [`create_offer_builder`]: Self::create_offer_builder
12414 * [`pay_for_offer`]: Self::pay_for_offer
12415 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
12416 * [`create_refund_builder`]: Self::create_refund_builder
12417 * [`request_refund_payment`]: Self::request_refund_payment
12418 * [`peer_disconnected`]: msgs::ChannelMessageHandler::peer_disconnected
12419 * [`funding_created`]: msgs::FundingCreated
12420 * [`funding_transaction_generated`]: Self::funding_transaction_generated
12421 * [`BlockHash`]: bitcoin::hash_types::BlockHash
12422 * [`update_channel`]: chain::Watch::update_channel
12423 * [`ChannelUpdate`]: msgs::ChannelUpdate
12424 * [`read`]: ReadableArgs::read
12426 typedef struct MUST_USE_STRUCT LDKChannelManager {
12428 * A pointer to the opaque Rust object.
12429 * Nearly everywhere, inner must be non-null, however in places where
12430 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12432 LDKnativeChannelManager *inner;
12434 * Indicates that this is the only struct which contains the same pointer.
12435 * Rust functions which take ownership of an object provided via an argument require
12436 * this to be true and invalidate the object pointed to by inner.
12439 } LDKChannelManager;
12442 * A tuple of 2 elements. See the individual fields for the types contained.
12444 typedef struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ {
12446 * The element at position 0
12448 struct LDKThirtyTwoBytes a;
12450 * The element at position 1
12452 struct LDKChannelManager b;
12453 } LDKC2Tuple_ThirtyTwoBytesChannelManagerZ;
12456 * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ
12458 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr {
12460 * A pointer to the contents in the success state.
12461 * Reading from this pointer when `result_ok` is not set is undefined.
12463 struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ *result;
12465 * A pointer to the contents in the error state.
12466 * Reading from this pointer when `result_ok` is set is undefined.
12468 struct LDKDecodeError *err;
12469 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr;
12472 * A CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ represents the result of a fallible operation,
12473 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
12474 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12476 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ {
12478 * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ, accessible via either
12479 * `err` or `result` depending on the state of `result_ok`.
12481 union LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr contents;
12483 * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ represents a success state.
12486 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ;
12489 * Options for how to set the max dust exposure allowed on a channel. See
12490 * [`ChannelConfig::max_dust_htlc_exposure`] for details.
12492 typedef enum LDKMaxDustHTLCExposure_Tag {
12494 * This sets a fixed limit on the total dust exposure in millisatoshis. Setting this too low
12495 * may prevent the sending or receipt of low-value HTLCs on high-traffic nodes, however this
12496 * limit is very important to prevent stealing of large amounts of dust HTLCs by miners
12497 * through [fee griefing
12498 * attacks](https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-May/002714.html).
12500 * Note that if the feerate increases significantly, without a manual increase
12501 * to this maximum the channel may be unable to send/receive HTLCs between the maximum dust
12502 * exposure and the new minimum value for HTLCs to be economically viable to claim.
12504 LDKMaxDustHTLCExposure_FixedLimitMsat,
12506 * This sets a multiplier on the [`ConfirmationTarget::OnChainSweep`] feerate (in sats/KW) to
12507 * determine the maximum allowed dust exposure. If this variant is used then the maximum dust
12508 * exposure in millisatoshis is calculated as:
12509 * `feerate_per_kw * value`. For example, with our default value
12510 * `FeeRateMultiplier(10_000)`:
12512 * - For the minimum fee rate of 1 sat/vByte (250 sat/KW, although the minimum
12513 * defaults to 253 sats/KW for rounding, see [`FeeEstimator`]), the max dust exposure would
12514 * be 253 * 10_000 = 2,530,000 msats.
12515 * - For a fee rate of 30 sat/vByte (7500 sat/KW), the max dust exposure would be
12516 * 7500 * 50_000 = 75,000,000 msats (0.00075 BTC).
12518 * Note, if you're using a third-party fee estimator, this may leave you more exposed to a
12519 * fee griefing attack, where your fee estimator may purposely overestimate the fee rate,
12520 * causing you to accept more dust HTLCs than you would otherwise.
12522 * This variant is primarily meant to serve pre-anchor channels, as HTLC fees being included
12523 * on HTLC outputs means your channel may be subject to more dust exposure in the event of
12524 * increases in fee rate.
12526 * # Backwards Compatibility
12527 * This variant only became available in LDK 0.0.116, so if you downgrade to a prior version
12528 * by default this will be set to a [`Self::FixedLimitMsat`] of 5,000,000 msat.
12530 * [`FeeEstimator`]: crate::chain::chaininterface::FeeEstimator
12531 * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep
12533 LDKMaxDustHTLCExposure_FeeRateMultiplier,
12535 * Must be last for serialization purposes
12537 LDKMaxDustHTLCExposure_Sentinel,
12538 } LDKMaxDustHTLCExposure_Tag;
12540 typedef struct MUST_USE_STRUCT LDKMaxDustHTLCExposure {
12541 LDKMaxDustHTLCExposure_Tag tag;
12544 uint64_t fixed_limit_msat;
12547 uint64_t fee_rate_multiplier;
12550 } LDKMaxDustHTLCExposure;
12553 * The contents of CResult_MaxDustHTLCExposureDecodeErrorZ
12555 typedef union LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr {
12557 * A pointer to the contents in the success state.
12558 * Reading from this pointer when `result_ok` is not set is undefined.
12560 struct LDKMaxDustHTLCExposure *result;
12562 * A pointer to the contents in the error state.
12563 * Reading from this pointer when `result_ok` is set is undefined.
12565 struct LDKDecodeError *err;
12566 } LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr;
12569 * A CResult_MaxDustHTLCExposureDecodeErrorZ represents the result of a fallible operation,
12570 * containing a crate::lightning::util::config::MaxDustHTLCExposure on success and a crate::lightning::ln::msgs::DecodeError on failure.
12571 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12573 typedef struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ {
12575 * The contents of this CResult_MaxDustHTLCExposureDecodeErrorZ, accessible via either
12576 * `err` or `result` depending on the state of `result_ok`.
12578 union LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr contents;
12580 * Whether this CResult_MaxDustHTLCExposureDecodeErrorZ represents a success state.
12583 } LDKCResult_MaxDustHTLCExposureDecodeErrorZ;
12588 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
12589 * with our counterparty.
12591 typedef struct MUST_USE_STRUCT LDKChannelConfig {
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 LDKnativeChannelConfig *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.
12604 } LDKChannelConfig;
12607 * The contents of CResult_ChannelConfigDecodeErrorZ
12609 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
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 LDKChannelConfig *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_ChannelConfigDecodeErrorZPtr;
12623 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
12624 * containing a crate::lightning::util::config::ChannelConfig 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_ChannelConfigDecodeErrorZ {
12629 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
12630 * `err` or `result` depending on the state of `result_ok`.
12632 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
12634 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
12637 } LDKCResult_ChannelConfigDecodeErrorZ;
12640 * An enum which can either contain a crate::lightning::util::config::MaxDustHTLCExposure or not
12642 typedef enum LDKCOption_MaxDustHTLCExposureZ_Tag {
12644 * When we're in this state, this COption_MaxDustHTLCExposureZ contains a crate::lightning::util::config::MaxDustHTLCExposure
12646 LDKCOption_MaxDustHTLCExposureZ_Some,
12648 * When we're in this state, this COption_MaxDustHTLCExposureZ contains nothing
12650 LDKCOption_MaxDustHTLCExposureZ_None,
12652 * Must be last for serialization purposes
12654 LDKCOption_MaxDustHTLCExposureZ_Sentinel,
12655 } LDKCOption_MaxDustHTLCExposureZ_Tag;
12657 typedef struct LDKCOption_MaxDustHTLCExposureZ {
12658 LDKCOption_MaxDustHTLCExposureZ_Tag tag;
12661 struct LDKMaxDustHTLCExposure some;
12664 } LDKCOption_MaxDustHTLCExposureZ;
12667 * An enum which can either contain a crate::lightning::util::errors::APIError or not
12669 typedef enum LDKCOption_APIErrorZ_Tag {
12671 * When we're in this state, this COption_APIErrorZ contains a crate::lightning::util::errors::APIError
12673 LDKCOption_APIErrorZ_Some,
12675 * When we're in this state, this COption_APIErrorZ contains nothing
12677 LDKCOption_APIErrorZ_None,
12679 * Must be last for serialization purposes
12681 LDKCOption_APIErrorZ_Sentinel,
12682 } LDKCOption_APIErrorZ_Tag;
12684 typedef struct LDKCOption_APIErrorZ {
12685 LDKCOption_APIErrorZ_Tag tag;
12688 struct LDKAPIError some;
12691 } LDKCOption_APIErrorZ;
12694 * The contents of CResult_COption_APIErrorZDecodeErrorZ
12696 typedef union LDKCResult_COption_APIErrorZDecodeErrorZPtr {
12698 * A pointer to the contents in the success state.
12699 * Reading from this pointer when `result_ok` is not set is undefined.
12701 struct LDKCOption_APIErrorZ *result;
12703 * A pointer to the contents in the error state.
12704 * Reading from this pointer when `result_ok` is set is undefined.
12706 struct LDKDecodeError *err;
12707 } LDKCResult_COption_APIErrorZDecodeErrorZPtr;
12710 * A CResult_COption_APIErrorZDecodeErrorZ represents the result of a fallible operation,
12711 * containing a crate::c_types::derived::COption_APIErrorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
12712 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12714 typedef struct LDKCResult_COption_APIErrorZDecodeErrorZ {
12716 * The contents of this CResult_COption_APIErrorZDecodeErrorZ, accessible via either
12717 * `err` or `result` depending on the state of `result_ok`.
12719 union LDKCResult_COption_APIErrorZDecodeErrorZPtr contents;
12721 * Whether this CResult_COption_APIErrorZDecodeErrorZ represents a success state.
12724 } LDKCResult_COption_APIErrorZDecodeErrorZ;
12727 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
12729 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
12731 * A pointer to the contents in the success state.
12732 * Reading from this pointer when `result_ok` is not set is undefined.
12734 struct LDKChannelMonitorUpdate *result;
12736 * A pointer to the contents in the error state.
12737 * Reading from this pointer when `result_ok` is set is undefined.
12739 struct LDKDecodeError *err;
12740 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
12743 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
12744 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
12745 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12747 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
12749 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
12750 * `err` or `result` depending on the state of `result_ok`.
12752 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
12754 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
12757 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
12760 * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
12762 typedef enum LDKCOption_MonitorEventZ_Tag {
12764 * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
12766 LDKCOption_MonitorEventZ_Some,
12768 * When we're in this state, this COption_MonitorEventZ contains nothing
12770 LDKCOption_MonitorEventZ_None,
12772 * Must be last for serialization purposes
12774 LDKCOption_MonitorEventZ_Sentinel,
12775 } LDKCOption_MonitorEventZ_Tag;
12777 typedef struct LDKCOption_MonitorEventZ {
12778 LDKCOption_MonitorEventZ_Tag tag;
12781 struct LDKMonitorEvent some;
12784 } LDKCOption_MonitorEventZ;
12787 * The contents of CResult_COption_MonitorEventZDecodeErrorZ
12789 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
12791 * A pointer to the contents in the success state.
12792 * Reading from this pointer when `result_ok` is not set is undefined.
12794 struct LDKCOption_MonitorEventZ *result;
12796 * A pointer to the contents in the error state.
12797 * Reading from this pointer when `result_ok` is set is undefined.
12799 struct LDKDecodeError *err;
12800 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
12803 * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
12804 * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
12805 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12807 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
12809 * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
12810 * `err` or `result` depending on the state of `result_ok`.
12812 union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
12814 * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
12817 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
12820 * The contents of CResult_HTLCUpdateDecodeErrorZ
12822 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
12824 * A pointer to the contents in the success state.
12825 * Reading from this pointer when `result_ok` is not set is undefined.
12827 struct LDKHTLCUpdate *result;
12829 * A pointer to the contents in the error state.
12830 * Reading from this pointer when `result_ok` is set is undefined.
12832 struct LDKDecodeError *err;
12833 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
12836 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
12837 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
12838 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12840 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
12842 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
12843 * `err` or `result` depending on the state of `result_ok`.
12845 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
12847 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
12850 } LDKCResult_HTLCUpdateDecodeErrorZ;
12853 * A tuple of 2 elements. See the individual fields for the types contained.
12855 typedef struct LDKC2Tuple_OutPointCVec_u8ZZ {
12857 * The element at position 0
12859 struct LDKOutPoint a;
12861 * The element at position 1
12863 struct LDKCVec_u8Z b;
12864 } LDKC2Tuple_OutPointCVec_u8ZZ;
12867 * A tuple of 2 elements. See the individual fields for the types contained.
12869 typedef struct LDKC2Tuple_u32CVec_u8ZZ {
12871 * The element at position 0
12875 * The element at position 1
12877 struct LDKCVec_u8Z b;
12878 } LDKC2Tuple_u32CVec_u8ZZ;
12881 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32CVec_u8ZZs of arbitrary size.
12882 * This corresponds to std::vector in C++
12884 typedef struct LDKCVec_C2Tuple_u32CVec_u8ZZZ {
12886 * The elements in the array.
12887 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12889 struct LDKC2Tuple_u32CVec_u8ZZ *data;
12891 * The number of elements pointed to by `data`.
12894 } LDKCVec_C2Tuple_u32CVec_u8ZZZ;
12897 * A tuple of 2 elements. See the individual fields for the types contained.
12899 typedef struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ {
12901 * The element at position 0
12903 struct LDKThirtyTwoBytes a;
12905 * The element at position 1
12907 struct LDKCVec_C2Tuple_u32CVec_u8ZZZ b;
12908 } LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ;
12911 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZs of arbitrary size.
12912 * This corresponds to std::vector in C++
12914 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ {
12916 * The elements in the array.
12917 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12919 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *data;
12921 * The number of elements pointed to by `data`.
12924 } LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ;
12927 * A dynamically-allocated array of crate::lightning::ln::chan_utils::CommitmentTransactions of arbitrary size.
12928 * This corresponds to std::vector in C++
12930 typedef struct LDKCVec_CommitmentTransactionZ {
12932 * The elements in the array.
12933 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12935 struct LDKCommitmentTransaction *data;
12937 * The number of elements pointed to by `data`.
12940 } LDKCVec_CommitmentTransactionZ;
12943 * A tuple of 2 elements. See the individual fields for the types contained.
12945 typedef struct LDKC2Tuple_u32TxOutZ {
12947 * The element at position 0
12951 * The element at position 1
12954 } LDKC2Tuple_u32TxOutZ;
12957 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
12958 * This corresponds to std::vector in C++
12960 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
12962 * The elements in the array.
12963 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12965 struct LDKC2Tuple_u32TxOutZ *data;
12967 * The number of elements pointed to by `data`.
12970 } LDKCVec_C2Tuple_u32TxOutZZ;
12973 * A tuple of 2 elements. See the individual fields for the types contained.
12975 typedef struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ {
12977 * The element at position 0
12979 struct LDKThirtyTwoBytes a;
12981 * The element at position 1
12983 struct LDKCVec_C2Tuple_u32TxOutZZ b;
12984 } LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ;
12987 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
12988 * This corresponds to std::vector in C++
12990 typedef struct LDKCVec_TransactionOutputsZ {
12992 * The elements in the array.
12993 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12995 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ *data;
12997 * The number of elements pointed to by `data`.
13000 } LDKCVec_TransactionOutputsZ;
13003 * Details about the balance(s) available for spending once the channel appears on chain.
13005 * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
13008 typedef enum LDKBalance_Tag {
13010 * The channel is not yet closed (or the commitment or closing transaction has not yet
13011 * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
13012 * force-closed now.
13014 LDKBalance_ClaimableOnChannelClose,
13016 * The channel has been closed, and the given balance is ours but awaiting confirmations until
13017 * we consider it spendable.
13019 LDKBalance_ClaimableAwaitingConfirmations,
13021 * The channel has been closed, and the given balance should be ours but awaiting spending
13022 * transaction confirmation. If the spending transaction does not confirm in time, it is
13023 * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
13025 * Once the spending transaction confirms, before it has reached enough confirmations to be
13026 * considered safe from chain reorganizations, the balance will instead be provided via
13027 * [`Balance::ClaimableAwaitingConfirmations`].
13029 LDKBalance_ContentiousClaimable,
13031 * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
13032 * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
13033 * likely to be claimed by our counterparty before we do.
13035 LDKBalance_MaybeTimeoutClaimableHTLC,
13037 * HTLCs which we received from our counterparty which are claimable with a preimage which we
13038 * do not currently have. This will only be claimable if we receive the preimage from the node
13039 * to which we forwarded this HTLC before the timeout.
13041 LDKBalance_MaybePreimageClaimableHTLC,
13043 * The channel has been closed, and our counterparty broadcasted a revoked commitment
13046 * Thus, we're able to claim all outputs in the commitment transaction, one of which has the
13047 * following amount.
13049 LDKBalance_CounterpartyRevokedOutputClaimable,
13051 * Must be last for serialization purposes
13053 LDKBalance_Sentinel,
13056 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
13058 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
13059 * required to do so.
13061 uint64_t amount_satoshis;
13062 } LDKBalance_LDKClaimableOnChannelClose_Body;
13064 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
13066 * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
13067 * were spent in broadcasting the transaction.
13069 uint64_t amount_satoshis;
13071 * The height at which an [`Event::SpendableOutputs`] event will be generated for this
13074 uint32_t confirmation_height;
13075 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
13077 typedef struct LDKBalance_LDKContentiousClaimable_Body {
13079 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
13080 * required to do so.
13082 uint64_t amount_satoshis;
13084 * The height at which the counterparty may be able to claim the balance if we have not
13087 uint32_t timeout_height;
13089 * The payment hash that locks this HTLC.
13091 struct LDKThirtyTwoBytes payment_hash;
13093 * The preimage that can be used to claim this HTLC.
13095 struct LDKThirtyTwoBytes payment_preimage;
13096 } LDKBalance_LDKContentiousClaimable_Body;
13098 typedef struct LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body {
13100 * The amount potentially available to claim, in satoshis, excluding the on-chain fees
13101 * which will be required to do so.
13103 uint64_t amount_satoshis;
13105 * The height at which we will be able to claim the balance if our counterparty has not
13108 uint32_t claimable_height;
13110 * The payment hash whose preimage our counterparty needs to claim this HTLC.
13112 struct LDKThirtyTwoBytes payment_hash;
13113 } LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body;
13115 typedef struct LDKBalance_LDKMaybePreimageClaimableHTLC_Body {
13117 * The amount potentially available to claim, in satoshis, excluding the on-chain fees
13118 * which will be required to do so.
13120 uint64_t amount_satoshis;
13122 * The height at which our counterparty will be able to claim the balance if we have not
13123 * yet received the preimage and claimed it ourselves.
13125 uint32_t expiry_height;
13127 * The payment hash whose preimage we need to claim this HTLC.
13129 struct LDKThirtyTwoBytes payment_hash;
13130 } LDKBalance_LDKMaybePreimageClaimableHTLC_Body;
13132 typedef struct LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body {
13134 * The amount, in satoshis, of the output which we can claim.
13136 * Note that for outputs from HTLC balances this may be excluding some on-chain fees that
13137 * were already spent.
13139 uint64_t amount_satoshis;
13140 } LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body;
13142 typedef struct MUST_USE_STRUCT LDKBalance {
13143 LDKBalance_Tag tag;
13145 LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
13146 LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
13147 LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
13148 LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body maybe_timeout_claimable_htlc;
13149 LDKBalance_LDKMaybePreimageClaimableHTLC_Body maybe_preimage_claimable_htlc;
13150 LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body counterparty_revoked_output_claimable;
13155 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
13156 * This corresponds to std::vector in C++
13158 typedef struct LDKCVec_BalanceZ {
13160 * The elements in the array.
13161 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13163 struct LDKBalance *data;
13165 * The number of elements pointed to by `data`.
13168 } LDKCVec_BalanceZ;
13171 * A tuple of 2 elements. See the individual fields for the types contained.
13173 typedef struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ {
13175 * The element at position 0
13177 struct LDKThirtyTwoBytes a;
13179 * The element at position 1
13181 struct LDKChannelMonitor b;
13182 } LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ;
13185 * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ
13187 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr {
13189 * A pointer to the contents in the success state.
13190 * Reading from this pointer when `result_ok` is not set is undefined.
13192 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *result;
13194 * A pointer to the contents in the error state.
13195 * Reading from this pointer when `result_ok` is set is undefined.
13197 struct LDKDecodeError *err;
13198 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr;
13201 * A CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
13202 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
13203 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13205 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ {
13207 * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ, accessible via either
13208 * `err` or `result` depending on the state of `result_ok`.
13210 union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr contents;
13212 * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ represents a success state.
13215 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ;
13218 * Defines a type identifier for sending messages over the wire.
13220 * Messages implementing this trait specify a type and must be [`Writeable`].
13222 typedef struct LDKType {
13224 * An opaque pointer which is passed to your function implementations as an argument.
13225 * This has no meaning in the LDK, and can be NULL or any other value.
13229 * Returns the type identifying the message payload.
13231 uint16_t (*type_id)(const void *this_arg);
13233 * Return a human-readable "debug" string describing this object
13235 struct LDKStr (*debug_str)(const void *this_arg);
13237 * Serialize the object into a byte array
13239 struct LDKCVec_u8Z (*write)(const void *this_arg);
13241 * Called, if set, after this Type has been cloned into a duplicate object.
13242 * The new Type is provided, and should be mutated as needed to perform a
13243 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
13245 void (*cloned)(struct LDKType *NONNULL_PTR new_Type);
13247 * Frees any resources associated with this object given its this_arg pointer.
13248 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13250 void (*free)(void *this_arg);
13254 * A tuple of 2 elements. See the individual fields for the types contained.
13256 typedef struct LDKC2Tuple_PublicKeyTypeZ {
13258 * The element at position 0
13260 struct LDKPublicKey a;
13262 * The element at position 1
13265 } LDKC2Tuple_PublicKeyTypeZ;
13268 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
13269 * This corresponds to std::vector in C++
13271 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
13273 * The elements in the array.
13274 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13276 struct LDKC2Tuple_PublicKeyTypeZ *data;
13278 * The number of elements pointed to by `data`.
13281 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
13284 * A tuple of 2 elements. See the individual fields for the types contained.
13286 typedef struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ {
13288 * The element at position 0
13290 struct LDKPublicKey a;
13292 * The element at position 1
13294 struct LDKCVec_SocketAddressZ b;
13295 } LDKC2Tuple_PublicKeyCVec_SocketAddressZZ;
13298 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyCVec_SocketAddressZZs of arbitrary size.
13299 * This corresponds to std::vector in C++
13301 typedef struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ {
13303 * The elements in the array.
13304 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13306 struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *data;
13308 * The number of elements pointed to by `data`.
13311 } LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ;
13314 * The contents of an onion message.
13316 typedef struct LDKOnionMessageContents {
13318 * An opaque pointer which is passed to your function implementations as an argument.
13319 * This has no meaning in the LDK, and can be NULL or any other value.
13323 * Returns the TLV type identifying the message contents. MUST be >= 64.
13325 uint64_t (*tlv_type)(const void *this_arg);
13327 * Serialize the object into a byte array
13329 struct LDKCVec_u8Z (*write)(const void *this_arg);
13331 * Return a human-readable "debug" string describing this object
13333 struct LDKStr (*debug_str)(const void *this_arg);
13335 * Called, if set, after this OnionMessageContents has been cloned into a duplicate object.
13336 * The new OnionMessageContents is provided, and should be mutated as needed to perform a
13337 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
13339 void (*cloned)(struct LDKOnionMessageContents *NONNULL_PTR new_OnionMessageContents);
13341 * Frees any resources associated with this object given its this_arg pointer.
13342 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13344 void (*free)(void *this_arg);
13345 } LDKOnionMessageContents;
13348 * An enum which can either contain a crate::lightning::onion_message::packet::OnionMessageContents or not
13350 typedef enum LDKCOption_OnionMessageContentsZ_Tag {
13352 * When we're in this state, this COption_OnionMessageContentsZ contains a crate::lightning::onion_message::packet::OnionMessageContents
13354 LDKCOption_OnionMessageContentsZ_Some,
13356 * When we're in this state, this COption_OnionMessageContentsZ contains nothing
13358 LDKCOption_OnionMessageContentsZ_None,
13360 * Must be last for serialization purposes
13362 LDKCOption_OnionMessageContentsZ_Sentinel,
13363 } LDKCOption_OnionMessageContentsZ_Tag;
13365 typedef struct LDKCOption_OnionMessageContentsZ {
13366 LDKCOption_OnionMessageContentsZ_Tag tag;
13369 struct LDKOnionMessageContents some;
13372 } LDKCOption_OnionMessageContentsZ;
13375 * The contents of CResult_COption_OnionMessageContentsZDecodeErrorZ
13377 typedef union LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr {
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 LDKCOption_OnionMessageContentsZ *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_COption_OnionMessageContentsZDecodeErrorZPtr;
13391 * A CResult_COption_OnionMessageContentsZDecodeErrorZ represents the result of a fallible operation,
13392 * containing a crate::c_types::derived::COption_OnionMessageContentsZ 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_COption_OnionMessageContentsZDecodeErrorZ {
13397 * The contents of this CResult_COption_OnionMessageContentsZDecodeErrorZ, accessible via either
13398 * `err` or `result` depending on the state of `result_ok`.
13400 union LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr contents;
13402 * Whether this CResult_COption_OnionMessageContentsZDecodeErrorZ represents a success state.
13405 } LDKCResult_COption_OnionMessageContentsZDecodeErrorZ;
13408 * A tuple of 3 elements. See the individual fields for the types contained.
13410 typedef struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ {
13412 * The element at position 0
13414 struct LDKOnionMessageContents a;
13416 * The element at position 1
13418 struct LDKDestination b;
13420 * The element at position 2
13422 struct LDKBlindedPath c;
13423 } LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ;
13426 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OnionMessageContentsDestinationBlindedPathZs of arbitrary size.
13427 * This corresponds to std::vector in C++
13429 typedef struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ {
13431 * The elements in the array.
13432 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13434 struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *data;
13436 * The number of elements pointed to by `data`.
13439 } LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ;
13442 * An enum which can either contain a crate::lightning::ln::wire::Type or not
13444 typedef enum LDKCOption_TypeZ_Tag {
13446 * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
13448 LDKCOption_TypeZ_Some,
13450 * When we're in this state, this COption_TypeZ contains nothing
13452 LDKCOption_TypeZ_None,
13454 * Must be last for serialization purposes
13456 LDKCOption_TypeZ_Sentinel,
13457 } LDKCOption_TypeZ_Tag;
13459 typedef struct LDKCOption_TypeZ {
13460 LDKCOption_TypeZ_Tag tag;
13463 struct LDKType some;
13466 } LDKCOption_TypeZ;
13469 * The contents of CResult_COption_TypeZDecodeErrorZ
13471 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
13473 * A pointer to the contents in the success state.
13474 * Reading from this pointer when `result_ok` is not set is undefined.
13476 struct LDKCOption_TypeZ *result;
13478 * A pointer to the contents in the error state.
13479 * Reading from this pointer when `result_ok` is set is undefined.
13481 struct LDKDecodeError *err;
13482 } LDKCResult_COption_TypeZDecodeErrorZPtr;
13485 * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
13486 * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
13487 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13489 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
13491 * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
13492 * `err` or `result` depending on the state of `result_ok`.
13494 union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
13496 * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
13499 } LDKCResult_COption_TypeZDecodeErrorZ;
13502 * An enum which can either contain a crate::lightning::ln::msgs::SocketAddress or not
13504 typedef enum LDKCOption_SocketAddressZ_Tag {
13506 * When we're in this state, this COption_SocketAddressZ contains a crate::lightning::ln::msgs::SocketAddress
13508 LDKCOption_SocketAddressZ_Some,
13510 * When we're in this state, this COption_SocketAddressZ contains nothing
13512 LDKCOption_SocketAddressZ_None,
13514 * Must be last for serialization purposes
13516 LDKCOption_SocketAddressZ_Sentinel,
13517 } LDKCOption_SocketAddressZ_Tag;
13519 typedef struct LDKCOption_SocketAddressZ {
13520 LDKCOption_SocketAddressZ_Tag tag;
13523 struct LDKSocketAddress some;
13526 } LDKCOption_SocketAddressZ;
13531 * Details of a connected peer as returned by [`PeerManager::list_peers`].
13533 typedef struct MUST_USE_STRUCT LDKPeerDetails {
13535 * A pointer to the opaque Rust object.
13536 * Nearly everywhere, inner must be non-null, however in places where
13537 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13539 LDKnativePeerDetails *inner;
13541 * Indicates that this is the only struct which contains the same pointer.
13542 * Rust functions which take ownership of an object provided via an argument require
13543 * this to be true and invalidate the object pointed to by inner.
13549 * A dynamically-allocated array of crate::lightning::ln::peer_handler::PeerDetailss of arbitrary size.
13550 * This corresponds to std::vector in C++
13552 typedef struct LDKCVec_PeerDetailsZ {
13554 * The elements in the array.
13555 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13557 struct LDKPeerDetails *data;
13559 * The number of elements pointed to by `data`.
13562 } LDKCVec_PeerDetailsZ;
13567 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
13568 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
13571 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
13573 * A pointer to the opaque Rust object.
13574 * Nearly everywhere, inner must be non-null, however in places where
13575 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13577 LDKnativePeerHandleError *inner;
13579 * Indicates that this is the only struct which contains the same pointer.
13580 * Rust functions which take ownership of an object provided via an argument require
13581 * this to be true and invalidate the object pointed to by inner.
13584 } LDKPeerHandleError;
13587 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
13589 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
13591 * A pointer to the contents in the success state.
13592 * Reading from this pointer when `result_ok` is not set is undefined.
13594 struct LDKCVec_u8Z *result;
13596 * A pointer to the contents in the error state.
13597 * Reading from this pointer when `result_ok` is set is undefined.
13599 struct LDKPeerHandleError *err;
13600 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
13603 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
13604 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
13605 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13607 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
13609 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
13610 * `err` or `result` depending on the state of `result_ok`.
13612 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
13614 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
13617 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
13620 * The contents of CResult_NonePeerHandleErrorZ
13622 typedef union LDKCResult_NonePeerHandleErrorZPtr {
13624 * Note that this value is always NULL, as there are no contents in the OK variant
13628 * A pointer to the contents in the error state.
13629 * Reading from this pointer when `result_ok` is set is undefined.
13631 struct LDKPeerHandleError *err;
13632 } LDKCResult_NonePeerHandleErrorZPtr;
13635 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
13636 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
13637 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13639 typedef struct LDKCResult_NonePeerHandleErrorZ {
13641 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
13642 * `err` or `result` depending on the state of `result_ok`.
13644 union LDKCResult_NonePeerHandleErrorZPtr contents;
13646 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
13649 } LDKCResult_NonePeerHandleErrorZ;
13652 * The contents of CResult_boolPeerHandleErrorZ
13654 typedef union LDKCResult_boolPeerHandleErrorZPtr {
13656 * A pointer to the contents in the success state.
13657 * Reading from this pointer when `result_ok` is not set is undefined.
13661 * A pointer to the contents in the error state.
13662 * Reading from this pointer when `result_ok` is set is undefined.
13664 struct LDKPeerHandleError *err;
13665 } LDKCResult_boolPeerHandleErrorZPtr;
13668 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
13669 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
13670 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13672 typedef struct LDKCResult_boolPeerHandleErrorZ {
13674 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
13675 * `err` or `result` depending on the state of `result_ok`.
13677 union LDKCResult_boolPeerHandleErrorZPtr contents;
13679 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
13682 } LDKCResult_boolPeerHandleErrorZ;
13685 * All-encompassing standard error type that processing can return
13687 typedef enum LDKGraphSyncError_Tag {
13689 * Error trying to read the update data, typically due to an erroneous data length indication
13690 * that is greater than the actual amount of data provided
13692 LDKGraphSyncError_DecodeError,
13694 * Error applying the patch to the network graph, usually the result of updates that are too
13695 * old or missing prerequisite data to the application of updates out of order
13697 LDKGraphSyncError_LightningError,
13699 * Must be last for serialization purposes
13701 LDKGraphSyncError_Sentinel,
13702 } LDKGraphSyncError_Tag;
13704 typedef struct MUST_USE_STRUCT LDKGraphSyncError {
13705 LDKGraphSyncError_Tag tag;
13708 struct LDKDecodeError decode_error;
13711 struct LDKLightningError lightning_error;
13714 } LDKGraphSyncError;
13717 * The contents of CResult_u32GraphSyncErrorZ
13719 typedef union LDKCResult_u32GraphSyncErrorZPtr {
13721 * A pointer to the contents in the success state.
13722 * Reading from this pointer when `result_ok` is not set is undefined.
13726 * A pointer to the contents in the error state.
13727 * Reading from this pointer when `result_ok` is set is undefined.
13729 struct LDKGraphSyncError *err;
13730 } LDKCResult_u32GraphSyncErrorZPtr;
13733 * A CResult_u32GraphSyncErrorZ represents the result of a fallible operation,
13734 * containing a u32 on success and a crate::lightning_rapid_gossip_sync::GraphSyncError on failure.
13735 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13737 typedef struct LDKCResult_u32GraphSyncErrorZ {
13739 * The contents of this CResult_u32GraphSyncErrorZ, accessible via either
13740 * `err` or `result` depending on the state of `result_ok`.
13742 union LDKCResult_u32GraphSyncErrorZPtr contents;
13744 * Whether this CResult_u32GraphSyncErrorZ represents a success state.
13747 } LDKCResult_u32GraphSyncErrorZ;
13750 * The contents of CResult_CVec_u8ZIOErrorZ
13752 typedef union LDKCResult_CVec_u8ZIOErrorZPtr {
13754 * A pointer to the contents in the success state.
13755 * Reading from this pointer when `result_ok` is not set is undefined.
13757 struct LDKCVec_u8Z *result;
13759 * A pointer to the contents in the error state.
13760 * Reading from this pointer when `result_ok` is set is undefined.
13762 enum LDKIOError *err;
13763 } LDKCResult_CVec_u8ZIOErrorZPtr;
13766 * A CResult_CVec_u8ZIOErrorZ represents the result of a fallible operation,
13767 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::c_types::IOError on failure.
13768 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13770 typedef struct LDKCResult_CVec_u8ZIOErrorZ {
13772 * The contents of this CResult_CVec_u8ZIOErrorZ, accessible via either
13773 * `err` or `result` depending on the state of `result_ok`.
13775 union LDKCResult_CVec_u8ZIOErrorZPtr contents;
13777 * Whether this CResult_CVec_u8ZIOErrorZ represents a success state.
13780 } LDKCResult_CVec_u8ZIOErrorZ;
13783 * A dynamically-allocated array of crate::c_types::Strs of arbitrary size.
13784 * This corresponds to std::vector in C++
13786 typedef struct LDKCVec_StrZ {
13788 * The elements in the array.
13789 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13791 struct LDKStr *data;
13793 * The number of elements pointed to by `data`.
13799 * The contents of CResult_CVec_StrZIOErrorZ
13801 typedef union LDKCResult_CVec_StrZIOErrorZPtr {
13803 * A pointer to the contents in the success state.
13804 * Reading from this pointer when `result_ok` is not set is undefined.
13806 struct LDKCVec_StrZ *result;
13808 * A pointer to the contents in the error state.
13809 * Reading from this pointer when `result_ok` is set is undefined.
13811 enum LDKIOError *err;
13812 } LDKCResult_CVec_StrZIOErrorZPtr;
13815 * A CResult_CVec_StrZIOErrorZ represents the result of a fallible operation,
13816 * containing a crate::c_types::derived::CVec_StrZ on success and a crate::c_types::IOError on failure.
13817 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13819 typedef struct LDKCResult_CVec_StrZIOErrorZ {
13821 * The contents of this CResult_CVec_StrZIOErrorZ, accessible via either
13822 * `err` or `result` depending on the state of `result_ok`.
13824 union LDKCResult_CVec_StrZIOErrorZPtr contents;
13826 * Whether this CResult_CVec_StrZIOErrorZ represents a success state.
13829 } LDKCResult_CVec_StrZIOErrorZ;
13832 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZs of arbitrary size.
13833 * This corresponds to std::vector in C++
13835 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ {
13837 * The elements in the array.
13838 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13840 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *data;
13842 * The number of elements pointed to by `data`.
13845 } LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ;
13848 * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ
13850 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr {
13852 * A pointer to the contents in the success state.
13853 * Reading from this pointer when `result_ok` is not set is undefined.
13855 struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ *result;
13857 * A pointer to the contents in the error state.
13858 * Reading from this pointer when `result_ok` is set is undefined.
13860 enum LDKIOError *err;
13861 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr;
13864 * A CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ represents the result of a fallible operation,
13865 * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ on success and a crate::c_types::IOError on failure.
13866 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13868 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ {
13870 * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ, accessible via either
13871 * `err` or `result` depending on the state of `result_ok`.
13873 union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr contents;
13875 * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ represents a success state.
13878 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ;
13881 * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ
13883 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr {
13885 * A pointer to the contents in the success state.
13886 * Reading from this pointer when `result_ok` is not set is undefined.
13888 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *result;
13890 * A pointer to the contents in the error state.
13891 * Reading from this pointer when `result_ok` is set is undefined.
13893 enum LDKIOError *err;
13894 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr;
13897 * A CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ represents the result of a fallible operation,
13898 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZ on success and a crate::c_types::IOError on failure.
13899 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13901 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ {
13903 * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ, accessible via either
13904 * `err` or `result` depending on the state of `result_ok`.
13906 union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr contents;
13908 * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ represents a success state.
13911 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ;
13914 * The contents of CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ
13916 typedef union LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZPtr {
13918 * A pointer to the contents in the success state.
13919 * Reading from this pointer when `result_ok` is not set is undefined.
13921 struct LDKUnsignedInvoiceRequest *result;
13923 * A pointer to the contents in the error state.
13924 * Reading from this pointer when `result_ok` is set is undefined.
13926 enum LDKBolt12SemanticError *err;
13927 } LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZPtr;
13930 * A CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ represents the result of a fallible operation,
13931 * containing a crate::lightning::offers::invoice_request::UnsignedInvoiceRequest on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
13932 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13934 typedef struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ {
13936 * The contents of this CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ, accessible via either
13937 * `err` or `result` depending on the state of `result_ok`.
13939 union LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZPtr contents;
13941 * Whether this CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ represents a success state.
13944 } LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ;
13947 * The contents of CResult_InvoiceRequestBolt12SemanticErrorZ
13949 typedef union LDKCResult_InvoiceRequestBolt12SemanticErrorZPtr {
13951 * A pointer to the contents in the success state.
13952 * Reading from this pointer when `result_ok` is not set is undefined.
13954 struct LDKInvoiceRequest *result;
13956 * A pointer to the contents in the error state.
13957 * Reading from this pointer when `result_ok` is set is undefined.
13959 enum LDKBolt12SemanticError *err;
13960 } LDKCResult_InvoiceRequestBolt12SemanticErrorZPtr;
13963 * A CResult_InvoiceRequestBolt12SemanticErrorZ represents the result of a fallible operation,
13964 * containing a crate::lightning::offers::invoice_request::InvoiceRequest on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
13965 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13967 typedef struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ {
13969 * The contents of this CResult_InvoiceRequestBolt12SemanticErrorZ, accessible via either
13970 * `err` or `result` depending on the state of `result_ok`.
13972 union LDKCResult_InvoiceRequestBolt12SemanticErrorZPtr contents;
13974 * Whether this CResult_InvoiceRequestBolt12SemanticErrorZ represents a success state.
13977 } LDKCResult_InvoiceRequestBolt12SemanticErrorZ;
13980 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
13982 typedef struct LDKSecretKey {
13984 * The bytes of the secret key
13990 * An enum which can either contain a crate::c_types::SecretKey or not
13992 typedef enum LDKCOption_SecretKeyZ_Tag {
13994 * When we're in this state, this COption_SecretKeyZ contains a crate::c_types::SecretKey
13996 LDKCOption_SecretKeyZ_Some,
13998 * When we're in this state, this COption_SecretKeyZ contains nothing
14000 LDKCOption_SecretKeyZ_None,
14002 * Must be last for serialization purposes
14004 LDKCOption_SecretKeyZ_Sentinel,
14005 } LDKCOption_SecretKeyZ_Tag;
14007 typedef struct LDKCOption_SecretKeyZ {
14008 LDKCOption_SecretKeyZ_Tag tag;
14011 struct LDKSecretKey some;
14014 } LDKCOption_SecretKeyZ;
14019 * Builds a [`Bolt12Invoice`] from either:
14020 * - an [`InvoiceRequest`] for the \"offer to be paid\" flow or
14021 * - a [`Refund`] for the \"offer for money\" flow.
14023 * See [module-level documentation] for usage.
14025 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
14026 * [`Refund`]: crate::offers::refund::Refund
14027 * [module-level documentation]: self
14029 typedef struct MUST_USE_STRUCT LDKInvoiceWithExplicitSigningPubkeyBuilder {
14031 * A pointer to the opaque Rust object.
14032 * Nearly everywhere, inner must be non-null, however in places where
14033 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14035 LDKnativeInvoiceWithExplicitSigningPubkeyBuilder *inner;
14037 * Indicates that this is the only struct which contains the same pointer.
14038 * Rust functions which take ownership of an object provided via an argument require
14039 * this to be true and invalidate the object pointed to by inner.
14042 } LDKInvoiceWithExplicitSigningPubkeyBuilder;
14045 * The contents of CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ
14047 typedef union LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZPtr {
14049 * A pointer to the contents in the success state.
14050 * Reading from this pointer when `result_ok` is not set is undefined.
14052 struct LDKInvoiceWithExplicitSigningPubkeyBuilder *result;
14054 * A pointer to the contents in the error state.
14055 * Reading from this pointer when `result_ok` is set is undefined.
14057 enum LDKBolt12SemanticError *err;
14058 } LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZPtr;
14061 * A CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
14062 * containing a crate::lightning::offers::invoice::InvoiceWithExplicitSigningPubkeyBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
14063 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14065 typedef struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ {
14067 * The contents of this CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ, accessible via either
14068 * `err` or `result` depending on the state of `result_ok`.
14070 union LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZPtr contents;
14072 * Whether this CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ represents a success state.
14075 } LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ;
14080 * An [`InvoiceRequest`] that has been verified by [`InvoiceRequest::verify`] and exposes different
14081 * ways to respond depending on whether the signing keys were derived.
14083 typedef struct MUST_USE_STRUCT LDKVerifiedInvoiceRequest {
14085 * A pointer to the opaque Rust object.
14086 * Nearly everywhere, inner must be non-null, however in places where
14087 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14089 LDKnativeVerifiedInvoiceRequest *inner;
14091 * Indicates that this is the only struct which contains the same pointer.
14092 * Rust functions which take ownership of an object provided via an argument require
14093 * this to be true and invalidate the object pointed to by inner.
14096 } LDKVerifiedInvoiceRequest;
14099 * The contents of CResult_VerifiedInvoiceRequestNoneZ
14101 typedef union LDKCResult_VerifiedInvoiceRequestNoneZPtr {
14103 * A pointer to the contents in the success state.
14104 * Reading from this pointer when `result_ok` is not set is undefined.
14106 struct LDKVerifiedInvoiceRequest *result;
14108 * Note that this value is always NULL, as there are no contents in the Err variant
14111 } LDKCResult_VerifiedInvoiceRequestNoneZPtr;
14114 * A CResult_VerifiedInvoiceRequestNoneZ represents the result of a fallible operation,
14115 * containing a crate::lightning::offers::invoice_request::VerifiedInvoiceRequest on success and a () on failure.
14116 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14118 typedef struct LDKCResult_VerifiedInvoiceRequestNoneZ {
14120 * The contents of this CResult_VerifiedInvoiceRequestNoneZ, accessible via either
14121 * `err` or `result` depending on the state of `result_ok`.
14123 union LDKCResult_VerifiedInvoiceRequestNoneZPtr contents;
14125 * Whether this CResult_VerifiedInvoiceRequestNoneZ represents a success state.
14128 } LDKCResult_VerifiedInvoiceRequestNoneZ;
14133 * Builds a [`Bolt12Invoice`] from either:
14134 * - an [`InvoiceRequest`] for the \"offer to be paid\" flow or
14135 * - a [`Refund`] for the \"offer for money\" flow.
14137 * See [module-level documentation] for usage.
14139 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
14140 * [`Refund`]: crate::offers::refund::Refund
14141 * [module-level documentation]: self
14143 typedef struct MUST_USE_STRUCT LDKInvoiceWithDerivedSigningPubkeyBuilder {
14145 * A pointer to the opaque Rust object.
14146 * Nearly everywhere, inner must be non-null, however in places where
14147 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14149 LDKnativeInvoiceWithDerivedSigningPubkeyBuilder *inner;
14151 * Indicates that this is the only struct which contains the same pointer.
14152 * Rust functions which take ownership of an object provided via an argument require
14153 * this to be true and invalidate the object pointed to by inner.
14156 } LDKInvoiceWithDerivedSigningPubkeyBuilder;
14159 * The contents of CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ
14161 typedef union LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZPtr {
14163 * A pointer to the contents in the success state.
14164 * Reading from this pointer when `result_ok` is not set is undefined.
14166 struct LDKInvoiceWithDerivedSigningPubkeyBuilder *result;
14168 * A pointer to the contents in the error state.
14169 * Reading from this pointer when `result_ok` is set is undefined.
14171 enum LDKBolt12SemanticError *err;
14172 } LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZPtr;
14175 * A CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
14176 * containing a crate::lightning::offers::invoice::InvoiceWithDerivedSigningPubkeyBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
14177 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14179 typedef struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ {
14181 * The contents of this CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ, accessible via either
14182 * `err` or `result` depending on the state of `result_ok`.
14184 union LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZPtr contents;
14186 * Whether this CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ represents a success state.
14189 } LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ;
14194 * Fields sent in an [`InvoiceRequest`] message to include in [`PaymentContext::Bolt12Offer`].
14196 * [`PaymentContext::Bolt12Offer`]: crate::blinded_path::payment::PaymentContext::Bolt12Offer
14198 typedef struct MUST_USE_STRUCT LDKInvoiceRequestFields {
14200 * A pointer to the opaque Rust object.
14201 * Nearly everywhere, inner must be non-null, however in places where
14202 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14204 LDKnativeInvoiceRequestFields *inner;
14206 * Indicates that this is the only struct which contains the same pointer.
14207 * Rust functions which take ownership of an object provided via an argument require
14208 * this to be true and invalidate the object pointed to by inner.
14211 } LDKInvoiceRequestFields;
14214 * The contents of CResult_InvoiceRequestFieldsDecodeErrorZ
14216 typedef union LDKCResult_InvoiceRequestFieldsDecodeErrorZPtr {
14218 * A pointer to the contents in the success state.
14219 * Reading from this pointer when `result_ok` is not set is undefined.
14221 struct LDKInvoiceRequestFields *result;
14223 * A pointer to the contents in the error state.
14224 * Reading from this pointer when `result_ok` is set is undefined.
14226 struct LDKDecodeError *err;
14227 } LDKCResult_InvoiceRequestFieldsDecodeErrorZPtr;
14230 * A CResult_InvoiceRequestFieldsDecodeErrorZ represents the result of a fallible operation,
14231 * containing a crate::lightning::offers::invoice_request::InvoiceRequestFields on success and a crate::lightning::ln::msgs::DecodeError on failure.
14232 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14234 typedef struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ {
14236 * The contents of this CResult_InvoiceRequestFieldsDecodeErrorZ, accessible via either
14237 * `err` or `result` depending on the state of `result_ok`.
14239 union LDKCResult_InvoiceRequestFieldsDecodeErrorZPtr contents;
14241 * Whether this CResult_InvoiceRequestFieldsDecodeErrorZ represents a success state.
14244 } LDKCResult_InvoiceRequestFieldsDecodeErrorZ;
14247 * A dynamically-allocated array of crate::c_types::Witnesss of arbitrary size.
14248 * This corresponds to std::vector in C++
14250 typedef struct LDKCVec_WitnessZ {
14252 * The elements in the array.
14253 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14255 struct LDKWitness *data;
14257 * The number of elements pointed to by `data`.
14260 } LDKCVec_WitnessZ;
14263 * An enum which can either contain a crate::c_types::ECDSASignature or not
14265 typedef enum LDKCOption_ECDSASignatureZ_Tag {
14267 * When we're in this state, this COption_ECDSASignatureZ contains a crate::c_types::ECDSASignature
14269 LDKCOption_ECDSASignatureZ_Some,
14271 * When we're in this state, this COption_ECDSASignatureZ contains nothing
14273 LDKCOption_ECDSASignatureZ_None,
14275 * Must be last for serialization purposes
14277 LDKCOption_ECDSASignatureZ_Sentinel,
14278 } LDKCOption_ECDSASignatureZ_Tag;
14280 typedef struct LDKCOption_ECDSASignatureZ {
14281 LDKCOption_ECDSASignatureZ_Tag tag;
14284 struct LDKECDSASignature some;
14287 } LDKCOption_ECDSASignatureZ;
14290 * An enum which can either contain a i64 or not
14292 typedef enum LDKCOption_i64Z_Tag {
14294 * When we're in this state, this COption_i64Z contains a i64
14296 LDKCOption_i64Z_Some,
14298 * When we're in this state, this COption_i64Z contains nothing
14300 LDKCOption_i64Z_None,
14302 * Must be last for serialization purposes
14304 LDKCOption_i64Z_Sentinel,
14305 } LDKCOption_i64Z_Tag;
14307 typedef struct LDKCOption_i64Z {
14308 LDKCOption_i64Z_Tag tag;
14317 * The contents of CResult_SocketAddressDecodeErrorZ
14319 typedef union LDKCResult_SocketAddressDecodeErrorZPtr {
14321 * A pointer to the contents in the success state.
14322 * Reading from this pointer when `result_ok` is not set is undefined.
14324 struct LDKSocketAddress *result;
14326 * A pointer to the contents in the error state.
14327 * Reading from this pointer when `result_ok` is set is undefined.
14329 struct LDKDecodeError *err;
14330 } LDKCResult_SocketAddressDecodeErrorZPtr;
14333 * A CResult_SocketAddressDecodeErrorZ represents the result of a fallible operation,
14334 * containing a crate::lightning::ln::msgs::SocketAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
14335 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14337 typedef struct LDKCResult_SocketAddressDecodeErrorZ {
14339 * The contents of this CResult_SocketAddressDecodeErrorZ, accessible via either
14340 * `err` or `result` depending on the state of `result_ok`.
14342 union LDKCResult_SocketAddressDecodeErrorZPtr contents;
14344 * Whether this CResult_SocketAddressDecodeErrorZ represents a success state.
14347 } LDKCResult_SocketAddressDecodeErrorZ;
14350 * The contents of CResult_SocketAddressSocketAddressParseErrorZ
14352 typedef union LDKCResult_SocketAddressSocketAddressParseErrorZPtr {
14354 * A pointer to the contents in the success state.
14355 * Reading from this pointer when `result_ok` is not set is undefined.
14357 struct LDKSocketAddress *result;
14359 * A pointer to the contents in the error state.
14360 * Reading from this pointer when `result_ok` is set is undefined.
14362 enum LDKSocketAddressParseError *err;
14363 } LDKCResult_SocketAddressSocketAddressParseErrorZPtr;
14366 * A CResult_SocketAddressSocketAddressParseErrorZ represents the result of a fallible operation,
14367 * containing a crate::lightning::ln::msgs::SocketAddress on success and a crate::lightning::ln::msgs::SocketAddressParseError on failure.
14368 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14370 typedef struct LDKCResult_SocketAddressSocketAddressParseErrorZ {
14372 * The contents of this CResult_SocketAddressSocketAddressParseErrorZ, accessible via either
14373 * `err` or `result` depending on the state of `result_ok`.
14375 union LDKCResult_SocketAddressSocketAddressParseErrorZPtr contents;
14377 * Whether this CResult_SocketAddressSocketAddressParseErrorZ represents a success state.
14380 } LDKCResult_SocketAddressSocketAddressParseErrorZ;
14385 * An [`update_add_htlc`] message to be sent to or received from a peer.
14387 * [`update_add_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#adding-an-htlc-update_add_htlc
14389 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
14391 * A pointer to the opaque Rust object.
14392 * Nearly everywhere, inner must be non-null, however in places where
14393 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14395 LDKnativeUpdateAddHTLC *inner;
14397 * Indicates that this is the only struct which contains the same pointer.
14398 * Rust functions which take ownership of an object provided via an argument require
14399 * this to be true and invalidate the object pointed to by inner.
14402 } LDKUpdateAddHTLC;
14405 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
14406 * This corresponds to std::vector in C++
14408 typedef struct LDKCVec_UpdateAddHTLCZ {
14410 * The elements in the array.
14411 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14413 struct LDKUpdateAddHTLC *data;
14415 * The number of elements pointed to by `data`.
14418 } LDKCVec_UpdateAddHTLCZ;
14423 * An [`update_fulfill_htlc`] message to be sent to or received from a peer.
14425 * [`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
14427 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
14429 * A pointer to the opaque Rust object.
14430 * Nearly everywhere, inner must be non-null, however in places where
14431 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14433 LDKnativeUpdateFulfillHTLC *inner;
14435 * Indicates that this is the only struct which contains the same pointer.
14436 * Rust functions which take ownership of an object provided via an argument require
14437 * this to be true and invalidate the object pointed to by inner.
14440 } LDKUpdateFulfillHTLC;
14443 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
14444 * This corresponds to std::vector in C++
14446 typedef struct LDKCVec_UpdateFulfillHTLCZ {
14448 * The elements in the array.
14449 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14451 struct LDKUpdateFulfillHTLC *data;
14453 * The number of elements pointed to by `data`.
14456 } LDKCVec_UpdateFulfillHTLCZ;
14461 * An [`update_fail_htlc`] message to be sent to or received from a peer.
14463 * [`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
14465 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
14467 * A pointer to the opaque Rust object.
14468 * Nearly everywhere, inner must be non-null, however in places where
14469 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14471 LDKnativeUpdateFailHTLC *inner;
14473 * Indicates that this is the only struct which contains the same pointer.
14474 * Rust functions which take ownership of an object provided via an argument require
14475 * this to be true and invalidate the object pointed to by inner.
14478 } LDKUpdateFailHTLC;
14481 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
14482 * This corresponds to std::vector in C++
14484 typedef struct LDKCVec_UpdateFailHTLCZ {
14486 * The elements in the array.
14487 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14489 struct LDKUpdateFailHTLC *data;
14491 * The number of elements pointed to by `data`.
14494 } LDKCVec_UpdateFailHTLCZ;
14499 * An [`update_fail_malformed_htlc`] message to be sent to or received from a peer.
14501 * [`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
14503 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
14505 * A pointer to the opaque Rust object.
14506 * Nearly everywhere, inner must be non-null, however in places where
14507 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14509 LDKnativeUpdateFailMalformedHTLC *inner;
14511 * Indicates that this is the only struct which contains the same pointer.
14512 * Rust functions which take ownership of an object provided via an argument require
14513 * this to be true and invalidate the object pointed to by inner.
14516 } LDKUpdateFailMalformedHTLC;
14519 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
14520 * This corresponds to std::vector in C++
14522 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
14524 * The elements in the array.
14525 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14527 struct LDKUpdateFailMalformedHTLC *data;
14529 * The number of elements pointed to by `data`.
14532 } LDKCVec_UpdateFailMalformedHTLCZ;
14535 * The contents of CResult_AcceptChannelDecodeErrorZ
14537 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
14539 * A pointer to the contents in the success state.
14540 * Reading from this pointer when `result_ok` is not set is undefined.
14542 struct LDKAcceptChannel *result;
14544 * A pointer to the contents in the error state.
14545 * Reading from this pointer when `result_ok` is set is undefined.
14547 struct LDKDecodeError *err;
14548 } LDKCResult_AcceptChannelDecodeErrorZPtr;
14551 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
14552 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
14553 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14555 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
14557 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
14558 * `err` or `result` depending on the state of `result_ok`.
14560 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
14562 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
14565 } LDKCResult_AcceptChannelDecodeErrorZ;
14568 * The contents of CResult_AcceptChannelV2DecodeErrorZ
14570 typedef union LDKCResult_AcceptChannelV2DecodeErrorZPtr {
14572 * A pointer to the contents in the success state.
14573 * Reading from this pointer when `result_ok` is not set is undefined.
14575 struct LDKAcceptChannelV2 *result;
14577 * A pointer to the contents in the error state.
14578 * Reading from this pointer when `result_ok` is set is undefined.
14580 struct LDKDecodeError *err;
14581 } LDKCResult_AcceptChannelV2DecodeErrorZPtr;
14584 * A CResult_AcceptChannelV2DecodeErrorZ represents the result of a fallible operation,
14585 * containing a crate::lightning::ln::msgs::AcceptChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
14586 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14588 typedef struct LDKCResult_AcceptChannelV2DecodeErrorZ {
14590 * The contents of this CResult_AcceptChannelV2DecodeErrorZ, accessible via either
14591 * `err` or `result` depending on the state of `result_ok`.
14593 union LDKCResult_AcceptChannelV2DecodeErrorZPtr contents;
14595 * Whether this CResult_AcceptChannelV2DecodeErrorZ represents a success state.
14598 } LDKCResult_AcceptChannelV2DecodeErrorZ;
14601 * The contents of CResult_StfuDecodeErrorZ
14603 typedef union LDKCResult_StfuDecodeErrorZPtr {
14605 * A pointer to the contents in the success state.
14606 * Reading from this pointer when `result_ok` is not set is undefined.
14608 struct LDKStfu *result;
14610 * A pointer to the contents in the error state.
14611 * Reading from this pointer when `result_ok` is set is undefined.
14613 struct LDKDecodeError *err;
14614 } LDKCResult_StfuDecodeErrorZPtr;
14617 * A CResult_StfuDecodeErrorZ represents the result of a fallible operation,
14618 * containing a crate::lightning::ln::msgs::Stfu on success and a crate::lightning::ln::msgs::DecodeError on failure.
14619 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14621 typedef struct LDKCResult_StfuDecodeErrorZ {
14623 * The contents of this CResult_StfuDecodeErrorZ, accessible via either
14624 * `err` or `result` depending on the state of `result_ok`.
14626 union LDKCResult_StfuDecodeErrorZPtr contents;
14628 * Whether this CResult_StfuDecodeErrorZ represents a success state.
14631 } LDKCResult_StfuDecodeErrorZ;
14634 * The contents of CResult_SpliceDecodeErrorZ
14636 typedef union LDKCResult_SpliceDecodeErrorZPtr {
14638 * A pointer to the contents in the success state.
14639 * Reading from this pointer when `result_ok` is not set is undefined.
14641 struct LDKSplice *result;
14643 * A pointer to the contents in the error state.
14644 * Reading from this pointer when `result_ok` is set is undefined.
14646 struct LDKDecodeError *err;
14647 } LDKCResult_SpliceDecodeErrorZPtr;
14650 * A CResult_SpliceDecodeErrorZ represents the result of a fallible operation,
14651 * containing a crate::lightning::ln::msgs::Splice on success and a crate::lightning::ln::msgs::DecodeError on failure.
14652 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14654 typedef struct LDKCResult_SpliceDecodeErrorZ {
14656 * The contents of this CResult_SpliceDecodeErrorZ, accessible via either
14657 * `err` or `result` depending on the state of `result_ok`.
14659 union LDKCResult_SpliceDecodeErrorZPtr contents;
14661 * Whether this CResult_SpliceDecodeErrorZ represents a success state.
14664 } LDKCResult_SpliceDecodeErrorZ;
14667 * The contents of CResult_SpliceAckDecodeErrorZ
14669 typedef union LDKCResult_SpliceAckDecodeErrorZPtr {
14671 * A pointer to the contents in the success state.
14672 * Reading from this pointer when `result_ok` is not set is undefined.
14674 struct LDKSpliceAck *result;
14676 * A pointer to the contents in the error state.
14677 * Reading from this pointer when `result_ok` is set is undefined.
14679 struct LDKDecodeError *err;
14680 } LDKCResult_SpliceAckDecodeErrorZPtr;
14683 * A CResult_SpliceAckDecodeErrorZ represents the result of a fallible operation,
14684 * containing a crate::lightning::ln::msgs::SpliceAck on success and a crate::lightning::ln::msgs::DecodeError on failure.
14685 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14687 typedef struct LDKCResult_SpliceAckDecodeErrorZ {
14689 * The contents of this CResult_SpliceAckDecodeErrorZ, accessible via either
14690 * `err` or `result` depending on the state of `result_ok`.
14692 union LDKCResult_SpliceAckDecodeErrorZPtr contents;
14694 * Whether this CResult_SpliceAckDecodeErrorZ represents a success state.
14697 } LDKCResult_SpliceAckDecodeErrorZ;
14700 * The contents of CResult_SpliceLockedDecodeErrorZ
14702 typedef union LDKCResult_SpliceLockedDecodeErrorZPtr {
14704 * A pointer to the contents in the success state.
14705 * Reading from this pointer when `result_ok` is not set is undefined.
14707 struct LDKSpliceLocked *result;
14709 * A pointer to the contents in the error state.
14710 * Reading from this pointer when `result_ok` is set is undefined.
14712 struct LDKDecodeError *err;
14713 } LDKCResult_SpliceLockedDecodeErrorZPtr;
14716 * A CResult_SpliceLockedDecodeErrorZ represents the result of a fallible operation,
14717 * containing a crate::lightning::ln::msgs::SpliceLocked on success and a crate::lightning::ln::msgs::DecodeError on failure.
14718 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14720 typedef struct LDKCResult_SpliceLockedDecodeErrorZ {
14722 * The contents of this CResult_SpliceLockedDecodeErrorZ, accessible via either
14723 * `err` or `result` depending on the state of `result_ok`.
14725 union LDKCResult_SpliceLockedDecodeErrorZPtr contents;
14727 * Whether this CResult_SpliceLockedDecodeErrorZ represents a success state.
14730 } LDKCResult_SpliceLockedDecodeErrorZ;
14733 * The contents of CResult_TxAddInputDecodeErrorZ
14735 typedef union LDKCResult_TxAddInputDecodeErrorZPtr {
14737 * A pointer to the contents in the success state.
14738 * Reading from this pointer when `result_ok` is not set is undefined.
14740 struct LDKTxAddInput *result;
14742 * A pointer to the contents in the error state.
14743 * Reading from this pointer when `result_ok` is set is undefined.
14745 struct LDKDecodeError *err;
14746 } LDKCResult_TxAddInputDecodeErrorZPtr;
14749 * A CResult_TxAddInputDecodeErrorZ represents the result of a fallible operation,
14750 * containing a crate::lightning::ln::msgs::TxAddInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
14751 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14753 typedef struct LDKCResult_TxAddInputDecodeErrorZ {
14755 * The contents of this CResult_TxAddInputDecodeErrorZ, accessible via either
14756 * `err` or `result` depending on the state of `result_ok`.
14758 union LDKCResult_TxAddInputDecodeErrorZPtr contents;
14760 * Whether this CResult_TxAddInputDecodeErrorZ represents a success state.
14763 } LDKCResult_TxAddInputDecodeErrorZ;
14766 * The contents of CResult_TxAddOutputDecodeErrorZ
14768 typedef union LDKCResult_TxAddOutputDecodeErrorZPtr {
14770 * A pointer to the contents in the success state.
14771 * Reading from this pointer when `result_ok` is not set is undefined.
14773 struct LDKTxAddOutput *result;
14775 * A pointer to the contents in the error state.
14776 * Reading from this pointer when `result_ok` is set is undefined.
14778 struct LDKDecodeError *err;
14779 } LDKCResult_TxAddOutputDecodeErrorZPtr;
14782 * A CResult_TxAddOutputDecodeErrorZ represents the result of a fallible operation,
14783 * containing a crate::lightning::ln::msgs::TxAddOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
14784 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14786 typedef struct LDKCResult_TxAddOutputDecodeErrorZ {
14788 * The contents of this CResult_TxAddOutputDecodeErrorZ, accessible via either
14789 * `err` or `result` depending on the state of `result_ok`.
14791 union LDKCResult_TxAddOutputDecodeErrorZPtr contents;
14793 * Whether this CResult_TxAddOutputDecodeErrorZ represents a success state.
14796 } LDKCResult_TxAddOutputDecodeErrorZ;
14799 * The contents of CResult_TxRemoveInputDecodeErrorZ
14801 typedef union LDKCResult_TxRemoveInputDecodeErrorZPtr {
14803 * A pointer to the contents in the success state.
14804 * Reading from this pointer when `result_ok` is not set is undefined.
14806 struct LDKTxRemoveInput *result;
14808 * A pointer to the contents in the error state.
14809 * Reading from this pointer when `result_ok` is set is undefined.
14811 struct LDKDecodeError *err;
14812 } LDKCResult_TxRemoveInputDecodeErrorZPtr;
14815 * A CResult_TxRemoveInputDecodeErrorZ represents the result of a fallible operation,
14816 * containing a crate::lightning::ln::msgs::TxRemoveInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
14817 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14819 typedef struct LDKCResult_TxRemoveInputDecodeErrorZ {
14821 * The contents of this CResult_TxRemoveInputDecodeErrorZ, accessible via either
14822 * `err` or `result` depending on the state of `result_ok`.
14824 union LDKCResult_TxRemoveInputDecodeErrorZPtr contents;
14826 * Whether this CResult_TxRemoveInputDecodeErrorZ represents a success state.
14829 } LDKCResult_TxRemoveInputDecodeErrorZ;
14832 * The contents of CResult_TxRemoveOutputDecodeErrorZ
14834 typedef union LDKCResult_TxRemoveOutputDecodeErrorZPtr {
14836 * A pointer to the contents in the success state.
14837 * Reading from this pointer when `result_ok` is not set is undefined.
14839 struct LDKTxRemoveOutput *result;
14841 * A pointer to the contents in the error state.
14842 * Reading from this pointer when `result_ok` is set is undefined.
14844 struct LDKDecodeError *err;
14845 } LDKCResult_TxRemoveOutputDecodeErrorZPtr;
14848 * A CResult_TxRemoveOutputDecodeErrorZ represents the result of a fallible operation,
14849 * containing a crate::lightning::ln::msgs::TxRemoveOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
14850 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14852 typedef struct LDKCResult_TxRemoveOutputDecodeErrorZ {
14854 * The contents of this CResult_TxRemoveOutputDecodeErrorZ, accessible via either
14855 * `err` or `result` depending on the state of `result_ok`.
14857 union LDKCResult_TxRemoveOutputDecodeErrorZPtr contents;
14859 * Whether this CResult_TxRemoveOutputDecodeErrorZ represents a success state.
14862 } LDKCResult_TxRemoveOutputDecodeErrorZ;
14865 * The contents of CResult_TxCompleteDecodeErrorZ
14867 typedef union LDKCResult_TxCompleteDecodeErrorZPtr {
14869 * A pointer to the contents in the success state.
14870 * Reading from this pointer when `result_ok` is not set is undefined.
14872 struct LDKTxComplete *result;
14874 * A pointer to the contents in the error state.
14875 * Reading from this pointer when `result_ok` is set is undefined.
14877 struct LDKDecodeError *err;
14878 } LDKCResult_TxCompleteDecodeErrorZPtr;
14881 * A CResult_TxCompleteDecodeErrorZ represents the result of a fallible operation,
14882 * containing a crate::lightning::ln::msgs::TxComplete on success and a crate::lightning::ln::msgs::DecodeError on failure.
14883 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14885 typedef struct LDKCResult_TxCompleteDecodeErrorZ {
14887 * The contents of this CResult_TxCompleteDecodeErrorZ, accessible via either
14888 * `err` or `result` depending on the state of `result_ok`.
14890 union LDKCResult_TxCompleteDecodeErrorZPtr contents;
14892 * Whether this CResult_TxCompleteDecodeErrorZ represents a success state.
14895 } LDKCResult_TxCompleteDecodeErrorZ;
14898 * The contents of CResult_TxSignaturesDecodeErrorZ
14900 typedef union LDKCResult_TxSignaturesDecodeErrorZPtr {
14902 * A pointer to the contents in the success state.
14903 * Reading from this pointer when `result_ok` is not set is undefined.
14905 struct LDKTxSignatures *result;
14907 * A pointer to the contents in the error state.
14908 * Reading from this pointer when `result_ok` is set is undefined.
14910 struct LDKDecodeError *err;
14911 } LDKCResult_TxSignaturesDecodeErrorZPtr;
14914 * A CResult_TxSignaturesDecodeErrorZ represents the result of a fallible operation,
14915 * containing a crate::lightning::ln::msgs::TxSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
14916 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14918 typedef struct LDKCResult_TxSignaturesDecodeErrorZ {
14920 * The contents of this CResult_TxSignaturesDecodeErrorZ, accessible via either
14921 * `err` or `result` depending on the state of `result_ok`.
14923 union LDKCResult_TxSignaturesDecodeErrorZPtr contents;
14925 * Whether this CResult_TxSignaturesDecodeErrorZ represents a success state.
14928 } LDKCResult_TxSignaturesDecodeErrorZ;
14931 * The contents of CResult_TxInitRbfDecodeErrorZ
14933 typedef union LDKCResult_TxInitRbfDecodeErrorZPtr {
14935 * A pointer to the contents in the success state.
14936 * Reading from this pointer when `result_ok` is not set is undefined.
14938 struct LDKTxInitRbf *result;
14940 * A pointer to the contents in the error state.
14941 * Reading from this pointer when `result_ok` is set is undefined.
14943 struct LDKDecodeError *err;
14944 } LDKCResult_TxInitRbfDecodeErrorZPtr;
14947 * A CResult_TxInitRbfDecodeErrorZ represents the result of a fallible operation,
14948 * containing a crate::lightning::ln::msgs::TxInitRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
14949 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14951 typedef struct LDKCResult_TxInitRbfDecodeErrorZ {
14953 * The contents of this CResult_TxInitRbfDecodeErrorZ, accessible via either
14954 * `err` or `result` depending on the state of `result_ok`.
14956 union LDKCResult_TxInitRbfDecodeErrorZPtr contents;
14958 * Whether this CResult_TxInitRbfDecodeErrorZ represents a success state.
14961 } LDKCResult_TxInitRbfDecodeErrorZ;
14964 * The contents of CResult_TxAckRbfDecodeErrorZ
14966 typedef union LDKCResult_TxAckRbfDecodeErrorZPtr {
14968 * A pointer to the contents in the success state.
14969 * Reading from this pointer when `result_ok` is not set is undefined.
14971 struct LDKTxAckRbf *result;
14973 * A pointer to the contents in the error state.
14974 * Reading from this pointer when `result_ok` is set is undefined.
14976 struct LDKDecodeError *err;
14977 } LDKCResult_TxAckRbfDecodeErrorZPtr;
14980 * A CResult_TxAckRbfDecodeErrorZ represents the result of a fallible operation,
14981 * containing a crate::lightning::ln::msgs::TxAckRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
14982 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14984 typedef struct LDKCResult_TxAckRbfDecodeErrorZ {
14986 * The contents of this CResult_TxAckRbfDecodeErrorZ, accessible via either
14987 * `err` or `result` depending on the state of `result_ok`.
14989 union LDKCResult_TxAckRbfDecodeErrorZPtr contents;
14991 * Whether this CResult_TxAckRbfDecodeErrorZ represents a success state.
14994 } LDKCResult_TxAckRbfDecodeErrorZ;
14997 * The contents of CResult_TxAbortDecodeErrorZ
14999 typedef union LDKCResult_TxAbortDecodeErrorZPtr {
15001 * A pointer to the contents in the success state.
15002 * Reading from this pointer when `result_ok` is not set is undefined.
15004 struct LDKTxAbort *result;
15006 * A pointer to the contents in the error state.
15007 * Reading from this pointer when `result_ok` is set is undefined.
15009 struct LDKDecodeError *err;
15010 } LDKCResult_TxAbortDecodeErrorZPtr;
15013 * A CResult_TxAbortDecodeErrorZ represents the result of a fallible operation,
15014 * containing a crate::lightning::ln::msgs::TxAbort on success and a crate::lightning::ln::msgs::DecodeError on failure.
15015 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15017 typedef struct LDKCResult_TxAbortDecodeErrorZ {
15019 * The contents of this CResult_TxAbortDecodeErrorZ, accessible via either
15020 * `err` or `result` depending on the state of `result_ok`.
15022 union LDKCResult_TxAbortDecodeErrorZPtr contents;
15024 * Whether this CResult_TxAbortDecodeErrorZ represents a success state.
15027 } LDKCResult_TxAbortDecodeErrorZ;
15030 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
15032 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
15034 * A pointer to the contents in the success state.
15035 * Reading from this pointer when `result_ok` is not set is undefined.
15037 struct LDKAnnouncementSignatures *result;
15039 * A pointer to the contents in the error state.
15040 * Reading from this pointer when `result_ok` is set is undefined.
15042 struct LDKDecodeError *err;
15043 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
15046 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
15047 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
15048 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15050 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
15052 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
15053 * `err` or `result` depending on the state of `result_ok`.
15055 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
15057 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
15060 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
15063 * The contents of CResult_ChannelReestablishDecodeErrorZ
15065 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
15067 * A pointer to the contents in the success state.
15068 * Reading from this pointer when `result_ok` is not set is undefined.
15070 struct LDKChannelReestablish *result;
15072 * A pointer to the contents in the error state.
15073 * Reading from this pointer when `result_ok` is set is undefined.
15075 struct LDKDecodeError *err;
15076 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
15079 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
15080 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
15081 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15083 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
15085 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
15086 * `err` or `result` depending on the state of `result_ok`.
15088 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
15090 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
15093 } LDKCResult_ChannelReestablishDecodeErrorZ;
15096 * The contents of CResult_ClosingSignedDecodeErrorZ
15098 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
15100 * A pointer to the contents in the success state.
15101 * Reading from this pointer when `result_ok` is not set is undefined.
15103 struct LDKClosingSigned *result;
15105 * A pointer to the contents in the error state.
15106 * Reading from this pointer when `result_ok` is set is undefined.
15108 struct LDKDecodeError *err;
15109 } LDKCResult_ClosingSignedDecodeErrorZPtr;
15112 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
15113 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
15114 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15116 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
15118 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
15119 * `err` or `result` depending on the state of `result_ok`.
15121 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
15123 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
15126 } LDKCResult_ClosingSignedDecodeErrorZ;
15131 * The minimum and maximum fees which the sender is willing to place on the closing transaction.
15133 * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
15136 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
15138 * A pointer to the opaque Rust object.
15139 * Nearly everywhere, inner must be non-null, however in places where
15140 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15142 LDKnativeClosingSignedFeeRange *inner;
15144 * Indicates that this is the only struct which contains the same pointer.
15145 * Rust functions which take ownership of an object provided via an argument require
15146 * this to be true and invalidate the object pointed to by inner.
15149 } LDKClosingSignedFeeRange;
15152 * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
15154 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
15156 * A pointer to the contents in the success state.
15157 * Reading from this pointer when `result_ok` is not set is undefined.
15159 struct LDKClosingSignedFeeRange *result;
15161 * A pointer to the contents in the error state.
15162 * Reading from this pointer when `result_ok` is set is undefined.
15164 struct LDKDecodeError *err;
15165 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
15168 * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
15169 * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
15170 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15172 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
15174 * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
15175 * `err` or `result` depending on the state of `result_ok`.
15177 union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
15179 * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
15182 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
15187 * A [`commitment_signed`] message to be sent to or received from a peer.
15189 * [`commitment_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#committing-updates-so-far-commitment_signed
15191 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
15193 * A pointer to the opaque Rust object.
15194 * Nearly everywhere, inner must be non-null, however in places where
15195 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15197 LDKnativeCommitmentSigned *inner;
15199 * Indicates that this is the only struct which contains the same pointer.
15200 * Rust functions which take ownership of an object provided via an argument require
15201 * this to be true and invalidate the object pointed to by inner.
15204 } LDKCommitmentSigned;
15207 * The contents of CResult_CommitmentSignedDecodeErrorZ
15209 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
15211 * A pointer to the contents in the success state.
15212 * Reading from this pointer when `result_ok` is not set is undefined.
15214 struct LDKCommitmentSigned *result;
15216 * A pointer to the contents in the error state.
15217 * Reading from this pointer when `result_ok` is set is undefined.
15219 struct LDKDecodeError *err;
15220 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
15223 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
15224 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
15225 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15227 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
15229 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
15230 * `err` or `result` depending on the state of `result_ok`.
15232 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
15234 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
15237 } LDKCResult_CommitmentSignedDecodeErrorZ;
15240 * The contents of CResult_FundingCreatedDecodeErrorZ
15242 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
15244 * A pointer to the contents in the success state.
15245 * Reading from this pointer when `result_ok` is not set is undefined.
15247 struct LDKFundingCreated *result;
15249 * A pointer to the contents in the error state.
15250 * Reading from this pointer when `result_ok` is set is undefined.
15252 struct LDKDecodeError *err;
15253 } LDKCResult_FundingCreatedDecodeErrorZPtr;
15256 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
15257 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
15258 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15260 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
15262 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
15263 * `err` or `result` depending on the state of `result_ok`.
15265 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
15267 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
15270 } LDKCResult_FundingCreatedDecodeErrorZ;
15273 * The contents of CResult_FundingSignedDecodeErrorZ
15275 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
15277 * A pointer to the contents in the success state.
15278 * Reading from this pointer when `result_ok` is not set is undefined.
15280 struct LDKFundingSigned *result;
15282 * A pointer to the contents in the error state.
15283 * Reading from this pointer when `result_ok` is set is undefined.
15285 struct LDKDecodeError *err;
15286 } LDKCResult_FundingSignedDecodeErrorZPtr;
15289 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
15290 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
15291 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15293 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
15295 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
15296 * `err` or `result` depending on the state of `result_ok`.
15298 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
15300 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
15303 } LDKCResult_FundingSignedDecodeErrorZ;
15306 * The contents of CResult_ChannelReadyDecodeErrorZ
15308 typedef union LDKCResult_ChannelReadyDecodeErrorZPtr {
15310 * A pointer to the contents in the success state.
15311 * Reading from this pointer when `result_ok` is not set is undefined.
15313 struct LDKChannelReady *result;
15315 * A pointer to the contents in the error state.
15316 * Reading from this pointer when `result_ok` is set is undefined.
15318 struct LDKDecodeError *err;
15319 } LDKCResult_ChannelReadyDecodeErrorZPtr;
15322 * A CResult_ChannelReadyDecodeErrorZ represents the result of a fallible operation,
15323 * containing a crate::lightning::ln::msgs::ChannelReady on success and a crate::lightning::ln::msgs::DecodeError on failure.
15324 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15326 typedef struct LDKCResult_ChannelReadyDecodeErrorZ {
15328 * The contents of this CResult_ChannelReadyDecodeErrorZ, accessible via either
15329 * `err` or `result` depending on the state of `result_ok`.
15331 union LDKCResult_ChannelReadyDecodeErrorZPtr contents;
15333 * Whether this CResult_ChannelReadyDecodeErrorZ represents a success state.
15336 } LDKCResult_ChannelReadyDecodeErrorZ;
15341 * An [`init`] message to be sent to or received from a peer.
15343 * [`init`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-init-message
15345 typedef struct MUST_USE_STRUCT LDKInit {
15347 * A pointer to the opaque Rust object.
15348 * Nearly everywhere, inner must be non-null, however in places where
15349 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15351 LDKnativeInit *inner;
15353 * Indicates that this is the only struct which contains the same pointer.
15354 * Rust functions which take ownership of an object provided via an argument require
15355 * this to be true and invalidate the object pointed to by inner.
15361 * The contents of CResult_InitDecodeErrorZ
15363 typedef union LDKCResult_InitDecodeErrorZPtr {
15365 * A pointer to the contents in the success state.
15366 * Reading from this pointer when `result_ok` is not set is undefined.
15368 struct LDKInit *result;
15370 * A pointer to the contents in the error state.
15371 * Reading from this pointer when `result_ok` is set is undefined.
15373 struct LDKDecodeError *err;
15374 } LDKCResult_InitDecodeErrorZPtr;
15377 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
15378 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
15379 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15381 typedef struct LDKCResult_InitDecodeErrorZ {
15383 * The contents of this CResult_InitDecodeErrorZ, accessible via either
15384 * `err` or `result` depending on the state of `result_ok`.
15386 union LDKCResult_InitDecodeErrorZPtr contents;
15388 * Whether this CResult_InitDecodeErrorZ represents a success state.
15391 } LDKCResult_InitDecodeErrorZ;
15394 * The contents of CResult_OpenChannelDecodeErrorZ
15396 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
15398 * A pointer to the contents in the success state.
15399 * Reading from this pointer when `result_ok` is not set is undefined.
15401 struct LDKOpenChannel *result;
15403 * A pointer to the contents in the error state.
15404 * Reading from this pointer when `result_ok` is set is undefined.
15406 struct LDKDecodeError *err;
15407 } LDKCResult_OpenChannelDecodeErrorZPtr;
15410 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
15411 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
15412 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15414 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
15416 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
15417 * `err` or `result` depending on the state of `result_ok`.
15419 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
15421 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
15424 } LDKCResult_OpenChannelDecodeErrorZ;
15427 * The contents of CResult_OpenChannelV2DecodeErrorZ
15429 typedef union LDKCResult_OpenChannelV2DecodeErrorZPtr {
15431 * A pointer to the contents in the success state.
15432 * Reading from this pointer when `result_ok` is not set is undefined.
15434 struct LDKOpenChannelV2 *result;
15436 * A pointer to the contents in the error state.
15437 * Reading from this pointer when `result_ok` is set is undefined.
15439 struct LDKDecodeError *err;
15440 } LDKCResult_OpenChannelV2DecodeErrorZPtr;
15443 * A CResult_OpenChannelV2DecodeErrorZ represents the result of a fallible operation,
15444 * containing a crate::lightning::ln::msgs::OpenChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
15445 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15447 typedef struct LDKCResult_OpenChannelV2DecodeErrorZ {
15449 * The contents of this CResult_OpenChannelV2DecodeErrorZ, accessible via either
15450 * `err` or `result` depending on the state of `result_ok`.
15452 union LDKCResult_OpenChannelV2DecodeErrorZPtr contents;
15454 * Whether this CResult_OpenChannelV2DecodeErrorZ represents a success state.
15457 } LDKCResult_OpenChannelV2DecodeErrorZ;
15460 * The contents of CResult_RevokeAndACKDecodeErrorZ
15462 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
15464 * A pointer to the contents in the success state.
15465 * Reading from this pointer when `result_ok` is not set is undefined.
15467 struct LDKRevokeAndACK *result;
15469 * A pointer to the contents in the error state.
15470 * Reading from this pointer when `result_ok` is set is undefined.
15472 struct LDKDecodeError *err;
15473 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
15476 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
15477 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
15478 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15480 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
15482 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
15483 * `err` or `result` depending on the state of `result_ok`.
15485 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
15487 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
15490 } LDKCResult_RevokeAndACKDecodeErrorZ;
15493 * The contents of CResult_ShutdownDecodeErrorZ
15495 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
15497 * A pointer to the contents in the success state.
15498 * Reading from this pointer when `result_ok` is not set is undefined.
15500 struct LDKShutdown *result;
15502 * A pointer to the contents in the error state.
15503 * Reading from this pointer when `result_ok` is set is undefined.
15505 struct LDKDecodeError *err;
15506 } LDKCResult_ShutdownDecodeErrorZPtr;
15509 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
15510 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
15511 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15513 typedef struct LDKCResult_ShutdownDecodeErrorZ {
15515 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
15516 * `err` or `result` depending on the state of `result_ok`.
15518 union LDKCResult_ShutdownDecodeErrorZPtr contents;
15520 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
15523 } LDKCResult_ShutdownDecodeErrorZ;
15526 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
15528 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
15530 * A pointer to the contents in the success state.
15531 * Reading from this pointer when `result_ok` is not set is undefined.
15533 struct LDKUpdateFailHTLC *result;
15535 * A pointer to the contents in the error state.
15536 * Reading from this pointer when `result_ok` is set is undefined.
15538 struct LDKDecodeError *err;
15539 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
15542 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
15543 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
15544 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15546 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
15548 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
15549 * `err` or `result` depending on the state of `result_ok`.
15551 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
15553 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
15556 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
15559 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
15561 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
15563 * A pointer to the contents in the success state.
15564 * Reading from this pointer when `result_ok` is not set is undefined.
15566 struct LDKUpdateFailMalformedHTLC *result;
15568 * A pointer to the contents in the error state.
15569 * Reading from this pointer when `result_ok` is set is undefined.
15571 struct LDKDecodeError *err;
15572 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
15575 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
15576 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
15577 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15579 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
15581 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
15582 * `err` or `result` depending on the state of `result_ok`.
15584 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
15586 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
15589 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
15594 * An [`update_fee`] message to be sent to or received from a peer
15596 * [`update_fee`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#updating-fees-update_fee
15598 typedef struct MUST_USE_STRUCT LDKUpdateFee {
15600 * A pointer to the opaque Rust object.
15601 * Nearly everywhere, inner must be non-null, however in places where
15602 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15604 LDKnativeUpdateFee *inner;
15606 * Indicates that this is the only struct which contains the same pointer.
15607 * Rust functions which take ownership of an object provided via an argument require
15608 * this to be true and invalidate the object pointed to by inner.
15614 * The contents of CResult_UpdateFeeDecodeErrorZ
15616 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
15618 * A pointer to the contents in the success state.
15619 * Reading from this pointer when `result_ok` is not set is undefined.
15621 struct LDKUpdateFee *result;
15623 * A pointer to the contents in the error state.
15624 * Reading from this pointer when `result_ok` is set is undefined.
15626 struct LDKDecodeError *err;
15627 } LDKCResult_UpdateFeeDecodeErrorZPtr;
15630 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
15631 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
15632 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15634 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
15636 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
15637 * `err` or `result` depending on the state of `result_ok`.
15639 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
15641 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
15644 } LDKCResult_UpdateFeeDecodeErrorZ;
15647 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
15649 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
15651 * A pointer to the contents in the success state.
15652 * Reading from this pointer when `result_ok` is not set is undefined.
15654 struct LDKUpdateFulfillHTLC *result;
15656 * A pointer to the contents in the error state.
15657 * Reading from this pointer when `result_ok` is set is undefined.
15659 struct LDKDecodeError *err;
15660 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
15663 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
15664 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
15665 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15667 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
15669 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
15670 * `err` or `result` depending on the state of `result_ok`.
15672 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
15674 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
15677 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
15680 * The contents of CResult_OnionPacketDecodeErrorZ
15682 typedef union LDKCResult_OnionPacketDecodeErrorZPtr {
15684 * A pointer to the contents in the success state.
15685 * Reading from this pointer when `result_ok` is not set is undefined.
15687 struct LDKOnionPacket *result;
15689 * A pointer to the contents in the error state.
15690 * Reading from this pointer when `result_ok` is set is undefined.
15692 struct LDKDecodeError *err;
15693 } LDKCResult_OnionPacketDecodeErrorZPtr;
15696 * A CResult_OnionPacketDecodeErrorZ represents the result of a fallible operation,
15697 * containing a crate::lightning::ln::msgs::OnionPacket on success and a crate::lightning::ln::msgs::DecodeError on failure.
15698 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15700 typedef struct LDKCResult_OnionPacketDecodeErrorZ {
15702 * The contents of this CResult_OnionPacketDecodeErrorZ, accessible via either
15703 * `err` or `result` depending on the state of `result_ok`.
15705 union LDKCResult_OnionPacketDecodeErrorZPtr contents;
15707 * Whether this CResult_OnionPacketDecodeErrorZ represents a success state.
15710 } LDKCResult_OnionPacketDecodeErrorZ;
15713 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
15715 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
15717 * A pointer to the contents in the success state.
15718 * Reading from this pointer when `result_ok` is not set is undefined.
15720 struct LDKUpdateAddHTLC *result;
15722 * A pointer to the contents in the error state.
15723 * Reading from this pointer when `result_ok` is set is undefined.
15725 struct LDKDecodeError *err;
15726 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
15729 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
15730 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
15731 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15733 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
15735 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
15736 * `err` or `result` depending on the state of `result_ok`.
15738 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
15740 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
15743 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
15748 * An onion message to be sent to or received from a peer.
15751 typedef struct MUST_USE_STRUCT LDKOnionMessage {
15753 * A pointer to the opaque Rust object.
15754 * Nearly everywhere, inner must be non-null, however in places where
15755 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15757 LDKnativeOnionMessage *inner;
15759 * Indicates that this is the only struct which contains the same pointer.
15760 * Rust functions which take ownership of an object provided via an argument require
15761 * this to be true and invalidate the object pointed to by inner.
15767 * The contents of CResult_OnionMessageDecodeErrorZ
15769 typedef union LDKCResult_OnionMessageDecodeErrorZPtr {
15771 * A pointer to the contents in the success state.
15772 * Reading from this pointer when `result_ok` is not set is undefined.
15774 struct LDKOnionMessage *result;
15776 * A pointer to the contents in the error state.
15777 * Reading from this pointer when `result_ok` is set is undefined.
15779 struct LDKDecodeError *err;
15780 } LDKCResult_OnionMessageDecodeErrorZPtr;
15783 * A CResult_OnionMessageDecodeErrorZ represents the result of a fallible operation,
15784 * containing a crate::lightning::ln::msgs::OnionMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
15785 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15787 typedef struct LDKCResult_OnionMessageDecodeErrorZ {
15789 * The contents of this CResult_OnionMessageDecodeErrorZ, accessible via either
15790 * `err` or `result` depending on the state of `result_ok`.
15792 union LDKCResult_OnionMessageDecodeErrorZPtr contents;
15794 * Whether this CResult_OnionMessageDecodeErrorZ represents a success state.
15797 } LDKCResult_OnionMessageDecodeErrorZ;
15800 * The contents of CResult_FinalOnionHopDataDecodeErrorZ
15802 typedef union LDKCResult_FinalOnionHopDataDecodeErrorZPtr {
15804 * A pointer to the contents in the success state.
15805 * Reading from this pointer when `result_ok` is not set is undefined.
15807 struct LDKFinalOnionHopData *result;
15809 * A pointer to the contents in the error state.
15810 * Reading from this pointer when `result_ok` is set is undefined.
15812 struct LDKDecodeError *err;
15813 } LDKCResult_FinalOnionHopDataDecodeErrorZPtr;
15816 * A CResult_FinalOnionHopDataDecodeErrorZ represents the result of a fallible operation,
15817 * containing a crate::lightning::ln::msgs::FinalOnionHopData on success and a crate::lightning::ln::msgs::DecodeError on failure.
15818 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15820 typedef struct LDKCResult_FinalOnionHopDataDecodeErrorZ {
15822 * The contents of this CResult_FinalOnionHopDataDecodeErrorZ, accessible via either
15823 * `err` or `result` depending on the state of `result_ok`.
15825 union LDKCResult_FinalOnionHopDataDecodeErrorZPtr contents;
15827 * Whether this CResult_FinalOnionHopDataDecodeErrorZ represents a success state.
15830 } LDKCResult_FinalOnionHopDataDecodeErrorZ;
15835 * A [`ping`] message to be sent to or received from a peer.
15837 * [`ping`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
15839 typedef struct MUST_USE_STRUCT LDKPing {
15841 * A pointer to the opaque Rust object.
15842 * Nearly everywhere, inner must be non-null, however in places where
15843 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15845 LDKnativePing *inner;
15847 * Indicates that this is the only struct which contains the same pointer.
15848 * Rust functions which take ownership of an object provided via an argument require
15849 * this to be true and invalidate the object pointed to by inner.
15855 * The contents of CResult_PingDecodeErrorZ
15857 typedef union LDKCResult_PingDecodeErrorZPtr {
15859 * A pointer to the contents in the success state.
15860 * Reading from this pointer when `result_ok` is not set is undefined.
15862 struct LDKPing *result;
15864 * A pointer to the contents in the error state.
15865 * Reading from this pointer when `result_ok` is set is undefined.
15867 struct LDKDecodeError *err;
15868 } LDKCResult_PingDecodeErrorZPtr;
15871 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
15872 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
15873 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15875 typedef struct LDKCResult_PingDecodeErrorZ {
15877 * The contents of this CResult_PingDecodeErrorZ, accessible via either
15878 * `err` or `result` depending on the state of `result_ok`.
15880 union LDKCResult_PingDecodeErrorZPtr contents;
15882 * Whether this CResult_PingDecodeErrorZ represents a success state.
15885 } LDKCResult_PingDecodeErrorZ;
15890 * A [`pong`] message to be sent to or received from a peer.
15892 * [`pong`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
15894 typedef struct MUST_USE_STRUCT LDKPong {
15896 * A pointer to the opaque Rust object.
15897 * Nearly everywhere, inner must be non-null, however in places where
15898 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15900 LDKnativePong *inner;
15902 * Indicates that this is the only struct which contains the same pointer.
15903 * Rust functions which take ownership of an object provided via an argument require
15904 * this to be true and invalidate the object pointed to by inner.
15910 * The contents of CResult_PongDecodeErrorZ
15912 typedef union LDKCResult_PongDecodeErrorZPtr {
15914 * A pointer to the contents in the success state.
15915 * Reading from this pointer when `result_ok` is not set is undefined.
15917 struct LDKPong *result;
15919 * A pointer to the contents in the error state.
15920 * Reading from this pointer when `result_ok` is set is undefined.
15922 struct LDKDecodeError *err;
15923 } LDKCResult_PongDecodeErrorZPtr;
15926 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
15927 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
15928 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15930 typedef struct LDKCResult_PongDecodeErrorZ {
15932 * The contents of this CResult_PongDecodeErrorZ, accessible via either
15933 * `err` or `result` depending on the state of `result_ok`.
15935 union LDKCResult_PongDecodeErrorZPtr contents;
15937 * Whether this CResult_PongDecodeErrorZ represents a success state.
15940 } LDKCResult_PongDecodeErrorZ;
15943 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
15945 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
15947 * A pointer to the contents in the success state.
15948 * Reading from this pointer when `result_ok` is not set is undefined.
15950 struct LDKUnsignedChannelAnnouncement *result;
15952 * A pointer to the contents in the error state.
15953 * Reading from this pointer when `result_ok` is set is undefined.
15955 struct LDKDecodeError *err;
15956 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
15959 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
15960 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
15961 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15963 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
15965 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
15966 * `err` or `result` depending on the state of `result_ok`.
15968 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
15970 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
15973 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
15976 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
15978 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
15980 * A pointer to the contents in the success state.
15981 * Reading from this pointer when `result_ok` is not set is undefined.
15983 struct LDKChannelAnnouncement *result;
15985 * A pointer to the contents in the error state.
15986 * Reading from this pointer when `result_ok` is set is undefined.
15988 struct LDKDecodeError *err;
15989 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
15992 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
15993 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
15994 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15996 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
15998 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
15999 * `err` or `result` depending on the state of `result_ok`.
16001 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
16003 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
16006 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
16009 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
16011 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
16013 * A pointer to the contents in the success state.
16014 * Reading from this pointer when `result_ok` is not set is undefined.
16016 struct LDKUnsignedChannelUpdate *result;
16018 * A pointer to the contents in the error state.
16019 * Reading from this pointer when `result_ok` is set is undefined.
16021 struct LDKDecodeError *err;
16022 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
16025 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
16026 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
16027 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16029 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
16031 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
16032 * `err` or `result` depending on the state of `result_ok`.
16034 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
16036 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
16039 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
16042 * The contents of CResult_ChannelUpdateDecodeErrorZ
16044 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
16046 * A pointer to the contents in the success state.
16047 * Reading from this pointer when `result_ok` is not set is undefined.
16049 struct LDKChannelUpdate *result;
16051 * A pointer to the contents in the error state.
16052 * Reading from this pointer when `result_ok` is set is undefined.
16054 struct LDKDecodeError *err;
16055 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
16058 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
16059 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
16060 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16062 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
16064 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
16065 * `err` or `result` depending on the state of `result_ok`.
16067 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
16069 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
16072 } LDKCResult_ChannelUpdateDecodeErrorZ;
16075 * The contents of CResult_ErrorMessageDecodeErrorZ
16077 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
16079 * A pointer to the contents in the success state.
16080 * Reading from this pointer when `result_ok` is not set is undefined.
16082 struct LDKErrorMessage *result;
16084 * A pointer to the contents in the error state.
16085 * Reading from this pointer when `result_ok` is set is undefined.
16087 struct LDKDecodeError *err;
16088 } LDKCResult_ErrorMessageDecodeErrorZPtr;
16091 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
16092 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
16093 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16095 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
16097 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
16098 * `err` or `result` depending on the state of `result_ok`.
16100 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
16102 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
16105 } LDKCResult_ErrorMessageDecodeErrorZ;
16108 * The contents of CResult_WarningMessageDecodeErrorZ
16110 typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
16112 * A pointer to the contents in the success state.
16113 * Reading from this pointer when `result_ok` is not set is undefined.
16115 struct LDKWarningMessage *result;
16117 * A pointer to the contents in the error state.
16118 * Reading from this pointer when `result_ok` is set is undefined.
16120 struct LDKDecodeError *err;
16121 } LDKCResult_WarningMessageDecodeErrorZPtr;
16124 * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
16125 * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
16126 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16128 typedef struct LDKCResult_WarningMessageDecodeErrorZ {
16130 * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
16131 * `err` or `result` depending on the state of `result_ok`.
16133 union LDKCResult_WarningMessageDecodeErrorZPtr contents;
16135 * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
16138 } LDKCResult_WarningMessageDecodeErrorZ;
16141 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
16143 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
16145 * A pointer to the contents in the success state.
16146 * Reading from this pointer when `result_ok` is not set is undefined.
16148 struct LDKUnsignedNodeAnnouncement *result;
16150 * A pointer to the contents in the error state.
16151 * Reading from this pointer when `result_ok` is set is undefined.
16153 struct LDKDecodeError *err;
16154 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
16157 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
16158 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
16159 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16161 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
16163 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
16164 * `err` or `result` depending on the state of `result_ok`.
16166 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
16168 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
16171 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
16174 * The contents of CResult_NodeAnnouncementDecodeErrorZ
16176 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
16178 * A pointer to the contents in the success state.
16179 * Reading from this pointer when `result_ok` is not set is undefined.
16181 struct LDKNodeAnnouncement *result;
16183 * A pointer to the contents in the error state.
16184 * Reading from this pointer when `result_ok` is set is undefined.
16186 struct LDKDecodeError *err;
16187 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
16190 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
16191 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
16192 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16194 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
16196 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
16197 * `err` or `result` depending on the state of `result_ok`.
16199 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
16201 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
16204 } LDKCResult_NodeAnnouncementDecodeErrorZ;
16207 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
16209 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
16211 * A pointer to the contents in the success state.
16212 * Reading from this pointer when `result_ok` is not set is undefined.
16214 struct LDKQueryShortChannelIds *result;
16216 * A pointer to the contents in the error state.
16217 * Reading from this pointer when `result_ok` is set is undefined.
16219 struct LDKDecodeError *err;
16220 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
16223 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
16224 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
16225 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16227 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
16229 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
16230 * `err` or `result` depending on the state of `result_ok`.
16232 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
16234 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
16237 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
16242 * A [`reply_short_channel_ids_end`] message is sent as a reply to a
16243 * message. The query recipient makes a best
16244 * effort to respond based on their local network view which may not be
16245 * a perfect view of the network.
16247 * [`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
16249 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
16251 * A pointer to the opaque Rust object.
16252 * Nearly everywhere, inner must be non-null, however in places where
16253 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16255 LDKnativeReplyShortChannelIdsEnd *inner;
16257 * Indicates that this is the only struct which contains the same pointer.
16258 * Rust functions which take ownership of an object provided via an argument require
16259 * this to be true and invalidate the object pointed to by inner.
16262 } LDKReplyShortChannelIdsEnd;
16265 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
16267 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
16269 * A pointer to the contents in the success state.
16270 * Reading from this pointer when `result_ok` is not set is undefined.
16272 struct LDKReplyShortChannelIdsEnd *result;
16274 * A pointer to the contents in the error state.
16275 * Reading from this pointer when `result_ok` is set is undefined.
16277 struct LDKDecodeError *err;
16278 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
16281 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
16282 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
16283 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16285 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
16287 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
16288 * `err` or `result` depending on the state of `result_ok`.
16290 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
16292 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
16295 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
16298 * The contents of CResult_QueryChannelRangeDecodeErrorZ
16300 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
16302 * A pointer to the contents in the success state.
16303 * Reading from this pointer when `result_ok` is not set is undefined.
16305 struct LDKQueryChannelRange *result;
16307 * A pointer to the contents in the error state.
16308 * Reading from this pointer when `result_ok` is set is undefined.
16310 struct LDKDecodeError *err;
16311 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
16314 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
16315 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
16316 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16318 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
16320 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
16321 * `err` or `result` depending on the state of `result_ok`.
16323 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
16325 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
16328 } LDKCResult_QueryChannelRangeDecodeErrorZ;
16331 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
16333 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
16335 * A pointer to the contents in the success state.
16336 * Reading from this pointer when `result_ok` is not set is undefined.
16338 struct LDKReplyChannelRange *result;
16340 * A pointer to the contents in the error state.
16341 * Reading from this pointer when `result_ok` is set is undefined.
16343 struct LDKDecodeError *err;
16344 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
16347 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
16348 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
16349 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16351 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
16353 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
16354 * `err` or `result` depending on the state of `result_ok`.
16356 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
16358 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
16361 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
16364 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
16366 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
16368 * A pointer to the contents in the success state.
16369 * Reading from this pointer when `result_ok` is not set is undefined.
16371 struct LDKGossipTimestampFilter *result;
16373 * A pointer to the contents in the error state.
16374 * Reading from this pointer when `result_ok` is set is undefined.
16376 struct LDKDecodeError *err;
16377 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
16380 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
16381 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
16382 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16384 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
16386 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
16387 * `err` or `result` depending on the state of `result_ok`.
16389 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
16391 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
16394 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
16397 * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
16398 * This corresponds to std::vector in C++
16400 typedef struct LDKCVec_PhantomRouteHintsZ {
16402 * The elements in the array.
16403 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
16405 struct LDKPhantomRouteHints *data;
16407 * The number of elements pointed to by `data`.
16410 } LDKCVec_PhantomRouteHintsZ;
16415 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
16417 * There are three ways to construct a `Bolt11Invoice`:
16418 * 1. using [`InvoiceBuilder`]
16419 * 2. using [`Bolt11Invoice::from_signed`]
16420 * 3. using `str::parse::<Bolt11Invoice>(&str)` (see [`Bolt11Invoice::from_str`])
16422 * [`Bolt11Invoice::from_str`]: crate::Bolt11Invoice#impl-FromStr
16424 typedef struct MUST_USE_STRUCT LDKBolt11Invoice {
16426 * A pointer to the opaque Rust object.
16427 * Nearly everywhere, inner must be non-null, however in places where
16428 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16430 LDKnativeBolt11Invoice *inner;
16432 * Indicates that this is the only struct which contains the same pointer.
16433 * Rust functions which take ownership of an object provided via an argument require
16434 * this to be true and invalidate the object pointed to by inner.
16437 } LDKBolt11Invoice;
16440 * When signing using a fallible method either an user-supplied `SignError` or a [`CreationError`]
16443 typedef enum LDKSignOrCreationError_Tag {
16445 * An error occurred during signing
16447 LDKSignOrCreationError_SignError,
16449 * An error occurred while building the transaction
16451 LDKSignOrCreationError_CreationError,
16453 * Must be last for serialization purposes
16455 LDKSignOrCreationError_Sentinel,
16456 } LDKSignOrCreationError_Tag;
16458 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
16459 LDKSignOrCreationError_Tag tag;
16462 enum LDKCreationError creation_error;
16465 } LDKSignOrCreationError;
16468 * The contents of CResult_Bolt11InvoiceSignOrCreationErrorZ
16470 typedef union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr {
16472 * A pointer to the contents in the success state.
16473 * Reading from this pointer when `result_ok` is not set is undefined.
16475 struct LDKBolt11Invoice *result;
16477 * A pointer to the contents in the error state.
16478 * Reading from this pointer when `result_ok` is set is undefined.
16480 struct LDKSignOrCreationError *err;
16481 } LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr;
16484 * A CResult_Bolt11InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
16485 * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
16486 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16488 typedef struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ {
16490 * The contents of this CResult_Bolt11InvoiceSignOrCreationErrorZ, accessible via either
16491 * `err` or `result` depending on the state of `result_ok`.
16493 union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr contents;
16495 * Whether this CResult_Bolt11InvoiceSignOrCreationErrorZ represents a success state.
16498 } LDKCResult_Bolt11InvoiceSignOrCreationErrorZ;
16503 * A simple future which can complete once, and calls some callback(s) when it does so.
16505 typedef struct MUST_USE_STRUCT LDKFuture {
16507 * A pointer to the opaque Rust object.
16508 * Nearly everywhere, inner must be non-null, however in places where
16509 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16511 LDKnativeFuture *inner;
16513 * Indicates that this is the only struct which contains the same pointer.
16514 * Rust functions which take ownership of an object provided via an argument require
16515 * this to be true and invalidate the object pointed to by inner.
16521 * A dynamically-allocated array of crate::lightning::util::wakers::Futures of arbitrary size.
16522 * This corresponds to std::vector in C++
16524 typedef struct LDKCVec_FutureZ {
16526 * The elements in the array.
16527 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
16529 struct LDKFuture *data;
16531 * The number of elements pointed to by `data`.
16537 * The contents of CResult_OffersMessageDecodeErrorZ
16539 typedef union LDKCResult_OffersMessageDecodeErrorZPtr {
16541 * A pointer to the contents in the success state.
16542 * Reading from this pointer when `result_ok` is not set is undefined.
16544 struct LDKOffersMessage *result;
16546 * A pointer to the contents in the error state.
16547 * Reading from this pointer when `result_ok` is set is undefined.
16549 struct LDKDecodeError *err;
16550 } LDKCResult_OffersMessageDecodeErrorZPtr;
16553 * A CResult_OffersMessageDecodeErrorZ represents the result of a fallible operation,
16554 * containing a crate::lightning::onion_message::offers::OffersMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
16555 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16557 typedef struct LDKCResult_OffersMessageDecodeErrorZ {
16559 * The contents of this CResult_OffersMessageDecodeErrorZ, accessible via either
16560 * `err` or `result` depending on the state of `result_ok`.
16562 union LDKCResult_OffersMessageDecodeErrorZPtr contents;
16564 * Whether this CResult_OffersMessageDecodeErrorZ represents a success state.
16567 } LDKCResult_OffersMessageDecodeErrorZ;
16570 * An enum which can either contain a crate::lightning::ln::chan_utils::HTLCClaim or not
16572 typedef enum LDKCOption_HTLCClaimZ_Tag {
16574 * When we're in this state, this COption_HTLCClaimZ contains a crate::lightning::ln::chan_utils::HTLCClaim
16576 LDKCOption_HTLCClaimZ_Some,
16578 * When we're in this state, this COption_HTLCClaimZ contains nothing
16580 LDKCOption_HTLCClaimZ_None,
16582 * Must be last for serialization purposes
16584 LDKCOption_HTLCClaimZ_Sentinel,
16585 } LDKCOption_HTLCClaimZ_Tag;
16587 typedef struct LDKCOption_HTLCClaimZ {
16588 LDKCOption_HTLCClaimZ_Tag tag;
16591 enum LDKHTLCClaim some;
16594 } LDKCOption_HTLCClaimZ;
16599 * Implements the per-commitment secret storage scheme from
16600 * [BOLT 3](https://github.com/lightning/bolts/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage).
16602 * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes
16605 typedef struct MUST_USE_STRUCT LDKCounterpartyCommitmentSecrets {
16607 * A pointer to the opaque Rust object.
16608 * Nearly everywhere, inner must be non-null, however in places where
16609 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16611 LDKnativeCounterpartyCommitmentSecrets *inner;
16613 * Indicates that this is the only struct which contains the same pointer.
16614 * Rust functions which take ownership of an object provided via an argument require
16615 * this to be true and invalidate the object pointed to by inner.
16618 } LDKCounterpartyCommitmentSecrets;
16621 * The contents of CResult_CounterpartyCommitmentSecretsDecodeErrorZ
16623 typedef union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr {
16625 * A pointer to the contents in the success state.
16626 * Reading from this pointer when `result_ok` is not set is undefined.
16628 struct LDKCounterpartyCommitmentSecrets *result;
16630 * A pointer to the contents in the error state.
16631 * Reading from this pointer when `result_ok` is set is undefined.
16633 struct LDKDecodeError *err;
16634 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr;
16637 * A CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents the result of a fallible operation,
16638 * containing a crate::lightning::ln::chan_utils::CounterpartyCommitmentSecrets on success and a crate::lightning::ln::msgs::DecodeError on failure.
16639 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16641 typedef struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ {
16643 * The contents of this CResult_CounterpartyCommitmentSecretsDecodeErrorZ, accessible via either
16644 * `err` or `result` depending on the state of `result_ok`.
16646 union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr contents;
16648 * Whether this CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents a success state.
16651 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ;
16656 * The set of public keys which are used in the creation of one commitment transaction.
16657 * These are derived from the channel base keys and per-commitment data.
16659 * A broadcaster key is provided from potential broadcaster of the computed transaction.
16660 * A countersignatory key is coming from a protocol participant unable to broadcast the
16663 * These keys are assumed to be good, either because the code derived them from
16664 * channel basepoints via the new function, or they were obtained via
16665 * CommitmentTransaction.trust().keys() because we trusted the source of the
16666 * pre-calculated keys.
16668 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
16670 * A pointer to the opaque Rust object.
16671 * Nearly everywhere, inner must be non-null, however in places where
16672 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16674 LDKnativeTxCreationKeys *inner;
16676 * Indicates that this is the only struct which contains the same pointer.
16677 * Rust functions which take ownership of an object provided via an argument require
16678 * this to be true and invalidate the object pointed to by inner.
16681 } LDKTxCreationKeys;
16684 * The contents of CResult_TxCreationKeysDecodeErrorZ
16686 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
16688 * A pointer to the contents in the success state.
16689 * Reading from this pointer when `result_ok` is not set is undefined.
16691 struct LDKTxCreationKeys *result;
16693 * A pointer to the contents in the error state.
16694 * Reading from this pointer when `result_ok` is set is undefined.
16696 struct LDKDecodeError *err;
16697 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
16700 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
16701 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
16702 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16704 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
16706 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
16707 * `err` or `result` depending on the state of `result_ok`.
16709 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
16711 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
16714 } LDKCResult_TxCreationKeysDecodeErrorZ;
16717 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
16719 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
16721 * A pointer to the contents in the success state.
16722 * Reading from this pointer when `result_ok` is not set is undefined.
16724 struct LDKChannelPublicKeys *result;
16726 * A pointer to the contents in the error state.
16727 * Reading from this pointer when `result_ok` is set is undefined.
16729 struct LDKDecodeError *err;
16730 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
16733 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
16734 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
16735 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16737 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
16739 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
16740 * `err` or `result` depending on the state of `result_ok`.
16742 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
16744 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
16747 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
16750 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
16752 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
16754 * A pointer to the contents in the success state.
16755 * Reading from this pointer when `result_ok` is not set is undefined.
16757 struct LDKHTLCOutputInCommitment *result;
16759 * A pointer to the contents in the error state.
16760 * Reading from this pointer when `result_ok` is set is undefined.
16762 struct LDKDecodeError *err;
16763 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
16766 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
16767 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
16768 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16770 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
16772 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
16773 * `err` or `result` depending on the state of `result_ok`.
16775 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
16777 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
16780 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
16785 * Late-bound per-channel counterparty data used to build transactions.
16787 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
16789 * A pointer to the opaque Rust object.
16790 * Nearly everywhere, inner must be non-null, however in places where
16791 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16793 LDKnativeCounterpartyChannelTransactionParameters *inner;
16795 * Indicates that this is the only struct which contains the same pointer.
16796 * Rust functions which take ownership of an object provided via an argument require
16797 * this to be true and invalidate the object pointed to by inner.
16800 } LDKCounterpartyChannelTransactionParameters;
16803 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
16805 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
16807 * A pointer to the contents in the success state.
16808 * Reading from this pointer when `result_ok` is not set is undefined.
16810 struct LDKCounterpartyChannelTransactionParameters *result;
16812 * A pointer to the contents in the error state.
16813 * Reading from this pointer when `result_ok` is set is undefined.
16815 struct LDKDecodeError *err;
16816 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
16819 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
16820 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
16821 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16823 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
16825 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
16826 * `err` or `result` depending on the state of `result_ok`.
16828 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
16830 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
16833 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
16836 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
16838 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
16840 * A pointer to the contents in the success state.
16841 * Reading from this pointer when `result_ok` is not set is undefined.
16843 struct LDKChannelTransactionParameters *result;
16845 * A pointer to the contents in the error state.
16846 * Reading from this pointer when `result_ok` is set is undefined.
16848 struct LDKDecodeError *err;
16849 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
16852 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
16853 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
16854 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16856 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
16858 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
16859 * `err` or `result` depending on the state of `result_ok`.
16861 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
16863 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
16866 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
16869 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
16871 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
16873 * A pointer to the contents in the success state.
16874 * Reading from this pointer when `result_ok` is not set is undefined.
16876 struct LDKHolderCommitmentTransaction *result;
16878 * A pointer to the contents in the error state.
16879 * Reading from this pointer when `result_ok` is set is undefined.
16881 struct LDKDecodeError *err;
16882 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
16885 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
16886 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
16887 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16889 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
16891 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
16892 * `err` or `result` depending on the state of `result_ok`.
16894 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
16896 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
16899 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
16904 * A pre-built Bitcoin commitment transaction and its txid.
16906 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
16908 * A pointer to the opaque Rust object.
16909 * Nearly everywhere, inner must be non-null, however in places where
16910 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16912 LDKnativeBuiltCommitmentTransaction *inner;
16914 * Indicates that this is the only struct which contains the same pointer.
16915 * Rust functions which take ownership of an object provided via an argument require
16916 * this to be true and invalidate the object pointed to by inner.
16919 } LDKBuiltCommitmentTransaction;
16922 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
16924 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
16926 * A pointer to the contents in the success state.
16927 * Reading from this pointer when `result_ok` is not set is undefined.
16929 struct LDKBuiltCommitmentTransaction *result;
16931 * A pointer to the contents in the error state.
16932 * Reading from this pointer when `result_ok` is set is undefined.
16934 struct LDKDecodeError *err;
16935 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
16938 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
16939 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
16940 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16942 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
16944 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
16945 * `err` or `result` depending on the state of `result_ok`.
16947 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
16949 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
16952 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
16957 * A wrapper on ClosingTransaction indicating that the built bitcoin
16958 * transaction is trusted.
16960 * See trust() and verify() functions on CommitmentTransaction.
16962 * This structure implements Deref.
16964 typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
16966 * A pointer to the opaque Rust object.
16967 * Nearly everywhere, inner must be non-null, however in places where
16968 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16970 LDKnativeTrustedClosingTransaction *inner;
16972 * Indicates that this is the only struct which contains the same pointer.
16973 * Rust functions which take ownership of an object provided via an argument require
16974 * this to be true and invalidate the object pointed to by inner.
16977 } LDKTrustedClosingTransaction;
16980 * The contents of CResult_TrustedClosingTransactionNoneZ
16982 typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
16984 * A pointer to the contents in the success state.
16985 * Reading from this pointer when `result_ok` is not set is undefined.
16987 struct LDKTrustedClosingTransaction *result;
16989 * Note that this value is always NULL, as there are no contents in the Err variant
16992 } LDKCResult_TrustedClosingTransactionNoneZPtr;
16995 * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
16996 * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
16997 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16999 typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
17001 * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
17002 * `err` or `result` depending on the state of `result_ok`.
17004 union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
17006 * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
17009 } LDKCResult_TrustedClosingTransactionNoneZ;
17012 * The contents of CResult_CommitmentTransactionDecodeErrorZ
17014 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
17016 * A pointer to the contents in the success state.
17017 * Reading from this pointer when `result_ok` is not set is undefined.
17019 struct LDKCommitmentTransaction *result;
17021 * A pointer to the contents in the error state.
17022 * Reading from this pointer when `result_ok` is set is undefined.
17024 struct LDKDecodeError *err;
17025 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
17028 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
17029 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
17030 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17032 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
17034 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
17035 * `err` or `result` depending on the state of `result_ok`.
17037 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
17039 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
17042 } LDKCResult_CommitmentTransactionDecodeErrorZ;
17047 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
17048 * transaction and the transaction creation keys) are trusted.
17050 * See trust() and verify() functions on CommitmentTransaction.
17052 * This structure implements Deref.
17054 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
17056 * A pointer to the opaque Rust object.
17057 * Nearly everywhere, inner must be non-null, however in places where
17058 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17060 LDKnativeTrustedCommitmentTransaction *inner;
17062 * Indicates that this is the only struct which contains the same pointer.
17063 * Rust functions which take ownership of an object provided via an argument require
17064 * this to be true and invalidate the object pointed to by inner.
17067 } LDKTrustedCommitmentTransaction;
17070 * The contents of CResult_TrustedCommitmentTransactionNoneZ
17072 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
17074 * A pointer to the contents in the success state.
17075 * Reading from this pointer when `result_ok` is not set is undefined.
17077 struct LDKTrustedCommitmentTransaction *result;
17079 * Note that this value is always NULL, as there are no contents in the Err variant
17082 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
17085 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
17086 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
17087 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17089 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
17091 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
17092 * `err` or `result` depending on the state of `result_ok`.
17094 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
17096 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
17099 } LDKCResult_TrustedCommitmentTransactionNoneZ;
17102 * The contents of CResult_CVec_ECDSASignatureZNoneZ
17104 typedef union LDKCResult_CVec_ECDSASignatureZNoneZPtr {
17106 * A pointer to the contents in the success state.
17107 * Reading from this pointer when `result_ok` is not set is undefined.
17109 struct LDKCVec_ECDSASignatureZ *result;
17111 * Note that this value is always NULL, as there are no contents in the Err variant
17114 } LDKCResult_CVec_ECDSASignatureZNoneZPtr;
17117 * A CResult_CVec_ECDSASignatureZNoneZ represents the result of a fallible operation,
17118 * containing a crate::c_types::derived::CVec_ECDSASignatureZ on success and a () on failure.
17119 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17121 typedef struct LDKCResult_CVec_ECDSASignatureZNoneZ {
17123 * The contents of this CResult_CVec_ECDSASignatureZNoneZ, accessible via either
17124 * `err` or `result` depending on the state of `result_ok`.
17126 union LDKCResult_CVec_ECDSASignatureZNoneZPtr contents;
17128 * Whether this CResult_CVec_ECDSASignatureZNoneZ represents a success state.
17131 } LDKCResult_CVec_ECDSASignatureZNoneZ;
17134 * An enum which can either contain a usize or not
17136 typedef enum LDKCOption_usizeZ_Tag {
17138 * When we're in this state, this COption_usizeZ contains a usize
17140 LDKCOption_usizeZ_Some,
17142 * When we're in this state, this COption_usizeZ contains nothing
17144 LDKCOption_usizeZ_None,
17146 * Must be last for serialization purposes
17148 LDKCOption_usizeZ_Sentinel,
17149 } LDKCOption_usizeZ_Tag;
17151 typedef struct LDKCOption_usizeZ {
17152 LDKCOption_usizeZ_Tag tag;
17158 } LDKCOption_usizeZ;
17161 * The contents of CResult_ShutdownScriptDecodeErrorZ
17163 typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
17165 * A pointer to the contents in the success state.
17166 * Reading from this pointer when `result_ok` is not set is undefined.
17168 struct LDKShutdownScript *result;
17170 * A pointer to the contents in the error state.
17171 * Reading from this pointer when `result_ok` is set is undefined.
17173 struct LDKDecodeError *err;
17174 } LDKCResult_ShutdownScriptDecodeErrorZPtr;
17177 * A CResult_ShutdownScriptDecodeErrorZ represents the result of a fallible operation,
17178 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::msgs::DecodeError on failure.
17179 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17181 typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
17183 * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
17184 * `err` or `result` depending on the state of `result_ok`.
17186 union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
17188 * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
17191 } LDKCResult_ShutdownScriptDecodeErrorZ;
17196 * An error occurring when converting from [`ScriptBuf`] to [`ShutdownScript`].
17198 typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
17200 * A pointer to the opaque Rust object.
17201 * Nearly everywhere, inner must be non-null, however in places where
17202 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17204 LDKnativeInvalidShutdownScript *inner;
17206 * Indicates that this is the only struct which contains the same pointer.
17207 * Rust functions which take ownership of an object provided via an argument require
17208 * this to be true and invalidate the object pointed to by inner.
17211 } LDKInvalidShutdownScript;
17214 * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
17216 typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
17218 * A pointer to the contents in the success state.
17219 * Reading from this pointer when `result_ok` is not set is undefined.
17221 struct LDKShutdownScript *result;
17223 * A pointer to the contents in the error state.
17224 * Reading from this pointer when `result_ok` is set is undefined.
17226 struct LDKInvalidShutdownScript *err;
17227 } LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
17230 * A CResult_ShutdownScriptInvalidShutdownScriptZ represents the result of a fallible operation,
17231 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::script::InvalidShutdownScript on failure.
17232 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17234 typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
17236 * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
17237 * `err` or `result` depending on the state of `result_ok`.
17239 union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
17241 * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
17244 } LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
17247 * Some information provided on receipt of payment depends on whether the payment received is a
17248 * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
17250 typedef enum LDKPaymentPurpose_Tag {
17252 * A payment for a BOLT 11 invoice.
17254 LDKPaymentPurpose_Bolt11InvoicePayment,
17256 * A payment for a BOLT 12 [`Offer`].
17258 * [`Offer`]: crate::offers::offer::Offer
17260 LDKPaymentPurpose_Bolt12OfferPayment,
17262 * A payment for a BOLT 12 [`Refund`].
17264 * [`Refund`]: crate::offers::refund::Refund
17266 LDKPaymentPurpose_Bolt12RefundPayment,
17268 * Because this is a spontaneous payment, the payer generated their own preimage rather than us
17269 * (the payee) providing a preimage.
17271 LDKPaymentPurpose_SpontaneousPayment,
17273 * Must be last for serialization purposes
17275 LDKPaymentPurpose_Sentinel,
17276 } LDKPaymentPurpose_Tag;
17278 typedef struct LDKPaymentPurpose_LDKBolt11InvoicePayment_Body {
17280 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
17281 * [`ChannelManager::create_inbound_payment`]. When handling [`Event::PaymentClaimable`],
17282 * this can be passed directly to [`ChannelManager::claim_funds`] to claim the payment. No
17283 * action is needed when seen in [`Event::PaymentClaimed`].
17285 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
17286 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
17288 struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
17290 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
17291 * number of deanonymization attacks during the routing process.
17292 * It is provided here for your reference, however its accuracy is enforced directly by
17293 * [`ChannelManager`] using the values you previously provided to
17294 * [`ChannelManager::create_inbound_payment`] or
17295 * [`ChannelManager::create_inbound_payment_for_hash`].
17297 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
17298 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
17299 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
17301 struct LDKThirtyTwoBytes payment_secret;
17302 } LDKPaymentPurpose_LDKBolt11InvoicePayment_Body;
17304 typedef struct LDKPaymentPurpose_LDKBolt12OfferPayment_Body {
17306 * The preimage to the payment hash. When handling [`Event::PaymentClaimable`], this can be
17307 * passed directly to [`ChannelManager::claim_funds`], if provided. No action is needed
17308 * when seen in [`Event::PaymentClaimed`].
17310 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
17312 struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
17314 * The secret used to authenticate the sender to the recipient, preventing a number of
17315 * de-anonymization attacks while routing a payment.
17317 * See [`PaymentPurpose::Bolt11InvoicePayment::payment_secret`] for further details.
17319 struct LDKThirtyTwoBytes payment_secret;
17321 * The context of the payment such as information about the corresponding [`Offer`] and
17322 * [`InvoiceRequest`].
17324 * [`Offer`]: crate::offers::offer::Offer
17325 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
17327 struct LDKBolt12OfferContext payment_context;
17328 } LDKPaymentPurpose_LDKBolt12OfferPayment_Body;
17330 typedef struct LDKPaymentPurpose_LDKBolt12RefundPayment_Body {
17332 * The preimage to the payment hash. When handling [`Event::PaymentClaimable`], this can be
17333 * passed directly to [`ChannelManager::claim_funds`], if provided. No action is needed
17334 * when seen in [`Event::PaymentClaimed`].
17336 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
17338 struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
17340 * The secret used to authenticate the sender to the recipient, preventing a number of
17341 * de-anonymization attacks while routing a payment.
17343 * See [`PaymentPurpose::Bolt11InvoicePayment::payment_secret`] for further details.
17345 struct LDKThirtyTwoBytes payment_secret;
17347 * The context of the payment such as information about the corresponding [`Refund`].
17349 * [`Refund`]: crate::offers::refund::Refund
17351 struct LDKBolt12RefundContext payment_context;
17352 } LDKPaymentPurpose_LDKBolt12RefundPayment_Body;
17354 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
17355 LDKPaymentPurpose_Tag tag;
17357 LDKPaymentPurpose_LDKBolt11InvoicePayment_Body bolt11_invoice_payment;
17358 LDKPaymentPurpose_LDKBolt12OfferPayment_Body bolt12_offer_payment;
17359 LDKPaymentPurpose_LDKBolt12RefundPayment_Body bolt12_refund_payment;
17361 struct LDKThirtyTwoBytes spontaneous_payment;
17364 } LDKPaymentPurpose;
17367 * The contents of CResult_PaymentPurposeDecodeErrorZ
17369 typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
17371 * A pointer to the contents in the success state.
17372 * Reading from this pointer when `result_ok` is not set is undefined.
17374 struct LDKPaymentPurpose *result;
17376 * A pointer to the contents in the error state.
17377 * Reading from this pointer when `result_ok` is set is undefined.
17379 struct LDKDecodeError *err;
17380 } LDKCResult_PaymentPurposeDecodeErrorZPtr;
17383 * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
17384 * containing a crate::lightning::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
17385 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17387 typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
17389 * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
17390 * `err` or `result` depending on the state of `result_ok`.
17392 union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
17394 * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
17397 } LDKCResult_PaymentPurposeDecodeErrorZ;
17402 * Information about an HTLC that is part of a payment that can be claimed.
17404 typedef struct MUST_USE_STRUCT LDKClaimedHTLC {
17406 * A pointer to the opaque Rust object.
17407 * Nearly everywhere, inner must be non-null, however in places where
17408 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17410 LDKnativeClaimedHTLC *inner;
17412 * Indicates that this is the only struct which contains the same pointer.
17413 * Rust functions which take ownership of an object provided via an argument require
17414 * this to be true and invalidate the object pointed to by inner.
17420 * The contents of CResult_ClaimedHTLCDecodeErrorZ
17422 typedef union LDKCResult_ClaimedHTLCDecodeErrorZPtr {
17424 * A pointer to the contents in the success state.
17425 * Reading from this pointer when `result_ok` is not set is undefined.
17427 struct LDKClaimedHTLC *result;
17429 * A pointer to the contents in the error state.
17430 * Reading from this pointer when `result_ok` is set is undefined.
17432 struct LDKDecodeError *err;
17433 } LDKCResult_ClaimedHTLCDecodeErrorZPtr;
17436 * A CResult_ClaimedHTLCDecodeErrorZ represents the result of a fallible operation,
17437 * containing a crate::lightning::events::ClaimedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
17438 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17440 typedef struct LDKCResult_ClaimedHTLCDecodeErrorZ {
17442 * The contents of this CResult_ClaimedHTLCDecodeErrorZ, accessible via either
17443 * `err` or `result` depending on the state of `result_ok`.
17445 union LDKCResult_ClaimedHTLCDecodeErrorZPtr contents;
17447 * Whether this CResult_ClaimedHTLCDecodeErrorZ represents a success state.
17450 } LDKCResult_ClaimedHTLCDecodeErrorZ;
17453 * When the payment path failure took place and extra details about it. [`PathFailure::OnPath`] may
17454 * contain a [`NetworkUpdate`] that needs to be applied to the [`NetworkGraph`].
17456 * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
17457 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
17459 typedef enum LDKPathFailure_Tag {
17461 * We failed to initially send the payment and no HTLC was committed to. Contains the relevant
17464 LDKPathFailure_InitialSend,
17466 * A hop on the path failed to forward our payment.
17468 LDKPathFailure_OnPath,
17470 * Must be last for serialization purposes
17472 LDKPathFailure_Sentinel,
17473 } LDKPathFailure_Tag;
17475 typedef struct LDKPathFailure_LDKInitialSend_Body {
17477 * The error surfaced from initial send.
17479 struct LDKAPIError err;
17480 } LDKPathFailure_LDKInitialSend_Body;
17482 typedef struct LDKPathFailure_LDKOnPath_Body {
17484 * If present, this [`NetworkUpdate`] should be applied to the [`NetworkGraph`] so that routing
17485 * decisions can take into account the update.
17487 * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
17488 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
17490 struct LDKCOption_NetworkUpdateZ network_update;
17491 } LDKPathFailure_LDKOnPath_Body;
17493 typedef struct MUST_USE_STRUCT LDKPathFailure {
17494 LDKPathFailure_Tag tag;
17496 LDKPathFailure_LDKInitialSend_Body initial_send;
17497 LDKPathFailure_LDKOnPath_Body on_path;
17502 * An enum which can either contain a crate::lightning::events::PathFailure or not
17504 typedef enum LDKCOption_PathFailureZ_Tag {
17506 * When we're in this state, this COption_PathFailureZ contains a crate::lightning::events::PathFailure
17508 LDKCOption_PathFailureZ_Some,
17510 * When we're in this state, this COption_PathFailureZ contains nothing
17512 LDKCOption_PathFailureZ_None,
17514 * Must be last for serialization purposes
17516 LDKCOption_PathFailureZ_Sentinel,
17517 } LDKCOption_PathFailureZ_Tag;
17519 typedef struct LDKCOption_PathFailureZ {
17520 LDKCOption_PathFailureZ_Tag tag;
17523 struct LDKPathFailure some;
17526 } LDKCOption_PathFailureZ;
17529 * The contents of CResult_COption_PathFailureZDecodeErrorZ
17531 typedef union LDKCResult_COption_PathFailureZDecodeErrorZPtr {
17533 * A pointer to the contents in the success state.
17534 * Reading from this pointer when `result_ok` is not set is undefined.
17536 struct LDKCOption_PathFailureZ *result;
17538 * A pointer to the contents in the error state.
17539 * Reading from this pointer when `result_ok` is set is undefined.
17541 struct LDKDecodeError *err;
17542 } LDKCResult_COption_PathFailureZDecodeErrorZPtr;
17545 * A CResult_COption_PathFailureZDecodeErrorZ represents the result of a fallible operation,
17546 * containing a crate::c_types::derived::COption_PathFailureZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
17547 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17549 typedef struct LDKCResult_COption_PathFailureZDecodeErrorZ {
17551 * The contents of this CResult_COption_PathFailureZDecodeErrorZ, accessible via either
17552 * `err` or `result` depending on the state of `result_ok`.
17554 union LDKCResult_COption_PathFailureZDecodeErrorZPtr contents;
17556 * Whether this CResult_COption_PathFailureZDecodeErrorZ represents a success state.
17559 } LDKCResult_COption_PathFailureZDecodeErrorZ;
17562 * An enum which can either contain a crate::lightning::events::ClosureReason or not
17564 typedef enum LDKCOption_ClosureReasonZ_Tag {
17566 * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::events::ClosureReason
17568 LDKCOption_ClosureReasonZ_Some,
17570 * When we're in this state, this COption_ClosureReasonZ contains nothing
17572 LDKCOption_ClosureReasonZ_None,
17574 * Must be last for serialization purposes
17576 LDKCOption_ClosureReasonZ_Sentinel,
17577 } LDKCOption_ClosureReasonZ_Tag;
17579 typedef struct LDKCOption_ClosureReasonZ {
17580 LDKCOption_ClosureReasonZ_Tag tag;
17583 struct LDKClosureReason some;
17586 } LDKCOption_ClosureReasonZ;
17589 * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
17591 typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
17593 * A pointer to the contents in the success state.
17594 * Reading from this pointer when `result_ok` is not set is undefined.
17596 struct LDKCOption_ClosureReasonZ *result;
17598 * A pointer to the contents in the error state.
17599 * Reading from this pointer when `result_ok` is set is undefined.
17601 struct LDKDecodeError *err;
17602 } LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
17605 * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
17606 * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
17607 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17609 typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
17611 * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
17612 * `err` or `result` depending on the state of `result_ok`.
17614 union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
17616 * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
17619 } LDKCResult_COption_ClosureReasonZDecodeErrorZ;
17622 * Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
17624 typedef enum LDKHTLCDestination_Tag {
17626 * We tried forwarding to a channel but failed to do so. An example of such an instance is when
17627 * there is insufficient capacity in our outbound channel.
17629 LDKHTLCDestination_NextHopChannel,
17631 * Scenario where we are unsure of the next node to forward the HTLC to.
17633 LDKHTLCDestination_UnknownNextHop,
17635 * We couldn't forward to the outgoing scid. An example would be attempting to send a duplicate
17638 LDKHTLCDestination_InvalidForward,
17640 * We couldn't decode the incoming onion to obtain the forwarding details.
17642 LDKHTLCDestination_InvalidOnion,
17644 * Failure scenario where an HTLC may have been forwarded to be intended for us,
17645 * but is invalid for some reason, so we reject it.
17647 * Some of the reasons may include:
17649 * * Excess HTLCs for a payment that we have already fully received, over-paying for the
17651 * * The counterparty node modified the HTLC in transit,
17652 * * A probing attack where an intermediary node is trying to detect if we are the ultimate
17653 * recipient for a payment.
17655 LDKHTLCDestination_FailedPayment,
17657 * Must be last for serialization purposes
17659 LDKHTLCDestination_Sentinel,
17660 } LDKHTLCDestination_Tag;
17662 typedef struct LDKHTLCDestination_LDKNextHopChannel_Body {
17664 * The `node_id` of the next node. For backwards compatibility, this field is
17665 * marked as optional, versions prior to 0.0.110 may not always be able to provide
17666 * counterparty node information.
17668 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
17670 struct LDKPublicKey node_id;
17672 * The outgoing `channel_id` between us and the next node.
17674 struct LDKChannelId channel_id;
17675 } LDKHTLCDestination_LDKNextHopChannel_Body;
17677 typedef struct LDKHTLCDestination_LDKUnknownNextHop_Body {
17679 * Short channel id we are requesting to forward an HTLC to.
17681 uint64_t requested_forward_scid;
17682 } LDKHTLCDestination_LDKUnknownNextHop_Body;
17684 typedef struct LDKHTLCDestination_LDKInvalidForward_Body {
17686 * Short channel id we are requesting to forward an HTLC to.
17688 uint64_t requested_forward_scid;
17689 } LDKHTLCDestination_LDKInvalidForward_Body;
17691 typedef struct LDKHTLCDestination_LDKFailedPayment_Body {
17693 * The payment hash of the payment we attempted to process.
17695 struct LDKThirtyTwoBytes payment_hash;
17696 } LDKHTLCDestination_LDKFailedPayment_Body;
17698 typedef struct MUST_USE_STRUCT LDKHTLCDestination {
17699 LDKHTLCDestination_Tag tag;
17701 LDKHTLCDestination_LDKNextHopChannel_Body next_hop_channel;
17702 LDKHTLCDestination_LDKUnknownNextHop_Body unknown_next_hop;
17703 LDKHTLCDestination_LDKInvalidForward_Body invalid_forward;
17704 LDKHTLCDestination_LDKFailedPayment_Body failed_payment;
17706 } LDKHTLCDestination;
17709 * An enum which can either contain a crate::lightning::events::HTLCDestination or not
17711 typedef enum LDKCOption_HTLCDestinationZ_Tag {
17713 * When we're in this state, this COption_HTLCDestinationZ contains a crate::lightning::events::HTLCDestination
17715 LDKCOption_HTLCDestinationZ_Some,
17717 * When we're in this state, this COption_HTLCDestinationZ contains nothing
17719 LDKCOption_HTLCDestinationZ_None,
17721 * Must be last for serialization purposes
17723 LDKCOption_HTLCDestinationZ_Sentinel,
17724 } LDKCOption_HTLCDestinationZ_Tag;
17726 typedef struct LDKCOption_HTLCDestinationZ {
17727 LDKCOption_HTLCDestinationZ_Tag tag;
17730 struct LDKHTLCDestination some;
17733 } LDKCOption_HTLCDestinationZ;
17736 * The contents of CResult_COption_HTLCDestinationZDecodeErrorZ
17738 typedef union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr {
17740 * A pointer to the contents in the success state.
17741 * Reading from this pointer when `result_ok` is not set is undefined.
17743 struct LDKCOption_HTLCDestinationZ *result;
17745 * A pointer to the contents in the error state.
17746 * Reading from this pointer when `result_ok` is set is undefined.
17748 struct LDKDecodeError *err;
17749 } LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr;
17752 * A CResult_COption_HTLCDestinationZDecodeErrorZ represents the result of a fallible operation,
17753 * containing a crate::c_types::derived::COption_HTLCDestinationZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
17754 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17756 typedef struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ {
17758 * The contents of this CResult_COption_HTLCDestinationZDecodeErrorZ, accessible via either
17759 * `err` or `result` depending on the state of `result_ok`.
17761 union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr contents;
17763 * Whether this CResult_COption_HTLCDestinationZDecodeErrorZ represents a success state.
17766 } LDKCResult_COption_HTLCDestinationZDecodeErrorZ;
17769 * The contents of CResult_PaymentFailureReasonDecodeErrorZ
17771 typedef union LDKCResult_PaymentFailureReasonDecodeErrorZPtr {
17773 * A pointer to the contents in the success state.
17774 * Reading from this pointer when `result_ok` is not set is undefined.
17776 enum LDKPaymentFailureReason *result;
17778 * A pointer to the contents in the error state.
17779 * Reading from this pointer when `result_ok` is set is undefined.
17781 struct LDKDecodeError *err;
17782 } LDKCResult_PaymentFailureReasonDecodeErrorZPtr;
17785 * A CResult_PaymentFailureReasonDecodeErrorZ represents the result of a fallible operation,
17786 * containing a crate::lightning::events::PaymentFailureReason on success and a crate::lightning::ln::msgs::DecodeError on failure.
17787 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17789 typedef struct LDKCResult_PaymentFailureReasonDecodeErrorZ {
17791 * The contents of this CResult_PaymentFailureReasonDecodeErrorZ, accessible via either
17792 * `err` or `result` depending on the state of `result_ok`.
17794 union LDKCResult_PaymentFailureReasonDecodeErrorZPtr contents;
17796 * Whether this CResult_PaymentFailureReasonDecodeErrorZ represents a success state.
17799 } LDKCResult_PaymentFailureReasonDecodeErrorZ;
17802 * An enum which can either contain a crate::c_types::U128 or not
17804 typedef enum LDKCOption_U128Z_Tag {
17806 * When we're in this state, this COption_U128Z contains a crate::c_types::U128
17808 LDKCOption_U128Z_Some,
17810 * When we're in this state, this COption_U128Z contains nothing
17812 LDKCOption_U128Z_None,
17814 * Must be last for serialization purposes
17816 LDKCOption_U128Z_Sentinel,
17817 } LDKCOption_U128Z_Tag;
17819 typedef struct LDKCOption_U128Z {
17820 LDKCOption_U128Z_Tag tag;
17823 struct LDKU128 some;
17826 } LDKCOption_U128Z;
17829 * A dynamically-allocated array of crate::lightning::events::ClaimedHTLCs of arbitrary size.
17830 * This corresponds to std::vector in C++
17832 typedef struct LDKCVec_ClaimedHTLCZ {
17834 * The elements in the array.
17835 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
17837 struct LDKClaimedHTLC *data;
17839 * The number of elements pointed to by `data`.
17842 } LDKCVec_ClaimedHTLCZ;
17845 * An enum which can either contain a crate::lightning::events::PaymentFailureReason or not
17847 typedef enum LDKCOption_PaymentFailureReasonZ_Tag {
17849 * When we're in this state, this COption_PaymentFailureReasonZ contains a crate::lightning::events::PaymentFailureReason
17851 LDKCOption_PaymentFailureReasonZ_Some,
17853 * When we're in this state, this COption_PaymentFailureReasonZ contains nothing
17855 LDKCOption_PaymentFailureReasonZ_None,
17857 * Must be last for serialization purposes
17859 LDKCOption_PaymentFailureReasonZ_Sentinel,
17860 } LDKCOption_PaymentFailureReasonZ_Tag;
17862 typedef struct LDKCOption_PaymentFailureReasonZ {
17863 LDKCOption_PaymentFailureReasonZ_Tag tag;
17866 enum LDKPaymentFailureReason some;
17869 } LDKCOption_PaymentFailureReasonZ;
17874 * A descriptor used to sign for a commitment transaction's anchor output.
17876 typedef struct MUST_USE_STRUCT LDKAnchorDescriptor {
17878 * A pointer to the opaque Rust object.
17879 * Nearly everywhere, inner must be non-null, however in places where
17880 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17882 LDKnativeAnchorDescriptor *inner;
17884 * Indicates that this is the only struct which contains the same pointer.
17885 * Rust functions which take ownership of an object provided via an argument require
17886 * this to be true and invalidate the object pointed to by inner.
17889 } LDKAnchorDescriptor;
17892 * Represents the different types of transactions, originating from LDK, to be bumped.
17894 typedef enum LDKBumpTransactionEvent_Tag {
17896 * Indicates that a channel featuring anchor outputs is to be closed by broadcasting the local
17897 * commitment transaction. Since commitment transactions have a static feerate pre-agreed upon,
17898 * they may need additional fees to be attached through a child transaction using the popular
17899 * [Child-Pays-For-Parent](https://bitcoinops.org/en/topics/cpfp) fee bumping technique. This
17900 * child transaction must include the anchor input described within `anchor_descriptor` along
17901 * with additional inputs to meet the target feerate. Failure to meet the target feerate
17902 * decreases the confirmation odds of the transaction package (which includes the commitment
17903 * and child anchor transactions), possibly resulting in a loss of funds. Once the transaction
17904 * is constructed, it must be fully signed for and broadcast by the consumer of the event
17905 * along with the `commitment_tx` enclosed. Note that the `commitment_tx` must always be
17906 * broadcast first, as the child anchor transaction depends on it.
17908 * The consumer should be able to sign for any of the additional inputs included within the
17909 * child anchor transaction. To sign its anchor input, an [`EcdsaChannelSigner`] should be
17910 * re-derived through [`AnchorDescriptor::derive_channel_signer`]. The anchor input signature
17911 * can be computed with [`EcdsaChannelSigner::sign_holder_anchor_input`], which can then be
17912 * provided to [`build_anchor_input_witness`] along with the `funding_pubkey` to obtain the
17913 * full witness required to spend.
17915 * It is possible to receive more than one instance of this event if a valid child anchor
17916 * transaction is never broadcast or is but not with a sufficient fee to be mined. Care should
17917 * be taken by the consumer of the event to ensure any future iterations of the child anchor
17918 * transaction adhere to the [Replace-By-Fee
17919 * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
17920 * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
17921 * these events is not user-controlled, users may ignore/drop the event if they are no longer
17922 * able to commit external confirmed funds to the child anchor transaction.
17924 * The set of `pending_htlcs` on the commitment transaction to be broadcast can be inspected to
17925 * determine whether a significant portion of the channel's funds are allocated to HTLCs,
17926 * enabling users to make their own decisions regarding the importance of the commitment
17927 * transaction's confirmation. Note that this is not required, but simply exists as an option
17928 * for users to override LDK's behavior. On commitments with no HTLCs (indicated by those with
17929 * an empty `pending_htlcs`), confirmation of the commitment transaction can be considered to
17932 * [`EcdsaChannelSigner`]: crate::sign::ecdsa::EcdsaChannelSigner
17933 * [`EcdsaChannelSigner::sign_holder_anchor_input`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_holder_anchor_input
17934 * [`build_anchor_input_witness`]: crate::ln::chan_utils::build_anchor_input_witness
17936 LDKBumpTransactionEvent_ChannelClose,
17938 * Indicates that a channel featuring anchor outputs has unilaterally closed on-chain by a
17939 * holder commitment transaction and its HTLC(s) need to be resolved on-chain. With the
17940 * zero-HTLC-transaction-fee variant of anchor outputs, the pre-signed HTLC
17941 * transactions have a zero fee, thus requiring additional inputs and/or outputs to be attached
17942 * for a timely confirmation within the chain. These additional inputs and/or outputs must be
17943 * appended to the resulting HTLC transaction to meet the target feerate. Failure to meet the
17944 * target feerate decreases the confirmation odds of the transaction, possibly resulting in a
17945 * loss of funds. Once the transaction meets the target feerate, it must be signed for and
17946 * broadcast by the consumer of the event.
17948 * The consumer should be able to sign for any of the non-HTLC inputs added to the resulting
17949 * HTLC transaction. To sign HTLC inputs, an [`EcdsaChannelSigner`] should be re-derived
17950 * through [`HTLCDescriptor::derive_channel_signer`]. Each HTLC input's signature can be
17951 * computed with [`EcdsaChannelSigner::sign_holder_htlc_transaction`], which can then be
17952 * provided to [`HTLCDescriptor::tx_input_witness`] to obtain the fully signed witness required
17955 * It is possible to receive more than one instance of this event if a valid HTLC transaction
17956 * is never broadcast or is but not with a sufficient fee to be mined. Care should be taken by
17957 * the consumer of the event to ensure any future iterations of the HTLC transaction adhere to
17958 * the [Replace-By-Fee
17959 * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
17960 * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
17961 * these events is not user-controlled, users may ignore/drop the event if either they are no
17962 * longer able to commit external confirmed funds to the HTLC transaction or the fee committed
17963 * to the HTLC transaction is greater in value than the HTLCs being claimed.
17965 * [`EcdsaChannelSigner`]: crate::sign::ecdsa::EcdsaChannelSigner
17966 * [`EcdsaChannelSigner::sign_holder_htlc_transaction`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_holder_htlc_transaction
17968 LDKBumpTransactionEvent_HTLCResolution,
17970 * Must be last for serialization purposes
17972 LDKBumpTransactionEvent_Sentinel,
17973 } LDKBumpTransactionEvent_Tag;
17975 typedef struct LDKBumpTransactionEvent_LDKChannelClose_Body {
17977 * The `channel_id` of the channel which has been closed.
17979 struct LDKChannelId channel_id;
17981 * Counterparty in the closed channel.
17983 struct LDKPublicKey counterparty_node_id;
17985 * The unique identifier for the claim of the anchor output in the commitment transaction.
17987 * The identifier must map to the set of external UTXOs assigned to the claim, such that
17988 * they can be reused when a new claim with the same identifier needs to be made, resulting
17989 * in a fee-bumping attempt.
17991 struct LDKThirtyTwoBytes claim_id;
17993 * The target feerate that the transaction package, which consists of the commitment
17994 * transaction and the to-be-crafted child anchor transaction, must meet.
17996 uint32_t package_target_feerate_sat_per_1000_weight;
17998 * The channel's commitment transaction to bump the fee of. This transaction should be
17999 * broadcast along with the anchor transaction constructed as a result of consuming this
18002 struct LDKTransaction commitment_tx;
18004 * The absolute fee in satoshis of the commitment transaction. This can be used along the
18005 * with weight of the commitment transaction to determine its feerate.
18007 uint64_t commitment_tx_fee_satoshis;
18009 * The descriptor to sign the anchor input of the anchor transaction constructed as a
18010 * result of consuming this event.
18012 struct LDKAnchorDescriptor anchor_descriptor;
18014 * The set of pending HTLCs on the commitment transaction that need to be resolved once the
18015 * commitment transaction confirms.
18017 struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs;
18018 } LDKBumpTransactionEvent_LDKChannelClose_Body;
18020 typedef struct LDKBumpTransactionEvent_LDKHTLCResolution_Body {
18022 * The `channel_id` of the channel which has been closed.
18024 struct LDKChannelId channel_id;
18026 * Counterparty in the closed channel.
18028 struct LDKPublicKey counterparty_node_id;
18030 * The unique identifier for the claim of the HTLCs in the confirmed commitment
18033 * The identifier must map to the set of external UTXOs assigned to the claim, such that
18034 * they can be reused when a new claim with the same identifier needs to be made, resulting
18035 * in a fee-bumping attempt.
18037 struct LDKThirtyTwoBytes claim_id;
18039 * The target feerate that the resulting HTLC transaction must meet.
18041 uint32_t target_feerate_sat_per_1000_weight;
18043 * The set of pending HTLCs on the confirmed commitment that need to be claimed, preferably
18044 * by the same transaction.
18046 struct LDKCVec_HTLCDescriptorZ htlc_descriptors;
18048 * The locktime required for the resulting HTLC transaction.
18050 uint32_t tx_lock_time;
18051 } LDKBumpTransactionEvent_LDKHTLCResolution_Body;
18053 typedef struct MUST_USE_STRUCT LDKBumpTransactionEvent {
18054 LDKBumpTransactionEvent_Tag tag;
18056 LDKBumpTransactionEvent_LDKChannelClose_Body channel_close;
18057 LDKBumpTransactionEvent_LDKHTLCResolution_Body htlc_resolution;
18059 } LDKBumpTransactionEvent;
18062 * An Event which you should probably take some action in response to.
18064 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
18065 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
18066 * written as it makes no sense to respond to it after reconnecting to peers).
18068 typedef enum LDKEvent_Tag {
18070 * Used to indicate that the client should generate a funding transaction with the given
18071 * parameters and then call [`ChannelManager::funding_transaction_generated`].
18072 * Generated in [`ChannelManager`] message handling.
18073 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
18074 * counterparty can steal your funds!
18076 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
18077 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
18079 LDKEvent_FundingGenerationReady,
18081 * Indicates that we've been offered a payment and it needs to be claimed via calling
18082 * [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`].
18084 * Note that if the preimage is not known, you should call
18085 * [`ChannelManager::fail_htlc_backwards`] or [`ChannelManager::fail_htlc_backwards_with_reason`]
18086 * to free up resources for this HTLC and avoid network congestion.
18088 * If [`Event::PaymentClaimable::onion_fields`] is `Some`, and includes custom TLVs with even type
18089 * numbers, you should use [`ChannelManager::fail_htlc_backwards_with_reason`] with
18090 * [`FailureCode::InvalidOnionPayload`] if you fail to understand and handle the contents, or
18091 * [`ChannelManager::claim_funds_with_known_custom_tlvs`] upon successful handling.
18092 * If you don't intend to check for custom TLVs, you can simply use
18093 * [`ChannelManager::claim_funds`], which will automatically fail back even custom TLVs.
18095 * If you fail to call [`ChannelManager::claim_funds`],
18096 * [`ChannelManager::claim_funds_with_known_custom_tlvs`],
18097 * [`ChannelManager::fail_htlc_backwards`], or
18098 * [`ChannelManager::fail_htlc_backwards_with_reason`] within the HTLC's timeout, the HTLC will
18099 * be automatically failed.
18102 * LDK will not stop an inbound payment from being paid multiple times, so multiple
18103 * `PaymentClaimable` events may be generated for the same payment. In such a case it is
18104 * polite (and required in the lightning specification) to fail the payment the second time
18105 * and give the sender their money back rather than accepting double payment.
18108 * This event used to be called `PaymentReceived` in LDK versions 0.0.112 and earlier.
18110 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
18111 * [`ChannelManager::claim_funds_with_known_custom_tlvs`]: crate::ln::channelmanager::ChannelManager::claim_funds_with_known_custom_tlvs
18112 * [`FailureCode::InvalidOnionPayload`]: crate::ln::channelmanager::FailureCode::InvalidOnionPayload
18113 * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
18114 * [`ChannelManager::fail_htlc_backwards_with_reason`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards_with_reason
18116 LDKEvent_PaymentClaimable,
18118 * Indicates a payment has been claimed and we've received money!
18120 * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
18121 * to an [`Event::PaymentClaimable`]. However, if we previously crashed during a
18122 * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
18123 * [`Event::PaymentClaimable`] event.
18126 * LDK will not stop an inbound payment from being paid multiple times, so multiple
18127 * `PaymentClaimable` events may be generated for the same payment. If you then call
18128 * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentClaimable`] you may get
18129 * multiple `PaymentClaimed` events.
18131 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
18133 LDKEvent_PaymentClaimed,
18135 * Indicates that a peer connection with a node is needed in order to send an [`OnionMessage`].
18137 * Typically, this happens when a [`MessageRouter`] is unable to find a complete path to a
18138 * [`Destination`]. Once a connection is established, any messages buffered by an
18139 * [`OnionMessageHandler`] may be sent.
18141 * This event will not be generated for onion message forwards; only for sends including
18142 * replies. Handlers should connect to the node otherwise any buffered messages may be lost.
18144 * [`OnionMessage`]: msgs::OnionMessage
18145 * [`MessageRouter`]: crate::onion_message::messenger::MessageRouter
18146 * [`Destination`]: crate::onion_message::messenger::Destination
18147 * [`OnionMessageHandler`]: crate::ln::msgs::OnionMessageHandler
18149 LDKEvent_ConnectionNeeded,
18151 * Indicates a request for an invoice failed to yield a response in a reasonable amount of time
18152 * or was explicitly abandoned by [`ChannelManager::abandon_payment`]. This may be for an
18153 * [`InvoiceRequest`] sent for an [`Offer`] or for a [`Refund`] that hasn't been redeemed.
18155 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
18156 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
18157 * [`Offer`]: crate::offers::offer::Offer
18158 * [`Refund`]: crate::offers::refund::Refund
18160 LDKEvent_InvoiceRequestFailed,
18162 * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
18163 * and we got back the payment preimage for it).
18165 * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
18166 * event. In this situation, you SHOULD treat this payment as having succeeded.
18168 LDKEvent_PaymentSent,
18170 * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
18171 * provide failure information for each path attempt in the payment, including retries.
18173 * This event is provided once there are no further pending HTLCs for the payment and the
18174 * payment is no longer retryable, due either to the [`Retry`] provided or
18175 * [`ChannelManager::abandon_payment`] having been called for the corresponding payment.
18177 * In exceedingly rare cases, it is possible that an [`Event::PaymentFailed`] is generated for
18178 * a payment after an [`Event::PaymentSent`] event for this same payment has already been
18179 * received and processed. In this case, the [`Event::PaymentFailed`] event MUST be ignored,
18180 * and the payment MUST be treated as having succeeded.
18182 * [`Retry`]: crate::ln::channelmanager::Retry
18183 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
18185 LDKEvent_PaymentFailed,
18187 * Indicates that a path for an outbound payment was successful.
18189 * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
18190 * [`Event::PaymentSent`] for obtaining the payment preimage.
18192 LDKEvent_PaymentPathSuccessful,
18194 * Indicates an outbound HTLC we sent failed, likely due to an intermediary node being unable to
18197 * Note that this does *not* indicate that all paths for an MPP payment have failed, see
18198 * [`Event::PaymentFailed`].
18200 * See [`ChannelManager::abandon_payment`] for giving up on this payment before its retries have
18203 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
18205 LDKEvent_PaymentPathFailed,
18207 * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
18209 LDKEvent_ProbeSuccessful,
18211 * Indicates that a probe payment we sent failed at an intermediary node on the path.
18213 LDKEvent_ProbeFailed,
18215 * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
18216 * a time in the future.
18218 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
18220 LDKEvent_PendingHTLCsForwardable,
18222 * Used to indicate that we've intercepted an HTLC forward. This event will only be generated if
18223 * you've encoded an intercept scid in the receiver's invoice route hints using
18224 * [`ChannelManager::get_intercept_scid`] and have set [`UserConfig::accept_intercept_htlcs`].
18226 * [`ChannelManager::forward_intercepted_htlc`] or
18227 * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to this event. See
18228 * their docs for more information.
18230 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
18231 * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
18232 * [`ChannelManager::forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
18233 * [`ChannelManager::fail_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::fail_intercepted_htlc
18235 LDKEvent_HTLCIntercepted,
18237 * Used to indicate that an output which you should know how to spend was confirmed on chain
18238 * and is now spendable.
18240 * Such an output will *never* be spent directly by LDK, and are not at risk of your
18241 * counterparty spending them due to some kind of timeout. Thus, you need to store them
18242 * somewhere and spend them when you create on-chain transactions.
18244 * You may hand them to the [`OutputSweeper`] utility which will store and (re-)generate spending
18245 * transactions for you.
18247 * [`OutputSweeper`]: crate::util::sweep::OutputSweeper
18249 LDKEvent_SpendableOutputs,
18251 * This event is generated when a payment has been successfully forwarded through us and a
18252 * forwarding fee earned.
18254 LDKEvent_PaymentForwarded,
18256 * Used to indicate that a channel with the given `channel_id` is being opened and pending
18257 * confirmation on-chain.
18259 * This event is emitted when the funding transaction has been signed and is broadcast to the
18260 * network. For 0conf channels it will be immediately followed by the corresponding
18261 * [`Event::ChannelReady`] event.
18263 LDKEvent_ChannelPending,
18265 * Used to indicate that a channel with the given `channel_id` is ready to
18266 * be used. This event is emitted either when the funding transaction has been confirmed
18267 * on-chain, or, in case of a 0conf channel, when both parties have confirmed the channel
18270 LDKEvent_ChannelReady,
18272 * Used to indicate that a channel that got past the initial handshake with the given `channel_id` is in the
18273 * process of closure. This includes previously opened channels, and channels that time out from not being funded.
18275 * Note that this event is only triggered for accepted channels: if the
18276 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true and the channel is
18277 * rejected, no `ChannelClosed` event will be sent.
18279 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18280 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
18282 LDKEvent_ChannelClosed,
18284 * Used to indicate to the user that they can abandon the funding transaction and recycle the
18285 * inputs for another purpose.
18287 * This event is not guaranteed to be generated for channels that are closed due to a restart.
18289 LDKEvent_DiscardFunding,
18291 * Indicates a request to open a new channel by a peer.
18293 * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the request,
18294 * call [`ChannelManager::force_close_without_broadcasting_txn`]. Note that a ['ChannelClosed`]
18295 * event will _not_ be triggered if the channel is rejected.
18297 * The event is only triggered when a new open channel request is received and the
18298 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
18300 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18301 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
18302 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
18304 LDKEvent_OpenChannelRequest,
18306 * Indicates that the HTLC was accepted, but could not be processed when or after attempting to
18309 * Some scenarios where this event may be sent include:
18310 * * Insufficient capacity in the outbound channel
18311 * * While waiting to forward the HTLC, the channel it is meant to be forwarded through closes
18312 * * When an unknown SCID is requested for forwarding a payment.
18313 * * Expected MPP amount has already been reached
18314 * * The HTLC has timed out
18316 * This event, however, does not get generated if an HTLC fails to meet the forwarding
18317 * requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
18319 LDKEvent_HTLCHandlingFailed,
18321 * Indicates that a transaction originating from LDK needs to have its fee bumped. This event
18322 * requires confirmed external funds to be readily available to spend.
18324 * LDK does not currently generate this event unless the
18325 * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`] config flag is set to true.
18326 * It is limited to the scope of channels with anchor outputs.
18328 * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`]: crate::util::config::ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx
18330 LDKEvent_BumpTransaction,
18332 * Must be last for serialization purposes
18337 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
18339 * The random channel_id we picked which you'll need to pass into
18340 * [`ChannelManager::funding_transaction_generated`].
18342 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
18344 struct LDKChannelId temporary_channel_id;
18346 * The counterparty's node_id, which you'll need to pass back into
18347 * [`ChannelManager::funding_transaction_generated`].
18349 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
18351 struct LDKPublicKey counterparty_node_id;
18353 * The value, in satoshis, that the output should have.
18355 uint64_t channel_value_satoshis;
18357 * The script which should be used in the transaction output.
18359 struct LDKCVec_u8Z output_script;
18361 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
18362 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
18363 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
18364 * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
18365 * serialized with LDK versions prior to 0.0.113.
18367 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
18368 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18369 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
18371 struct LDKU128 user_channel_id;
18372 } LDKEvent_LDKFundingGenerationReady_Body;
18374 typedef struct LDKEvent_LDKPaymentClaimable_Body {
18376 * The node that will receive the payment after it has been claimed.
18377 * This is useful to identify payments received via [phantom nodes].
18378 * This field will always be filled in when the event was generated by LDK versions
18379 * 0.0.113 and above.
18381 * [phantom nodes]: crate::sign::PhantomKeysManager
18383 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18385 struct LDKPublicKey receiver_node_id;
18387 * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
18388 * not stop you from registering duplicate payment hashes for inbound payments.
18390 struct LDKThirtyTwoBytes payment_hash;
18392 * The fields in the onion which were received with each HTLC. Only fields which were
18393 * identical in each HTLC involved in the payment will be included here.
18395 * Payments received on LDK versions prior to 0.0.115 will have this field unset.
18397 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18399 struct LDKRecipientOnionFields onion_fields;
18401 * The value, in thousandths of a satoshi, that this payment is claimable for. May be greater
18402 * than the invoice amount.
18404 * May be less than the invoice amount if [`ChannelConfig::accept_underpaying_htlcs`] is set
18405 * and the previous hop took an extra fee.
18408 * If [`ChannelConfig::accept_underpaying_htlcs`] is set and you claim without verifying this
18409 * field, you may lose money!
18411 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
18413 uint64_t amount_msat;
18415 * The value, in thousands of a satoshi, that was skimmed off of this payment as an extra fee
18416 * taken by our channel counterparty.
18418 * Will always be 0 unless [`ChannelConfig::accept_underpaying_htlcs`] is set.
18420 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
18422 uint64_t counterparty_skimmed_fee_msat;
18424 * Information for claiming this received payment, based on whether the purpose of the
18425 * payment is to pay an invoice or to send a spontaneous payment.
18427 struct LDKPaymentPurpose purpose;
18429 * The `channel_id` indicating over which channel we received the payment.
18431 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18433 struct LDKChannelId via_channel_id;
18435 * The `user_channel_id` indicating over which channel we received the payment.
18437 struct LDKCOption_U128Z via_user_channel_id;
18439 * The block height at which this payment will be failed back and will no longer be
18440 * eligible for claiming.
18442 * Prior to this height, a call to [`ChannelManager::claim_funds`] is guaranteed to
18443 * succeed, however you should wait for [`Event::PaymentClaimed`] to be sure.
18445 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
18447 struct LDKCOption_u32Z claim_deadline;
18448 } LDKEvent_LDKPaymentClaimable_Body;
18450 typedef struct LDKEvent_LDKPaymentClaimed_Body {
18452 * The node that received the payment.
18453 * This is useful to identify payments which were received via [phantom nodes].
18454 * This field will always be filled in when the event was generated by LDK versions
18455 * 0.0.113 and above.
18457 * [phantom nodes]: crate::sign::PhantomKeysManager
18459 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18461 struct LDKPublicKey receiver_node_id;
18463 * The payment hash of the claimed payment. Note that LDK will not stop you from
18464 * registering duplicate payment hashes for inbound payments.
18466 struct LDKThirtyTwoBytes payment_hash;
18468 * The value, in thousandths of a satoshi, that this payment is for. May be greater than the
18471 uint64_t amount_msat;
18473 * The purpose of the claimed payment, i.e. whether the payment was for an invoice or a
18474 * spontaneous payment.
18476 struct LDKPaymentPurpose purpose;
18478 * The HTLCs that comprise the claimed payment. This will be empty for events serialized prior
18479 * to LDK version 0.0.117.
18481 struct LDKCVec_ClaimedHTLCZ htlcs;
18483 * The sender-intended sum total of all the MPP parts. This will be `None` for events
18484 * serialized prior to LDK version 0.0.117.
18486 struct LDKCOption_u64Z sender_intended_total_msat;
18487 } LDKEvent_LDKPaymentClaimed_Body;
18489 typedef struct LDKEvent_LDKConnectionNeeded_Body {
18491 * The node id for the node needing a connection.
18493 struct LDKPublicKey node_id;
18495 * Sockets for connecting to the node.
18497 struct LDKCVec_SocketAddressZ addresses;
18498 } LDKEvent_LDKConnectionNeeded_Body;
18500 typedef struct LDKEvent_LDKInvoiceRequestFailed_Body {
18502 * The `payment_id` to have been associated with payment for the requested invoice.
18504 struct LDKThirtyTwoBytes payment_id;
18505 } LDKEvent_LDKInvoiceRequestFailed_Body;
18507 typedef struct LDKEvent_LDKPaymentSent_Body {
18509 * The `payment_id` passed to [`ChannelManager::send_payment`].
18511 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18513 struct LDKCOption_ThirtyTwoBytesZ payment_id;
18515 * The preimage to the hash given to ChannelManager::send_payment.
18516 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
18517 * store it somehow!
18519 struct LDKThirtyTwoBytes payment_preimage;
18521 * The hash that was given to [`ChannelManager::send_payment`].
18523 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18525 struct LDKThirtyTwoBytes payment_hash;
18527 * The total fee which was spent at intermediate hops in this payment, across all paths.
18529 * Note that, like [`Route::get_total_fees`] this does *not* include any potential
18530 * overpayment to the recipient node.
18532 * If the recipient or an intermediate node misbehaves and gives us free money, this may
18533 * overstate the amount paid, though this is unlikely.
18535 * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
18537 struct LDKCOption_u64Z fee_paid_msat;
18538 } LDKEvent_LDKPaymentSent_Body;
18540 typedef struct LDKEvent_LDKPaymentFailed_Body {
18542 * The `payment_id` passed to [`ChannelManager::send_payment`].
18544 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18546 struct LDKThirtyTwoBytes payment_id;
18548 * The hash that was given to [`ChannelManager::send_payment`].
18550 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18552 struct LDKThirtyTwoBytes payment_hash;
18554 * The reason the payment failed. This is only `None` for events generated or serialized
18555 * by versions prior to 0.0.115.
18557 struct LDKCOption_PaymentFailureReasonZ reason;
18558 } LDKEvent_LDKPaymentFailed_Body;
18560 typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
18562 * The `payment_id` passed to [`ChannelManager::send_payment`].
18564 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18566 struct LDKThirtyTwoBytes payment_id;
18568 * The hash that was given to [`ChannelManager::send_payment`].
18570 * This will be `Some` for all payments which completed on LDK 0.0.104 or later.
18572 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18574 struct LDKCOption_ThirtyTwoBytesZ payment_hash;
18576 * The payment path that was successful.
18578 * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
18580 struct LDKPath path;
18581 } LDKEvent_LDKPaymentPathSuccessful_Body;
18583 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
18585 * The `payment_id` passed to [`ChannelManager::send_payment`].
18587 * This will be `Some` for all payment paths which failed on LDK 0.0.103 or later.
18589 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18590 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
18592 struct LDKCOption_ThirtyTwoBytesZ payment_id;
18594 * The hash that was given to [`ChannelManager::send_payment`].
18596 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18598 struct LDKThirtyTwoBytes payment_hash;
18600 * Indicates the payment was rejected for some reason by the recipient. This implies that
18601 * the payment has failed, not just the route in question. If this is not set, the payment may
18602 * be retried via a different route.
18604 bool payment_failed_permanently;
18606 * Extra error details based on the failure type. May contain an update that needs to be
18607 * applied to the [`NetworkGraph`].
18609 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
18611 struct LDKPathFailure failure;
18613 * The payment path that failed.
18615 struct LDKPath path;
18617 * The channel responsible for the failed payment path.
18619 * Note that for route hints or for the first hop in a path this may be an SCID alias and
18620 * may not refer to a channel in the public network graph. These aliases may also collide
18621 * with channels in the public network graph.
18623 * If this is `Some`, then the corresponding channel should be avoided when the payment is
18624 * retried. May be `None` for older [`Event`] serializations.
18626 struct LDKCOption_u64Z short_channel_id;
18627 } LDKEvent_LDKPaymentPathFailed_Body;
18629 typedef struct LDKEvent_LDKProbeSuccessful_Body {
18631 * The id returned by [`ChannelManager::send_probe`].
18633 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
18635 struct LDKThirtyTwoBytes payment_id;
18637 * The hash generated by [`ChannelManager::send_probe`].
18639 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
18641 struct LDKThirtyTwoBytes payment_hash;
18643 * The payment path that was successful.
18645 struct LDKPath path;
18646 } LDKEvent_LDKProbeSuccessful_Body;
18648 typedef struct LDKEvent_LDKProbeFailed_Body {
18650 * The id returned by [`ChannelManager::send_probe`].
18652 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
18654 struct LDKThirtyTwoBytes payment_id;
18656 * The hash generated by [`ChannelManager::send_probe`].
18658 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
18660 struct LDKThirtyTwoBytes payment_hash;
18662 * The payment path that failed.
18664 struct LDKPath path;
18666 * The channel responsible for the failed probe.
18668 * Note that for route hints or for the first hop in a path this may be an SCID alias and
18669 * may not refer to a channel in the public network graph. These aliases may also collide
18670 * with channels in the public network graph.
18672 struct LDKCOption_u64Z short_channel_id;
18673 } LDKEvent_LDKProbeFailed_Body;
18675 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
18677 * The minimum amount of time that should be waited prior to calling
18678 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
18679 * you should wait a random amount of time in roughly the range (now + time_forwardable,
18680 * now + 5*time_forwardable).
18682 uint64_t time_forwardable;
18683 } LDKEvent_LDKPendingHTLCsForwardable_Body;
18685 typedef struct LDKEvent_LDKHTLCIntercepted_Body {
18687 * An id to help LDK identify which HTLC is being forwarded or failed.
18689 struct LDKThirtyTwoBytes intercept_id;
18691 * The fake scid that was programmed as the next hop's scid, generated using
18692 * [`ChannelManager::get_intercept_scid`].
18694 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
18696 uint64_t requested_next_hop_scid;
18698 * The payment hash used for this HTLC.
18700 struct LDKThirtyTwoBytes payment_hash;
18702 * How many msats were received on the inbound edge of this HTLC.
18704 uint64_t inbound_amount_msat;
18706 * How many msats the payer intended to route to the next node. Depending on the reason you are
18707 * intercepting this payment, you might take a fee by forwarding less than this amount.
18708 * Forwarding less than this amount may break compatibility with LDK versions prior to 0.0.116.
18710 * Note that LDK will NOT check that expected fees were factored into this value. You MUST
18711 * check that whatever fee you want has been included here or subtract it as required. Further,
18712 * LDK will not stop you from forwarding more than you received.
18714 uint64_t expected_outbound_amount_msat;
18715 } LDKEvent_LDKHTLCIntercepted_Body;
18717 typedef struct LDKEvent_LDKSpendableOutputs_Body {
18719 * The outputs which you should store as spendable by you.
18721 struct LDKCVec_SpendableOutputDescriptorZ outputs;
18723 * The `channel_id` indicating which channel the spendable outputs belong to.
18725 * This will always be `Some` for events generated by LDK versions 0.0.117 and above.
18727 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18729 struct LDKChannelId channel_id;
18730 } LDKEvent_LDKSpendableOutputs_Body;
18732 typedef struct LDKEvent_LDKPaymentForwarded_Body {
18734 * The channel id of the incoming channel between the previous node and us.
18736 * This is only `None` for events generated or serialized by versions prior to 0.0.107.
18738 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18740 struct LDKChannelId prev_channel_id;
18742 * The channel id of the outgoing channel between the next node and us.
18744 * This is only `None` for events generated or serialized by versions prior to 0.0.107.
18746 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18748 struct LDKChannelId next_channel_id;
18750 * The `user_channel_id` of the incoming channel between the previous node and us.
18752 * This is only `None` for events generated or serialized by versions prior to 0.0.122.
18754 struct LDKCOption_U128Z prev_user_channel_id;
18756 * The `user_channel_id` of the outgoing channel between the next node and us.
18758 * This will be `None` if the payment was settled via an on-chain transaction. See the
18759 * caveat described for the `total_fee_earned_msat` field. Moreover it will be `None` for
18760 * events generated or serialized by versions prior to 0.0.122.
18762 struct LDKCOption_U128Z next_user_channel_id;
18764 * The total fee, in milli-satoshis, which was earned as a result of the payment.
18766 * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
18767 * was pending, the amount the next hop claimed will have been rounded down to the nearest
18768 * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
18769 * claimed the full value in millisatoshis from the source. In this case,
18770 * `claim_from_onchain_tx` will be set.
18772 * If the channel which sent us the payment has been force-closed, we will claim the funds
18773 * via an on-chain transaction. In that case we do not yet know the on-chain transaction
18774 * fees which we will spend and will instead set this to `None`. It is possible duplicate
18775 * `PaymentForwarded` events are generated for the same payment iff `total_fee_earned_msat` is
18778 struct LDKCOption_u64Z total_fee_earned_msat;
18780 * The share of the total fee, in milli-satoshis, which was withheld in addition to the
18783 * This will only be `Some` if we forwarded an intercepted HTLC with less than the
18784 * expected amount. This means our counterparty accepted to receive less than the invoice
18785 * amount, e.g., by claiming the payment featuring a corresponding
18786 * [`PaymentClaimable::counterparty_skimmed_fee_msat`].
18788 * Will also always be `None` for events serialized with LDK prior to version 0.0.122.
18790 * The caveat described above the `total_fee_earned_msat` field applies here as well.
18792 * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: Self::PaymentClaimable::counterparty_skimmed_fee_msat
18794 struct LDKCOption_u64Z skimmed_fee_msat;
18796 * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
18799 bool claim_from_onchain_tx;
18801 * The final amount forwarded, in milli-satoshis, after the fee is deducted.
18803 * The caveat described above the `total_fee_earned_msat` field applies here as well.
18805 struct LDKCOption_u64Z outbound_amount_forwarded_msat;
18806 } LDKEvent_LDKPaymentForwarded_Body;
18808 typedef struct LDKEvent_LDKChannelPending_Body {
18810 * The `channel_id` of the channel that is pending confirmation.
18812 struct LDKChannelId channel_id;
18814 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
18815 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
18816 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
18817 * `user_channel_id` will be randomized for an inbound channel.
18819 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
18820 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18821 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
18823 struct LDKU128 user_channel_id;
18825 * The `temporary_channel_id` this channel used to be known by during channel establishment.
18827 * Will be `None` for channels created prior to LDK version 0.0.115.
18829 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18831 struct LDKChannelId former_temporary_channel_id;
18833 * The `node_id` of the channel counterparty.
18835 struct LDKPublicKey counterparty_node_id;
18837 * The outpoint of the channel's funding transaction.
18839 struct LDKOutPoint funding_txo;
18841 * The features that this channel will operate with.
18843 * Will be `None` for channels created prior to LDK version 0.0.122.
18845 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18847 struct LDKChannelTypeFeatures channel_type;
18848 } LDKEvent_LDKChannelPending_Body;
18850 typedef struct LDKEvent_LDKChannelReady_Body {
18852 * The `channel_id` of the channel that is ready.
18854 struct LDKChannelId channel_id;
18856 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
18857 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
18858 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
18859 * `user_channel_id` will be randomized for an inbound channel.
18861 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
18862 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18863 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
18865 struct LDKU128 user_channel_id;
18867 * The `node_id` of the channel counterparty.
18869 struct LDKPublicKey counterparty_node_id;
18871 * The features that this channel will operate with.
18873 struct LDKChannelTypeFeatures channel_type;
18874 } LDKEvent_LDKChannelReady_Body;
18876 typedef struct LDKEvent_LDKChannelClosed_Body {
18878 * The `channel_id` of the channel which has been closed. Note that on-chain transactions
18879 * resolving the channel are likely still awaiting confirmation.
18881 struct LDKChannelId channel_id;
18883 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
18884 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
18885 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
18886 * `user_channel_id` will be randomized for inbound channels.
18887 * This may be zero for inbound channels serialized prior to 0.0.113 and will always be
18888 * zero for objects serialized with LDK versions prior to 0.0.102.
18890 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
18891 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18892 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
18894 struct LDKU128 user_channel_id;
18896 * The reason the channel was closed.
18898 struct LDKClosureReason reason;
18900 * Counterparty in the closed channel.
18902 * This field will be `None` for objects serialized prior to LDK 0.0.117.
18904 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18906 struct LDKPublicKey counterparty_node_id;
18908 * Channel capacity of the closing channel (sats).
18910 * This field will be `None` for objects serialized prior to LDK 0.0.117.
18912 struct LDKCOption_u64Z channel_capacity_sats;
18914 * The original channel funding TXO; this helps checking for the existence and confirmation
18915 * status of the closing tx.
18916 * Note that for instances serialized in v0.0.119 or prior this will be missing (None).
18918 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18920 struct LDKOutPoint channel_funding_txo;
18921 } LDKEvent_LDKChannelClosed_Body;
18923 typedef struct LDKEvent_LDKDiscardFunding_Body {
18925 * The channel_id of the channel which has been closed.
18927 struct LDKChannelId channel_id;
18929 * The full transaction received from the user
18931 struct LDKTransaction transaction;
18932 } LDKEvent_LDKDiscardFunding_Body;
18934 typedef struct LDKEvent_LDKOpenChannelRequest_Body {
18936 * The temporary channel ID of the channel requested to be opened.
18938 * When responding to the request, the `temporary_channel_id` should be passed
18939 * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
18940 * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
18942 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18943 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
18945 struct LDKChannelId temporary_channel_id;
18947 * The node_id of the counterparty requesting to open the channel.
18949 * When responding to the request, the `counterparty_node_id` should be passed
18950 * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
18951 * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
18954 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18955 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
18957 struct LDKPublicKey counterparty_node_id;
18959 * The channel value of the requested channel.
18961 uint64_t funding_satoshis;
18963 * Our starting balance in the channel if the request is accepted, in milli-satoshi.
18965 uint64_t push_msat;
18967 * The features that this channel will operate with. If you reject the channel, a
18968 * well-behaved counterparty may automatically re-attempt the channel with a new set of
18971 * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
18972 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
18975 * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
18976 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
18977 * 0.0.107. Channels setting this type also need to get manually accepted via
18978 * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
18979 * or will be rejected otherwise.
18981 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
18983 struct LDKChannelTypeFeatures channel_type;
18984 } LDKEvent_LDKOpenChannelRequest_Body;
18986 typedef struct LDKEvent_LDKHTLCHandlingFailed_Body {
18988 * The channel over which the HTLC was received.
18990 struct LDKChannelId prev_channel_id;
18992 * Destination of the HTLC that failed to be processed.
18994 struct LDKHTLCDestination failed_next_destination;
18995 } LDKEvent_LDKHTLCHandlingFailed_Body;
18997 typedef struct MUST_USE_STRUCT LDKEvent {
19000 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
19001 LDKEvent_LDKPaymentClaimable_Body payment_claimable;
19002 LDKEvent_LDKPaymentClaimed_Body payment_claimed;
19003 LDKEvent_LDKConnectionNeeded_Body connection_needed;
19004 LDKEvent_LDKInvoiceRequestFailed_Body invoice_request_failed;
19005 LDKEvent_LDKPaymentSent_Body payment_sent;
19006 LDKEvent_LDKPaymentFailed_Body payment_failed;
19007 LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
19008 LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
19009 LDKEvent_LDKProbeSuccessful_Body probe_successful;
19010 LDKEvent_LDKProbeFailed_Body probe_failed;
19011 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
19012 LDKEvent_LDKHTLCIntercepted_Body htlc_intercepted;
19013 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
19014 LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
19015 LDKEvent_LDKChannelPending_Body channel_pending;
19016 LDKEvent_LDKChannelReady_Body channel_ready;
19017 LDKEvent_LDKChannelClosed_Body channel_closed;
19018 LDKEvent_LDKDiscardFunding_Body discard_funding;
19019 LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
19020 LDKEvent_LDKHTLCHandlingFailed_Body htlc_handling_failed;
19022 struct LDKBumpTransactionEvent bump_transaction;
19028 * An enum which can either contain a crate::lightning::events::Event or not
19030 typedef enum LDKCOption_EventZ_Tag {
19032 * When we're in this state, this COption_EventZ contains a crate::lightning::events::Event
19034 LDKCOption_EventZ_Some,
19036 * When we're in this state, this COption_EventZ contains nothing
19038 LDKCOption_EventZ_None,
19040 * Must be last for serialization purposes
19042 LDKCOption_EventZ_Sentinel,
19043 } LDKCOption_EventZ_Tag;
19045 typedef struct LDKCOption_EventZ {
19046 LDKCOption_EventZ_Tag tag;
19049 struct LDKEvent some;
19052 } LDKCOption_EventZ;
19055 * The contents of CResult_COption_EventZDecodeErrorZ
19057 typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
19059 * A pointer to the contents in the success state.
19060 * Reading from this pointer when `result_ok` is not set is undefined.
19062 struct LDKCOption_EventZ *result;
19064 * A pointer to the contents in the error state.
19065 * Reading from this pointer when `result_ok` is set is undefined.
19067 struct LDKDecodeError *err;
19068 } LDKCResult_COption_EventZDecodeErrorZPtr;
19071 * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
19072 * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
19073 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19075 typedef struct LDKCResult_COption_EventZDecodeErrorZ {
19077 * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
19078 * `err` or `result` depending on the state of `result_ok`.
19080 union LDKCResult_COption_EventZDecodeErrorZPtr contents;
19082 * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
19085 } LDKCResult_COption_EventZDecodeErrorZ;
19088 * Sub-errors which don't have specific information in them use this type.
19090 typedef struct LDKError {
19092 * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
19098 * Errors that indicate what is wrong with the invoice. They have some granularity for debug
19099 * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
19101 typedef enum LDKBolt11ParseError_Tag {
19102 LDKBolt11ParseError_Bech32Error,
19103 LDKBolt11ParseError_ParseAmountError,
19104 LDKBolt11ParseError_MalformedSignature,
19105 LDKBolt11ParseError_BadPrefix,
19106 LDKBolt11ParseError_UnknownCurrency,
19107 LDKBolt11ParseError_UnknownSiPrefix,
19108 LDKBolt11ParseError_MalformedHRP,
19109 LDKBolt11ParseError_TooShortDataPart,
19110 LDKBolt11ParseError_UnexpectedEndOfTaggedFields,
19111 LDKBolt11ParseError_DescriptionDecodeError,
19112 LDKBolt11ParseError_PaddingError,
19113 LDKBolt11ParseError_IntegerOverflowError,
19114 LDKBolt11ParseError_InvalidSegWitProgramLength,
19115 LDKBolt11ParseError_InvalidPubKeyHashLength,
19116 LDKBolt11ParseError_InvalidScriptHashLength,
19117 LDKBolt11ParseError_InvalidRecoveryId,
19118 LDKBolt11ParseError_InvalidSliceLength,
19120 * Not an error, but used internally to signal that a part of the invoice should be ignored
19121 * according to BOLT11
19123 LDKBolt11ParseError_Skip,
19125 * Must be last for serialization purposes
19127 LDKBolt11ParseError_Sentinel,
19128 } LDKBolt11ParseError_Tag;
19130 typedef struct MUST_USE_STRUCT LDKBolt11ParseError {
19131 LDKBolt11ParseError_Tag tag;
19134 struct LDKBech32Error bech32_error;
19137 struct LDKError parse_amount_error;
19140 enum LDKSecp256k1Error malformed_signature;
19143 struct LDKError description_decode_error;
19146 struct LDKStr invalid_slice_length;
19149 } LDKBolt11ParseError;
19152 * The contents of CResult_SiPrefixBolt11ParseErrorZ
19154 typedef union LDKCResult_SiPrefixBolt11ParseErrorZPtr {
19156 * A pointer to the contents in the success state.
19157 * Reading from this pointer when `result_ok` is not set is undefined.
19159 enum LDKSiPrefix *result;
19161 * A pointer to the contents in the error state.
19162 * Reading from this pointer when `result_ok` is set is undefined.
19164 struct LDKBolt11ParseError *err;
19165 } LDKCResult_SiPrefixBolt11ParseErrorZPtr;
19168 * A CResult_SiPrefixBolt11ParseErrorZ represents the result of a fallible operation,
19169 * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::Bolt11ParseError on failure.
19170 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19172 typedef struct LDKCResult_SiPrefixBolt11ParseErrorZ {
19174 * The contents of this CResult_SiPrefixBolt11ParseErrorZ, accessible via either
19175 * `err` or `result` depending on the state of `result_ok`.
19177 union LDKCResult_SiPrefixBolt11ParseErrorZPtr contents;
19179 * Whether this CResult_SiPrefixBolt11ParseErrorZ represents a success state.
19182 } LDKCResult_SiPrefixBolt11ParseErrorZ;
19185 * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
19186 * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
19187 * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
19189 typedef enum LDKParseOrSemanticError_Tag {
19191 * The invoice couldn't be decoded
19193 LDKParseOrSemanticError_ParseError,
19195 * The invoice could be decoded but violates the BOLT11 standard
19197 LDKParseOrSemanticError_SemanticError,
19199 * Must be last for serialization purposes
19201 LDKParseOrSemanticError_Sentinel,
19202 } LDKParseOrSemanticError_Tag;
19204 typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
19205 LDKParseOrSemanticError_Tag tag;
19208 struct LDKBolt11ParseError parse_error;
19211 enum LDKBolt11SemanticError semantic_error;
19214 } LDKParseOrSemanticError;
19217 * The contents of CResult_Bolt11InvoiceParseOrSemanticErrorZ
19219 typedef union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr {
19221 * A pointer to the contents in the success state.
19222 * Reading from this pointer when `result_ok` is not set is undefined.
19224 struct LDKBolt11Invoice *result;
19226 * A pointer to the contents in the error state.
19227 * Reading from this pointer when `result_ok` is set is undefined.
19229 struct LDKParseOrSemanticError *err;
19230 } LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr;
19233 * A CResult_Bolt11InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
19234 * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
19235 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19237 typedef struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ {
19239 * The contents of this CResult_Bolt11InvoiceParseOrSemanticErrorZ, accessible via either
19240 * `err` or `result` depending on the state of `result_ok`.
19242 union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr contents;
19244 * Whether this CResult_Bolt11InvoiceParseOrSemanticErrorZ represents a success state.
19247 } LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ;
19252 * Represents a signed [`RawBolt11Invoice`] with cached hash. The signature is not checked and may be
19256 * The hash has to be either from the deserialized invoice or from the serialized [`RawBolt11Invoice`].
19258 typedef struct MUST_USE_STRUCT LDKSignedRawBolt11Invoice {
19260 * A pointer to the opaque Rust object.
19261 * Nearly everywhere, inner must be non-null, however in places where
19262 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19264 LDKnativeSignedRawBolt11Invoice *inner;
19266 * Indicates that this is the only struct which contains the same pointer.
19267 * Rust functions which take ownership of an object provided via an argument require
19268 * this to be true and invalidate the object pointed to by inner.
19271 } LDKSignedRawBolt11Invoice;
19274 * The contents of CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ
19276 typedef union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr {
19278 * A pointer to the contents in the success state.
19279 * Reading from this pointer when `result_ok` is not set is undefined.
19281 struct LDKSignedRawBolt11Invoice *result;
19283 * A pointer to the contents in the error state.
19284 * Reading from this pointer when `result_ok` is set is undefined.
19286 struct LDKBolt11ParseError *err;
19287 } LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr;
19290 * A CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents the result of a fallible operation,
19291 * containing a crate::lightning_invoice::SignedRawBolt11Invoice on success and a crate::lightning_invoice::Bolt11ParseError on failure.
19292 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19294 typedef struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ {
19296 * The contents of this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ, accessible via either
19297 * `err` or `result` depending on the state of `result_ok`.
19299 union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr contents;
19301 * Whether this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents a success state.
19304 } LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ;
19309 * Represents an syntactically correct [`Bolt11Invoice`] for a payment on the lightning network,
19310 * but without the signature information.
19311 * Decoding and encoding should not lead to information loss but may lead to different hashes.
19313 * For methods without docs see the corresponding methods in [`Bolt11Invoice`].
19315 typedef struct MUST_USE_STRUCT LDKRawBolt11Invoice {
19317 * A pointer to the opaque Rust object.
19318 * Nearly everywhere, inner must be non-null, however in places where
19319 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19321 LDKnativeRawBolt11Invoice *inner;
19323 * Indicates that this is the only struct which contains the same pointer.
19324 * Rust functions which take ownership of an object provided via an argument require
19325 * this to be true and invalidate the object pointed to by inner.
19328 } LDKRawBolt11Invoice;
19333 * Recoverable signature
19335 typedef struct MUST_USE_STRUCT LDKBolt11InvoiceSignature {
19337 * A pointer to the opaque Rust object.
19338 * Nearly everywhere, inner must be non-null, however in places where
19339 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19341 LDKnativeBolt11InvoiceSignature *inner;
19343 * Indicates that this is the only struct which contains the same pointer.
19344 * Rust functions which take ownership of an object provided via an argument require
19345 * this to be true and invalidate the object pointed to by inner.
19348 } LDKBolt11InvoiceSignature;
19351 * A tuple of 3 elements. See the individual fields for the types contained.
19353 typedef struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ {
19355 * The element at position 0
19357 struct LDKRawBolt11Invoice a;
19359 * The element at position 1
19361 struct LDKThirtyTwoBytes b;
19363 * The element at position 2
19365 struct LDKBolt11InvoiceSignature c;
19366 } LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ;
19373 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
19375 * A pointer to the opaque Rust object.
19376 * Nearly everywhere, inner must be non-null, however in places where
19377 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19379 LDKnativePayeePubKey *inner;
19381 * Indicates that this is the only struct which contains the same pointer.
19382 * Rust functions which take ownership of an object provided via an argument require
19383 * this to be true and invalidate the object pointed to by inner.
19389 * The contents of CResult_PayeePubKeySecp256k1ErrorZ
19391 typedef union LDKCResult_PayeePubKeySecp256k1ErrorZPtr {
19393 * A pointer to the contents in the success state.
19394 * Reading from this pointer when `result_ok` is not set is undefined.
19396 struct LDKPayeePubKey *result;
19398 * A pointer to the contents in the error state.
19399 * Reading from this pointer when `result_ok` is set is undefined.
19401 enum LDKSecp256k1Error *err;
19402 } LDKCResult_PayeePubKeySecp256k1ErrorZPtr;
19405 * A CResult_PayeePubKeySecp256k1ErrorZ represents the result of a fallible operation,
19406 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
19407 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19409 typedef struct LDKCResult_PayeePubKeySecp256k1ErrorZ {
19411 * The contents of this CResult_PayeePubKeySecp256k1ErrorZ, accessible via either
19412 * `err` or `result` depending on the state of `result_ok`.
19414 union LDKCResult_PayeePubKeySecp256k1ErrorZPtr contents;
19416 * Whether this CResult_PayeePubKeySecp256k1ErrorZ represents a success state.
19419 } LDKCResult_PayeePubKeySecp256k1ErrorZ;
19424 * Private routing information
19427 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
19430 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
19432 * A pointer to the opaque Rust object.
19433 * Nearly everywhere, inner must be non-null, however in places where
19434 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19436 LDKnativePrivateRoute *inner;
19438 * Indicates that this is the only struct which contains the same pointer.
19439 * Rust functions which take ownership of an object provided via an argument require
19440 * this to be true and invalidate the object pointed to by inner.
19446 * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
19447 * This corresponds to std::vector in C++
19449 typedef struct LDKCVec_PrivateRouteZ {
19451 * The elements in the array.
19452 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
19454 struct LDKPrivateRoute *data;
19456 * The number of elements pointed to by `data`.
19459 } LDKCVec_PrivateRouteZ;
19464 * A timestamp that refers to a date after 1 January 1970.
19468 * The Unix timestamp representing the stored time has to be positive and no greater than
19469 * [`MAX_TIMESTAMP`].
19471 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
19473 * A pointer to the opaque Rust object.
19474 * Nearly everywhere, inner must be non-null, however in places where
19475 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19477 LDKnativePositiveTimestamp *inner;
19479 * Indicates that this is the only struct which contains the same pointer.
19480 * Rust functions which take ownership of an object provided via an argument require
19481 * this to be true and invalidate the object pointed to by inner.
19484 } LDKPositiveTimestamp;
19487 * The contents of CResult_PositiveTimestampCreationErrorZ
19489 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
19491 * A pointer to the contents in the success state.
19492 * Reading from this pointer when `result_ok` is not set is undefined.
19494 struct LDKPositiveTimestamp *result;
19496 * A pointer to the contents in the error state.
19497 * Reading from this pointer when `result_ok` is set is undefined.
19499 enum LDKCreationError *err;
19500 } LDKCResult_PositiveTimestampCreationErrorZPtr;
19503 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
19504 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
19505 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19507 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
19509 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
19510 * `err` or `result` depending on the state of `result_ok`.
19512 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
19514 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
19517 } LDKCResult_PositiveTimestampCreationErrorZ;
19520 * The contents of CResult_NoneBolt11SemanticErrorZ
19522 typedef union LDKCResult_NoneBolt11SemanticErrorZPtr {
19524 * Note that this value is always NULL, as there are no contents in the OK variant
19528 * A pointer to the contents in the error state.
19529 * Reading from this pointer when `result_ok` is set is undefined.
19531 enum LDKBolt11SemanticError *err;
19532 } LDKCResult_NoneBolt11SemanticErrorZPtr;
19535 * A CResult_NoneBolt11SemanticErrorZ represents the result of a fallible operation,
19536 * containing a () on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
19537 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19539 typedef struct LDKCResult_NoneBolt11SemanticErrorZ {
19541 * The contents of this CResult_NoneBolt11SemanticErrorZ, accessible via either
19542 * `err` or `result` depending on the state of `result_ok`.
19544 union LDKCResult_NoneBolt11SemanticErrorZPtr contents;
19546 * Whether this CResult_NoneBolt11SemanticErrorZ represents a success state.
19549 } LDKCResult_NoneBolt11SemanticErrorZ;
19552 * The contents of CResult_Bolt11InvoiceBolt11SemanticErrorZ
19554 typedef union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr {
19556 * A pointer to the contents in the success state.
19557 * Reading from this pointer when `result_ok` is not set is undefined.
19559 struct LDKBolt11Invoice *result;
19561 * A pointer to the contents in the error state.
19562 * Reading from this pointer when `result_ok` is set is undefined.
19564 enum LDKBolt11SemanticError *err;
19565 } LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr;
19568 * A CResult_Bolt11InvoiceBolt11SemanticErrorZ represents the result of a fallible operation,
19569 * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
19570 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19572 typedef struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ {
19574 * The contents of this CResult_Bolt11InvoiceBolt11SemanticErrorZ, accessible via either
19575 * `err` or `result` depending on the state of `result_ok`.
19577 union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr contents;
19579 * Whether this CResult_Bolt11InvoiceBolt11SemanticErrorZ represents a success state.
19582 } LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ;
19587 * Description string
19590 * The description can be at most 639 __bytes__ long
19592 typedef struct MUST_USE_STRUCT LDKDescription {
19594 * A pointer to the opaque Rust object.
19595 * Nearly everywhere, inner must be non-null, however in places where
19596 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19598 LDKnativeDescription *inner;
19600 * Indicates that this is the only struct which contains the same pointer.
19601 * Rust functions which take ownership of an object provided via an argument require
19602 * this to be true and invalidate the object pointed to by inner.
19608 * The contents of CResult_DescriptionCreationErrorZ
19610 typedef union LDKCResult_DescriptionCreationErrorZPtr {
19612 * A pointer to the contents in the success state.
19613 * Reading from this pointer when `result_ok` is not set is undefined.
19615 struct LDKDescription *result;
19617 * A pointer to the contents in the error state.
19618 * Reading from this pointer when `result_ok` is set is undefined.
19620 enum LDKCreationError *err;
19621 } LDKCResult_DescriptionCreationErrorZPtr;
19624 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
19625 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
19626 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19628 typedef struct LDKCResult_DescriptionCreationErrorZ {
19630 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
19631 * `err` or `result` depending on the state of `result_ok`.
19633 union LDKCResult_DescriptionCreationErrorZPtr contents;
19635 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
19638 } LDKCResult_DescriptionCreationErrorZ;
19641 * The contents of CResult_PrivateRouteCreationErrorZ
19643 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
19645 * A pointer to the contents in the success state.
19646 * Reading from this pointer when `result_ok` is not set is undefined.
19648 struct LDKPrivateRoute *result;
19650 * A pointer to the contents in the error state.
19651 * Reading from this pointer when `result_ok` is set is undefined.
19653 enum LDKCreationError *err;
19654 } LDKCResult_PrivateRouteCreationErrorZPtr;
19657 * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
19658 * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
19659 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19661 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
19663 * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
19664 * `err` or `result` depending on the state of `result_ok`.
19666 union LDKCResult_PrivateRouteCreationErrorZPtr contents;
19668 * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
19671 } LDKCResult_PrivateRouteCreationErrorZ;
19674 * The contents of CResult_OutPointDecodeErrorZ
19676 typedef union LDKCResult_OutPointDecodeErrorZPtr {
19678 * A pointer to the contents in the success state.
19679 * Reading from this pointer when `result_ok` is not set is undefined.
19681 struct LDKOutPoint *result;
19683 * A pointer to the contents in the error state.
19684 * Reading from this pointer when `result_ok` is set is undefined.
19686 struct LDKDecodeError *err;
19687 } LDKCResult_OutPointDecodeErrorZPtr;
19690 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
19691 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
19692 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19694 typedef struct LDKCResult_OutPointDecodeErrorZ {
19696 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
19697 * `err` or `result` depending on the state of `result_ok`.
19699 union LDKCResult_OutPointDecodeErrorZPtr contents;
19701 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
19704 } LDKCResult_OutPointDecodeErrorZ;
19709 * Lightning TLV uses a custom variable-length integer called `BigSize`. It is similar to Bitcoin's
19710 * variable-length integers except that it is serialized in big-endian instead of little-endian.
19712 * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
19713 * encoded in several different ways, which we must check for at deserialization-time. Thus, if
19714 * you're looking for an example of a variable-length integer to use for your own project, move
19715 * along, this is a rather poor design.
19717 typedef struct MUST_USE_STRUCT LDKBigSize {
19719 * A pointer to the opaque Rust object.
19720 * Nearly everywhere, inner must be non-null, however in places where
19721 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19723 LDKnativeBigSize *inner;
19725 * Indicates that this is the only struct which contains the same pointer.
19726 * Rust functions which take ownership of an object provided via an argument require
19727 * this to be true and invalidate the object pointed to by inner.
19733 * The contents of CResult_BigSizeDecodeErrorZ
19735 typedef union LDKCResult_BigSizeDecodeErrorZPtr {
19737 * A pointer to the contents in the success state.
19738 * Reading from this pointer when `result_ok` is not set is undefined.
19740 struct LDKBigSize *result;
19742 * A pointer to the contents in the error state.
19743 * Reading from this pointer when `result_ok` is set is undefined.
19745 struct LDKDecodeError *err;
19746 } LDKCResult_BigSizeDecodeErrorZPtr;
19749 * A CResult_BigSizeDecodeErrorZ represents the result of a fallible operation,
19750 * containing a crate::lightning::util::ser::BigSize on success and a crate::lightning::ln::msgs::DecodeError on failure.
19751 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19753 typedef struct LDKCResult_BigSizeDecodeErrorZ {
19755 * The contents of this CResult_BigSizeDecodeErrorZ, accessible via either
19756 * `err` or `result` depending on the state of `result_ok`.
19758 union LDKCResult_BigSizeDecodeErrorZPtr contents;
19760 * Whether this CResult_BigSizeDecodeErrorZ represents a success state.
19763 } LDKCResult_BigSizeDecodeErrorZ;
19766 * The contents of CResult_HostnameDecodeErrorZ
19768 typedef union LDKCResult_HostnameDecodeErrorZPtr {
19770 * A pointer to the contents in the success state.
19771 * Reading from this pointer when `result_ok` is not set is undefined.
19773 struct LDKHostname *result;
19775 * A pointer to the contents in the error state.
19776 * Reading from this pointer when `result_ok` is set is undefined.
19778 struct LDKDecodeError *err;
19779 } LDKCResult_HostnameDecodeErrorZPtr;
19782 * A CResult_HostnameDecodeErrorZ represents the result of a fallible operation,
19783 * containing a crate::lightning::util::ser::Hostname on success and a crate::lightning::ln::msgs::DecodeError on failure.
19784 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19786 typedef struct LDKCResult_HostnameDecodeErrorZ {
19788 * The contents of this CResult_HostnameDecodeErrorZ, accessible via either
19789 * `err` or `result` depending on the state of `result_ok`.
19791 union LDKCResult_HostnameDecodeErrorZPtr contents;
19793 * Whether this CResult_HostnameDecodeErrorZ represents a success state.
19796 } LDKCResult_HostnameDecodeErrorZ;
19801 * A wrapper for a `Transaction` which can only be constructed with [`TransactionU16LenLimited::new`]
19802 * if the `Transaction`'s consensus-serialized length is <= u16::MAX.
19804 * Use [`TransactionU16LenLimited::into_transaction`] to convert into the contained `Transaction`.
19806 typedef struct MUST_USE_STRUCT LDKTransactionU16LenLimited {
19808 * A pointer to the opaque Rust object.
19809 * Nearly everywhere, inner must be non-null, however in places where
19810 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19812 LDKnativeTransactionU16LenLimited *inner;
19814 * Indicates that this is the only struct which contains the same pointer.
19815 * Rust functions which take ownership of an object provided via an argument require
19816 * this to be true and invalidate the object pointed to by inner.
19819 } LDKTransactionU16LenLimited;
19822 * The contents of CResult_TransactionU16LenLimitedNoneZ
19824 typedef union LDKCResult_TransactionU16LenLimitedNoneZPtr {
19826 * A pointer to the contents in the success state.
19827 * Reading from this pointer when `result_ok` is not set is undefined.
19829 struct LDKTransactionU16LenLimited *result;
19831 * Note that this value is always NULL, as there are no contents in the Err variant
19834 } LDKCResult_TransactionU16LenLimitedNoneZPtr;
19837 * A CResult_TransactionU16LenLimitedNoneZ represents the result of a fallible operation,
19838 * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a () on failure.
19839 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19841 typedef struct LDKCResult_TransactionU16LenLimitedNoneZ {
19843 * The contents of this CResult_TransactionU16LenLimitedNoneZ, accessible via either
19844 * `err` or `result` depending on the state of `result_ok`.
19846 union LDKCResult_TransactionU16LenLimitedNoneZPtr contents;
19848 * Whether this CResult_TransactionU16LenLimitedNoneZ represents a success state.
19851 } LDKCResult_TransactionU16LenLimitedNoneZ;
19854 * The contents of CResult_TransactionU16LenLimitedDecodeErrorZ
19856 typedef union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr {
19858 * A pointer to the contents in the success state.
19859 * Reading from this pointer when `result_ok` is not set is undefined.
19861 struct LDKTransactionU16LenLimited *result;
19863 * A pointer to the contents in the error state.
19864 * Reading from this pointer when `result_ok` is set is undefined.
19866 struct LDKDecodeError *err;
19867 } LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr;
19870 * A CResult_TransactionU16LenLimitedDecodeErrorZ represents the result of a fallible operation,
19871 * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a crate::lightning::ln::msgs::DecodeError on failure.
19872 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19874 typedef struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ {
19876 * The contents of this CResult_TransactionU16LenLimitedDecodeErrorZ, accessible via either
19877 * `err` or `result` depending on the state of `result_ok`.
19879 union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr contents;
19881 * Whether this CResult_TransactionU16LenLimitedDecodeErrorZ represents a success state.
19884 } LDKCResult_TransactionU16LenLimitedDecodeErrorZ;
19887 * The contents of CResult_UntrustedStringDecodeErrorZ
19889 typedef union LDKCResult_UntrustedStringDecodeErrorZPtr {
19891 * A pointer to the contents in the success state.
19892 * Reading from this pointer when `result_ok` is not set is undefined.
19894 struct LDKUntrustedString *result;
19896 * A pointer to the contents in the error state.
19897 * Reading from this pointer when `result_ok` is set is undefined.
19899 struct LDKDecodeError *err;
19900 } LDKCResult_UntrustedStringDecodeErrorZPtr;
19903 * A CResult_UntrustedStringDecodeErrorZ represents the result of a fallible operation,
19904 * containing a crate::lightning::util::string::UntrustedString on success and a crate::lightning::ln::msgs::DecodeError on failure.
19905 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19907 typedef struct LDKCResult_UntrustedStringDecodeErrorZ {
19909 * The contents of this CResult_UntrustedStringDecodeErrorZ, accessible via either
19910 * `err` or `result` depending on the state of `result_ok`.
19912 union LDKCResult_UntrustedStringDecodeErrorZPtr contents;
19914 * Whether this CResult_UntrustedStringDecodeErrorZ represents a success state.
19917 } LDKCResult_UntrustedStringDecodeErrorZ;
19920 * The contents of CResult_ChannelIdDecodeErrorZ
19922 typedef union LDKCResult_ChannelIdDecodeErrorZPtr {
19924 * A pointer to the contents in the success state.
19925 * Reading from this pointer when `result_ok` is not set is undefined.
19927 struct LDKChannelId *result;
19929 * A pointer to the contents in the error state.
19930 * Reading from this pointer when `result_ok` is set is undefined.
19932 struct LDKDecodeError *err;
19933 } LDKCResult_ChannelIdDecodeErrorZPtr;
19936 * A CResult_ChannelIdDecodeErrorZ represents the result of a fallible operation,
19937 * containing a crate::lightning::ln::types::ChannelId on success and a crate::lightning::ln::msgs::DecodeError on failure.
19938 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19940 typedef struct LDKCResult_ChannelIdDecodeErrorZ {
19942 * The contents of this CResult_ChannelIdDecodeErrorZ, accessible via either
19943 * `err` or `result` depending on the state of `result_ok`.
19945 union LDKCResult_ChannelIdDecodeErrorZPtr contents;
19947 * Whether this CResult_ChannelIdDecodeErrorZ represents a success state.
19950 } LDKCResult_ChannelIdDecodeErrorZ;
19953 * A tuple of 2 elements. See the individual fields for the types contained.
19955 typedef struct LDKC2Tuple__u832u16Z {
19957 * The element at position 0
19959 struct LDKThirtyTwoBytes a;
19961 * The element at position 1
19964 } LDKC2Tuple__u832u16Z;
19969 * Parameters for relaying over a given [`BlindedHop`].
19971 * [`BlindedHop`]: crate::blinded_path::BlindedHop
19973 typedef struct MUST_USE_STRUCT LDKPaymentRelay {
19975 * A pointer to the opaque Rust object.
19976 * Nearly everywhere, inner must be non-null, however in places where
19977 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19979 LDKnativePaymentRelay *inner;
19981 * Indicates that this is the only struct which contains the same pointer.
19982 * Rust functions which take ownership of an object provided via an argument require
19983 * this to be true and invalidate the object pointed to by inner.
19989 * The contents of CResult_PaymentRelayDecodeErrorZ
19991 typedef union LDKCResult_PaymentRelayDecodeErrorZPtr {
19993 * A pointer to the contents in the success state.
19994 * Reading from this pointer when `result_ok` is not set is undefined.
19996 struct LDKPaymentRelay *result;
19998 * A pointer to the contents in the error state.
19999 * Reading from this pointer when `result_ok` is set is undefined.
20001 struct LDKDecodeError *err;
20002 } LDKCResult_PaymentRelayDecodeErrorZPtr;
20005 * A CResult_PaymentRelayDecodeErrorZ represents the result of a fallible operation,
20006 * containing a crate::lightning::blinded_path::payment::PaymentRelay on success and a crate::lightning::ln::msgs::DecodeError on failure.
20007 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20009 typedef struct LDKCResult_PaymentRelayDecodeErrorZ {
20011 * The contents of this CResult_PaymentRelayDecodeErrorZ, accessible via either
20012 * `err` or `result` depending on the state of `result_ok`.
20014 union LDKCResult_PaymentRelayDecodeErrorZPtr contents;
20016 * Whether this CResult_PaymentRelayDecodeErrorZ represents a success state.
20019 } LDKCResult_PaymentRelayDecodeErrorZ;
20024 * Constraints for relaying over a given [`BlindedHop`].
20026 * [`BlindedHop`]: crate::blinded_path::BlindedHop
20028 typedef struct MUST_USE_STRUCT LDKPaymentConstraints {
20030 * A pointer to the opaque Rust object.
20031 * Nearly everywhere, inner must be non-null, however in places where
20032 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20034 LDKnativePaymentConstraints *inner;
20036 * Indicates that this is the only struct which contains the same pointer.
20037 * Rust functions which take ownership of an object provided via an argument require
20038 * this to be true and invalidate the object pointed to by inner.
20041 } LDKPaymentConstraints;
20044 * The contents of CResult_PaymentConstraintsDecodeErrorZ
20046 typedef union LDKCResult_PaymentConstraintsDecodeErrorZPtr {
20048 * A pointer to the contents in the success state.
20049 * Reading from this pointer when `result_ok` is not set is undefined.
20051 struct LDKPaymentConstraints *result;
20053 * A pointer to the contents in the error state.
20054 * Reading from this pointer when `result_ok` is set is undefined.
20056 struct LDKDecodeError *err;
20057 } LDKCResult_PaymentConstraintsDecodeErrorZPtr;
20060 * A CResult_PaymentConstraintsDecodeErrorZ represents the result of a fallible operation,
20061 * containing a crate::lightning::blinded_path::payment::PaymentConstraints on success and a crate::lightning::ln::msgs::DecodeError on failure.
20062 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20064 typedef struct LDKCResult_PaymentConstraintsDecodeErrorZ {
20066 * The contents of this CResult_PaymentConstraintsDecodeErrorZ, accessible via either
20067 * `err` or `result` depending on the state of `result_ok`.
20069 union LDKCResult_PaymentConstraintsDecodeErrorZPtr contents;
20071 * Whether this CResult_PaymentConstraintsDecodeErrorZ represents a success state.
20074 } LDKCResult_PaymentConstraintsDecodeErrorZ;
20077 * The contents of CResult_PaymentContextDecodeErrorZ
20079 typedef union LDKCResult_PaymentContextDecodeErrorZPtr {
20081 * A pointer to the contents in the success state.
20082 * Reading from this pointer when `result_ok` is not set is undefined.
20084 struct LDKPaymentContext *result;
20086 * A pointer to the contents in the error state.
20087 * Reading from this pointer when `result_ok` is set is undefined.
20089 struct LDKDecodeError *err;
20090 } LDKCResult_PaymentContextDecodeErrorZPtr;
20093 * A CResult_PaymentContextDecodeErrorZ represents the result of a fallible operation,
20094 * containing a crate::lightning::blinded_path::payment::PaymentContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
20095 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20097 typedef struct LDKCResult_PaymentContextDecodeErrorZ {
20099 * The contents of this CResult_PaymentContextDecodeErrorZ, accessible via either
20100 * `err` or `result` depending on the state of `result_ok`.
20102 union LDKCResult_PaymentContextDecodeErrorZPtr contents;
20104 * Whether this CResult_PaymentContextDecodeErrorZ represents a success state.
20107 } LDKCResult_PaymentContextDecodeErrorZ;
20110 * The contents of CResult_UnknownPaymentContextDecodeErrorZ
20112 typedef union LDKCResult_UnknownPaymentContextDecodeErrorZPtr {
20114 * A pointer to the contents in the success state.
20115 * Reading from this pointer when `result_ok` is not set is undefined.
20117 struct LDKUnknownPaymentContext *result;
20119 * A pointer to the contents in the error state.
20120 * Reading from this pointer when `result_ok` is set is undefined.
20122 struct LDKDecodeError *err;
20123 } LDKCResult_UnknownPaymentContextDecodeErrorZPtr;
20126 * A CResult_UnknownPaymentContextDecodeErrorZ represents the result of a fallible operation,
20127 * containing a crate::lightning::blinded_path::payment::UnknownPaymentContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
20128 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20130 typedef struct LDKCResult_UnknownPaymentContextDecodeErrorZ {
20132 * The contents of this CResult_UnknownPaymentContextDecodeErrorZ, accessible via either
20133 * `err` or `result` depending on the state of `result_ok`.
20135 union LDKCResult_UnknownPaymentContextDecodeErrorZPtr contents;
20137 * Whether this CResult_UnknownPaymentContextDecodeErrorZ represents a success state.
20140 } LDKCResult_UnknownPaymentContextDecodeErrorZ;
20143 * The contents of CResult_Bolt12OfferContextDecodeErrorZ
20145 typedef union LDKCResult_Bolt12OfferContextDecodeErrorZPtr {
20147 * A pointer to the contents in the success state.
20148 * Reading from this pointer when `result_ok` is not set is undefined.
20150 struct LDKBolt12OfferContext *result;
20152 * A pointer to the contents in the error state.
20153 * Reading from this pointer when `result_ok` is set is undefined.
20155 struct LDKDecodeError *err;
20156 } LDKCResult_Bolt12OfferContextDecodeErrorZPtr;
20159 * A CResult_Bolt12OfferContextDecodeErrorZ represents the result of a fallible operation,
20160 * containing a crate::lightning::blinded_path::payment::Bolt12OfferContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
20161 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20163 typedef struct LDKCResult_Bolt12OfferContextDecodeErrorZ {
20165 * The contents of this CResult_Bolt12OfferContextDecodeErrorZ, accessible via either
20166 * `err` or `result` depending on the state of `result_ok`.
20168 union LDKCResult_Bolt12OfferContextDecodeErrorZPtr contents;
20170 * Whether this CResult_Bolt12OfferContextDecodeErrorZ represents a success state.
20173 } LDKCResult_Bolt12OfferContextDecodeErrorZ;
20176 * The contents of CResult_Bolt12RefundContextDecodeErrorZ
20178 typedef union LDKCResult_Bolt12RefundContextDecodeErrorZPtr {
20180 * A pointer to the contents in the success state.
20181 * Reading from this pointer when `result_ok` is not set is undefined.
20183 struct LDKBolt12RefundContext *result;
20185 * A pointer to the contents in the error state.
20186 * Reading from this pointer when `result_ok` is set is undefined.
20188 struct LDKDecodeError *err;
20189 } LDKCResult_Bolt12RefundContextDecodeErrorZPtr;
20192 * A CResult_Bolt12RefundContextDecodeErrorZ represents the result of a fallible operation,
20193 * containing a crate::lightning::blinded_path::payment::Bolt12RefundContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
20194 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20196 typedef struct LDKCResult_Bolt12RefundContextDecodeErrorZ {
20198 * The contents of this CResult_Bolt12RefundContextDecodeErrorZ, accessible via either
20199 * `err` or `result` depending on the state of `result_ok`.
20201 union LDKCResult_Bolt12RefundContextDecodeErrorZPtr contents;
20203 * Whether this CResult_Bolt12RefundContextDecodeErrorZ represents a success state.
20206 } LDKCResult_Bolt12RefundContextDecodeErrorZ;
20209 * The contents of CResult_StrSecp256k1ErrorZ
20211 typedef union LDKCResult_StrSecp256k1ErrorZPtr {
20213 * A pointer to the contents in the success state.
20214 * Reading from this pointer when `result_ok` is not set is undefined.
20216 struct LDKStr *result;
20218 * A pointer to the contents in the error state.
20219 * Reading from this pointer when `result_ok` is set is undefined.
20221 enum LDKSecp256k1Error *err;
20222 } LDKCResult_StrSecp256k1ErrorZPtr;
20225 * A CResult_StrSecp256k1ErrorZ represents the result of a fallible operation,
20226 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
20227 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20229 typedef struct LDKCResult_StrSecp256k1ErrorZ {
20231 * The contents of this CResult_StrSecp256k1ErrorZ, accessible via either
20232 * `err` or `result` depending on the state of `result_ok`.
20234 union LDKCResult_StrSecp256k1ErrorZPtr contents;
20236 * Whether this CResult_StrSecp256k1ErrorZ represents a success state.
20239 } LDKCResult_StrSecp256k1ErrorZ;
20242 * A tuple of 3 elements. See the individual fields for the types contained.
20244 typedef struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ {
20246 * The element at position 0
20248 struct LDKThirtyTwoBytes a;
20250 * The element at position 1
20252 struct LDKRecipientOnionFields b;
20254 * The element at position 2
20256 struct LDKRouteParameters c;
20257 } LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ;
20260 * The contents of CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ
20262 typedef union LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr {
20264 * A pointer to the contents in the success state.
20265 * Reading from this pointer when `result_ok` is not set is undefined.
20267 struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *result;
20269 * Note that this value is always NULL, as there are no contents in the Err variant
20272 } LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr;
20275 * A CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ represents the result of a fallible operation,
20276 * containing a crate::c_types::derived::C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ on success and a () on failure.
20277 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20279 typedef struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ {
20281 * The contents of this CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ, accessible via either
20282 * `err` or `result` depending on the state of `result_ok`.
20284 union LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr contents;
20286 * Whether this CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ represents a success state.
20289 } LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ;
20292 * A tuple of 3 elements. See the individual fields for the types contained.
20294 typedef struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ {
20296 * The element at position 0
20298 struct LDKPublicKey a;
20300 * The element at position 1
20302 struct LDKOnionMessage b;
20304 * The element at position 2
20306 struct LDKCOption_CVec_SocketAddressZZ c;
20307 } LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ;
20310 * Errors that may occur when [sending an onion message].
20312 * [sending an onion message]: OnionMessenger::send_onion_message
20314 typedef enum LDKSendError_Tag {
20316 * Errored computing onion message packet keys.
20318 LDKSendError_Secp256k1,
20320 * Because implementations such as Eclair will drop onion messages where the message packet
20321 * exceeds 32834 bytes, we refuse to send messages where the packet exceeds this size.
20323 LDKSendError_TooBigPacket,
20325 * The provided [`Destination`] was an invalid [`BlindedPath`] due to not having any blinded
20328 LDKSendError_TooFewBlindedHops,
20330 * The first hop is not a peer and doesn't have a known [`SocketAddress`].
20332 LDKSendError_InvalidFirstHop,
20334 * A path from the sender to the destination could not be found by the [`MessageRouter`].
20336 LDKSendError_PathNotFound,
20338 * Onion message contents must have a TLV type >= 64.
20340 LDKSendError_InvalidMessage,
20342 * Our next-hop peer's buffer was full or our total outbound buffer was full.
20344 LDKSendError_BufferFull,
20346 * Failed to retrieve our node id from the provided [`NodeSigner`].
20348 * [`NodeSigner`]: crate::sign::NodeSigner
20350 LDKSendError_GetNodeIdFailed,
20352 * The provided [`Destination`] has a blinded path with an unresolved introduction node. An
20353 * attempt to resolve it in the [`MessageRouter`] when finding an [`OnionMessagePath`] likely
20356 LDKSendError_UnresolvedIntroductionNode,
20358 * We attempted to send to a blinded path where we are the introduction node, and failed to
20359 * advance the blinded path to make the second hop the new introduction node. Either
20360 * [`NodeSigner::ecdh`] failed, we failed to tweak the current blinding point to get the
20361 * new blinding point, or we were attempting to send to ourselves.
20363 LDKSendError_BlindedPathAdvanceFailed,
20365 * Must be last for serialization purposes
20367 LDKSendError_Sentinel,
20368 } LDKSendError_Tag;
20370 typedef struct MUST_USE_STRUCT LDKSendError {
20371 LDKSendError_Tag tag;
20374 enum LDKSecp256k1Error secp256k1;
20377 struct LDKPublicKey invalid_first_hop;
20383 * The contents of CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ
20385 typedef union LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr {
20387 * A pointer to the contents in the success state.
20388 * Reading from this pointer when `result_ok` is not set is undefined.
20390 struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *result;
20392 * A pointer to the contents in the error state.
20393 * Reading from this pointer when `result_ok` is set is undefined.
20395 struct LDKSendError *err;
20396 } LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr;
20399 * A CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ represents the result of a fallible operation,
20400 * containing a crate::c_types::derived::C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ on success and a crate::lightning::onion_message::messenger::SendError on failure.
20401 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20403 typedef struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ {
20405 * The contents of this CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ, accessible via either
20406 * `err` or `result` depending on the state of `result_ok`.
20408 union LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr contents;
20410 * Whether this CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ represents a success state.
20413 } LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ;
20416 * The next hop to forward an onion message along its path.
20418 * Note that payment blinded paths always specify their next hop using an explicit node id.
20420 typedef enum LDKNextMessageHop_Tag {
20422 * The node id of the next hop.
20424 LDKNextMessageHop_NodeId,
20426 * The short channel id leading to the next hop.
20428 LDKNextMessageHop_ShortChannelId,
20430 * Must be last for serialization purposes
20432 LDKNextMessageHop_Sentinel,
20433 } LDKNextMessageHop_Tag;
20435 typedef struct MUST_USE_STRUCT LDKNextMessageHop {
20436 LDKNextMessageHop_Tag tag;
20439 struct LDKPublicKey node_id;
20442 uint64_t short_channel_id;
20445 } LDKNextMessageHop;
20448 * The contents of an [`OnionMessage`] as read from the wire.
20450 * [`OnionMessage`]: crate::ln::msgs::OnionMessage
20452 typedef enum LDKParsedOnionMessageContents_Tag {
20454 * A message related to BOLT 12 Offers.
20456 LDKParsedOnionMessageContents_Offers,
20458 * A custom onion message specified by the user.
20460 LDKParsedOnionMessageContents_Custom,
20462 * Must be last for serialization purposes
20464 LDKParsedOnionMessageContents_Sentinel,
20465 } LDKParsedOnionMessageContents_Tag;
20467 typedef struct MUST_USE_STRUCT LDKParsedOnionMessageContents {
20468 LDKParsedOnionMessageContents_Tag tag;
20471 struct LDKOffersMessage offers;
20474 struct LDKOnionMessageContents custom;
20477 } LDKParsedOnionMessageContents;
20480 * A processed incoming onion message, containing either a Forward (another onion message)
20481 * or a Receive payload with decrypted contents.
20483 typedef enum LDKPeeledOnion_Tag {
20485 * Forwarded onion, with the next node id and a new onion
20487 LDKPeeledOnion_Forward,
20489 * Received onion message, with decrypted contents, path_id, and reply path
20491 LDKPeeledOnion_Receive,
20493 * Must be last for serialization purposes
20495 LDKPeeledOnion_Sentinel,
20496 } LDKPeeledOnion_Tag;
20498 typedef struct LDKPeeledOnion_LDKForward_Body {
20499 struct LDKNextMessageHop _0;
20500 struct LDKOnionMessage _1;
20501 } LDKPeeledOnion_LDKForward_Body;
20503 typedef struct LDKPeeledOnion_LDKReceive_Body {
20504 struct LDKParsedOnionMessageContents _0;
20507 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
20509 struct LDKThirtyTwoBytes _1;
20512 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
20514 struct LDKBlindedPath _2;
20515 } LDKPeeledOnion_LDKReceive_Body;
20517 typedef struct MUST_USE_STRUCT LDKPeeledOnion {
20518 LDKPeeledOnion_Tag tag;
20520 LDKPeeledOnion_LDKForward_Body forward;
20521 LDKPeeledOnion_LDKReceive_Body receive;
20526 * The contents of CResult_PeeledOnionNoneZ
20528 typedef union LDKCResult_PeeledOnionNoneZPtr {
20530 * A pointer to the contents in the success state.
20531 * Reading from this pointer when `result_ok` is not set is undefined.
20533 struct LDKPeeledOnion *result;
20535 * Note that this value is always NULL, as there are no contents in the Err variant
20538 } LDKCResult_PeeledOnionNoneZPtr;
20541 * A CResult_PeeledOnionNoneZ represents the result of a fallible operation,
20542 * containing a crate::lightning::onion_message::messenger::PeeledOnion on success and a () on failure.
20543 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20545 typedef struct LDKCResult_PeeledOnionNoneZ {
20547 * The contents of this CResult_PeeledOnionNoneZ, accessible via either
20548 * `err` or `result` depending on the state of `result_ok`.
20550 union LDKCResult_PeeledOnionNoneZPtr contents;
20552 * Whether this CResult_PeeledOnionNoneZ represents a success state.
20555 } LDKCResult_PeeledOnionNoneZ;
20558 * Result of successfully [sending an onion message].
20560 * [sending an onion message]: OnionMessenger::send_onion_message
20562 typedef enum LDKSendSuccess_Tag {
20564 * The message was buffered and will be sent once it is processed by
20565 * [`OnionMessageHandler::next_onion_message_for_peer`].
20567 LDKSendSuccess_Buffered,
20569 * The message was buffered and will be sent once the node is connected as a peer and it is
20570 * processed by [`OnionMessageHandler::next_onion_message_for_peer`].
20572 LDKSendSuccess_BufferedAwaitingConnection,
20574 * Must be last for serialization purposes
20576 LDKSendSuccess_Sentinel,
20577 } LDKSendSuccess_Tag;
20579 typedef struct MUST_USE_STRUCT LDKSendSuccess {
20580 LDKSendSuccess_Tag tag;
20583 struct LDKPublicKey buffered_awaiting_connection;
20589 * The contents of CResult_SendSuccessSendErrorZ
20591 typedef union LDKCResult_SendSuccessSendErrorZPtr {
20593 * A pointer to the contents in the success state.
20594 * Reading from this pointer when `result_ok` is not set is undefined.
20596 struct LDKSendSuccess *result;
20598 * A pointer to the contents in the error state.
20599 * Reading from this pointer when `result_ok` is set is undefined.
20601 struct LDKSendError *err;
20602 } LDKCResult_SendSuccessSendErrorZPtr;
20605 * A CResult_SendSuccessSendErrorZ represents the result of a fallible operation,
20606 * containing a crate::lightning::onion_message::messenger::SendSuccess on success and a crate::lightning::onion_message::messenger::SendError on failure.
20607 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20609 typedef struct LDKCResult_SendSuccessSendErrorZ {
20611 * The contents of this CResult_SendSuccessSendErrorZ, accessible via either
20612 * `err` or `result` depending on the state of `result_ok`.
20614 union LDKCResult_SendSuccessSendErrorZPtr contents;
20616 * Whether this CResult_SendSuccessSendErrorZ represents a success state.
20619 } LDKCResult_SendSuccessSendErrorZ;
20622 * The contents of CResult_BlindedPathNoneZ
20624 typedef union LDKCResult_BlindedPathNoneZPtr {
20626 * A pointer to the contents in the success state.
20627 * Reading from this pointer when `result_ok` is not set is undefined.
20629 struct LDKBlindedPath *result;
20631 * Note that this value is always NULL, as there are no contents in the Err variant
20634 } LDKCResult_BlindedPathNoneZPtr;
20637 * A CResult_BlindedPathNoneZ represents the result of a fallible operation,
20638 * containing a crate::lightning::blinded_path::BlindedPath on success and a () on failure.
20639 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20641 typedef struct LDKCResult_BlindedPathNoneZ {
20643 * The contents of this CResult_BlindedPathNoneZ, accessible via either
20644 * `err` or `result` depending on the state of `result_ok`.
20646 union LDKCResult_BlindedPathNoneZPtr contents;
20648 * Whether this CResult_BlindedPathNoneZ represents a success state.
20651 } LDKCResult_BlindedPathNoneZ;
20654 * The contents of CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ
20656 typedef union LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr {
20658 * A pointer to the contents in the success state.
20659 * Reading from this pointer when `result_ok` is not set is undefined.
20661 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *result;
20663 * Note that this value is always NULL, as there are no contents in the Err variant
20666 } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr;
20669 * A CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ represents the result of a fallible operation,
20670 * containing a crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZ on success and a () on failure.
20671 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20673 typedef struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ {
20675 * The contents of this CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ, accessible via either
20676 * `err` or `result` depending on the state of `result_ok`.
20678 union LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr contents;
20680 * Whether this CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ represents a success state.
20683 } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ;
20688 * An intermediate node, its outbound channel, and relay parameters.
20690 typedef struct MUST_USE_STRUCT LDKForwardNode {
20692 * A pointer to the opaque Rust object.
20693 * Nearly everywhere, inner must be non-null, however in places where
20694 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20696 LDKnativeForwardNode *inner;
20698 * Indicates that this is the only struct which contains the same pointer.
20699 * Rust functions which take ownership of an object provided via an argument require
20700 * this to be true and invalidate the object pointed to by inner.
20706 * A dynamically-allocated array of crate::lightning::blinded_path::payment::ForwardNodes of arbitrary size.
20707 * This corresponds to std::vector in C++
20709 typedef struct LDKCVec_ForwardNodeZ {
20711 * The elements in the array.
20712 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
20714 struct LDKForwardNode *data;
20716 * The number of elements pointed to by `data`.
20719 } LDKCVec_ForwardNodeZ;
20722 * The contents of CResult_BlindedPathDecodeErrorZ
20724 typedef union LDKCResult_BlindedPathDecodeErrorZPtr {
20726 * A pointer to the contents in the success state.
20727 * Reading from this pointer when `result_ok` is not set is undefined.
20729 struct LDKBlindedPath *result;
20731 * A pointer to the contents in the error state.
20732 * Reading from this pointer when `result_ok` is set is undefined.
20734 struct LDKDecodeError *err;
20735 } LDKCResult_BlindedPathDecodeErrorZPtr;
20738 * A CResult_BlindedPathDecodeErrorZ represents the result of a fallible operation,
20739 * containing a crate::lightning::blinded_path::BlindedPath on success and a crate::lightning::ln::msgs::DecodeError on failure.
20740 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20742 typedef struct LDKCResult_BlindedPathDecodeErrorZ {
20744 * The contents of this CResult_BlindedPathDecodeErrorZ, accessible via either
20745 * `err` or `result` depending on the state of `result_ok`.
20747 union LDKCResult_BlindedPathDecodeErrorZPtr contents;
20749 * Whether this CResult_BlindedPathDecodeErrorZ represents a success state.
20752 } LDKCResult_BlindedPathDecodeErrorZ;
20755 * The contents of CResult_BlindedHopDecodeErrorZ
20757 typedef union LDKCResult_BlindedHopDecodeErrorZPtr {
20759 * A pointer to the contents in the success state.
20760 * Reading from this pointer when `result_ok` is not set is undefined.
20762 struct LDKBlindedHop *result;
20764 * A pointer to the contents in the error state.
20765 * Reading from this pointer when `result_ok` is set is undefined.
20767 struct LDKDecodeError *err;
20768 } LDKCResult_BlindedHopDecodeErrorZPtr;
20771 * A CResult_BlindedHopDecodeErrorZ represents the result of a fallible operation,
20772 * containing a crate::lightning::blinded_path::BlindedHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
20773 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20775 typedef struct LDKCResult_BlindedHopDecodeErrorZ {
20777 * The contents of this CResult_BlindedHopDecodeErrorZ, accessible via either
20778 * `err` or `result` depending on the state of `result_ok`.
20780 union LDKCResult_BlindedHopDecodeErrorZPtr contents;
20782 * Whether this CResult_BlindedHopDecodeErrorZ represents a success state.
20785 } LDKCResult_BlindedHopDecodeErrorZ;
20788 * The contents of CResult_InvoiceErrorDecodeErrorZ
20790 typedef union LDKCResult_InvoiceErrorDecodeErrorZPtr {
20792 * A pointer to the contents in the success state.
20793 * Reading from this pointer when `result_ok` is not set is undefined.
20795 struct LDKInvoiceError *result;
20797 * A pointer to the contents in the error state.
20798 * Reading from this pointer when `result_ok` is set is undefined.
20800 struct LDKDecodeError *err;
20801 } LDKCResult_InvoiceErrorDecodeErrorZPtr;
20804 * A CResult_InvoiceErrorDecodeErrorZ represents the result of a fallible operation,
20805 * containing a crate::lightning::offers::invoice_error::InvoiceError on success and a crate::lightning::ln::msgs::DecodeError on failure.
20806 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20808 typedef struct LDKCResult_InvoiceErrorDecodeErrorZ {
20810 * The contents of this CResult_InvoiceErrorDecodeErrorZ, accessible via either
20811 * `err` or `result` depending on the state of `result_ok`.
20813 union LDKCResult_InvoiceErrorDecodeErrorZPtr contents;
20815 * Whether this CResult_InvoiceErrorDecodeErrorZ represents a success state.
20818 } LDKCResult_InvoiceErrorDecodeErrorZ;
20823 * The state of a spendable output currently tracked by an [`OutputSweeper`].
20825 typedef struct MUST_USE_STRUCT LDKTrackedSpendableOutput {
20827 * A pointer to the opaque Rust object.
20828 * Nearly everywhere, inner must be non-null, however in places where
20829 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20831 LDKnativeTrackedSpendableOutput *inner;
20833 * Indicates that this is the only struct which contains the same pointer.
20834 * Rust functions which take ownership of an object provided via an argument require
20835 * this to be true and invalidate the object pointed to by inner.
20838 } LDKTrackedSpendableOutput;
20841 * The contents of CResult_TrackedSpendableOutputDecodeErrorZ
20843 typedef union LDKCResult_TrackedSpendableOutputDecodeErrorZPtr {
20845 * A pointer to the contents in the success state.
20846 * Reading from this pointer when `result_ok` is not set is undefined.
20848 struct LDKTrackedSpendableOutput *result;
20850 * A pointer to the contents in the error state.
20851 * Reading from this pointer when `result_ok` is set is undefined.
20853 struct LDKDecodeError *err;
20854 } LDKCResult_TrackedSpendableOutputDecodeErrorZPtr;
20857 * A CResult_TrackedSpendableOutputDecodeErrorZ represents the result of a fallible operation,
20858 * containing a crate::lightning::util::sweep::TrackedSpendableOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
20859 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20861 typedef struct LDKCResult_TrackedSpendableOutputDecodeErrorZ {
20863 * The contents of this CResult_TrackedSpendableOutputDecodeErrorZ, accessible via either
20864 * `err` or `result` depending on the state of `result_ok`.
20866 union LDKCResult_TrackedSpendableOutputDecodeErrorZPtr contents;
20868 * Whether this CResult_TrackedSpendableOutputDecodeErrorZ represents a success state.
20871 } LDKCResult_TrackedSpendableOutputDecodeErrorZ;
20874 * The current status of the output spend.
20876 typedef enum LDKOutputSpendStatus_Tag {
20878 * The output is tracked but an initial spending transaction hasn't been generated and
20881 LDKOutputSpendStatus_PendingInitialBroadcast,
20883 * A transaction spending the output has been broadcasted but is pending its first confirmation on-chain.
20885 LDKOutputSpendStatus_PendingFirstConfirmation,
20887 * A transaction spending the output has been confirmed on-chain but will be tracked until it
20888 * reaches [`ANTI_REORG_DELAY`] confirmations.
20890 LDKOutputSpendStatus_PendingThresholdConfirmations,
20892 * Must be last for serialization purposes
20894 LDKOutputSpendStatus_Sentinel,
20895 } LDKOutputSpendStatus_Tag;
20897 typedef struct LDKOutputSpendStatus_LDKPendingInitialBroadcast_Body {
20899 * The height at which we will first generate and broadcast a spending transaction.
20901 struct LDKCOption_u32Z delayed_until_height;
20902 } LDKOutputSpendStatus_LDKPendingInitialBroadcast_Body;
20904 typedef struct LDKOutputSpendStatus_LDKPendingFirstConfirmation_Body {
20906 * The hash of the chain tip when we first broadcast a transaction spending this output.
20908 struct LDKThirtyTwoBytes first_broadcast_hash;
20910 * The best height when we last broadcast a transaction spending this output.
20912 uint32_t latest_broadcast_height;
20914 * The transaction spending this output we last broadcasted.
20916 struct LDKTransaction latest_spending_tx;
20917 } LDKOutputSpendStatus_LDKPendingFirstConfirmation_Body;
20919 typedef struct LDKOutputSpendStatus_LDKPendingThresholdConfirmations_Body {
20921 * The hash of the chain tip when we first broadcast a transaction spending this output.
20923 struct LDKThirtyTwoBytes first_broadcast_hash;
20925 * The best height when we last broadcast a transaction spending this output.
20927 uint32_t latest_broadcast_height;
20929 * The transaction spending this output we saw confirmed on-chain.
20931 struct LDKTransaction latest_spending_tx;
20933 * The height at which the spending transaction was confirmed.
20935 uint32_t confirmation_height;
20937 * The hash of the block in which the spending transaction was confirmed.
20939 struct LDKThirtyTwoBytes confirmation_hash;
20940 } LDKOutputSpendStatus_LDKPendingThresholdConfirmations_Body;
20942 typedef struct MUST_USE_STRUCT LDKOutputSpendStatus {
20943 LDKOutputSpendStatus_Tag tag;
20945 LDKOutputSpendStatus_LDKPendingInitialBroadcast_Body pending_initial_broadcast;
20946 LDKOutputSpendStatus_LDKPendingFirstConfirmation_Body pending_first_confirmation;
20947 LDKOutputSpendStatus_LDKPendingThresholdConfirmations_Body pending_threshold_confirmations;
20949 } LDKOutputSpendStatus;
20952 * The contents of CResult_OutputSpendStatusDecodeErrorZ
20954 typedef union LDKCResult_OutputSpendStatusDecodeErrorZPtr {
20956 * A pointer to the contents in the success state.
20957 * Reading from this pointer when `result_ok` is not set is undefined.
20959 struct LDKOutputSpendStatus *result;
20961 * A pointer to the contents in the error state.
20962 * Reading from this pointer when `result_ok` is set is undefined.
20964 struct LDKDecodeError *err;
20965 } LDKCResult_OutputSpendStatusDecodeErrorZPtr;
20968 * A CResult_OutputSpendStatusDecodeErrorZ represents the result of a fallible operation,
20969 * containing a crate::lightning::util::sweep::OutputSpendStatus on success and a crate::lightning::ln::msgs::DecodeError on failure.
20970 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20972 typedef struct LDKCResult_OutputSpendStatusDecodeErrorZ {
20974 * The contents of this CResult_OutputSpendStatusDecodeErrorZ, accessible via either
20975 * `err` or `result` depending on the state of `result_ok`.
20977 union LDKCResult_OutputSpendStatusDecodeErrorZPtr contents;
20979 * Whether this CResult_OutputSpendStatusDecodeErrorZ represents a success state.
20982 } LDKCResult_OutputSpendStatusDecodeErrorZ;
20987 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
20989 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
20990 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
20991 * [`Confirm::transactions_confirmed`].
20993 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
20994 * may have been spent there. See [`Filter::register_output`] for details.
20996 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
20997 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
20999 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
21001 * A pointer to the opaque Rust object.
21002 * Nearly everywhere, inner must be non-null, however in places where
21003 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21005 LDKnativeWatchedOutput *inner;
21007 * Indicates that this is the only struct which contains the same pointer.
21008 * Rust functions which take ownership of an object provided via an argument require
21009 * this to be true and invalidate the object pointed to by inner.
21012 } LDKWatchedOutput;
21015 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
21018 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
21019 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
21020 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
21021 * receiving full blocks from a chain source, any further filtering is unnecessary.
21023 * After an output has been registered, subsequent block retrievals from the chain source must not
21024 * exclude any transactions matching the new criteria nor any in-block descendants of such
21027 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
21028 * should not block on I/O. Implementations should instead queue the newly monitored data to be
21029 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
21030 * invocation that has called the `Filter` must return [`InProgress`].
21032 * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
21033 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
21034 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
21036 typedef struct LDKFilter {
21038 * An opaque pointer which is passed to your function implementations as an argument.
21039 * This has no meaning in the LDK, and can be NULL or any other value.
21043 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
21044 * a spending condition.
21046 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
21048 * Registers interest in spends of a transaction output.
21050 * Note that this method might be called during processing of a new block. You therefore need
21051 * to ensure that also dependent output spents within an already connected block are correctly
21052 * handled, e.g., by re-scanning the block in question whenever new outputs have been
21053 * registered mid-processing.
21055 void (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
21057 * Frees any resources associated with this object given its this_arg pointer.
21058 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21060 void (*free)(void *this_arg);
21064 * An enum which can either contain a crate::lightning::chain::Filter or not
21066 typedef enum LDKCOption_FilterZ_Tag {
21068 * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
21070 LDKCOption_FilterZ_Some,
21072 * When we're in this state, this COption_FilterZ contains nothing
21074 LDKCOption_FilterZ_None,
21076 * Must be last for serialization purposes
21078 LDKCOption_FilterZ_Sentinel,
21079 } LDKCOption_FilterZ_Tag;
21081 typedef struct LDKCOption_FilterZ {
21082 LDKCOption_FilterZ_Tag tag;
21085 struct LDKFilter some;
21088 } LDKCOption_FilterZ;
21091 * A dynamically-allocated array of crate::lightning::util::sweep::TrackedSpendableOutputs of arbitrary size.
21092 * This corresponds to std::vector in C++
21094 typedef struct LDKCVec_TrackedSpendableOutputZ {
21096 * The elements in the array.
21097 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
21099 struct LDKTrackedSpendableOutput *data;
21101 * The number of elements pointed to by `data`.
21104 } LDKCVec_TrackedSpendableOutputZ;
21107 * A helper trait that describes an on-chain wallet capable of returning a (change) destination
21110 typedef struct LDKChangeDestinationSource {
21112 * An opaque pointer which is passed to your function implementations as an argument.
21113 * This has no meaning in the LDK, and can be NULL or any other value.
21117 * Returns a script pubkey which can be used as a change destination for
21118 * [`OutputSpender::spend_spendable_outputs`].
21120 * This method should return a different value each time it is called, to avoid linking
21121 * on-chain funds controlled to the same user.
21123 struct LDKCResult_CVec_u8ZNoneZ (*get_change_destination_script)(const void *this_arg);
21125 * Frees any resources associated with this object given its this_arg pointer.
21126 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21128 void (*free)(void *this_arg);
21129 } LDKChangeDestinationSource;
21132 * Provides an interface that allows storage and retrieval of persisted values that are associated
21135 * In order to avoid collisions the key space is segmented based on the given `primary_namespace`s
21136 * and `secondary_namespace`s. Implementations of this trait are free to handle them in different
21137 * ways, as long as per-namespace key uniqueness is asserted.
21139 * Keys and namespaces are required to be valid ASCII strings in the range of
21140 * [`KVSTORE_NAMESPACE_KEY_ALPHABET`] and no longer than [`KVSTORE_NAMESPACE_KEY_MAX_LEN`]. Empty
21141 * primary namespaces and secondary namespaces (`\"\"`) are assumed to be a valid, however, if
21142 * `primary_namespace` is empty, `secondary_namespace` is required to be empty, too. This means
21143 * that concerns should always be separated by primary namespace first, before secondary
21144 * namespaces are used. While the number of primary namespaces will be relatively small and is
21145 * determined at compile time, there may be many secondary namespaces per primary namespace. Note
21146 * that per-namespace uniqueness needs to also hold for keys *and* namespaces in any given
21147 * namespace, i.e., conflicts between keys and equally named
21148 * primary namespaces/secondary namespaces must be avoided.
21150 * **Note:** Users migrating custom persistence backends from the pre-v0.0.117 `KVStorePersister`
21151 * interface can use a concatenation of `[{primary_namespace}/[{secondary_namespace}/]]{key}` to
21152 * recover a `key` compatible with the data model previously assumed by `KVStorePersister::persist`.
21154 typedef struct LDKKVStore {
21156 * An opaque pointer which is passed to your function implementations as an argument.
21157 * This has no meaning in the LDK, and can be NULL or any other value.
21161 * Returns the data stored for the given `primary_namespace`, `secondary_namespace`, and
21164 * Returns an [`ErrorKind::NotFound`] if the given `key` could not be found in the given
21165 * `primary_namespace` and `secondary_namespace`.
21167 * [`ErrorKind::NotFound`]: io::ErrorKind::NotFound
21169 struct LDKCResult_CVec_u8ZIOErrorZ (*read)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key);
21171 * Persists the given data under the given `key`.
21173 * Will create the given `primary_namespace` and `secondary_namespace` if not already present
21176 struct LDKCResult_NoneIOErrorZ (*write)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, struct LDKu8slice buf);
21178 * Removes any data that had previously been persisted under the given `key`.
21180 * If the `lazy` flag is set to `true`, the backend implementation might choose to lazily
21181 * remove the given `key` at some point in time after the method returns, e.g., as part of an
21182 * eventual batch deletion of multiple keys. As a consequence, subsequent calls to
21183 * [`KVStore::list`] might include the removed key until the changes are actually persisted.
21185 * Note that while setting the `lazy` flag reduces the I/O burden of multiple subsequent
21186 * `remove` calls, it also influences the atomicity guarantees as lazy `remove`s could
21187 * potentially get lost on crash after the method returns. Therefore, this flag should only be
21188 * set for `remove` operations that can be safely replayed at a later time.
21190 * Returns successfully if no data will be stored for the given `primary_namespace`,
21191 * `secondary_namespace`, and `key`, independently of whether it was present before its
21192 * invokation or not.
21194 struct LDKCResult_NoneIOErrorZ (*remove)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, bool lazy);
21196 * Returns a list of keys that are stored under the given `secondary_namespace` in
21197 * `primary_namespace`.
21199 * Returns the keys in arbitrary order, so users requiring a particular order need to sort the
21200 * returned keys. Returns an empty list if `primary_namespace` or `secondary_namespace` is unknown.
21202 struct LDKCResult_CVec_StrZIOErrorZ (*list)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace);
21204 * Frees any resources associated with this object given its this_arg pointer.
21205 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21207 void (*free)(void *this_arg);
21211 * A trait that describes a wallet capable of creating a spending [`Transaction`] from a set of
21212 * [`SpendableOutputDescriptor`]s.
21214 typedef struct LDKOutputSpender {
21216 * An opaque pointer which is passed to your function implementations as an argument.
21217 * This has no meaning in the LDK, and can be NULL or any other value.
21221 * Creates a [`Transaction`] which spends the given descriptors to the given outputs, plus an
21222 * output to the given change destination (if sufficient change value remains). The
21223 * transaction will have a feerate, at least, of the given value.
21225 * The `locktime` argument is used to set the transaction's locktime. If `None`, the
21226 * transaction will have a locktime of 0. It it recommended to set this to the current block
21227 * height to avoid fee sniping, unless you have some specific reason to use a different
21230 * Returns `Err(())` if the output value is greater than the input value minus required fee,
21231 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
21232 * does not match the one we can spend.
21234 struct LDKCResult_TransactionNoneZ (*spend_spendable_outputs)(const void *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);
21236 * Frees any resources associated with this object given its this_arg pointer.
21237 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21239 void (*free)(void *this_arg);
21240 } LDKOutputSpender;
21245 * A utility that keeps track of [`SpendableOutputDescriptor`]s, persists them in a given
21246 * [`KVStore`] and regularly retries sweeping them based on a callback given to the constructor
21249 * Users should call [`Self::track_spendable_outputs`] for any [`SpendableOutputDescriptor`]s received via [`Event::SpendableOutputs`].
21251 * This needs to be notified of chain state changes either via its [`Listen`] or [`Confirm`]
21252 * implementation and hence has to be connected with the utilized chain data sources.
21254 * If chain data is provided via the [`Confirm`] interface or via filtered blocks, users are
21255 * required to give their chain data sources (i.e., [`Filter`] implementation) to the respective
21258 * [`Event::SpendableOutputs`]: crate::events::Event::SpendableOutputs
21260 typedef struct MUST_USE_STRUCT LDKOutputSweeper {
21262 * A pointer to the opaque Rust object.
21263 * Nearly everywhere, inner must be non-null, however in places where
21264 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21266 LDKnativeOutputSweeper *inner;
21268 * Indicates that this is the only struct which contains the same pointer.
21269 * Rust functions which take ownership of an object provided via an argument require
21270 * this to be true and invalidate the object pointed to by inner.
21273 } LDKOutputSweeper;
21276 * The contents of CResult_OutputSweeperDecodeErrorZ
21278 typedef union LDKCResult_OutputSweeperDecodeErrorZPtr {
21280 * A pointer to the contents in the success state.
21281 * Reading from this pointer when `result_ok` is not set is undefined.
21283 struct LDKOutputSweeper *result;
21285 * A pointer to the contents in the error state.
21286 * Reading from this pointer when `result_ok` is set is undefined.
21288 struct LDKDecodeError *err;
21289 } LDKCResult_OutputSweeperDecodeErrorZPtr;
21292 * A CResult_OutputSweeperDecodeErrorZ represents the result of a fallible operation,
21293 * containing a crate::lightning::util::sweep::OutputSweeper on success and a crate::lightning::ln::msgs::DecodeError on failure.
21294 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21296 typedef struct LDKCResult_OutputSweeperDecodeErrorZ {
21298 * The contents of this CResult_OutputSweeperDecodeErrorZ, accessible via either
21299 * `err` or `result` depending on the state of `result_ok`.
21301 union LDKCResult_OutputSweeperDecodeErrorZPtr contents;
21303 * Whether this CResult_OutputSweeperDecodeErrorZ represents a success state.
21306 } LDKCResult_OutputSweeperDecodeErrorZ;
21309 * A tuple of 2 elements. See the individual fields for the types contained.
21311 typedef struct LDKC2Tuple_BestBlockOutputSweeperZ {
21313 * The element at position 0
21315 struct LDKBestBlock a;
21317 * The element at position 1
21319 struct LDKOutputSweeper b;
21320 } LDKC2Tuple_BestBlockOutputSweeperZ;
21323 * The contents of CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ
21325 typedef union LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZPtr {
21327 * A pointer to the contents in the success state.
21328 * Reading from this pointer when `result_ok` is not set is undefined.
21330 struct LDKC2Tuple_BestBlockOutputSweeperZ *result;
21332 * A pointer to the contents in the error state.
21333 * Reading from this pointer when `result_ok` is set is undefined.
21335 struct LDKDecodeError *err;
21336 } LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZPtr;
21339 * A CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ represents the result of a fallible operation,
21340 * containing a crate::c_types::derived::C2Tuple_BestBlockOutputSweeperZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
21341 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21343 typedef struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ {
21345 * The contents of this CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ, accessible via either
21346 * `err` or `result` depending on the state of `result_ok`.
21348 union LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZPtr contents;
21350 * Whether this CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ represents a success state.
21353 } LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ;
21358 * Base key used in conjunction with a `per_commitment_point` to generate a [`DelayedPaymentKey`].
21360 * The delayed payment key is used to pay the commitment state broadcaster their
21361 * non-HTLC-encumbered funds after a delay to give their counterparty a chance to punish if the
21362 * state broadcasted was previously revoked.
21364 typedef struct MUST_USE_STRUCT LDKDelayedPaymentBasepoint {
21366 * A pointer to the opaque Rust object.
21367 * Nearly everywhere, inner must be non-null, however in places where
21368 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21370 LDKnativeDelayedPaymentBasepoint *inner;
21372 * Indicates that this is the only struct which contains the same pointer.
21373 * Rust functions which take ownership of an object provided via an argument require
21374 * this to be true and invalidate the object pointed to by inner.
21377 } LDKDelayedPaymentBasepoint;
21380 * The contents of CResult_DelayedPaymentBasepointDecodeErrorZ
21382 typedef union LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr {
21384 * A pointer to the contents in the success state.
21385 * Reading from this pointer when `result_ok` is not set is undefined.
21387 struct LDKDelayedPaymentBasepoint *result;
21389 * A pointer to the contents in the error state.
21390 * Reading from this pointer when `result_ok` is set is undefined.
21392 struct LDKDecodeError *err;
21393 } LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr;
21396 * A CResult_DelayedPaymentBasepointDecodeErrorZ represents the result of a fallible operation,
21397 * containing a crate::lightning::ln::channel_keys::DelayedPaymentBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
21398 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21400 typedef struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ {
21402 * The contents of this CResult_DelayedPaymentBasepointDecodeErrorZ, accessible via either
21403 * `err` or `result` depending on the state of `result_ok`.
21405 union LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr contents;
21407 * Whether this CResult_DelayedPaymentBasepointDecodeErrorZ represents a success state.
21410 } LDKCResult_DelayedPaymentBasepointDecodeErrorZ;
21415 * A derived key built from a [`DelayedPaymentBasepoint`] and `per_commitment_point`.
21417 * The delayed payment key is used to pay the commitment state broadcaster their
21418 * non-HTLC-encumbered funds after a delay. This delay gives their counterparty a chance to
21419 * punish and claim all the channel funds if the state broadcasted was previously revoked.
21421 * [See the BOLT specs]
21422 * (https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation)
21423 * for more information on key derivation details.
21425 typedef struct MUST_USE_STRUCT LDKDelayedPaymentKey {
21427 * A pointer to the opaque Rust object.
21428 * Nearly everywhere, inner must be non-null, however in places where
21429 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21431 LDKnativeDelayedPaymentKey *inner;
21433 * Indicates that this is the only struct which contains the same pointer.
21434 * Rust functions which take ownership of an object provided via an argument require
21435 * this to be true and invalidate the object pointed to by inner.
21438 } LDKDelayedPaymentKey;
21441 * The contents of CResult_DelayedPaymentKeyDecodeErrorZ
21443 typedef union LDKCResult_DelayedPaymentKeyDecodeErrorZPtr {
21445 * A pointer to the contents in the success state.
21446 * Reading from this pointer when `result_ok` is not set is undefined.
21448 struct LDKDelayedPaymentKey *result;
21450 * A pointer to the contents in the error state.
21451 * Reading from this pointer when `result_ok` is set is undefined.
21453 struct LDKDecodeError *err;
21454 } LDKCResult_DelayedPaymentKeyDecodeErrorZPtr;
21457 * A CResult_DelayedPaymentKeyDecodeErrorZ represents the result of a fallible operation,
21458 * containing a crate::lightning::ln::channel_keys::DelayedPaymentKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
21459 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21461 typedef struct LDKCResult_DelayedPaymentKeyDecodeErrorZ {
21463 * The contents of this CResult_DelayedPaymentKeyDecodeErrorZ, accessible via either
21464 * `err` or `result` depending on the state of `result_ok`.
21466 union LDKCResult_DelayedPaymentKeyDecodeErrorZPtr contents;
21468 * Whether this CResult_DelayedPaymentKeyDecodeErrorZ represents a success state.
21471 } LDKCResult_DelayedPaymentKeyDecodeErrorZ;
21476 * Base key used in conjunction with a `per_commitment_point` to generate an [`HtlcKey`].
21478 * HTLC keys are used to ensure only the recipient of an HTLC can claim it on-chain with the HTLC
21479 * preimage and that only the sender of an HTLC can claim it on-chain after it has timed out.
21480 * Thus, both channel counterparties' HTLC keys will appears in each HTLC output's script.
21482 typedef struct MUST_USE_STRUCT LDKHtlcBasepoint {
21484 * A pointer to the opaque Rust object.
21485 * Nearly everywhere, inner must be non-null, however in places where
21486 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21488 LDKnativeHtlcBasepoint *inner;
21490 * Indicates that this is the only struct which contains the same pointer.
21491 * Rust functions which take ownership of an object provided via an argument require
21492 * this to be true and invalidate the object pointed to by inner.
21495 } LDKHtlcBasepoint;
21498 * The contents of CResult_HtlcBasepointDecodeErrorZ
21500 typedef union LDKCResult_HtlcBasepointDecodeErrorZPtr {
21502 * A pointer to the contents in the success state.
21503 * Reading from this pointer when `result_ok` is not set is undefined.
21505 struct LDKHtlcBasepoint *result;
21507 * A pointer to the contents in the error state.
21508 * Reading from this pointer when `result_ok` is set is undefined.
21510 struct LDKDecodeError *err;
21511 } LDKCResult_HtlcBasepointDecodeErrorZPtr;
21514 * A CResult_HtlcBasepointDecodeErrorZ represents the result of a fallible operation,
21515 * containing a crate::lightning::ln::channel_keys::HtlcBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
21516 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21518 typedef struct LDKCResult_HtlcBasepointDecodeErrorZ {
21520 * The contents of this CResult_HtlcBasepointDecodeErrorZ, accessible via either
21521 * `err` or `result` depending on the state of `result_ok`.
21523 union LDKCResult_HtlcBasepointDecodeErrorZPtr contents;
21525 * Whether this CResult_HtlcBasepointDecodeErrorZ represents a success state.
21528 } LDKCResult_HtlcBasepointDecodeErrorZ;
21533 * A derived key built from a [`HtlcBasepoint`] and `per_commitment_point`.
21535 * HTLC keys are used to ensure only the recipient of an HTLC can claim it on-chain with the HTLC
21536 * preimage and that only the sender of an HTLC can claim it on-chain after it has timed out.
21537 * Thus, both channel counterparties' HTLC keys will appears in each HTLC output's script.
21539 * [See the BOLT specs]
21540 * (https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation)
21541 * for more information on key derivation details.
21543 typedef struct MUST_USE_STRUCT LDKHtlcKey {
21545 * A pointer to the opaque Rust object.
21546 * Nearly everywhere, inner must be non-null, however in places where
21547 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21549 LDKnativeHtlcKey *inner;
21551 * Indicates that this is the only struct which contains the same pointer.
21552 * Rust functions which take ownership of an object provided via an argument require
21553 * this to be true and invalidate the object pointed to by inner.
21559 * The contents of CResult_HtlcKeyDecodeErrorZ
21561 typedef union LDKCResult_HtlcKeyDecodeErrorZPtr {
21563 * A pointer to the contents in the success state.
21564 * Reading from this pointer when `result_ok` is not set is undefined.
21566 struct LDKHtlcKey *result;
21568 * A pointer to the contents in the error state.
21569 * Reading from this pointer when `result_ok` is set is undefined.
21571 struct LDKDecodeError *err;
21572 } LDKCResult_HtlcKeyDecodeErrorZPtr;
21575 * A CResult_HtlcKeyDecodeErrorZ represents the result of a fallible operation,
21576 * containing a crate::lightning::ln::channel_keys::HtlcKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
21577 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21579 typedef struct LDKCResult_HtlcKeyDecodeErrorZ {
21581 * The contents of this CResult_HtlcKeyDecodeErrorZ, accessible via either
21582 * `err` or `result` depending on the state of `result_ok`.
21584 union LDKCResult_HtlcKeyDecodeErrorZPtr contents;
21586 * Whether this CResult_HtlcKeyDecodeErrorZ represents a success state.
21589 } LDKCResult_HtlcKeyDecodeErrorZ;
21594 * Master key used in conjunction with per_commitment_point to generate [htlcpubkey](https://github.com/lightning/bolts/blob/master/03-transactions.md#key-derivation) for the latest state of a channel.
21595 * A watcher can be given a [RevocationBasepoint] to generate per commitment [RevocationKey] to create justice transactions.
21597 typedef struct MUST_USE_STRUCT LDKRevocationBasepoint {
21599 * A pointer to the opaque Rust object.
21600 * Nearly everywhere, inner must be non-null, however in places where
21601 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21603 LDKnativeRevocationBasepoint *inner;
21605 * Indicates that this is the only struct which contains the same pointer.
21606 * Rust functions which take ownership of an object provided via an argument require
21607 * this to be true and invalidate the object pointed to by inner.
21610 } LDKRevocationBasepoint;
21613 * The contents of CResult_RevocationBasepointDecodeErrorZ
21615 typedef union LDKCResult_RevocationBasepointDecodeErrorZPtr {
21617 * A pointer to the contents in the success state.
21618 * Reading from this pointer when `result_ok` is not set is undefined.
21620 struct LDKRevocationBasepoint *result;
21622 * A pointer to the contents in the error state.
21623 * Reading from this pointer when `result_ok` is set is undefined.
21625 struct LDKDecodeError *err;
21626 } LDKCResult_RevocationBasepointDecodeErrorZPtr;
21629 * A CResult_RevocationBasepointDecodeErrorZ represents the result of a fallible operation,
21630 * containing a crate::lightning::ln::channel_keys::RevocationBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
21631 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21633 typedef struct LDKCResult_RevocationBasepointDecodeErrorZ {
21635 * The contents of this CResult_RevocationBasepointDecodeErrorZ, accessible via either
21636 * `err` or `result` depending on the state of `result_ok`.
21638 union LDKCResult_RevocationBasepointDecodeErrorZPtr contents;
21640 * Whether this CResult_RevocationBasepointDecodeErrorZ represents a success state.
21643 } LDKCResult_RevocationBasepointDecodeErrorZ;
21648 * The revocation key is used to allow a channel party to revoke their state - giving their
21649 * counterparty the required material to claim all of their funds if they broadcast that state.
21651 * Each commitment transaction has a revocation key based on the basepoint and
21652 * per_commitment_point which is used in both commitment and HTLC transactions.
21654 * See [the BOLT spec for derivation details]
21655 * (https://github.com/lightning/bolts/blob/master/03-transactions.md#revocationpubkey-derivation)
21657 typedef struct MUST_USE_STRUCT LDKRevocationKey {
21659 * A pointer to the opaque Rust object.
21660 * Nearly everywhere, inner must be non-null, however in places where
21661 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21663 LDKnativeRevocationKey *inner;
21665 * Indicates that this is the only struct which contains the same pointer.
21666 * Rust functions which take ownership of an object provided via an argument require
21667 * this to be true and invalidate the object pointed to by inner.
21670 } LDKRevocationKey;
21673 * The contents of CResult_RevocationKeyDecodeErrorZ
21675 typedef union LDKCResult_RevocationKeyDecodeErrorZPtr {
21677 * A pointer to the contents in the success state.
21678 * Reading from this pointer when `result_ok` is not set is undefined.
21680 struct LDKRevocationKey *result;
21682 * A pointer to the contents in the error state.
21683 * Reading from this pointer when `result_ok` is set is undefined.
21685 struct LDKDecodeError *err;
21686 } LDKCResult_RevocationKeyDecodeErrorZPtr;
21689 * A CResult_RevocationKeyDecodeErrorZ represents the result of a fallible operation,
21690 * containing a crate::lightning::ln::channel_keys::RevocationKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
21691 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21693 typedef struct LDKCResult_RevocationKeyDecodeErrorZ {
21695 * The contents of this CResult_RevocationKeyDecodeErrorZ, accessible via either
21696 * `err` or `result` depending on the state of `result_ok`.
21698 union LDKCResult_RevocationKeyDecodeErrorZPtr contents;
21700 * Whether this CResult_RevocationKeyDecodeErrorZ represents a success state.
21703 } LDKCResult_RevocationKeyDecodeErrorZ;
21708 * A read-only reference to a current ChannelMonitor.
21710 * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
21713 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
21715 * A pointer to the opaque Rust object.
21716 * Nearly everywhere, inner must be non-null, however in places where
21717 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21719 LDKnativeLockedChannelMonitor *inner;
21721 * Indicates that this is the only struct which contains the same pointer.
21722 * Rust functions which take ownership of an object provided via an argument require
21723 * this to be true and invalidate the object pointed to by inner.
21726 } LDKLockedChannelMonitor;
21729 * The contents of CResult_LockedChannelMonitorNoneZ
21731 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
21733 * A pointer to the contents in the success state.
21734 * Reading from this pointer when `result_ok` is not set is undefined.
21736 struct LDKLockedChannelMonitor *result;
21738 * Note that this value is always NULL, as there are no contents in the Err variant
21741 } LDKCResult_LockedChannelMonitorNoneZPtr;
21744 * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
21745 * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
21746 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21748 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
21750 * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
21751 * `err` or `result` depending on the state of `result_ok`.
21753 union LDKCResult_LockedChannelMonitorNoneZPtr contents;
21755 * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
21758 } LDKCResult_LockedChannelMonitorNoneZ;
21761 * A tuple of 2 elements. See the individual fields for the types contained.
21763 typedef struct LDKC2Tuple_OutPointChannelIdZ {
21765 * The element at position 0
21767 struct LDKOutPoint a;
21769 * The element at position 1
21771 struct LDKChannelId b;
21772 } LDKC2Tuple_OutPointChannelIdZ;
21775 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointChannelIdZs of arbitrary size.
21776 * This corresponds to std::vector in C++
21778 typedef struct LDKCVec_C2Tuple_OutPointChannelIdZZ {
21780 * The elements in the array.
21781 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
21783 struct LDKC2Tuple_OutPointChannelIdZ *data;
21785 * The number of elements pointed to by `data`.
21788 } LDKCVec_C2Tuple_OutPointChannelIdZZ;
21793 * An opaque identifier describing a specific [`Persist`] method call.
21795 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
21797 * A pointer to the opaque Rust object.
21798 * Nearly everywhere, inner must be non-null, however in places where
21799 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21801 LDKnativeMonitorUpdateId *inner;
21803 * Indicates that this is the only struct which contains the same pointer.
21804 * Rust functions which take ownership of an object provided via an argument require
21805 * this to be true and invalidate the object pointed to by inner.
21808 } LDKMonitorUpdateId;
21811 * A dynamically-allocated array of crate::lightning::chain::chainmonitor::MonitorUpdateIds of arbitrary size.
21812 * This corresponds to std::vector in C++
21814 typedef struct LDKCVec_MonitorUpdateIdZ {
21816 * The elements in the array.
21817 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
21819 struct LDKMonitorUpdateId *data;
21821 * The number of elements pointed to by `data`.
21824 } LDKCVec_MonitorUpdateIdZ;
21827 * A tuple of 2 elements. See the individual fields for the types contained.
21829 typedef struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ {
21831 * The element at position 0
21833 struct LDKOutPoint a;
21835 * The element at position 1
21837 struct LDKCVec_MonitorUpdateIdZ b;
21838 } LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ;
21841 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointCVec_MonitorUpdateIdZZs of arbitrary size.
21842 * This corresponds to std::vector in C++
21844 typedef struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ {
21846 * The elements in the array.
21847 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
21849 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *data;
21851 * The number of elements pointed to by `data`.
21854 } LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ;
21857 * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk.
21859 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
21861 typedef struct LDKPersister {
21863 * An opaque pointer which is passed to your function implementations as an argument.
21864 * This has no meaning in the LDK, and can be NULL or any other value.
21868 * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
21870 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
21872 struct LDKCResult_NoneIOErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
21874 * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
21876 struct LDKCResult_NoneIOErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
21878 * Persist the given [`WriteableScore`] to disk, returning an error if persistence failed.
21880 struct LDKCResult_NoneIOErrorZ (*persist_scorer)(const void *this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer);
21882 * Frees any resources associated with this object given its this_arg pointer.
21883 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21885 void (*free)(void *this_arg);
21891 * Implements [`Persist`] in a way that writes and reads both [`ChannelMonitor`]s and
21892 * [`ChannelMonitorUpdate`]s.
21896 * The main benefit this provides over the [`KVStore`]'s [`Persist`] implementation is decreased
21897 * I/O bandwidth and storage churn, at the expense of more IOPS (including listing, reading, and
21898 * deleting) and complexity. This is because it writes channel monitor differential updates,
21899 * whereas the other (default) implementation rewrites the entire monitor on each update. For
21900 * routing nodes, updates can happen many times per second to a channel, and monitors can be tens
21901 * of megabytes (or more). Updates can be as small as a few hundred bytes.
21903 * Note that monitors written with `MonitorUpdatingPersister` are _not_ backward-compatible with
21904 * the default [`KVStore`]'s [`Persist`] implementation. They have a prepended byte sequence,
21905 * [`MONITOR_UPDATING_PERSISTER_PREPEND_SENTINEL`], applied to prevent deserialization with other
21906 * persisters. This is because monitors written by this struct _may_ have unapplied updates. In
21907 * order to downgrade, you must ensure that all updates are applied to the monitor, and remove the
21910 * # Storing monitors
21912 * Monitors are stored by implementing the [`Persist`] trait, which has two functions:
21914 * - [`Persist::persist_new_channel`], which persists whole [`ChannelMonitor`]s.
21915 * - [`Persist::update_persisted_channel`], which persists only a [`ChannelMonitorUpdate`]
21917 * Whole [`ChannelMonitor`]s are stored in the [`CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE`],
21918 * using the familiar encoding of an [`OutPoint`] (for example, `[SOME-64-CHAR-HEX-STRING]_1`).
21920 * Each [`ChannelMonitorUpdate`] is stored in a dynamic secondary namespace, as follows:
21922 * - primary namespace: [`CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE`]
21923 * - secondary namespace: [the monitor's encoded outpoint name]
21925 * Under that secondary namespace, each update is stored with a number string, like `21`, which
21926 * represents its `update_id` value.
21928 * For example, consider this channel, named for its transaction ID and index, or [`OutPoint`]:
21930 * - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
21933 * Full channel monitors would be stored at a single key:
21935 * `[CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
21937 * Updates would be stored as follows (with `/` delimiting primary_namespace/secondary_namespace/key):
21940 * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/1
21941 * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/2
21942 * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/3
21946 * # Reading channel state from storage
21948 * Channel state can be reconstructed by calling
21949 * [`MonitorUpdatingPersister::read_all_channel_monitors_with_updates`]. Alternatively, users can
21950 * list channel monitors themselves and load channels individually using
21951 * [`MonitorUpdatingPersister::read_channel_monitor_with_updates`].
21953 * ## EXTREMELY IMPORTANT
21955 * It is extremely important that your [`KVStore::read`] implementation uses the
21956 * [`io::ErrorKind::NotFound`] variant correctly: that is, when a file is not found, and _only_ in
21957 * that circumstance (not when there is really a permissions error, for example). This is because
21958 * neither channel monitor reading function lists updates. Instead, either reads the monitor, and
21959 * using its stored `update_id`, synthesizes update storage keys, and tries them in sequence until
21960 * one is not found. All _other_ errors will be bubbled up in the function's [`Result`].
21962 * # Pruning stale channel updates
21964 * Stale updates are pruned when the consolidation threshold is reached according to `maximum_pending_updates`.
21965 * Monitor updates in the range between the latest `update_id` and `update_id - maximum_pending_updates`
21967 * The `lazy` flag is used on the [`KVStore::remove`] method, so there are no guarantees that the deletions
21968 * will complete. However, stale updates are not a problem for data integrity, since updates are
21969 * only read that are higher than the stored [`ChannelMonitor`]'s `update_id`.
21971 * If you have many stale updates stored (such as after a crash with pending lazy deletes), and
21972 * would like to get rid of them, consider using the
21973 * [`MonitorUpdatingPersister::cleanup_stale_updates`] function.
21975 typedef struct MUST_USE_STRUCT LDKMonitorUpdatingPersister {
21977 * A pointer to the opaque Rust object.
21978 * Nearly everywhere, inner must be non-null, however in places where
21979 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21981 LDKnativeMonitorUpdatingPersister *inner;
21983 * Indicates that this is the only struct which contains the same pointer.
21984 * Rust functions which take ownership of an object provided via an argument require
21985 * this to be true and invalidate the object pointed to by inner.
21988 } LDKMonitorUpdatingPersister;
21991 * `Persist` defines behavior for persisting channel monitors: this could mean
21992 * writing once to disk, and/or uploading to one or more backup services.
21994 * Persistence can happen in one of two ways - synchronously completing before the trait method
21995 * calls return or asynchronously in the background.
21997 * # For those implementing synchronous persistence
21999 * * If persistence completes fully (including any relevant `fsync()` calls), the implementation
22000 * should return [`ChannelMonitorUpdateStatus::Completed`], indicating normal channel operation
22003 * * If persistence fails for some reason, implementations should consider returning
22004 * [`ChannelMonitorUpdateStatus::InProgress`] and retry all pending persistence operations in
22005 * the background with [`ChainMonitor::list_pending_monitor_updates`] and
22006 * [`ChainMonitor::get_monitor`].
22008 * Once a full [`ChannelMonitor`] has been persisted, all pending updates for that channel can
22009 * be marked as complete via [`ChainMonitor::channel_monitor_updated`].
22011 * If at some point no further progress can be made towards persisting the pending updates, the
22012 * node should simply shut down.
22014 * * If the persistence has failed and cannot be retried further (e.g. because of an outage),
22015 * [`ChannelMonitorUpdateStatus::UnrecoverableError`] can be used, though this will result in
22016 * an immediate panic and future operations in LDK generally failing.
22018 * # For those implementing asynchronous persistence
22020 * All calls should generally spawn a background task and immediately return
22021 * [`ChannelMonitorUpdateStatus::InProgress`]. Once the update completes,
22022 * [`ChainMonitor::channel_monitor_updated`] should be called with the corresponding
22023 * [`MonitorUpdateId`].
22025 * Note that unlike the direct [`chain::Watch`] interface,
22026 * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
22028 * If at some point no further progress can be made towards persisting a pending update, the node
22029 * should simply shut down. Until then, the background task should either loop indefinitely, or
22030 * persistence should be regularly retried with [`ChainMonitor::list_pending_monitor_updates`]
22031 * and [`ChainMonitor::get_monitor`] (note that if a full monitor is persisted all pending
22032 * monitor updates may be marked completed).
22034 * # Using remote watchtowers
22036 * Watchtowers may be updated as a part of an implementation of this trait, utilizing the async
22037 * update process described above while the watchtower is being updated. The following methods are
22038 * provided for bulding transactions for a watchtower:
22039 * [`ChannelMonitor::initial_counterparty_commitment_tx`],
22040 * [`ChannelMonitor::counterparty_commitment_txs_from_update`],
22041 * [`ChannelMonitor::sign_to_local_justice_tx`], [`TrustedCommitmentTransaction::revokeable_output_index`],
22042 * [`TrustedCommitmentTransaction::build_to_local_justice_tx`].
22044 * [`TrustedCommitmentTransaction::revokeable_output_index`]: crate::ln::chan_utils::TrustedCommitmentTransaction::revokeable_output_index
22045 * [`TrustedCommitmentTransaction::build_to_local_justice_tx`]: crate::ln::chan_utils::TrustedCommitmentTransaction::build_to_local_justice_tx
22047 typedef struct LDKPersist {
22049 * An opaque pointer which is passed to your function implementations as an argument.
22050 * This has no meaning in the LDK, and can be NULL or any other value.
22054 * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
22055 * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
22057 * The data can be stored any way you want, but the identifier provided by LDK is the
22058 * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
22059 * and the stored channel data). Note that you **must** persist every new monitor to disk.
22061 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
22062 * if you return [`ChannelMonitorUpdateStatus::InProgress`].
22064 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
22065 * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
22067 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
22068 * [`Writeable::write`]: crate::util::ser::Writeable::write
22070 enum LDKChannelMonitorUpdateStatus (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_funding_outpoint, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
22072 * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
22075 * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
22076 * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
22079 * During blockchain synchronization operations, and in some rare cases, this may be called with
22080 * no [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
22081 * Note that after the full [`ChannelMonitor`] is persisted any previous
22082 * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
22083 * applied to the persisted [`ChannelMonitor`] as they were already applied.
22085 * If an implementer chooses to persist the updates only, they need to make
22086 * sure that all the updates are applied to the `ChannelMonitors` *before*
22087 * the set of channel monitors is given to the `ChannelManager`
22088 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
22089 * applying a monitor update to a monitor. If full `ChannelMonitors` are
22090 * persisted, then there is no need to persist individual updates.
22092 * Note that there could be a performance tradeoff between persisting complete
22093 * channel monitors on every update vs. persisting only updates and applying
22094 * them in batches. The size of each monitor grows `O(number of state updates)`
22095 * whereas updates are small and `O(1)`.
22097 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
22098 * if you return [`ChannelMonitorUpdateStatus::InProgress`].
22100 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
22101 * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
22102 * [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
22104 * [`Writeable::write`]: crate::util::ser::Writeable::write
22106 * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
22108 enum LDKChannelMonitorUpdateStatus (*update_persisted_channel)(const void *this_arg, struct LDKOutPoint channel_funding_outpoint, struct LDKChannelMonitorUpdate update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
22110 * Prevents the channel monitor from being loaded on startup.
22112 * Archiving the data in a backup location (rather than deleting it fully) is useful for
22113 * hedging against data loss in case of unexpected failure.
22115 void (*archive_persisted_channel)(const void *this_arg, struct LDKOutPoint channel_funding_outpoint);
22117 * Frees any resources associated with this object given its this_arg pointer.
22118 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22120 void (*free)(void *this_arg);
22126 * A string that displays only printable characters, replacing control characters with
22127 * [`core::char::REPLACEMENT_CHARACTER`].
22129 typedef struct MUST_USE_STRUCT LDKPrintableString {
22131 * A pointer to the opaque Rust object.
22132 * Nearly everywhere, inner must be non-null, however in places where
22133 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22135 LDKnativePrintableString *inner;
22137 * Indicates that this is the only struct which contains the same pointer.
22138 * Rust functions which take ownership of an object provided via an argument require
22139 * this to be true and invalidate the object pointed to by inner.
22142 } LDKPrintableString;
22145 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
22148 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
22149 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
22150 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
22153 * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
22154 * entire header chain and only blocks with matching transaction data using BIP 157 filters or
22155 * other similar filtering.
22157 typedef struct LDKListen {
22159 * An opaque pointer which is passed to your function implementations as an argument.
22160 * This has no meaning in the LDK, and can be NULL or any other value.
22164 * Notifies the listener that a block was added at the given height, with the transaction data
22165 * possibly filtered.
22167 void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
22169 * Notifies the listener that a block was added at the given height.
22171 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
22173 * Notifies the listener that a block was removed at the given height.
22175 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
22177 * Frees any resources associated with this object given its this_arg pointer.
22178 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22180 void (*free)(void *this_arg);
22184 * The `Confirm` trait is used to notify LDK when relevant transactions have been confirmed on
22185 * chain or unconfirmed during a chain reorganization.
22187 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
22188 * [`Listen`]. For instance, an Electrum-based transaction sync implementation may implement
22189 * [`Filter`] to subscribe to relevant transactions and unspent outputs it should monitor for
22190 * on-chain activity. Then, it needs to notify LDK via this interface upon observing any changes
22191 * with reference to the confirmation status of the monitored objects.
22194 * The intended use is as follows:
22195 * - Call [`transactions_confirmed`] to notify LDK whenever any of the registered transactions or
22196 * outputs are, respectively, confirmed or spent on chain.
22197 * - Call [`transaction_unconfirmed`] to notify LDK whenever any transaction returned by
22198 * [`get_relevant_txids`] is no longer confirmed in the block with the given block hash.
22199 * - Call [`best_block_updated`] to notify LDK whenever a new chain tip becomes available.
22203 * Clients must call these methods in chain order. Specifically:
22204 * - Transactions which are confirmed in a particular block must be given before transactions
22205 * confirmed in a later block.
22206 * - Dependent transactions within the same block must be given in topological order, possibly in
22208 * - All unconfirmed transactions must be given after the original confirmations and before *any*
22209 * reconfirmations, i.e., [`transactions_confirmed`] and [`transaction_unconfirmed`] calls should
22210 * never be interleaved, but always conduced *en bloc*.
22211 * - Any reconfirmed transactions need to be explicitly unconfirmed before they are reconfirmed
22212 * in regard to the new block.
22214 * See individual method documentation for further details.
22216 * [`transactions_confirmed`]: Self::transactions_confirmed
22217 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
22218 * [`best_block_updated`]: Self::best_block_updated
22219 * [`get_relevant_txids`]: Self::get_relevant_txids
22221 typedef struct LDKConfirm {
22223 * An opaque pointer which is passed to your function implementations as an argument.
22224 * This has no meaning in the LDK, and can be NULL or any other value.
22228 * Notifies LDK of transactions confirmed in a block with a given header and height.
22230 * Must be called for any transactions registered by [`Filter::register_tx`] or any
22231 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
22232 * appearing in the same block do not need to be included in the same call; instead, multiple
22233 * calls with additional transactions may be made so long as they are made in [chain order].
22235 * May be called before or after [`best_block_updated`] for the corresponding block. However,
22236 * in the event of a chain reorganization, it must not be called with a `header` that is no
22237 * longer in the chain as of the last call to [`best_block_updated`].
22239 * [chain order]: Confirm#order
22240 * [`best_block_updated`]: Self::best_block_updated
22242 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
22244 * Notifies LDK of a transaction that is no longer confirmed as result of a chain reorganization.
22246 * Must be called for any transaction returned by [`get_relevant_txids`] if it has been
22247 * reorganized out of the best chain or if it is no longer confirmed in the block with the
22248 * given block hash. Once called, the given transaction will not be returned
22249 * by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`].
22251 * [`get_relevant_txids`]: Self::get_relevant_txids
22252 * [`transactions_confirmed`]: Self::transactions_confirmed
22254 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
22256 * Notifies LDK of an update to the best header connected at the given height.
22258 * Must be called whenever a new chain tip becomes available. May be skipped for intermediary
22261 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
22263 * Returns transactions that must be monitored for reorganization out of the chain along
22264 * with the height and the hash of the block as part of which it had been previously confirmed.
22266 * Note that the returned `Option<BlockHash>` might be `None` for channels created with LDK
22267 * 0.0.112 and prior, in which case you need to manually track previous confirmations.
22269 * Will include any transactions passed to [`transactions_confirmed`] that have insufficient
22270 * confirmations to be safe from a chain reorganization. Will not include any transactions
22271 * passed to [`transaction_unconfirmed`], unless later reconfirmed.
22273 * Must be called to determine the subset of transactions that must be monitored for
22274 * reorganization. Will be idempotent between calls but may change as a result of calls to the
22275 * other interface methods. Thus, this is useful to determine which transactions must be
22276 * given to [`transaction_unconfirmed`].
22278 * If any of the returned transactions are confirmed in a block other than the one with the
22279 * given hash at the given height, they need to be unconfirmed and reconfirmed via
22280 * [`transaction_unconfirmed`] and [`transactions_confirmed`], respectively.
22282 * [`transactions_confirmed`]: Self::transactions_confirmed
22283 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
22285 struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ (*get_relevant_txids)(const void *this_arg);
22287 * Frees any resources associated with this object given its this_arg pointer.
22288 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22290 void (*free)(void *this_arg);
22294 * A `enum` signalling to the [`OutputSweeper`] that it should delay spending an output until a
22295 * future block height is reached.
22297 typedef enum LDKSpendingDelay_Tag {
22299 * A relative delay indicating we shouldn't spend the output before `cur_height + num_blocks`
22302 LDKSpendingDelay_Relative,
22304 * An absolute delay indicating we shouldn't spend the output before `height` is reached.
22306 LDKSpendingDelay_Absolute,
22308 * Must be last for serialization purposes
22310 LDKSpendingDelay_Sentinel,
22311 } LDKSpendingDelay_Tag;
22313 typedef struct LDKSpendingDelay_LDKRelative_Body {
22315 * The number of blocks until we'll generate and broadcast the spending transaction.
22317 uint32_t num_blocks;
22318 } LDKSpendingDelay_LDKRelative_Body;
22320 typedef struct LDKSpendingDelay_LDKAbsolute_Body {
22322 * The height at which we'll generate and broadcast the spending transaction.
22325 } LDKSpendingDelay_LDKAbsolute_Body;
22327 typedef struct MUST_USE_STRUCT LDKSpendingDelay {
22328 LDKSpendingDelay_Tag tag;
22330 LDKSpendingDelay_LDKRelative_Body relative;
22331 LDKSpendingDelay_LDKAbsolute_Body absolute;
22333 } LDKSpendingDelay;
22336 * A callback which is called when a [`Future`] completes.
22338 * Note that this MUST NOT call back into LDK directly, it must instead schedule actions to be
22339 * taken later. Rust users should use the [`std::future::Future`] implementation for [`Future`]
22342 * Note that the [`std::future::Future`] implementation may only work for runtimes which schedule
22343 * futures when they receive a wake, rather than immediately executing them.
22345 typedef struct LDKFutureCallback {
22347 * An opaque pointer which is passed to your function implementations as an argument.
22348 * This has no meaning in the LDK, and can be NULL or any other value.
22352 * The method which is called.
22354 void (*call)(const void *this_arg);
22356 * Frees any resources associated with this object given its this_arg pointer.
22357 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22359 void (*free)(void *this_arg);
22360 } LDKFutureCallback;
22365 * A struct which can be used to select across many [`Future`]s at once without relying on a full
22368 typedef struct MUST_USE_STRUCT LDKSleeper {
22370 * A pointer to the opaque Rust object.
22371 * Nearly everywhere, inner must be non-null, however in places where
22372 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22374 LDKnativeSleeper *inner;
22376 * Indicates that this is the only struct which contains the same pointer.
22377 * Rust functions which take ownership of an object provided via an argument require
22378 * this to be true and invalidate the object pointed to by inner.
22386 * Configuration we set when applicable.
22388 * Default::default() provides sane defaults.
22390 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
22392 * A pointer to the opaque Rust object.
22393 * Nearly everywhere, inner must be non-null, however in places where
22394 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22396 LDKnativeChannelHandshakeConfig *inner;
22398 * Indicates that this is the only struct which contains the same pointer.
22399 * Rust functions which take ownership of an object provided via an argument require
22400 * this to be true and invalidate the object pointed to by inner.
22403 } LDKChannelHandshakeConfig;
22408 * Optional channel limits which are applied during channel creation.
22410 * These limits are only applied to our counterparty's limits, not our own.
22412 * Use 0/`<type>::max_value()` as appropriate to skip checking.
22414 * Provides sane defaults for most configurations.
22416 * Most additional limits are disabled except those with which specify a default in individual
22417 * field documentation. Note that this may result in barely-usable channels, but since they
22418 * are applied mostly only to incoming channels that's not much of a problem.
22420 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
22422 * A pointer to the opaque Rust object.
22423 * Nearly everywhere, inner must be non-null, however in places where
22424 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22426 LDKnativeChannelHandshakeLimits *inner;
22428 * Indicates that this is the only struct which contains the same pointer.
22429 * Rust functions which take ownership of an object provided via an argument require
22430 * this to be true and invalidate the object pointed to by inner.
22433 } LDKChannelHandshakeLimits;
22438 * A parallel struct to [`ChannelConfig`] to define partial updates.
22440 typedef struct MUST_USE_STRUCT LDKChannelConfigUpdate {
22442 * A pointer to the opaque Rust object.
22443 * Nearly everywhere, inner must be non-null, however in places where
22444 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22446 LDKnativeChannelConfigUpdate *inner;
22448 * Indicates that this is the only struct which contains the same pointer.
22449 * Rust functions which take ownership of an object provided via an argument require
22450 * this to be true and invalidate the object pointed to by inner.
22453 } LDKChannelConfigUpdate;
22458 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
22460 * Default::default() provides sane defaults for most configurations
22461 * (but currently with 0 relay fees!)
22463 typedef struct MUST_USE_STRUCT LDKUserConfig {
22465 * A pointer to the opaque Rust object.
22466 * Nearly everywhere, inner must be non-null, however in places where
22467 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22469 LDKnativeUserConfig *inner;
22471 * Indicates that this is the only struct which contains the same pointer.
22472 * Rust functions which take ownership of an object provided via an argument require
22473 * this to be true and invalidate the object pointed to by inner.
22481 * An implementation of [`chain::Watch`] for monitoring channels.
22483 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
22484 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
22485 * or used independently to monitor channels remotely. See the [module-level documentation] for
22488 * Note that `ChainMonitor` should regularly trigger rebroadcasts/fee bumps of pending claims from
22489 * a force-closed channel. This is crucial in preventing certain classes of pinning attacks,
22490 * detecting substantial mempool feerate changes between blocks, and ensuring reliability if
22491 * broadcasting fails. We recommend invoking this every 30 seconds, or lower if running in an
22492 * environment with spotty connections, like on mobile.
22494 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
22495 * [module-level documentation]: crate::chain::chainmonitor
22496 * [`rebroadcast_pending_claims`]: Self::rebroadcast_pending_claims
22498 typedef struct MUST_USE_STRUCT LDKChainMonitor {
22500 * A pointer to the opaque Rust object.
22501 * Nearly everywhere, inner must be non-null, however in places where
22502 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22504 LDKnativeChainMonitor *inner;
22506 * Indicates that this is the only struct which contains the same pointer.
22507 * Rust functions which take ownership of an object provided via an argument require
22508 * this to be true and invalidate the object pointed to by inner.
22514 * A trait implemented for objects handling events from [`EventsProvider`].
22516 * An async variation also exists for implementations of [`EventsProvider`] that support async
22517 * event handling. The async event handler should satisfy the generic bounds: `F:
22518 * core::future::Future, H: Fn(Event) -> F`.
22520 typedef struct LDKEventHandler {
22522 * An opaque pointer which is passed to your function implementations as an argument.
22523 * This has no meaning in the LDK, and can be NULL or any other value.
22527 * Handles the given [`Event`].
22529 * See [`EventsProvider`] for details that must be considered when implementing this method.
22531 void (*handle_event)(const void *this_arg, struct LDKEvent event);
22533 * Frees any resources associated with this object given its this_arg pointer.
22534 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22536 void (*free)(void *this_arg);
22540 * A trait indicating an object may generate events.
22542 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
22544 * Implementations of this trait may also feature an async version of event handling, as shown with
22545 * [`ChannelManager::process_pending_events_async`] and
22546 * [`ChainMonitor::process_pending_events_async`].
22550 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
22551 * event since the last invocation.
22553 * In order to ensure no [`Event`]s are lost, implementors of this trait will persist [`Event`]s
22554 * and replay any unhandled events on startup. An [`Event`] is considered handled when
22555 * [`process_pending_events`] returns, thus handlers MUST fully handle [`Event`]s and persist any
22556 * relevant changes to disk *before* returning.
22558 * Further, because an application may crash between an [`Event`] being handled and the
22559 * implementor of this trait being re-serialized, [`Event`] handling must be idempotent - in
22560 * effect, [`Event`]s may be replayed.
22562 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
22563 * consult the provider's documentation on the implication of processing events and how a handler
22564 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
22565 * [`ChainMonitor::process_pending_events`]).
22567 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
22570 * [`process_pending_events`]: Self::process_pending_events
22571 * [`handle_event`]: EventHandler::handle_event
22572 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
22573 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
22574 * [`ChannelManager::process_pending_events_async`]: crate::ln::channelmanager::ChannelManager::process_pending_events_async
22575 * [`ChainMonitor::process_pending_events_async`]: crate::chain::chainmonitor::ChainMonitor::process_pending_events_async
22577 typedef struct LDKEventsProvider {
22579 * An opaque pointer which is passed to your function implementations as an argument.
22580 * This has no meaning in the LDK, and can be NULL or any other value.
22584 * Processes any events generated since the last call using the given event handler.
22586 * See the trait-level documentation for requirements.
22588 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
22590 * Frees any resources associated with this object given its this_arg pointer.
22591 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22593 void (*free)(void *this_arg);
22594 } LDKEventsProvider;
22597 * This enum is used to specify which error data to send to peers when failing back an HTLC
22598 * using [`ChannelManager::fail_htlc_backwards_with_reason`].
22600 * For more info on failure codes, see <https://github.com/lightning/bolts/blob/master/04-onion-routing.md#failure-messages>.
22602 typedef enum LDKFailureCode_Tag {
22604 * We had a temporary error processing the payment. Useful if no other error codes fit
22605 * and you want to indicate that the payer may want to retry.
22607 LDKFailureCode_TemporaryNodeFailure,
22609 * We have a required feature which was not in this onion. For example, you may require
22610 * some additional metadata that was not provided with this payment.
22612 LDKFailureCode_RequiredNodeFeatureMissing,
22614 * You may wish to use this when a `payment_preimage` is unknown, or the CLTV expiry of
22615 * the HTLC is too close to the current block height for safe handling.
22616 * Using this failure code in [`ChannelManager::fail_htlc_backwards_with_reason`] is
22617 * equivalent to calling [`ChannelManager::fail_htlc_backwards`].
22619 LDKFailureCode_IncorrectOrUnknownPaymentDetails,
22621 * We failed to process the payload after the onion was decrypted. You may wish to
22622 * use this when receiving custom HTLC TLVs with even type numbers that you don't recognize.
22624 * If available, the tuple data may include the type number and byte offset in the
22625 * decrypted byte stream where the failure occurred.
22627 LDKFailureCode_InvalidOnionPayload,
22629 * Must be last for serialization purposes
22631 LDKFailureCode_Sentinel,
22632 } LDKFailureCode_Tag;
22634 typedef struct MUST_USE_STRUCT LDKFailureCode {
22635 LDKFailureCode_Tag tag;
22638 struct LDKCOption_C2Tuple_u64u16ZZ invalid_onion_payload;
22646 * Chain-related parameters used to construct a new `ChannelManager`.
22648 * Typically, the block-specific parameters are derived from the best block hash for the network,
22649 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
22650 * are not needed when deserializing a previously constructed `ChannelManager`.
22652 typedef struct MUST_USE_STRUCT LDKChainParameters {
22654 * A pointer to the opaque Rust object.
22655 * Nearly everywhere, inner must be non-null, however in places where
22656 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22658 LDKnativeChainParameters *inner;
22660 * Indicates that this is the only struct which contains the same pointer.
22661 * Rust functions which take ownership of an object provided via an argument require
22662 * this to be true and invalidate the object pointed to by inner.
22665 } LDKChainParameters;
22668 * A trait indicating an object may generate message send events
22670 typedef struct LDKMessageSendEventsProvider {
22672 * An opaque pointer which is passed to your function implementations as an argument.
22673 * This has no meaning in the LDK, and can be NULL or any other value.
22677 * Gets the list of pending events which were generated by previous actions, clearing the list
22680 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
22682 * Frees any resources associated with this object given its this_arg pointer.
22683 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22685 void (*free)(void *this_arg);
22686 } LDKMessageSendEventsProvider;
22689 * A trait to describe an object which can receive channel messages.
22691 * Messages MAY be called in parallel when they originate from different `their_node_ids`, however
22692 * they MUST NOT be called in parallel when the two calls have the same `their_node_id`.
22694 typedef struct LDKChannelMessageHandler {
22696 * An opaque pointer which is passed to your function implementations as an argument.
22697 * This has no meaning in the LDK, and can be NULL or any other value.
22701 * Handle an incoming `open_channel` message from the given peer.
22703 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannel *NONNULL_PTR msg);
22705 * Handle an incoming `open_channel2` message from the given peer.
22707 void (*handle_open_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannelV2 *NONNULL_PTR msg);
22709 * Handle an incoming `accept_channel` message from the given peer.
22711 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannel *NONNULL_PTR msg);
22713 * Handle an incoming `accept_channel2` message from the given peer.
22715 void (*handle_accept_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannelV2 *NONNULL_PTR msg);
22717 * Handle an incoming `funding_created` message from the given peer.
22719 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
22721 * Handle an incoming `funding_signed` message from the given peer.
22723 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
22725 * Handle an incoming `channel_ready` message from the given peer.
22727 void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
22729 * Handle an incoming `shutdown` message from the given peer.
22731 void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg);
22733 * Handle an incoming `closing_signed` message from the given peer.
22735 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
22737 * Handle an incoming `stfu` message from the given peer.
22739 void (*handle_stfu)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKStfu *NONNULL_PTR msg);
22741 * Handle an incoming `tx_add_input message` from the given peer.
22743 void (*handle_tx_add_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddInput *NONNULL_PTR msg);
22745 * Handle an incoming `tx_add_output` message from the given peer.
22747 void (*handle_tx_add_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddOutput *NONNULL_PTR msg);
22749 * Handle an incoming `tx_remove_input` message from the given peer.
22751 void (*handle_tx_remove_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveInput *NONNULL_PTR msg);
22753 * Handle an incoming `tx_remove_output` message from the given peer.
22755 void (*handle_tx_remove_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveOutput *NONNULL_PTR msg);
22757 * Handle an incoming `tx_complete message` from the given peer.
22759 void (*handle_tx_complete)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxComplete *NONNULL_PTR msg);
22761 * Handle an incoming `tx_signatures` message from the given peer.
22763 void (*handle_tx_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxSignatures *NONNULL_PTR msg);
22765 * Handle an incoming `tx_init_rbf` message from the given peer.
22767 void (*handle_tx_init_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxInitRbf *NONNULL_PTR msg);
22769 * Handle an incoming `tx_ack_rbf` message from the given peer.
22771 void (*handle_tx_ack_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAckRbf *NONNULL_PTR msg);
22773 * Handle an incoming `tx_abort message` from the given peer.
22775 void (*handle_tx_abort)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAbort *NONNULL_PTR msg);
22777 * Handle an incoming `update_add_htlc` message from the given peer.
22779 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
22781 * Handle an incoming `update_fulfill_htlc` message from the given peer.
22783 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
22785 * Handle an incoming `update_fail_htlc` message from the given peer.
22787 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
22789 * Handle an incoming `update_fail_malformed_htlc` message from the given peer.
22791 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
22793 * Handle an incoming `commitment_signed` message from the given peer.
22795 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
22797 * Handle an incoming `revoke_and_ack` message from the given peer.
22799 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
22801 * Handle an incoming `update_fee` message from the given peer.
22803 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
22805 * Handle an incoming `announcement_signatures` message from the given peer.
22807 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
22809 * Indicates a connection to the peer failed/an existing connection was lost.
22811 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
22813 * Handle a peer reconnecting, possibly generating `channel_reestablish` message(s).
22815 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
22816 * with us. Implementors should be somewhat conservative about doing so, however, as other
22817 * message handlers may still wish to communicate with this peer.
22819 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg, bool inbound);
22821 * Handle an incoming `channel_reestablish` message from the given peer.
22823 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
22825 * Handle an incoming `channel_update` message from the given peer.
22827 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
22829 * Handle an incoming `error` message from the given peer.
22831 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
22833 * Gets the node feature flags which this handler itself supports. All available handlers are
22834 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
22835 * which are broadcasted in our [`NodeAnnouncement`] message.
22837 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
22839 * Gets the init feature flags which should be sent to the given peer. All available handlers
22840 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
22841 * which are sent in our [`Init`] message.
22843 * Note that this method is called before [`Self::peer_connected`].
22845 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
22847 * Gets the chain hashes for this `ChannelMessageHandler` indicating which chains it supports.
22849 * If it's `None`, then no particular network chain hash compatibility will be enforced when
22850 * connecting to peers.
22852 struct LDKCOption_CVec_ThirtyTwoBytesZZ (*get_chain_hashes)(const void *this_arg);
22854 * Implementation of MessageSendEventsProvider for this object.
22856 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
22858 * Frees any resources associated with this object given its this_arg pointer.
22859 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22861 void (*free)(void *this_arg);
22862 } LDKChannelMessageHandler;
22865 * A handler for an [`OnionMessage`] containing a BOLT 12 Offers message as its payload.
22867 * [`OnionMessage`]: crate::ln::msgs::OnionMessage
22869 typedef struct LDKOffersMessageHandler {
22871 * An opaque pointer which is passed to your function implementations as an argument.
22872 * This has no meaning in the LDK, and can be NULL or any other value.
22876 * Handles the given message by either responding with an [`Bolt12Invoice`], sending a payment,
22877 * or replying with an error.
22879 * The returned [`OffersMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
22881 * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
22883 struct LDKCOption_OffersMessageZ (*handle_message)(const void *this_arg, struct LDKOffersMessage message);
22885 * Releases any [`OffersMessage`]s that need to be sent.
22887 * Typically, this is used for messages initiating a payment flow rather than in response to
22888 * another message. The latter should use the return value of [`Self::handle_message`].
22890 struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ (*release_pending_messages)(const void *this_arg);
22892 * Frees any resources associated with this object given its this_arg pointer.
22893 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22895 void (*free)(void *this_arg);
22896 } LDKOffersMessageHandler;
22899 * An interface for looking up the node id of a channel counterparty for the purpose of forwarding
22900 * an [`OnionMessage`].
22902 * [`OnionMessage`]: crate::ln::msgs::OnionMessage
22904 typedef struct LDKNodeIdLookUp {
22906 * An opaque pointer which is passed to your function implementations as an argument.
22907 * This has no meaning in the LDK, and can be NULL or any other value.
22911 * Returns the node id of the forwarding node's channel counterparty with `short_channel_id`.
22913 * Here, the forwarding node is referring to the node of the [`OnionMessenger`] parameterized
22914 * by the [`NodeIdLookUp`] and the counterparty to one of that node's peers.
22916 * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
22918 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22920 struct LDKPublicKey (*next_node_id)(const void *this_arg, uint64_t short_channel_id);
22922 * Frees any resources associated with this object given its this_arg pointer.
22923 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22925 void (*free)(void *this_arg);
22931 * Arguments for the creation of a ChannelManager that are not deserialized.
22933 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
22935 * 1) Deserialize all stored [`ChannelMonitor`]s.
22936 * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
22937 * `<(BlockHash, ChannelManager)>::read(reader, args)`
22938 * This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
22939 * [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
22940 * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
22941 * same way you would handle a [`chain::Filter`] call using
22942 * [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
22943 * 4) Reconnect blocks on your [`ChannelMonitor`]s.
22944 * 5) Disconnect/connect blocks on the [`ChannelManager`].
22945 * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
22946 * Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
22947 * will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
22949 * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
22950 * [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
22952 * Note that the ordering of #4-7 is not of importance, however all four must occur before you
22953 * call any other methods on the newly-deserialized [`ChannelManager`].
22955 * Note that because some channels may be closed during deserialization, it is critical that you
22956 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
22957 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
22958 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
22959 * not force-close the same channels but consider them live), you may end up revoking a state for
22960 * which you've already broadcasted the transaction.
22962 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
22964 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
22966 * A pointer to the opaque Rust object.
22967 * Nearly everywhere, inner must be non-null, however in places where
22968 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22970 LDKnativeChannelManagerReadArgs *inner;
22972 * Indicates that this is the only struct which contains the same pointer.
22973 * Rust functions which take ownership of an object provided via an argument require
22974 * this to be true and invalidate the object pointed to by inner.
22977 } LDKChannelManagerReadArgs;
22982 * A set of keys that were HKDF-expanded from an initial call to
22983 * [`NodeSigner::get_inbound_payment_key_material`].
22985 * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
22987 typedef struct MUST_USE_STRUCT LDKExpandedKey {
22989 * A pointer to the opaque Rust object.
22990 * Nearly everywhere, inner must be non-null, however in places where
22991 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22993 LDKnativeExpandedKey *inner;
22995 * Indicates that this is the only struct which contains the same pointer.
22996 * Rust functions which take ownership of an object provided via an argument require
22997 * this to be true and invalidate the object pointed to by inner.
23005 * Contains fields that are both common to [`open_channel`] and `open_channel2` messages.
23007 * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message
23009 typedef struct MUST_USE_STRUCT LDKCommonOpenChannelFields {
23011 * A pointer to the opaque Rust object.
23012 * Nearly everywhere, inner must be non-null, however in places where
23013 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23015 LDKnativeCommonOpenChannelFields *inner;
23017 * Indicates that this is the only struct which contains the same pointer.
23018 * Rust functions which take ownership of an object provided via an argument require
23019 * this to be true and invalidate the object pointed to by inner.
23022 } LDKCommonOpenChannelFields;
23027 * Contains fields that are both common to [`accept_channel`] and `accept_channel2` messages.
23029 * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message
23031 typedef struct MUST_USE_STRUCT LDKCommonAcceptChannelFields {
23033 * A pointer to the opaque Rust object.
23034 * Nearly everywhere, inner must be non-null, however in places where
23035 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23037 LDKnativeCommonAcceptChannelFields *inner;
23039 * Indicates that this is the only struct which contains the same pointer.
23040 * Rust functions which take ownership of an object provided via an argument require
23041 * this to be true and invalidate the object pointed to by inner.
23044 } LDKCommonAcceptChannelFields;
23049 * Packet of hop data for next peer
23051 typedef struct MUST_USE_STRUCT LDKPacket {
23053 * A pointer to the opaque Rust object.
23054 * Nearly everywhere, inner must be non-null, however in places where
23055 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23057 LDKnativePacket *inner;
23059 * Indicates that this is the only struct which contains the same pointer.
23060 * Rust functions which take ownership of an object provided via an argument require
23061 * this to be true and invalidate the object pointed to by inner.
23067 * A trait to describe an object which can receive routing messages.
23069 * # Implementor DoS Warnings
23071 * For messages enabled with the `gossip_queries` feature there are potential DoS vectors when
23072 * handling inbound queries. Implementors using an on-disk network graph should be aware of
23073 * repeated disk I/O for queries accessing different parts of the network graph.
23075 typedef struct LDKRoutingMessageHandler {
23077 * An opaque pointer which is passed to your function implementations as an argument.
23078 * This has no meaning in the LDK, and can be NULL or any other value.
23082 * Handle an incoming `node_announcement` message, returning `true` if it should be forwarded on,
23083 * `false` or returning an `Err` otherwise.
23085 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
23087 * Handle a `channel_announcement` message, returning `true` if it should be forwarded on, `false`
23088 * or returning an `Err` otherwise.
23090 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
23092 * Handle an incoming `channel_update` message, returning true if it should be forwarded on,
23093 * `false` or returning an `Err` otherwise.
23095 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
23097 * Gets channel announcements and updates required to dump our routing table to a remote node,
23098 * starting at the `short_channel_id` indicated by `starting_point` and including announcements
23099 * for a single channel.
23101 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcement)(const void *this_arg, uint64_t starting_point);
23103 * Gets a node announcement required to dump our routing table to a remote node, starting at
23104 * the node *after* the provided pubkey and including up to one announcement immediately
23105 * higher (as defined by `<PublicKey as Ord>::cmp`) than `starting_point`.
23106 * If `None` is provided for `starting_point`, we start at the first node.
23108 * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
23109 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23111 struct LDKNodeAnnouncement (*get_next_node_announcement)(const void *this_arg, struct LDKNodeId starting_point);
23113 * Called when a connection is established with a peer. This can be used to
23114 * perform routing table synchronization using a strategy defined by the
23117 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
23118 * with us. Implementors should be somewhat conservative about doing so, however, as other
23119 * message handlers may still wish to communicate with this peer.
23121 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
23123 * Handles the reply of a query we initiated to learn about channels
23124 * for a given range of blocks. We can expect to receive one or more
23125 * replies to a single query.
23127 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
23129 * Handles the reply of a query we initiated asking for routing gossip
23130 * messages for a list of channels. We should receive this message when
23131 * a node has completed its best effort to send us the pertaining routing
23134 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
23136 * Handles when a peer asks us to send a list of `short_channel_id`s
23137 * for the requested range of blocks.
23139 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
23141 * Handles when a peer asks us to send routing gossip messages for a
23142 * list of `short_channel_id`s.
23144 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
23146 * Indicates that there are a large number of [`ChannelAnnouncement`] (or other) messages
23147 * pending some async action. While there is no guarantee of the rate of future messages, the
23148 * caller should seek to reduce the rate of new gossip messages handled, especially
23149 * [`ChannelAnnouncement`]s.
23151 bool (*processing_queue_high)(const void *this_arg);
23153 * Gets the node feature flags which this handler itself supports. All available handlers are
23154 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
23155 * which are broadcasted in our [`NodeAnnouncement`] message.
23157 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
23159 * Gets the init feature flags which should be sent to the given peer. All available handlers
23160 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
23161 * which are sent in our [`Init`] message.
23163 * Note that this method is called before [`Self::peer_connected`].
23165 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
23167 * Implementation of MessageSendEventsProvider for this object.
23169 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
23171 * Frees any resources associated with this object given its this_arg pointer.
23172 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23174 void (*free)(void *this_arg);
23175 } LDKRoutingMessageHandler;
23178 * A handler for received [`OnionMessage`]s and for providing generated ones to send.
23180 typedef struct LDKOnionMessageHandler {
23182 * An opaque pointer which is passed to your function implementations as an argument.
23183 * This has no meaning in the LDK, and can be NULL or any other value.
23187 * Because much of the lightning network does not yet support forwarding onion messages, we
23188 * may need to directly connect to a node which will forward a message for us. In such a case,
23189 * this method will return the set of nodes which need connection by node_id and the
23190 * corresponding socket addresses where they may accept incoming connections.
23192 * Thus, this method should be polled regularly to detect messages await such a direct
23195 struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ (*get_and_clear_connections_needed)(const void *this_arg);
23197 * Handle an incoming `onion_message` message from the given peer.
23199 void (*handle_onion_message)(const void *this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg);
23201 * Returns the next pending onion message for the peer with the given node id.
23203 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23205 struct LDKOnionMessage (*next_onion_message_for_peer)(const void *this_arg, struct LDKPublicKey peer_node_id);
23207 * Called when a connection is established with a peer. Can be used to track which peers
23208 * advertise onion message support and are online.
23210 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
23211 * with us. Implementors should be somewhat conservative about doing so, however, as other
23212 * message handlers may still wish to communicate with this peer.
23214 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
23216 * Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
23217 * drop and refuse to forward onion messages to this peer.
23219 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
23221 * Performs actions that should happen roughly every ten seconds after startup. Allows handlers
23222 * to drop any buffered onion messages intended for prospective peers.
23224 void (*timer_tick_occurred)(const void *this_arg);
23226 * Gets the node feature flags which this handler itself supports. All available handlers are
23227 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
23228 * which are broadcasted in our [`NodeAnnouncement`] message.
23230 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
23232 * Gets the init feature flags which should be sent to the given peer. All available handlers
23233 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
23234 * which are sent in our [`Init`] message.
23236 * Note that this method is called before [`Self::peer_connected`].
23238 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
23240 * Frees any resources associated with this object given its this_arg pointer.
23241 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23243 void (*free)(void *this_arg);
23244 } LDKOnionMessageHandler;
23249 * BOLT 4 onion packet including hop data for the next peer.
23251 typedef struct MUST_USE_STRUCT LDKTrampolineOnionPacket {
23253 * A pointer to the opaque Rust object.
23254 * Nearly everywhere, inner must be non-null, however in places where
23255 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23257 LDKnativeTrampolineOnionPacket *inner;
23259 * Indicates that this is the only struct which contains the same pointer.
23260 * Rust functions which take ownership of an object provided via an argument require
23261 * this to be true and invalidate the object pointed to by inner.
23264 } LDKTrampolineOnionPacket;
23267 * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
23270 typedef struct LDKCustomMessageReader {
23272 * An opaque pointer which is passed to your function implementations as an argument.
23273 * This has no meaning in the LDK, and can be NULL or any other value.
23277 * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
23278 * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
23279 * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
23280 * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
23282 struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
23284 * Frees any resources associated with this object given its this_arg pointer.
23285 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23287 void (*free)(void *this_arg);
23288 } LDKCustomMessageReader;
23291 * A handler provided to [`PeerManager`] for reading and handling custom messages.
23293 * [BOLT 1] specifies a custom message type range for use with experimental or application-specific
23294 * messages. `CustomMessageHandler` allows for user-defined handling of such types. See the
23295 * [`lightning_custom_message`] crate for tools useful in composing more than one custom handler.
23297 * [BOLT 1]: https://github.com/lightning/bolts/blob/master/01-messaging.md
23298 * [`lightning_custom_message`]: https://docs.rs/lightning_custom_message/latest/lightning_custom_message
23300 typedef struct LDKCustomMessageHandler {
23302 * An opaque pointer which is passed to your function implementations as an argument.
23303 * This has no meaning in the LDK, and can be NULL or any other value.
23307 * Handles the given message sent from `sender_node_id`, possibly producing messages for
23308 * [`CustomMessageHandler::get_and_clear_pending_msg`] to return and thus for [`PeerManager`]
23311 struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
23313 * Returns the list of pending messages that were generated by the handler, clearing the list
23314 * in the process. Each message is paired with the node id of the intended recipient. If no
23315 * connection to the node exists, then the message is simply not sent.
23317 struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
23319 * Gets the node feature flags which this handler itself supports. All available handlers are
23320 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
23321 * which are broadcasted in our [`NodeAnnouncement`] message.
23323 * [`NodeAnnouncement`]: crate::ln::msgs::NodeAnnouncement
23325 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
23327 * Gets the init feature flags which should be sent to the given peer. All available handlers
23328 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
23329 * which are sent in our [`Init`] message.
23331 * [`Init`]: crate::ln::msgs::Init
23333 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
23335 * Implementation of CustomMessageReader for this object.
23337 struct LDKCustomMessageReader CustomMessageReader;
23339 * Frees any resources associated with this object given its this_arg pointer.
23340 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23342 void (*free)(void *this_arg);
23343 } LDKCustomMessageHandler;
23348 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
23349 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
23351 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
23353 * A pointer to the opaque Rust object.
23354 * Nearly everywhere, inner must be non-null, however in places where
23355 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23357 LDKnativeIgnoringMessageHandler *inner;
23359 * Indicates that this is the only struct which contains the same pointer.
23360 * Rust functions which take ownership of an object provided via an argument require
23361 * this to be true and invalidate the object pointed to by inner.
23364 } LDKIgnoringMessageHandler;
23367 * Handler for custom onion messages. If you are using [`SimpleArcOnionMessenger`],
23368 * [`SimpleRefOnionMessenger`], or prefer to ignore inbound custom onion messages,
23369 * [`IgnoringMessageHandler`] must be provided to [`OnionMessenger::new`]. Otherwise, a custom
23370 * implementation of this trait must be provided, with [`CustomMessage`] specifying the supported
23373 * See [`OnionMessenger`] for example usage.
23375 * [`IgnoringMessageHandler`]: crate::ln::peer_handler::IgnoringMessageHandler
23376 * [`CustomMessage`]: Self::CustomMessage
23378 typedef struct LDKCustomOnionMessageHandler {
23380 * An opaque pointer which is passed to your function implementations as an argument.
23381 * This has no meaning in the LDK, and can be NULL or any other value.
23385 * Called with the custom message that was received, returning a response to send, if any.
23387 * The returned [`Self::CustomMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
23389 struct LDKCOption_OnionMessageContentsZ (*handle_custom_message)(const void *this_arg, struct LDKOnionMessageContents msg);
23391 * Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
23392 * message type is unknown.
23394 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ (*read_custom_message)(const void *this_arg, uint64_t message_type, struct LDKu8slice buffer);
23396 * Releases any [`Self::CustomMessage`]s that need to be sent.
23398 * Typically, this is used for messages initiating a message flow rather than in response to
23399 * another message. The latter should use the return value of [`Self::handle_custom_message`].
23401 struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ (*release_pending_custom_messages)(const void *this_arg);
23403 * Frees any resources associated with this object given its this_arg pointer.
23404 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23406 void (*free)(void *this_arg);
23407 } LDKCustomOnionMessageHandler;
23412 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
23413 * You can provide one of these as the route_handler in a MessageHandler.
23415 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
23417 * A pointer to the opaque Rust object.
23418 * Nearly everywhere, inner must be non-null, however in places where
23419 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23421 LDKnativeErroringMessageHandler *inner;
23423 * Indicates that this is the only struct which contains the same pointer.
23424 * Rust functions which take ownership of an object provided via an argument require
23425 * this to be true and invalidate the object pointed to by inner.
23428 } LDKErroringMessageHandler;
23433 * Provides references to trait impls which handle different types of messages.
23435 typedef struct MUST_USE_STRUCT LDKMessageHandler {
23437 * A pointer to the opaque Rust object.
23438 * Nearly everywhere, inner must be non-null, however in places where
23439 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23441 LDKnativeMessageHandler *inner;
23443 * Indicates that this is the only struct which contains the same pointer.
23444 * Rust functions which take ownership of an object provided via an argument require
23445 * this to be true and invalidate the object pointed to by inner.
23448 } LDKMessageHandler;
23451 * Provides an object which can be used to send data to and which uniquely identifies a connection
23452 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
23453 * implement Hash to meet the PeerManager API.
23455 * For efficiency, [`Clone`] should be relatively cheap for this type.
23457 * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
23458 * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
23459 * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
23460 * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
23461 * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
23462 * to simply use another value which is guaranteed to be globally unique instead.
23464 typedef struct LDKSocketDescriptor {
23466 * An opaque pointer which is passed to your function implementations as an argument.
23467 * This has no meaning in the LDK, and can be NULL or any other value.
23471 * Attempts to send some data from the given slice to the peer.
23473 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
23474 * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
23475 * called and further write attempts may occur until that time.
23477 * If the returned size is smaller than `data.len()`, a
23478 * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
23479 * written. Additionally, until a `send_data` event completes fully, no further
23480 * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
23481 * prevent denial-of-service issues, you should not read or buffer any data from the socket
23484 * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
23485 * (indicating that read events should be paused to prevent DoS in the send buffer),
23486 * `resume_read` may be set indicating that read events on this descriptor should resume. A
23487 * `resume_read` of false carries no meaning, and should not cause any action.
23489 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
23491 * Disconnect the socket pointed to by this SocketDescriptor.
23493 * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
23494 * call (doing so is a noop).
23496 void (*disconnect_socket)(void *this_arg);
23498 * Checks if two objects are equal given this object's this_arg pointer and another object.
23500 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
23502 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
23503 * This is used, for example, for inclusion of this object in a hash map.
23505 uint64_t (*hash)(const void *this_arg);
23507 * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
23508 * The new SocketDescriptor is provided, and should be mutated as needed to perform a
23509 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
23511 void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
23513 * Frees any resources associated with this object given its this_arg pointer.
23514 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23516 void (*free)(void *this_arg);
23517 } LDKSocketDescriptor;
23522 * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
23523 * socket events into messages which it passes on to its [`MessageHandler`].
23525 * Locks are taken internally, so you must never assume that reentrancy from a
23526 * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
23528 * Calls to [`read_event`] will decode relevant messages and pass them to the
23529 * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
23530 * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
23531 * [`PeerManager`] functions related to the same connection must occur only in serial, making new
23532 * calls only after previous ones have returned.
23534 * Rather than using a plain [`PeerManager`], it is preferable to use either a [`SimpleArcPeerManager`]
23535 * a [`SimpleRefPeerManager`], for conciseness. See their documentation for more details, but
23536 * essentially you should default to using a [`SimpleRefPeerManager`], and use a
23537 * [`SimpleArcPeerManager`] when you require a `PeerManager` with a static lifetime, such as when
23538 * you're using lightning-net-tokio.
23540 * [`read_event`]: PeerManager::read_event
23542 typedef struct MUST_USE_STRUCT LDKPeerManager {
23544 * A pointer to the opaque Rust object.
23545 * Nearly everywhere, inner must be non-null, however in places where
23546 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23548 LDKnativePeerManager *inner;
23550 * Indicates that this is the only struct which contains the same pointer.
23551 * Rust functions which take ownership of an object provided via an argument require
23552 * this to be true and invalidate the object pointed to by inner.
23560 * Static channel fields used to build transactions given per-commitment fields, organized by
23561 * broadcaster/countersignatory.
23563 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
23564 * as_holder_broadcastable and as_counterparty_broadcastable functions.
23566 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
23568 * A pointer to the opaque Rust object.
23569 * Nearly everywhere, inner must be non-null, however in places where
23570 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23572 LDKnativeDirectedChannelTransactionParameters *inner;
23574 * Indicates that this is the only struct which contains the same pointer.
23575 * Rust functions which take ownership of an object provided via an argument require
23576 * this to be true and invalidate the object pointed to by inner.
23579 } LDKDirectedChannelTransactionParameters;
23584 * Features used within an `offer`.
23586 typedef struct MUST_USE_STRUCT LDKOfferFeatures {
23588 * A pointer to the opaque Rust object.
23589 * Nearly everywhere, inner must be non-null, however in places where
23590 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23592 LDKnativeOfferFeatures *inner;
23594 * Indicates that this is the only struct which contains the same pointer.
23595 * Rust functions which take ownership of an object provided via an argument require
23596 * this to be true and invalidate the object pointed to by inner.
23599 } LDKOfferFeatures;
23604 * Features used within an `invoice_request`.
23606 typedef struct MUST_USE_STRUCT LDKInvoiceRequestFeatures {
23608 * A pointer to the opaque Rust object.
23609 * Nearly everywhere, inner must be non-null, however in places where
23610 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23612 LDKnativeInvoiceRequestFeatures *inner;
23614 * Indicates that this is the only struct which contains the same pointer.
23615 * Rust functions which take ownership of an object provided via an argument require
23616 * this to be true and invalidate the object pointed to by inner.
23619 } LDKInvoiceRequestFeatures;
23624 * Builds an [`Offer`] for the \"offer to be paid\" flow.
23626 * See [module-level documentation] for usage.
23628 * [module-level documentation]: self
23630 typedef struct MUST_USE_STRUCT LDKOfferWithExplicitMetadataBuilder {
23632 * A pointer to the opaque Rust object.
23633 * Nearly everywhere, inner must be non-null, however in places where
23634 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23636 LDKnativeOfferWithExplicitMetadataBuilder *inner;
23638 * Indicates that this is the only struct which contains the same pointer.
23639 * Rust functions which take ownership of an object provided via an argument require
23640 * this to be true and invalidate the object pointed to by inner.
23643 } LDKOfferWithExplicitMetadataBuilder;
23646 * Represents a tweaked X-only public key as required for BIP 340 (Taproot).
23648 typedef struct LDKTweakedPublicKey {
23650 * The bytes of the public key X coordinate
23652 uint8_t x_coordinate[32];
23653 } LDKTweakedPublicKey;
23656 * A function for signing an [`UnsignedBolt12Invoice`].
23658 typedef struct LDKSignBolt12InvoiceFn {
23660 * An opaque pointer which is passed to your function implementations as an argument.
23661 * This has no meaning in the LDK, and can be NULL or any other value.
23665 * Signs a [`TaggedHash`] computed over the merkle root of `message`'s TLV stream.
23667 struct LDKCResult_SchnorrSignatureNoneZ (*sign_invoice)(const void *this_arg, const struct LDKUnsignedBolt12Invoice *NONNULL_PTR message);
23669 * Frees any resources associated with this object given its this_arg pointer.
23670 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23672 void (*free)(void *this_arg);
23673 } LDKSignBolt12InvoiceFn;
23678 * A hash for use in a specific context by tweaking with a context-dependent tag as per [BIP 340]
23679 * and computed over the merkle root of a TLV stream to sign as defined in [BOLT 12].
23681 * [BIP 340]: https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki
23682 * [BOLT 12]: https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md#signature-calculation
23684 typedef struct MUST_USE_STRUCT LDKTaggedHash {
23686 * A pointer to the opaque Rust object.
23687 * Nearly everywhere, inner must be non-null, however in places where
23688 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23690 LDKnativeTaggedHash *inner;
23692 * Indicates that this is the only struct which contains the same pointer.
23693 * Rust functions which take ownership of an object provided via an argument require
23694 * this to be true and invalidate the object pointed to by inner.
23702 * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
23704 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
23705 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
23707 typedef struct MUST_USE_STRUCT LDKErroneousField {
23709 * A pointer to the opaque Rust object.
23710 * Nearly everywhere, inner must be non-null, however in places where
23711 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23713 LDKnativeErroneousField *inner;
23715 * Indicates that this is the only struct which contains the same pointer.
23716 * Rust functions which take ownership of an object provided via an argument require
23717 * this to be true and invalidate the object pointed to by inner.
23720 } LDKErroneousField;
23723 * A function for signing an [`UnsignedInvoiceRequest`].
23725 typedef struct LDKSignInvoiceRequestFn {
23727 * An opaque pointer which is passed to your function implementations as an argument.
23728 * This has no meaning in the LDK, and can be NULL or any other value.
23732 * Signs a [`TaggedHash`] computed over the merkle root of `message`'s TLV stream.
23734 struct LDKCResult_SchnorrSignatureNoneZ (*sign_invoice_request)(const void *this_arg, const struct LDKUnsignedInvoiceRequest *NONNULL_PTR message);
23736 * Frees any resources associated with this object given its this_arg pointer.
23737 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23739 void (*free)(void *this_arg);
23740 } LDKSignInvoiceRequestFn;
23743 * Error when signing messages.
23745 typedef enum LDKSignError_Tag {
23747 * User-defined error when signing the message.
23749 LDKSignError_Signing,
23751 * Error when verifying the produced signature using the given pubkey.
23753 LDKSignError_Verification,
23755 * Must be last for serialization purposes
23757 LDKSignError_Sentinel,
23758 } LDKSignError_Tag;
23760 typedef struct MUST_USE_STRUCT LDKSignError {
23761 LDKSignError_Tag tag;
23764 enum LDKSecp256k1Error verification;
23772 * Receives and validates network updates from peers,
23773 * stores authentic and relevant data as a network graph.
23774 * This network graph is then used for routing payments.
23775 * Provides interface to help with initial routing sync by
23776 * serving historical announcements.
23778 typedef struct MUST_USE_STRUCT LDKP2PGossipSync {
23780 * A pointer to the opaque Rust object.
23781 * Nearly everywhere, inner must be non-null, however in places where
23782 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23784 LDKnativeP2PGossipSync *inner;
23786 * Indicates that this is the only struct which contains the same pointer.
23787 * Rust functions which take ownership of an object provided via an argument require
23788 * this to be true and invalidate the object pointed to by inner.
23791 } LDKP2PGossipSync;
23796 * A read-only view of [`NetworkGraph`].
23798 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
23800 * A pointer to the opaque Rust object.
23801 * Nearly everywhere, inner must be non-null, however in places where
23802 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23804 LDKnativeReadOnlyNetworkGraph *inner;
23806 * Indicates that this is the only struct which contains the same pointer.
23807 * Rust functions which take ownership of an object provided via an argument require
23808 * this to be true and invalidate the object pointed to by inner.
23811 } LDKReadOnlyNetworkGraph;
23816 * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
23817 * source node to a target node.
23819 typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
23821 * A pointer to the opaque Rust object.
23822 * Nearly everywhere, inner must be non-null, however in places where
23823 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23825 LDKnativeDirectedChannelInfo *inner;
23827 * Indicates that this is the only struct which contains the same pointer.
23828 * Rust functions which take ownership of an object provided via an argument require
23829 * this to be true and invalidate the object pointed to by inner.
23832 } LDKDirectedChannelInfo;
23835 * The effective capacity of a channel for routing purposes.
23837 * While this may be smaller than the actual channel capacity, amounts greater than
23838 * [`Self::as_msat`] should not be routed through the channel.
23840 typedef enum LDKEffectiveCapacity_Tag {
23842 * The available liquidity in the channel known from being a channel counterparty, and thus a
23845 LDKEffectiveCapacity_ExactLiquidity,
23847 * The maximum HTLC amount in one direction as advertised on the gossip network.
23849 LDKEffectiveCapacity_AdvertisedMaxHTLC,
23851 * The total capacity of the channel as determined by the funding transaction.
23853 LDKEffectiveCapacity_Total,
23855 * A capacity sufficient to route any payment, typically used for private channels provided by
23858 LDKEffectiveCapacity_Infinite,
23860 * The maximum HTLC amount as provided by an invoice route hint.
23862 LDKEffectiveCapacity_HintMaxHTLC,
23864 * A capacity that is unknown possibly because either the chain state is unavailable to know
23865 * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
23867 LDKEffectiveCapacity_Unknown,
23869 * Must be last for serialization purposes
23871 LDKEffectiveCapacity_Sentinel,
23872 } LDKEffectiveCapacity_Tag;
23874 typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
23876 * Either the inbound or outbound liquidity depending on the direction, denominated in
23879 uint64_t liquidity_msat;
23880 } LDKEffectiveCapacity_LDKExactLiquidity_Body;
23882 typedef struct LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body {
23884 * The maximum HTLC amount denominated in millisatoshi.
23886 uint64_t amount_msat;
23887 } LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body;
23889 typedef struct LDKEffectiveCapacity_LDKTotal_Body {
23891 * The funding amount denominated in millisatoshi.
23893 uint64_t capacity_msat;
23895 * The maximum HTLC amount denominated in millisatoshi.
23897 uint64_t htlc_maximum_msat;
23898 } LDKEffectiveCapacity_LDKTotal_Body;
23900 typedef struct LDKEffectiveCapacity_LDKHintMaxHTLC_Body {
23902 * The maximum HTLC amount denominated in millisatoshi.
23904 uint64_t amount_msat;
23905 } LDKEffectiveCapacity_LDKHintMaxHTLC_Body;
23907 typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
23908 LDKEffectiveCapacity_Tag tag;
23910 LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
23911 LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body advertised_max_htlc;
23912 LDKEffectiveCapacity_LDKTotal_Body total;
23913 LDKEffectiveCapacity_LDKHintMaxHTLC_Body hint_max_htlc;
23915 } LDKEffectiveCapacity;
23920 * A [`Router`] implemented using [`find_route`].
23922 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
23924 * A pointer to the opaque Rust object.
23925 * Nearly everywhere, inner must be non-null, however in places where
23926 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23928 LDKnativeDefaultRouter *inner;
23930 * Indicates that this is the only struct which contains the same pointer.
23931 * Rust functions which take ownership of an object provided via an argument require
23932 * this to be true and invalidate the object pointed to by inner.
23935 } LDKDefaultRouter;
23940 * [`ScoreLookUp`] implementation that factors in in-flight HTLC liquidity.
23942 * Useful for custom [`Router`] implementations to wrap their [`ScoreLookUp`] on-the-fly when calling
23945 * [`ScoreLookUp`]: crate::routing::scoring::ScoreLookUp
23947 typedef struct MUST_USE_STRUCT LDKScorerAccountingForInFlightHtlcs {
23949 * A pointer to the opaque Rust object.
23950 * Nearly everywhere, inner must be non-null, however in places where
23951 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23953 LDKnativeScorerAccountingForInFlightHtlcs *inner;
23955 * Indicates that this is the only struct which contains the same pointer.
23956 * Rust functions which take ownership of an object provided via an argument require
23957 * this to be true and invalidate the object pointed to by inner.
23960 } LDKScorerAccountingForInFlightHtlcs;
23963 * The recipient of a payment, differing based on whether they've hidden their identity with route
23966 typedef enum LDKPayee_Tag {
23968 * The recipient provided blinded paths and payinfo to reach them. The blinded paths themselves
23969 * will be included in the final [`Route`].
23973 * The recipient included these route hints in their BOLT11 invoice.
23977 * Must be last for serialization purposes
23982 typedef struct LDKPayee_LDKBlinded_Body {
23984 * Aggregated routing info and blinded paths, for routing to the payee without knowing their
23987 struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints;
23989 * Features supported by the payee.
23991 * May be set from the payee's invoice. May be `None` if the invoice does not contain any
23994 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
23996 struct LDKBolt12InvoiceFeatures features;
23997 } LDKPayee_LDKBlinded_Body;
23999 typedef struct LDKPayee_LDKClear_Body {
24001 * The node id of the payee.
24003 struct LDKPublicKey node_id;
24005 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
24007 struct LDKCVec_RouteHintZ route_hints;
24009 * Features supported by the payee.
24011 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
24012 * does not contain any features.
24014 * [`for_keysend`]: PaymentParameters::for_keysend
24016 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
24018 struct LDKBolt11InvoiceFeatures features;
24020 * The minimum CLTV delta at the end of the route. This value must not be zero.
24022 uint32_t final_cltv_expiry_delta;
24023 } LDKPayee_LDKClear_Body;
24025 typedef struct MUST_USE_STRUCT LDKPayee {
24028 LDKPayee_LDKBlinded_Body blinded;
24029 LDKPayee_LDKClear_Body clear;
24034 * A trait which can both lookup and update routing channel penalty scores.
24036 * This is used in places where both bounds are required and implemented for all types which
24037 * implement [`ScoreLookUp`] and [`ScoreUpdate`].
24039 * Bindings users may need to manually implement this for their custom scoring implementations.
24041 typedef struct LDKScore {
24043 * An opaque pointer which is passed to your function implementations as an argument.
24044 * This has no meaning in the LDK, and can be NULL or any other value.
24048 * Implementation of ScoreLookUp for this object.
24050 struct LDKScoreLookUp ScoreLookUp;
24052 * Implementation of ScoreUpdate for this object.
24054 struct LDKScoreUpdate ScoreUpdate;
24056 * Serialize the object into a byte array
24058 struct LDKCVec_u8Z (*write)(const void *this_arg);
24060 * Frees any resources associated with this object given its this_arg pointer.
24061 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
24063 void (*free)(void *this_arg);
24069 * A concrete implementation of [`LockableScore`] which supports multi-threading.
24071 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
24073 * A pointer to the opaque Rust object.
24074 * Nearly everywhere, inner must be non-null, however in places where
24075 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24077 LDKnativeMultiThreadedLockableScore *inner;
24079 * Indicates that this is the only struct which contains the same pointer.
24080 * Rust functions which take ownership of an object provided via an argument require
24081 * this to be true and invalidate the object pointed to by inner.
24084 } LDKMultiThreadedLockableScore;
24089 * A locked `MultiThreadedLockableScore`.
24091 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockRead {
24093 * A pointer to the opaque Rust object.
24094 * Nearly everywhere, inner must be non-null, however in places where
24095 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24097 LDKnativeMultiThreadedScoreLockRead *inner;
24099 * Indicates that this is the only struct which contains the same pointer.
24100 * Rust functions which take ownership of an object provided via an argument require
24101 * this to be true and invalidate the object pointed to by inner.
24104 } LDKMultiThreadedScoreLockRead;
24109 * A locked `MultiThreadedLockableScore`.
24111 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockWrite {
24113 * A pointer to the opaque Rust object.
24114 * Nearly everywhere, inner must be non-null, however in places where
24115 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24117 LDKnativeMultiThreadedScoreLockWrite *inner;
24119 * Indicates that this is the only struct which contains the same pointer.
24120 * Rust functions which take ownership of an object provided via an argument require
24121 * this to be true and invalidate the object pointed to by inner.
24124 } LDKMultiThreadedScoreLockWrite;
24129 * Parameters for configuring [`ProbabilisticScorer`].
24131 * Used to configure decay parameters that are static throughout the lifetime of the scorer.
24132 * these decay parameters affect the score of the channel penalty and are not changed on a
24133 * per-route penalty cost call.
24135 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringDecayParameters {
24137 * A pointer to the opaque Rust object.
24138 * Nearly everywhere, inner must be non-null, however in places where
24139 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24141 LDKnativeProbabilisticScoringDecayParameters *inner;
24143 * Indicates that this is the only struct which contains the same pointer.
24144 * Rust functions which take ownership of an object provided via an argument require
24145 * this to be true and invalidate the object pointed to by inner.
24148 } LDKProbabilisticScoringDecayParameters;
24153 * Simple implementation of [`EntropySource`], [`NodeSigner`], and [`SignerProvider`] that takes a
24154 * 32-byte seed for use as a BIP 32 extended key and derives keys from that.
24156 * Your `node_id` is seed/0'.
24157 * Unilateral closes may use seed/1'.
24158 * Cooperative closes may use seed/2'.
24159 * The two close keys may be needed to claim on-chain funds!
24161 * This struct cannot be used for nodes that wish to support receiving phantom payments;
24162 * [`PhantomKeysManager`] must be used instead.
24164 * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
24165 * previously issued invoices and attempts to pay previous invoices will fail.
24167 typedef struct MUST_USE_STRUCT LDKKeysManager {
24169 * A pointer to the opaque Rust object.
24170 * Nearly everywhere, inner must be non-null, however in places where
24171 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24173 LDKnativeKeysManager *inner;
24175 * Indicates that this is the only struct which contains the same pointer.
24176 * Rust functions which take ownership of an object provided via an argument require
24177 * this to be true and invalidate the object pointed to by inner.
24185 * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
24188 * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
24189 * paid to one of multiple nodes. This works because we encode the invoice route hints such that
24190 * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
24191 * itself without ever needing to forward to this fake node.
24193 * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
24194 * provide some fault tolerance, because payers will automatically retry paying other provided
24195 * nodes in the case that one node goes down.
24197 * Note that multi-path payments are not supported in phantom invoices for security reasons.
24198 * Switching between this struct and [`KeysManager`] will invalidate any previously issued
24199 * invoices and attempts to pay previous invoices will fail.
24201 typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
24203 * A pointer to the opaque Rust object.
24204 * Nearly everywhere, inner must be non-null, however in places where
24205 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24207 LDKnativePhantomKeysManager *inner;
24209 * Indicates that this is the only struct which contains the same pointer.
24210 * Rust functions which take ownership of an object provided via an argument require
24211 * this to be true and invalidate the object pointed to by inner.
24214 } LDKPhantomKeysManager;
24219 * An implementation of [`EntropySource`] using ChaCha20.
24221 typedef struct MUST_USE_STRUCT LDKRandomBytes {
24223 * A pointer to the opaque Rust object.
24224 * Nearly everywhere, inner must be non-null, however in places where
24225 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24227 LDKnativeRandomBytes *inner;
24229 * Indicates that this is the only struct which contains the same pointer.
24230 * Rust functions which take ownership of an object provided via an argument require
24231 * this to be true and invalidate the object pointed to by inner.
24239 * A sender, receiver and forwarder of [`OnionMessage`]s.
24241 * # Handling Messages
24243 * `OnionMessenger` implements [`OnionMessageHandler`], making it responsible for either forwarding
24244 * messages to peers or delegating to the appropriate handler for the message type. Currently, the
24245 * available handlers are:
24246 * * [`OffersMessageHandler`], for responding to [`InvoiceRequest`]s and paying [`Bolt12Invoice`]s
24247 * * [`CustomOnionMessageHandler`], for handling user-defined message types
24249 * # Sending Messages
24251 * [`OnionMessage`]s are sent initially using [`OnionMessenger::send_onion_message`]. When handling
24252 * a message, the matched handler may return a response message which `OnionMessenger` will send
24258 * # extern crate bitcoin;
24259 * # use bitcoin::hashes::_export::_core::time::Duration;
24260 * # use bitcoin::hashes::hex::FromHex;
24261 * # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey, self};
24262 * # use lightning::blinded_path::{BlindedPath, EmptyNodeIdLookUp};
24263 * # use lightning::sign::{EntropySource, KeysManager};
24264 * # use lightning::ln::peer_handler::IgnoringMessageHandler;
24265 * # use lightning::onion_message::messenger::{Destination, MessageRouter, OnionMessagePath, OnionMessenger};
24266 * # use lightning::onion_message::packet::OnionMessageContents;
24267 * # use lightning::util::logger::{Logger, Record};
24268 * # use lightning::util::ser::{Writeable, Writer};
24269 * # use lightning::io;
24270 * # use std::sync::Arc;
24271 * # struct FakeLogger;
24272 * # impl Logger for FakeLogger {
24273 * # fn log(&self, record: Record) { println!(\"{:?}\" , record); }
24275 * # struct FakeMessageRouter {}
24276 * # impl MessageRouter for FakeMessageRouter {
24277 * # fn find_path(&self, sender: PublicKey, peers: Vec<PublicKey>, destination: Destination) -> Result<OnionMessagePath, ()> {
24278 * # let secp_ctx = Secp256k1::new();
24279 * # let node_secret = SecretKey::from_slice(&<Vec<u8>>::from_hex(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
24280 * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
24281 * # let hop_node_id2 = hop_node_id1;
24282 * # Ok(OnionMessagePath {
24283 * # intermediate_nodes: vec![hop_node_id1, hop_node_id2],
24285 * # first_node_addresses: None,
24288 * # fn create_blinded_paths<T: secp256k1::Signing + secp256k1::Verification>(
24289 * # &self, _recipient: PublicKey, _peers: Vec<PublicKey>, _secp_ctx: &Secp256k1<T>
24290 * # ) -> Result<Vec<BlindedPath>, ()> {
24294 * # let seed = [42u8; 32];
24295 * # let time = Duration::from_secs(123456);
24296 * # let keys_manager = KeysManager::new(&seed, time.as_secs(), time.subsec_nanos());
24297 * # let logger = Arc::new(FakeLogger {});
24298 * # let node_secret = SecretKey::from_slice(&<Vec<u8>>::from_hex(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
24299 * # let secp_ctx = Secp256k1::new();
24300 * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
24301 * # let (hop_node_id3, hop_node_id4) = (hop_node_id1, hop_node_id1);
24302 * # let destination_node_id = hop_node_id1;
24303 * # let node_id_lookup = EmptyNodeIdLookUp {};
24304 * # let message_router = Arc::new(FakeMessageRouter {});
24305 * # let custom_message_handler = IgnoringMessageHandler {};
24306 * # let offers_message_handler = IgnoringMessageHandler {};
24307 * // Create the onion messenger. This must use the same `keys_manager` as is passed to your
24308 * // ChannelManager.
24309 * let onion_messenger = OnionMessenger::new(
24310 * &keys_manager, &keys_manager, logger, &node_id_lookup, message_router,
24311 * &offers_message_handler, &custom_message_handler
24314 * # #[derive(Debug, Clone)]
24315 * # struct YourCustomMessage {}
24316 * impl Writeable for YourCustomMessage {
24317 * \tfn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
24319 * \t\t// Write your custom onion message to `w`
24322 * impl OnionMessageContents for YourCustomMessage {
24323 * \tfn tlv_type(&self) -> u64 {
24324 * \t\t# let your_custom_message_type = 42;
24325 * \t\tyour_custom_message_type
24328 * // Send a custom onion message to a node id.
24329 * let destination = Destination::Node(destination_node_id);
24330 * let reply_path = None;
24331 * # let message = YourCustomMessage {};
24332 * onion_messenger.send_onion_message(message, destination, reply_path);
24334 * // Create a blinded path to yourself, for someone to send an onion message to.
24335 * # let your_node_id = hop_node_id1;
24336 * let hops = [hop_node_id3, hop_node_id4, your_node_id];
24337 * let blinded_path = BlindedPath::new_for_message(&hops, &keys_manager, &secp_ctx).unwrap();
24339 * // Send a custom onion message to a blinded path.
24340 * let destination = Destination::BlindedPath(blinded_path);
24341 * let reply_path = None;
24342 * # let message = YourCustomMessage {};
24343 * onion_messenger.send_onion_message(message, destination, reply_path);
24346 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
24347 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
24349 typedef struct MUST_USE_STRUCT LDKOnionMessenger {
24351 * A pointer to the opaque Rust object.
24352 * Nearly everywhere, inner must be non-null, however in places where
24353 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24355 LDKnativeOnionMessenger *inner;
24357 * Indicates that this is the only struct which contains the same pointer.
24358 * Rust functions which take ownership of an object provided via an argument require
24359 * this to be true and invalidate the object pointed to by inner.
24362 } LDKOnionMessenger;
24367 * A [`MessageRouter`] that can only route to a directly connected [`Destination`].
24369 typedef struct MUST_USE_STRUCT LDKDefaultMessageRouter {
24371 * A pointer to the opaque Rust object.
24372 * Nearly everywhere, inner must be non-null, however in places where
24373 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24375 LDKnativeDefaultMessageRouter *inner;
24377 * Indicates that this is the only struct which contains the same pointer.
24378 * Rust functions which take ownership of an object provided via an argument require
24379 * this to be true and invalidate the object pointed to by inner.
24382 } LDKDefaultMessageRouter;
24385 * The unblinded node in a [`BlindedPath`].
24387 typedef enum LDKIntroductionNode_Tag {
24389 * The node id of the introduction node.
24391 LDKIntroductionNode_NodeId,
24393 * The short channel id of the channel leading to the introduction node. The [`Direction`]
24394 * identifies which side of the channel is the introduction node.
24396 LDKIntroductionNode_DirectedShortChannelId,
24398 * Must be last for serialization purposes
24400 LDKIntroductionNode_Sentinel,
24401 } LDKIntroductionNode_Tag;
24403 typedef struct LDKIntroductionNode_LDKDirectedShortChannelId_Body {
24404 enum LDKDirection _0;
24406 } LDKIntroductionNode_LDKDirectedShortChannelId_Body;
24408 typedef struct MUST_USE_STRUCT LDKIntroductionNode {
24409 LDKIntroductionNode_Tag tag;
24412 struct LDKPublicKey node_id;
24414 LDKIntroductionNode_LDKDirectedShortChannelId_Body directed_short_channel_id;
24416 } LDKIntroductionNode;
24421 * A [`NodeIdLookUp`] that always returns `None`.
24423 typedef struct MUST_USE_STRUCT LDKEmptyNodeIdLookUp {
24425 * A pointer to the opaque Rust object.
24426 * Nearly everywhere, inner must be non-null, however in places where
24427 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24429 LDKnativeEmptyNodeIdLookUp *inner;
24431 * Indicates that this is the only struct which contains the same pointer.
24432 * Rust functions which take ownership of an object provided via an argument require
24433 * this to be true and invalidate the object pointed to by inner.
24436 } LDKEmptyNodeIdLookUp;
24441 * Data to construct a [`BlindedHop`] for forwarding a payment.
24443 typedef struct MUST_USE_STRUCT LDKForwardTlvs {
24445 * A pointer to the opaque Rust object.
24446 * Nearly everywhere, inner must be non-null, however in places where
24447 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24449 LDKnativeForwardTlvs *inner;
24451 * Indicates that this is the only struct which contains the same pointer.
24452 * Rust functions which take ownership of an object provided via an argument require
24453 * this to be true and invalidate the object pointed to by inner.
24459 * An abstraction over a bitcoin wallet that can perform coin selection over a set of UTXOs and can
24460 * sign for them. The coin selection method aims to mimic Bitcoin Core's `fundrawtransaction` RPC,
24461 * which most wallets should be able to satisfy. Otherwise, consider implementing [`WalletSource`],
24462 * which can provide a default implementation of this trait when used with [`Wallet`].
24464 typedef struct LDKCoinSelectionSource {
24466 * An opaque pointer which is passed to your function implementations as an argument.
24467 * This has no meaning in the LDK, and can be NULL or any other value.
24471 * Performs coin selection of a set of UTXOs, with at least 1 confirmation each, that are
24472 * available to spend. Implementations are free to pick their coin selection algorithm of
24473 * choice, as long as the following requirements are met:
24475 * 1. `must_spend` contains a set of [`Input`]s that must be included in the transaction
24476 * throughout coin selection, but must not be returned as part of the result.
24477 * 2. `must_pay_to` contains a set of [`TxOut`]s that must be included in the transaction
24478 * throughout coin selection. In some cases, like when funding an anchor transaction, this
24479 * set is empty. Implementations should ensure they handle this correctly on their end,
24480 * e.g., Bitcoin Core's `fundrawtransaction` RPC requires at least one output to be
24481 * provided, in which case a zero-value empty OP_RETURN output can be used instead.
24482 * 3. Enough inputs must be selected/contributed for the resulting transaction (including the
24483 * inputs and outputs noted above) to meet `target_feerate_sat_per_1000_weight`.
24485 * Implementations must take note that [`Input::satisfaction_weight`] only tracks the weight of
24486 * the input's `script_sig` and `witness`. Some wallets, like Bitcoin Core's, may require
24487 * providing the full input weight. Failing to do so may lead to underestimating fee bumps and
24488 * delaying block inclusion.
24490 * The `claim_id` must map to the set of external UTXOs assigned to the claim, such that they
24491 * can be re-used within new fee-bumped iterations of the original claiming transaction,
24492 * ensuring that claims don't double spend each other. If a specific `claim_id` has never had a
24493 * transaction associated with it, and all of the available UTXOs have already been assigned to
24494 * other claims, implementations must be willing to double spend their UTXOs. The choice of
24495 * which UTXOs to double spend is left to the implementation, but it must strive to keep the
24496 * set of other claims being double spent to a minimum.
24498 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);
24500 * Signs and provides the full witness for all inputs within the transaction known to the
24501 * trait (i.e., any provided via [`CoinSelectionSource::select_confirmed_utxos`]).
24503 * If your wallet does not support signing PSBTs you can call `psbt.extract_tx()` to get the
24504 * unsigned transaction and then sign it with your wallet.
24506 struct LDKCResult_TransactionNoneZ (*sign_psbt)(const void *this_arg, struct LDKCVec_u8Z psbt);
24508 * Frees any resources associated with this object given its this_arg pointer.
24509 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
24511 void (*free)(void *this_arg);
24512 } LDKCoinSelectionSource;
24515 * An alternative to [`CoinSelectionSource`] that can be implemented and used along [`Wallet`] to
24516 * provide a default implementation to [`CoinSelectionSource`].
24518 typedef struct LDKWalletSource {
24520 * An opaque pointer which is passed to your function implementations as an argument.
24521 * This has no meaning in the LDK, and can be NULL or any other value.
24525 * Returns all UTXOs, with at least 1 confirmation each, that are available to spend.
24527 struct LDKCResult_CVec_UtxoZNoneZ (*list_confirmed_utxos)(const void *this_arg);
24529 * Returns a script to use for change above dust resulting from a successful coin selection
24532 struct LDKCResult_CVec_u8ZNoneZ (*get_change_script)(const void *this_arg);
24534 * Signs and provides the full [`TxIn::script_sig`] and [`TxIn::witness`] for all inputs within
24535 * the transaction known to the wallet (i.e., any provided via
24536 * [`WalletSource::list_confirmed_utxos`]).
24538 * If your wallet does not support signing PSBTs you can call `psbt.extract_tx()` to get the
24539 * unsigned transaction and then sign it with your wallet.
24541 struct LDKCResult_TransactionNoneZ (*sign_psbt)(const void *this_arg, struct LDKCVec_u8Z psbt);
24543 * Frees any resources associated with this object given its this_arg pointer.
24544 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
24546 void (*free)(void *this_arg);
24552 * A wrapper over [`WalletSource`] that implements [`CoinSelection`] by preferring UTXOs that would
24553 * avoid conflicting double spends. If not enough UTXOs are available to do so, conflicting double
24554 * spends may happen.
24556 typedef struct MUST_USE_STRUCT LDKWallet {
24558 * A pointer to the opaque Rust object.
24559 * Nearly everywhere, inner must be non-null, however in places where
24560 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24562 LDKnativeWallet *inner;
24564 * Indicates that this is the only struct which contains the same pointer.
24565 * Rust functions which take ownership of an object provided via an argument require
24566 * this to be true and invalidate the object pointed to by inner.
24574 * A handler for [`Event::BumpTransaction`] events that sources confirmed UTXOs from a
24575 * [`CoinSelectionSource`] to fee bump transactions via Child-Pays-For-Parent (CPFP) or
24576 * Replace-By-Fee (RBF).
24578 * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
24580 typedef struct MUST_USE_STRUCT LDKBumpTransactionEventHandler {
24582 * A pointer to the opaque Rust object.
24583 * Nearly everywhere, inner must be non-null, however in places where
24584 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24586 LDKnativeBumpTransactionEventHandler *inner;
24588 * Indicates that this is the only struct which contains the same pointer.
24589 * Rust functions which take ownership of an object provided via an argument require
24590 * this to be true and invalidate the object pointed to by inner.
24593 } LDKBumpTransactionEventHandler;
24598 * A [`KVStore`] implementation that writes to and reads from the file system.
24600 typedef struct MUST_USE_STRUCT LDKFilesystemStore {
24602 * A pointer to the opaque Rust object.
24603 * Nearly everywhere, inner must be non-null, however in places where
24604 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24606 LDKnativeFilesystemStore *inner;
24608 * Indicates that this is the only struct which contains the same pointer.
24609 * Rust functions which take ownership of an object provided via an argument require
24610 * this to be true and invalidate the object pointed to by inner.
24613 } LDKFilesystemStore;
24618 * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
24619 * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
24620 * responsibilities are:
24621 * * Processing [`Event`]s with a user-provided [`EventHandler`].
24622 * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
24623 * writing it to disk/backups by invoking the callback given to it at startup.
24624 * [`ChannelManager`] persistence should be done in the background.
24625 * * Calling [`ChannelManager::timer_tick_occurred`], [`ChainMonitor::rebroadcast_pending_claims`]
24626 * and [`PeerManager::timer_tick_occurred`] at the appropriate intervals.
24627 * * Calling [`NetworkGraph::remove_stale_channels_and_tracking`] (if a [`GossipSync`] with a
24628 * [`NetworkGraph`] is provided to [`BackgroundProcessor::start`]).
24630 * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
24631 * upon as doing so may result in high latency.
24635 * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
24636 * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
24637 * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
24638 * unilateral chain closure fees are at risk.
24640 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
24641 * [`ChannelManager::timer_tick_occurred`]: lightning::ln::channelmanager::ChannelManager::timer_tick_occurred
24642 * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
24643 * [`Event`]: lightning::events::Event
24644 * [`PeerManager::timer_tick_occurred`]: lightning::ln::peer_handler::PeerManager::timer_tick_occurred
24645 * [`PeerManager::process_events`]: lightning::ln::peer_handler::PeerManager::process_events
24646 *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
24648 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
24650 * A pointer to the opaque Rust object.
24651 * Nearly everywhere, inner must be non-null, however in places where
24652 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24654 LDKnativeBackgroundProcessor *inner;
24656 * Indicates that this is the only struct which contains the same pointer.
24657 * Rust functions which take ownership of an object provided via an argument require
24658 * this to be true and invalidate the object pointed to by inner.
24661 } LDKBackgroundProcessor;
24666 * The main Rapid Gossip Sync object.
24668 * See [crate-level documentation] for usage.
24670 * [crate-level documentation]: crate
24672 typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
24674 * A pointer to the opaque Rust object.
24675 * Nearly everywhere, inner must be non-null, however in places where
24676 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24678 LDKnativeRapidGossipSync *inner;
24680 * Indicates that this is the only struct which contains the same pointer.
24681 * Rust functions which take ownership of an object provided via an argument require
24682 * this to be true and invalidate the object pointed to by inner.
24685 } LDKRapidGossipSync;
24688 * Either [`P2PGossipSync`] or [`RapidGossipSync`].
24690 typedef enum LDKGossipSync_Tag {
24692 * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
24696 * Rapid gossip sync from a trusted server.
24698 LDKGossipSync_Rapid,
24702 LDKGossipSync_None,
24704 * Must be last for serialization purposes
24706 LDKGossipSync_Sentinel,
24707 } LDKGossipSync_Tag;
24709 typedef struct MUST_USE_STRUCT LDKGossipSync {
24710 LDKGossipSync_Tag tag;
24714 * Note that this field is expected to be a reference.
24716 struct LDKP2PGossipSync p2p;
24720 * Note that this field is expected to be a reference.
24722 struct LDKRapidGossipSync rapid;
24730 * Data of the [`RawBolt11Invoice`] that is encoded in the data part
24732 typedef struct MUST_USE_STRUCT LDKRawDataPart {
24734 * A pointer to the opaque Rust object.
24735 * Nearly everywhere, inner must be non-null, however in places where
24736 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24738 LDKnativeRawDataPart *inner;
24740 * Indicates that this is the only struct which contains the same pointer.
24741 * Rust functions which take ownership of an object provided via an argument require
24742 * this to be true and invalidate the object pointed to by inner.
24752 typedef struct MUST_USE_STRUCT LDKSha256 {
24754 * A pointer to the opaque Rust object.
24755 * Nearly everywhere, inner must be non-null, however in places where
24756 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24758 LDKnativeSha256 *inner;
24760 * Indicates that this is the only struct which contains the same pointer.
24761 * Rust functions which take ownership of an object provided via an argument require
24762 * this to be true and invalidate the object pointed to by inner.
24770 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
24773 typedef struct MUST_USE_STRUCT LDKExpiryTime {
24775 * A pointer to the opaque Rust object.
24776 * Nearly everywhere, inner must be non-null, however in places where
24777 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24779 LDKnativeExpiryTime *inner;
24781 * Indicates that this is the only struct which contains the same pointer.
24782 * Rust functions which take ownership of an object provided via an argument require
24783 * this to be true and invalidate the object pointed to by inner.
24791 * `min_final_cltv_expiry_delta` to use for the last HTLC in the route
24793 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiryDelta {
24795 * A pointer to the opaque Rust object.
24796 * Nearly everywhere, inner must be non-null, however in places where
24797 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24799 LDKnativeMinFinalCltvExpiryDelta *inner;
24801 * Indicates that this is the only struct which contains the same pointer.
24802 * Rust functions which take ownership of an object provided via an argument require
24803 * this to be true and invalidate the object pointed to by inner.
24806 } LDKMinFinalCltvExpiryDelta;
24809 * A 20-byte byte array.
24811 typedef struct LDKTwentyBytes {
24819 * Fallback address in case no LN payment is possible
24821 typedef enum LDKFallback_Tag {
24822 LDKFallback_SegWitProgram,
24823 LDKFallback_PubKeyHash,
24824 LDKFallback_ScriptHash,
24826 * Must be last for serialization purposes
24828 LDKFallback_Sentinel,
24831 typedef struct LDKFallback_LDKSegWitProgram_Body {
24832 struct LDKWitnessVersion version;
24833 struct LDKCVec_u8Z program;
24834 } LDKFallback_LDKSegWitProgram_Body;
24836 typedef struct MUST_USE_STRUCT LDKFallback {
24837 LDKFallback_Tag tag;
24839 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
24841 struct LDKTwentyBytes pub_key_hash;
24844 struct LDKTwentyBytes script_hash;
24849 extern const uintptr_t MAX_BUF_SIZE;
24851 extern const uintptr_t KVSTORE_NAMESPACE_KEY_MAX_LEN;
24853 extern const uint64_t MAX_SCID_BLOCK;
24855 extern const uint64_t MAX_SCID_TX_INDEX;
24857 extern const uint64_t MAX_SCID_VOUT_INDEX;
24859 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
24861 extern const uint32_t FEERATE_FLOOR_SATS_PER_KW;
24863 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
24865 extern const uint32_t ANTI_REORG_DELAY;
24867 extern const uint16_t BREAKDOWN_TIMEOUT;
24869 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
24871 extern const uint16_t MIN_FINAL_CLTV_EXPIRY_DELTA;
24873 extern const uint16_t MAX_HTLCS;
24875 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT;
24877 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT_ANCHORS;
24879 extern const uintptr_t MAX_ACCEPTED_HTLC_SCRIPT_WEIGHT;
24881 extern const uint64_t ANCHOR_INPUT_WITNESS_WEIGHT;
24883 extern const uint64_t HTLC_TIMEOUT_INPUT_ANCHOR_WITNESS_WEIGHT;
24885 extern const uint64_t HTLC_SUCCESS_INPUT_ANCHOR_WITNESS_WEIGHT;
24887 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
24889 extern const uintptr_t PAYER_NOTE_LIMIT;
24891 extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
24893 extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
24895 extern const uint8_t DEFAULT_MAX_PATH_COUNT;
24897 extern const uint64_t MAX_TIMESTAMP;
24899 extern const uint64_t DEFAULT_EXPIRY_TIME;
24901 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA;
24903 extern const uint8_t TAG_PAYMENT_HASH;
24905 extern const uint8_t TAG_DESCRIPTION;
24907 extern const uint8_t TAG_PAYEE_PUB_KEY;
24909 extern const uint8_t TAG_DESCRIPTION_HASH;
24911 extern const uint8_t TAG_EXPIRY_TIME;
24913 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY_DELTA;
24915 extern const uint8_t TAG_FALLBACK;
24917 extern const uint8_t TAG_PRIVATE_ROUTE;
24919 extern const uint8_t TAG_PAYMENT_SECRET;
24921 extern const uint8_t TAG_PAYMENT_METADATA;
24923 extern const uint8_t TAG_FEATURES;
24925 struct LDKStr _ldk_get_compiled_version(void);
24927 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
24930 * Gets the 128-bit integer, as 16 little-endian bytes
24932 struct LDKSixteenBytes U128_le_bytes(struct LDKU128 val);
24935 * Constructs a new U128 from 16 little-endian bytes
24937 struct LDKU128 U128_new(struct LDKSixteenBytes le_bytes);
24940 * Constructs a new WitnessProgram given a version and program bytes.
24942 * The program MUST be at least 2 bytes and no longer than 40 bytes long.
24943 * Further, if the version is 0, the program MUST be either exactly 20 or exactly 32 bytes long.
24945 struct LDKWitnessProgram WitnessProgram_new(struct LDKWitnessVersion version, struct LDKCVec_u8Z program);
24948 * Gets the `WitnessVersion` of the given `WitnessProgram`
24950 struct LDKWitnessVersion WitnessProgram_get_version(const struct LDKWitnessProgram *NONNULL_PTR prog);
24953 * Gets the witness program bytes of the given `WitnessProgram`
24955 struct LDKu8slice WitnessProgram_get_program(const struct LDKWitnessProgram *NONNULL_PTR prog);
24958 * Creates a new WitnessProgram which has the same data as `orig`
24960 struct LDKWitnessProgram WitnessProgram_clone(const struct LDKWitnessProgram *NONNULL_PTR orig);
24963 * Releases any memory held by the given `WitnessProgram` (which is currently none)
24965 void WitnessProgram_free(struct LDKWitnessProgram o);
24968 * Convenience function for constructing a new BigEndianScalar
24970 struct LDKBigEndianScalar BigEndianScalar_new(struct LDKThirtyTwoBytes big_endian_bytes);
24973 * Creates a new BigEndianScalar which has the same data as `orig`
24975 struct LDKBigEndianScalar BigEndianScalar_clone(const struct LDKBigEndianScalar *NONNULL_PTR orig);
24978 * Creates a new Bech32Error which has the same data as `orig`
24980 struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
24983 * Releases any memory held by the given `Bech32Error` (which is currently none)
24985 void Bech32Error_free(struct LDKBech32Error o);
24988 * Frees the data buffer, if data_is_owned is set and datalen > 0.
24990 void Transaction_free(struct LDKTransaction _res);
24993 * Creates a new Witness which has the same data as `orig` but with a new buffer.
24995 struct LDKWitness Witness_clone(const struct LDKWitness *NONNULL_PTR orig);
24998 * Frees the data pointed to by data
25000 void Witness_free(struct LDKWitness _res);
25003 * Convenience function for constructing a new TxIn
25005 struct LDKTxIn TxIn_new(struct LDKWitness witness, struct LDKCVec_u8Z script_sig, uint32_t sequence, struct LDKThirtyTwoBytes previous_txid, uint32_t previous_vout);
25008 * Gets the `witness` in the given `TxIn`.
25010 struct LDKWitness TxIn_get_witness(const struct LDKTxIn *NONNULL_PTR txin);
25013 * Gets the `script_sig` in the given `TxIn`.
25015 struct LDKu8slice TxIn_get_script_sig(const struct LDKTxIn *NONNULL_PTR txin);
25018 * Gets the `sequence` in the given `TxIn`.
25020 uint32_t TxIn_get_sequence(const struct LDKTxIn *NONNULL_PTR txin);
25023 * Gets the previous outpoint txid in the given `TxIn`.
25025 struct LDKThirtyTwoBytes TxIn_get_previous_txid(const struct LDKTxIn *NONNULL_PTR txin);
25028 * Gets the previout outpoint index in the given `TxIn`.
25030 uint32_t TxIn_get_previous_vout(const struct LDKTxIn *NONNULL_PTR txin);
25033 * Frees the witness and script_sig in a TxIn
25035 void TxIn_free(struct LDKTxIn _res);
25038 * Convenience function for constructing a new TxOut
25040 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
25043 * Gets the `script_pubkey` in the given `TxOut`.
25045 struct LDKu8slice TxOut_get_script_pubkey(const struct LDKTxOut *NONNULL_PTR txout);
25048 * Gets the value in the given `TxOut`.
25050 uint64_t TxOut_get_value(const struct LDKTxOut *NONNULL_PTR txout);
25053 * Frees the data pointed to by script_pubkey.
25055 void TxOut_free(struct LDKTxOut _res);
25058 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
25060 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
25063 * Frees the data buffer, if chars_is_owned is set and len > 0.
25065 void Str_free(struct LDKStr _res);
25067 #if defined(LDK_DEBUG_BUILD)
25069 * This function exists for memory safety testing purposes. It should never be used in production
25072 const void *__unmangle_inner_ptr(const void *ptr);
25076 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25078 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
25081 * Creates a new CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ in the success state.
25083 struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(struct LDKRefundMaybeWithDerivedMetadataBuilder o);
25086 * Creates a new CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ in the error state.
25088 struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
25091 * Checks if the given object is currently in the success state
25093 bool CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
25096 * Frees any resources used by the CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.
25098 void CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ _res);
25101 * Creates a new CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ which has the same data as `orig`
25102 * but with all dynamically-allocated buffers duplicated in new buffers.
25104 struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(const struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR orig);
25107 * Creates a new CResult_RefundBolt12SemanticErrorZ in the success state.
25109 struct LDKCResult_RefundBolt12SemanticErrorZ CResult_RefundBolt12SemanticErrorZ_ok(struct LDKRefund o);
25112 * Creates a new CResult_RefundBolt12SemanticErrorZ in the error state.
25114 struct LDKCResult_RefundBolt12SemanticErrorZ CResult_RefundBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
25117 * Checks if the given object is currently in the success state
25119 bool CResult_RefundBolt12SemanticErrorZ_is_ok(const struct LDKCResult_RefundBolt12SemanticErrorZ *NONNULL_PTR o);
25122 * Frees any resources used by the CResult_RefundBolt12SemanticErrorZ.
25124 void CResult_RefundBolt12SemanticErrorZ_free(struct LDKCResult_RefundBolt12SemanticErrorZ _res);
25127 * Creates a new CResult_RefundBolt12SemanticErrorZ which has the same data as `orig`
25128 * but with all dynamically-allocated buffers duplicated in new buffers.
25130 struct LDKCResult_RefundBolt12SemanticErrorZ CResult_RefundBolt12SemanticErrorZ_clone(const struct LDKCResult_RefundBolt12SemanticErrorZ *NONNULL_PTR orig);
25133 * Constructs a new COption_u64Z containing a u64
25135 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
25138 * Constructs a new COption_u64Z containing nothing
25140 struct LDKCOption_u64Z COption_u64Z_none(void);
25143 * Frees any resources associated with the u64, if we are in the Some state
25145 void COption_u64Z_free(struct LDKCOption_u64Z _res);
25148 * Creates a new COption_u64Z which has the same data as `orig`
25149 * but with all dynamically-allocated buffers duplicated in new buffers.
25151 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
25154 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25156 void CVec_BlindedPathZ_free(struct LDKCVec_BlindedPathZ _res);
25159 * Creates a new CResult_RefundBolt12ParseErrorZ in the success state.
25161 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_ok(struct LDKRefund o);
25164 * Creates a new CResult_RefundBolt12ParseErrorZ in the error state.
25166 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
25169 * Checks if the given object is currently in the success state
25171 bool CResult_RefundBolt12ParseErrorZ_is_ok(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR o);
25174 * Frees any resources used by the CResult_RefundBolt12ParseErrorZ.
25176 void CResult_RefundBolt12ParseErrorZ_free(struct LDKCResult_RefundBolt12ParseErrorZ _res);
25179 * Creates a new CResult_RefundBolt12ParseErrorZ which has the same data as `orig`
25180 * but with all dynamically-allocated buffers duplicated in new buffers.
25182 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_clone(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR orig);
25185 * Creates a new CResult_RetryDecodeErrorZ in the success state.
25187 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_ok(struct LDKRetry o);
25190 * Creates a new CResult_RetryDecodeErrorZ in the error state.
25192 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_err(struct LDKDecodeError e);
25195 * Checks if the given object is currently in the success state
25197 bool CResult_RetryDecodeErrorZ_is_ok(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR o);
25200 * Frees any resources used by the CResult_RetryDecodeErrorZ.
25202 void CResult_RetryDecodeErrorZ_free(struct LDKCResult_RetryDecodeErrorZ _res);
25205 * Creates a new CResult_RetryDecodeErrorZ which has the same data as `orig`
25206 * but with all dynamically-allocated buffers duplicated in new buffers.
25208 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_clone(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR orig);
25211 * Creates a new CResult_NoneAPIErrorZ in the success state.
25213 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
25216 * Creates a new CResult_NoneAPIErrorZ in the error state.
25218 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
25221 * Checks if the given object is currently in the success state
25223 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
25226 * Frees any resources used by the CResult_NoneAPIErrorZ.
25228 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
25231 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
25232 * but with all dynamically-allocated buffers duplicated in new buffers.
25234 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
25237 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25239 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
25242 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25244 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
25247 * Constructs a new COption_ThirtyTwoBytesZ containing a crate::c_types::ThirtyTwoBytes
25249 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_some(struct LDKThirtyTwoBytes o);
25252 * Constructs a new COption_ThirtyTwoBytesZ containing nothing
25254 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_none(void);
25257 * Frees any resources associated with the crate::c_types::ThirtyTwoBytes, if we are in the Some state
25259 void COption_ThirtyTwoBytesZ_free(struct LDKCOption_ThirtyTwoBytesZ _res);
25262 * Creates a new COption_ThirtyTwoBytesZ which has the same data as `orig`
25263 * but with all dynamically-allocated buffers duplicated in new buffers.
25265 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_clone(const struct LDKCOption_ThirtyTwoBytesZ *NONNULL_PTR orig);
25268 * Constructs a new COption_CVec_u8ZZ containing a crate::c_types::derived::CVec_u8Z
25270 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_some(struct LDKCVec_u8Z o);
25273 * Constructs a new COption_CVec_u8ZZ containing nothing
25275 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_none(void);
25278 * Frees any resources associated with the crate::c_types::derived::CVec_u8Z, if we are in the Some state
25280 void COption_CVec_u8ZZ_free(struct LDKCOption_CVec_u8ZZ _res);
25283 * Creates a new COption_CVec_u8ZZ which has the same data as `orig`
25284 * but with all dynamically-allocated buffers duplicated in new buffers.
25286 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_clone(const struct LDKCOption_CVec_u8ZZ *NONNULL_PTR orig);
25289 * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the success state.
25291 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_ok(struct LDKRecipientOnionFields o);
25294 * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the error state.
25296 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_err(struct LDKDecodeError e);
25299 * Checks if the given object is currently in the success state
25301 bool CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR o);
25304 * Frees any resources used by the CResult_RecipientOnionFieldsDecodeErrorZ.
25306 void CResult_RecipientOnionFieldsDecodeErrorZ_free(struct LDKCResult_RecipientOnionFieldsDecodeErrorZ _res);
25309 * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ which has the same data as `orig`
25310 * but with all dynamically-allocated buffers duplicated in new buffers.
25312 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_clone(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR orig);
25315 * Creates a new tuple which has the same data as `orig`
25316 * but with all dynamically-allocated buffers duplicated in new buffers.
25318 struct LDKC2Tuple_u64CVec_u8ZZ C2Tuple_u64CVec_u8ZZ_clone(const struct LDKC2Tuple_u64CVec_u8ZZ *NONNULL_PTR orig);
25321 * Creates a new C2Tuple_u64CVec_u8ZZ from the contained elements.
25323 struct LDKC2Tuple_u64CVec_u8ZZ C2Tuple_u64CVec_u8ZZ_new(uint64_t a, struct LDKCVec_u8Z b);
25326 * Frees any resources used by the C2Tuple_u64CVec_u8ZZ.
25328 void C2Tuple_u64CVec_u8ZZ_free(struct LDKC2Tuple_u64CVec_u8ZZ _res);
25331 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25333 void CVec_C2Tuple_u64CVec_u8ZZZ_free(struct LDKCVec_C2Tuple_u64CVec_u8ZZZ _res);
25336 * Creates a new CResult_RecipientOnionFieldsNoneZ in the success state.
25338 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_ok(struct LDKRecipientOnionFields o);
25341 * Creates a new CResult_RecipientOnionFieldsNoneZ in the error state.
25343 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_err(void);
25346 * Checks if the given object is currently in the success state
25348 bool CResult_RecipientOnionFieldsNoneZ_is_ok(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR o);
25351 * Frees any resources used by the CResult_RecipientOnionFieldsNoneZ.
25353 void CResult_RecipientOnionFieldsNoneZ_free(struct LDKCResult_RecipientOnionFieldsNoneZ _res);
25356 * Creates a new CResult_RecipientOnionFieldsNoneZ which has the same data as `orig`
25357 * but with all dynamically-allocated buffers duplicated in new buffers.
25359 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_clone(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR orig);
25362 * Creates a new CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ in the success state.
25364 struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_ok(struct LDKUnsignedBolt12Invoice o);
25367 * Creates a new CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ in the error state.
25369 struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
25372 * Checks if the given object is currently in the success state
25374 bool CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_is_ok(const struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR o);
25377 * Frees any resources used by the CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ.
25379 void CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_free(struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ _res);
25382 * Creates a new CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ which has the same data as `orig`
25383 * but with all dynamically-allocated buffers duplicated in new buffers.
25385 struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone(const struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR orig);
25388 * Creates a new CResult_Bolt12InvoiceBolt12SemanticErrorZ in the success state.
25390 struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ CResult_Bolt12InvoiceBolt12SemanticErrorZ_ok(struct LDKBolt12Invoice o);
25393 * Creates a new CResult_Bolt12InvoiceBolt12SemanticErrorZ in the error state.
25395 struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ CResult_Bolt12InvoiceBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
25398 * Checks if the given object is currently in the success state
25400 bool CResult_Bolt12InvoiceBolt12SemanticErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR o);
25403 * Frees any resources used by the CResult_Bolt12InvoiceBolt12SemanticErrorZ.
25405 void CResult_Bolt12InvoiceBolt12SemanticErrorZ_free(struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ _res);
25408 * Creates a new CResult_Bolt12InvoiceBolt12SemanticErrorZ which has the same data as `orig`
25409 * but with all dynamically-allocated buffers duplicated in new buffers.
25411 struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone(const struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR orig);
25414 * Creates a new CResult_SchnorrSignatureNoneZ in the success state.
25416 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_ok(struct LDKSchnorrSignature o);
25419 * Creates a new CResult_SchnorrSignatureNoneZ in the error state.
25421 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_err(void);
25424 * Checks if the given object is currently in the success state
25426 bool CResult_SchnorrSignatureNoneZ_is_ok(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR o);
25429 * Frees any resources used by the CResult_SchnorrSignatureNoneZ.
25431 void CResult_SchnorrSignatureNoneZ_free(struct LDKCResult_SchnorrSignatureNoneZ _res);
25434 * Creates a new CResult_SchnorrSignatureNoneZ which has the same data as `orig`
25435 * but with all dynamically-allocated buffers duplicated in new buffers.
25437 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_clone(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR orig);
25440 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25442 void CVec_ThirtyTwoBytesZ_free(struct LDKCVec_ThirtyTwoBytesZ _res);
25445 * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing a crate::c_types::derived::CVec_ThirtyTwoBytesZ
25447 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_some(struct LDKCVec_ThirtyTwoBytesZ o);
25450 * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing nothing
25452 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_none(void);
25455 * Frees any resources associated with the crate::c_types::derived::CVec_ThirtyTwoBytesZ, if we are in the Some state
25457 void COption_CVec_ThirtyTwoBytesZZ_free(struct LDKCOption_CVec_ThirtyTwoBytesZZ _res);
25460 * Creates a new COption_CVec_ThirtyTwoBytesZZ which has the same data as `orig`
25461 * but with all dynamically-allocated buffers duplicated in new buffers.
25463 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_clone(const struct LDKCOption_CVec_ThirtyTwoBytesZZ *NONNULL_PTR orig);
25466 * Constructs a new COption_AmountZ containing a crate::lightning::offers::offer::Amount
25468 struct LDKCOption_AmountZ COption_AmountZ_some(struct LDKAmount o);
25471 * Constructs a new COption_AmountZ containing nothing
25473 struct LDKCOption_AmountZ COption_AmountZ_none(void);
25476 * Frees any resources associated with the crate::lightning::offers::offer::Amount, if we are in the Some state
25478 void COption_AmountZ_free(struct LDKCOption_AmountZ _res);
25481 * Creates a new COption_AmountZ which has the same data as `orig`
25482 * but with all dynamically-allocated buffers duplicated in new buffers.
25484 struct LDKCOption_AmountZ COption_AmountZ_clone(const struct LDKCOption_AmountZ *NONNULL_PTR orig);
25487 * Constructs a new COption_QuantityZ containing a crate::lightning::offers::offer::Quantity
25489 struct LDKCOption_QuantityZ COption_QuantityZ_some(struct LDKQuantity o);
25492 * Constructs a new COption_QuantityZ containing nothing
25494 struct LDKCOption_QuantityZ COption_QuantityZ_none(void);
25497 * Frees any resources associated with the crate::lightning::offers::offer::Quantity, if we are in the Some state
25499 void COption_QuantityZ_free(struct LDKCOption_QuantityZ _res);
25502 * Creates a new COption_QuantityZ which has the same data as `orig`
25503 * but with all dynamically-allocated buffers duplicated in new buffers.
25505 struct LDKCOption_QuantityZ COption_QuantityZ_clone(const struct LDKCOption_QuantityZ *NONNULL_PTR orig);
25508 * Creates a new CResult_ThirtyTwoBytesNoneZ in the success state.
25510 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_ok(struct LDKThirtyTwoBytes o);
25513 * Creates a new CResult_ThirtyTwoBytesNoneZ in the error state.
25515 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_err(void);
25518 * Checks if the given object is currently in the success state
25520 bool CResult_ThirtyTwoBytesNoneZ_is_ok(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR o);
25523 * Frees any resources used by the CResult_ThirtyTwoBytesNoneZ.
25525 void CResult_ThirtyTwoBytesNoneZ_free(struct LDKCResult_ThirtyTwoBytesNoneZ _res);
25528 * Creates a new CResult_ThirtyTwoBytesNoneZ which has the same data as `orig`
25529 * but with all dynamically-allocated buffers duplicated in new buffers.
25531 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_clone(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR orig);
25534 * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the success state.
25536 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_ok(struct LDKBlindedPayInfo o);
25539 * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the error state.
25541 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_err(struct LDKDecodeError e);
25544 * Checks if the given object is currently in the success state
25546 bool CResult_BlindedPayInfoDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR o);
25549 * Frees any resources used by the CResult_BlindedPayInfoDecodeErrorZ.
25551 void CResult_BlindedPayInfoDecodeErrorZ_free(struct LDKCResult_BlindedPayInfoDecodeErrorZ _res);
25554 * Creates a new CResult_BlindedPayInfoDecodeErrorZ which has the same data as `orig`
25555 * but with all dynamically-allocated buffers duplicated in new buffers.
25557 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_clone(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR orig);
25560 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
25562 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
25565 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
25567 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
25570 * Checks if the given object is currently in the success state
25572 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
25575 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
25577 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
25580 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
25581 * but with all dynamically-allocated buffers duplicated in new buffers.
25583 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
25586 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
25588 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
25591 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
25593 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
25596 * Checks if the given object is currently in the success state
25598 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
25601 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
25603 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
25606 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
25607 * but with all dynamically-allocated buffers duplicated in new buffers.
25609 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
25612 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
25614 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
25617 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
25619 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
25622 * Checks if the given object is currently in the success state
25624 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
25627 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
25629 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
25632 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
25633 * but with all dynamically-allocated buffers duplicated in new buffers.
25635 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
25638 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25640 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
25643 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25645 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
25648 * Constructs a new COption_u32Z containing a u32
25650 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
25653 * Constructs a new COption_u32Z containing nothing
25655 struct LDKCOption_u32Z COption_u32Z_none(void);
25658 * Frees any resources associated with the u32, if we are in the Some state
25660 void COption_u32Z_free(struct LDKCOption_u32Z _res);
25663 * Creates a new COption_u32Z which has the same data as `orig`
25664 * but with all dynamically-allocated buffers duplicated in new buffers.
25666 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
25669 * Creates a new tuple which has the same data as `orig`
25670 * but with all dynamically-allocated buffers duplicated in new buffers.
25672 struct LDKC2Tuple_CVec_u8Zu64Z C2Tuple_CVec_u8Zu64Z_clone(const struct LDKC2Tuple_CVec_u8Zu64Z *NONNULL_PTR orig);
25675 * Creates a new C2Tuple_CVec_u8Zu64Z from the contained elements.
25677 struct LDKC2Tuple_CVec_u8Zu64Z C2Tuple_CVec_u8Zu64Z_new(struct LDKCVec_u8Z a, uint64_t b);
25680 * Frees any resources used by the C2Tuple_CVec_u8Zu64Z.
25682 void C2Tuple_CVec_u8Zu64Z_free(struct LDKC2Tuple_CVec_u8Zu64Z _res);
25685 * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ in the success state.
25687 struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ CResult_C2Tuple_CVec_u8Zu64ZNoneZ_ok(struct LDKC2Tuple_CVec_u8Zu64Z o);
25690 * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ in the error state.
25692 struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ CResult_C2Tuple_CVec_u8Zu64ZNoneZ_err(void);
25695 * Checks if the given object is currently in the success state
25697 bool CResult_C2Tuple_CVec_u8Zu64ZNoneZ_is_ok(const struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ *NONNULL_PTR o);
25700 * Frees any resources used by the CResult_C2Tuple_CVec_u8Zu64ZNoneZ.
25702 void CResult_C2Tuple_CVec_u8Zu64ZNoneZ_free(struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ _res);
25705 * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ which has the same data as `orig`
25706 * but with all dynamically-allocated buffers duplicated in new buffers.
25708 struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ CResult_C2Tuple_CVec_u8Zu64ZNoneZ_clone(const struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ *NONNULL_PTR orig);
25711 * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the success state.
25713 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_ok(struct LDKChannelDerivationParameters o);
25716 * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the error state.
25718 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_err(struct LDKDecodeError e);
25721 * Checks if the given object is currently in the success state
25723 bool CResult_ChannelDerivationParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR o);
25726 * Frees any resources used by the CResult_ChannelDerivationParametersDecodeErrorZ.
25728 void CResult_ChannelDerivationParametersDecodeErrorZ_free(struct LDKCResult_ChannelDerivationParametersDecodeErrorZ _res);
25731 * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ which has the same data as `orig`
25732 * but with all dynamically-allocated buffers duplicated in new buffers.
25734 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR orig);
25737 * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the success state.
25739 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_ok(struct LDKHTLCDescriptor o);
25742 * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the error state.
25744 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
25747 * Checks if the given object is currently in the success state
25749 bool CResult_HTLCDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR o);
25752 * Frees any resources used by the CResult_HTLCDescriptorDecodeErrorZ.
25754 void CResult_HTLCDescriptorDecodeErrorZ_free(struct LDKCResult_HTLCDescriptorDecodeErrorZ _res);
25757 * Creates a new CResult_HTLCDescriptorDecodeErrorZ which has the same data as `orig`
25758 * but with all dynamically-allocated buffers duplicated in new buffers.
25760 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_clone(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR orig);
25763 * Creates a new CResult_NoneNoneZ in the success state.
25765 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
25768 * Creates a new CResult_NoneNoneZ in the error state.
25770 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
25773 * Checks if the given object is currently in the success state
25775 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
25778 * Frees any resources used by the CResult_NoneNoneZ.
25780 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
25783 * Creates a new CResult_NoneNoneZ which has the same data as `orig`
25784 * but with all dynamically-allocated buffers duplicated in new buffers.
25786 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
25789 * Creates a new CResult_PublicKeyNoneZ in the success state.
25791 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_ok(struct LDKPublicKey o);
25794 * Creates a new CResult_PublicKeyNoneZ in the error state.
25796 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_err(void);
25799 * Checks if the given object is currently in the success state
25801 bool CResult_PublicKeyNoneZ_is_ok(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR o);
25804 * Frees any resources used by the CResult_PublicKeyNoneZ.
25806 void CResult_PublicKeyNoneZ_free(struct LDKCResult_PublicKeyNoneZ _res);
25809 * Creates a new CResult_PublicKeyNoneZ which has the same data as `orig`
25810 * but with all dynamically-allocated buffers duplicated in new buffers.
25812 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_clone(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR orig);
25815 * Constructs a new COption_BigEndianScalarZ containing a crate::c_types::BigEndianScalar
25817 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_some(struct LDKBigEndianScalar o);
25820 * Constructs a new COption_BigEndianScalarZ containing nothing
25822 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_none(void);
25825 * Frees any resources associated with the crate::c_types::BigEndianScalar, if we are in the Some state
25827 void COption_BigEndianScalarZ_free(struct LDKCOption_BigEndianScalarZ _res);
25830 * Creates a new COption_BigEndianScalarZ which has the same data as `orig`
25831 * but with all dynamically-allocated buffers duplicated in new buffers.
25833 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_clone(const struct LDKCOption_BigEndianScalarZ *NONNULL_PTR orig);
25836 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25838 void CVec_U5Z_free(struct LDKCVec_U5Z _res);
25841 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
25843 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
25846 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
25848 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
25851 * Checks if the given object is currently in the success state
25853 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
25856 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
25858 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
25861 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
25862 * but with all dynamically-allocated buffers duplicated in new buffers.
25864 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
25867 * Creates a new CResult_ECDSASignatureNoneZ in the success state.
25869 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_ok(struct LDKECDSASignature o);
25872 * Creates a new CResult_ECDSASignatureNoneZ in the error state.
25874 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_err(void);
25877 * Checks if the given object is currently in the success state
25879 bool CResult_ECDSASignatureNoneZ_is_ok(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR o);
25882 * Frees any resources used by the CResult_ECDSASignatureNoneZ.
25884 void CResult_ECDSASignatureNoneZ_free(struct LDKCResult_ECDSASignatureNoneZ _res);
25887 * Creates a new CResult_ECDSASignatureNoneZ which has the same data as `orig`
25888 * but with all dynamically-allocated buffers duplicated in new buffers.
25890 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_clone(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR orig);
25893 * Creates a new CResult_TransactionNoneZ in the success state.
25895 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
25898 * Creates a new CResult_TransactionNoneZ in the error state.
25900 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
25903 * Checks if the given object is currently in the success state
25905 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
25908 * Frees any resources used by the CResult_TransactionNoneZ.
25910 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
25913 * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
25914 * but with all dynamically-allocated buffers duplicated in new buffers.
25916 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
25919 * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the success state.
25921 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(struct LDKWriteableEcdsaChannelSigner o);
25924 * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the error state.
25926 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(struct LDKDecodeError e);
25929 * Checks if the given object is currently in the success state
25931 bool CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR o);
25934 * Frees any resources used by the CResult_WriteableEcdsaChannelSignerDecodeErrorZ.
25936 void CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res);
25939 * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ which has the same data as `orig`
25940 * but with all dynamically-allocated buffers duplicated in new buffers.
25942 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR orig);
25945 * Creates a new CResult_CVec_u8ZNoneZ in the success state.
25947 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_ok(struct LDKCVec_u8Z o);
25950 * Creates a new CResult_CVec_u8ZNoneZ in the error state.
25952 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_err(void);
25955 * Checks if the given object is currently in the success state
25957 bool CResult_CVec_u8ZNoneZ_is_ok(const struct LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR o);
25960 * Frees any resources used by the CResult_CVec_u8ZNoneZ.
25962 void CResult_CVec_u8ZNoneZ_free(struct LDKCResult_CVec_u8ZNoneZ _res);
25965 * Creates a new CResult_CVec_u8ZNoneZ which has the same data as `orig`
25966 * but with all dynamically-allocated buffers duplicated in new buffers.
25968 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_clone(const struct LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR orig);
25971 * Creates a new CResult_ShutdownScriptNoneZ in the success state.
25973 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_ok(struct LDKShutdownScript o);
25976 * Creates a new CResult_ShutdownScriptNoneZ in the error state.
25978 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_err(void);
25981 * Checks if the given object is currently in the success state
25983 bool CResult_ShutdownScriptNoneZ_is_ok(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR o);
25986 * Frees any resources used by the CResult_ShutdownScriptNoneZ.
25988 void CResult_ShutdownScriptNoneZ_free(struct LDKCResult_ShutdownScriptNoneZ _res);
25991 * Creates a new CResult_ShutdownScriptNoneZ which has the same data as `orig`
25992 * but with all dynamically-allocated buffers duplicated in new buffers.
25994 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_clone(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR orig);
25997 * Constructs a new COption_u16Z containing a u16
25999 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
26002 * Constructs a new COption_u16Z containing nothing
26004 struct LDKCOption_u16Z COption_u16Z_none(void);
26007 * Frees any resources associated with the u16, if we are in the Some state
26009 void COption_u16Z_free(struct LDKCOption_u16Z _res);
26012 * Creates a new COption_u16Z which has the same data as `orig`
26013 * but with all dynamically-allocated buffers duplicated in new buffers.
26015 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
26018 * Constructs a new COption_boolZ containing a bool
26020 struct LDKCOption_boolZ COption_boolZ_some(bool o);
26023 * Constructs a new COption_boolZ containing nothing
26025 struct LDKCOption_boolZ COption_boolZ_none(void);
26028 * Frees any resources associated with the bool, if we are in the Some state
26030 void COption_boolZ_free(struct LDKCOption_boolZ _res);
26033 * Creates a new COption_boolZ which has the same data as `orig`
26034 * but with all dynamically-allocated buffers duplicated in new buffers.
26036 struct LDKCOption_boolZ COption_boolZ_clone(const struct LDKCOption_boolZ *NONNULL_PTR orig);
26039 * Creates a new CResult_WitnessNoneZ in the success state.
26041 struct LDKCResult_WitnessNoneZ CResult_WitnessNoneZ_ok(struct LDKWitness o);
26044 * Creates a new CResult_WitnessNoneZ in the error state.
26046 struct LDKCResult_WitnessNoneZ CResult_WitnessNoneZ_err(void);
26049 * Checks if the given object is currently in the success state
26051 bool CResult_WitnessNoneZ_is_ok(const struct LDKCResult_WitnessNoneZ *NONNULL_PTR o);
26054 * Frees any resources used by the CResult_WitnessNoneZ.
26056 void CResult_WitnessNoneZ_free(struct LDKCResult_WitnessNoneZ _res);
26059 * Creates a new CResult_WitnessNoneZ which has the same data as `orig`
26060 * but with all dynamically-allocated buffers duplicated in new buffers.
26062 struct LDKCResult_WitnessNoneZ CResult_WitnessNoneZ_clone(const struct LDKCResult_WitnessNoneZ *NONNULL_PTR orig);
26065 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26067 void CVec_ECDSASignatureZ_free(struct LDKCVec_ECDSASignatureZ _res);
26070 * Creates a new tuple which has the same data as `orig`
26071 * but with all dynamically-allocated buffers duplicated in new buffers.
26073 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone(const struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *NONNULL_PTR orig);
26076 * Creates a new C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ from the contained elements.
26078 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_new(struct LDKECDSASignature a, struct LDKCVec_ECDSASignatureZ b);
26081 * Frees any resources used by the C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ.
26083 void C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_free(struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ _res);
26086 * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the success state.
26088 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_ok(struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ o);
26091 * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the error state.
26093 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_err(void);
26096 * Checks if the given object is currently in the success state
26098 bool CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR o);
26101 * Frees any resources used by the CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ.
26103 void CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_free(struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ _res);
26106 * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ which has the same data as `orig`
26107 * but with all dynamically-allocated buffers duplicated in new buffers.
26109 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR orig);
26112 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
26114 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
26117 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
26119 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
26122 * Checks if the given object is currently in the success state
26124 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
26127 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
26129 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
26132 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
26133 * but with all dynamically-allocated buffers duplicated in new buffers.
26135 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
26138 * Constructs a new COption_WriteableScoreZ containing a crate::lightning::routing::scoring::WriteableScore
26140 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_some(struct LDKWriteableScore o);
26143 * Constructs a new COption_WriteableScoreZ containing nothing
26145 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_none(void);
26148 * Frees any resources associated with the crate::lightning::routing::scoring::WriteableScore, if we are in the Some state
26150 void COption_WriteableScoreZ_free(struct LDKCOption_WriteableScoreZ _res);
26153 * Creates a new CResult_NoneIOErrorZ in the success state.
26155 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_ok(void);
26158 * Creates a new CResult_NoneIOErrorZ in the error state.
26160 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_err(enum LDKIOError e);
26163 * Checks if the given object is currently in the success state
26165 bool CResult_NoneIOErrorZ_is_ok(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR o);
26168 * Frees any resources used by the CResult_NoneIOErrorZ.
26170 void CResult_NoneIOErrorZ_free(struct LDKCResult_NoneIOErrorZ _res);
26173 * Creates a new CResult_NoneIOErrorZ which has the same data as `orig`
26174 * but with all dynamically-allocated buffers duplicated in new buffers.
26176 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_clone(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR orig);
26179 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26181 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
26184 * Creates a new CResult_RouteLightningErrorZ in the success state.
26186 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
26189 * Creates a new CResult_RouteLightningErrorZ in the error state.
26191 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
26194 * Checks if the given object is currently in the success state
26196 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
26199 * Frees any resources used by the CResult_RouteLightningErrorZ.
26201 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
26204 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
26205 * but with all dynamically-allocated buffers duplicated in new buffers.
26207 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
26210 * Creates a new tuple which has the same data as `orig`
26211 * but with all dynamically-allocated buffers duplicated in new buffers.
26213 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_clone(const struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR orig);
26216 * Creates a new C2Tuple_BlindedPayInfoBlindedPathZ from the contained elements.
26218 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_new(struct LDKBlindedPayInfo a, struct LDKBlindedPath b);
26221 * Frees any resources used by the C2Tuple_BlindedPayInfoBlindedPathZ.
26223 void C2Tuple_BlindedPayInfoBlindedPathZ_free(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ _res);
26226 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26228 void CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res);
26231 * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ in the success state.
26233 struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ o);
26236 * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ in the error state.
26238 struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err(void);
26241 * Checks if the given object is currently in the success state
26243 bool CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR o);
26246 * Frees any resources used by the CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.
26248 void CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free(struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ _res);
26251 * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ which has the same data as `orig`
26252 * but with all dynamically-allocated buffers duplicated in new buffers.
26254 struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(const struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR orig);
26257 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26259 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
26262 * Creates a new CResult_OnionMessagePathNoneZ in the success state.
26264 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_ok(struct LDKOnionMessagePath o);
26267 * Creates a new CResult_OnionMessagePathNoneZ in the error state.
26269 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_err(void);
26272 * Checks if the given object is currently in the success state
26274 bool CResult_OnionMessagePathNoneZ_is_ok(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR o);
26277 * Frees any resources used by the CResult_OnionMessagePathNoneZ.
26279 void CResult_OnionMessagePathNoneZ_free(struct LDKCResult_OnionMessagePathNoneZ _res);
26282 * Creates a new CResult_OnionMessagePathNoneZ which has the same data as `orig`
26283 * but with all dynamically-allocated buffers duplicated in new buffers.
26285 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_clone(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR orig);
26288 * Creates a new CResult_CVec_BlindedPathZNoneZ in the success state.
26290 struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_ok(struct LDKCVec_BlindedPathZ o);
26293 * Creates a new CResult_CVec_BlindedPathZNoneZ in the error state.
26295 struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_err(void);
26298 * Checks if the given object is currently in the success state
26300 bool CResult_CVec_BlindedPathZNoneZ_is_ok(const struct LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR o);
26303 * Frees any resources used by the CResult_CVec_BlindedPathZNoneZ.
26305 void CResult_CVec_BlindedPathZNoneZ_free(struct LDKCResult_CVec_BlindedPathZNoneZ _res);
26308 * Creates a new CResult_CVec_BlindedPathZNoneZ which has the same data as `orig`
26309 * but with all dynamically-allocated buffers duplicated in new buffers.
26311 struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_clone(const struct LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR orig);
26314 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the success state.
26316 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_ok(struct LDKInFlightHtlcs o);
26319 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the error state.
26321 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_err(struct LDKDecodeError e);
26324 * Checks if the given object is currently in the success state
26326 bool CResult_InFlightHtlcsDecodeErrorZ_is_ok(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR o);
26329 * Frees any resources used by the CResult_InFlightHtlcsDecodeErrorZ.
26331 void CResult_InFlightHtlcsDecodeErrorZ_free(struct LDKCResult_InFlightHtlcsDecodeErrorZ _res);
26334 * Creates a new CResult_InFlightHtlcsDecodeErrorZ which has the same data as `orig`
26335 * but with all dynamically-allocated buffers duplicated in new buffers.
26337 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_clone(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR orig);
26340 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
26342 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
26345 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
26347 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
26350 * Checks if the given object is currently in the success state
26352 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
26355 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
26357 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
26360 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
26361 * but with all dynamically-allocated buffers duplicated in new buffers.
26363 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
26366 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26368 void CVec_BlindedHopZ_free(struct LDKCVec_BlindedHopZ _res);
26371 * Creates a new CResult_BlindedTailDecodeErrorZ in the success state.
26373 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_ok(struct LDKBlindedTail o);
26376 * Creates a new CResult_BlindedTailDecodeErrorZ in the error state.
26378 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_err(struct LDKDecodeError e);
26381 * Checks if the given object is currently in the success state
26383 bool CResult_BlindedTailDecodeErrorZ_is_ok(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR o);
26386 * Frees any resources used by the CResult_BlindedTailDecodeErrorZ.
26388 void CResult_BlindedTailDecodeErrorZ_free(struct LDKCResult_BlindedTailDecodeErrorZ _res);
26391 * Creates a new CResult_BlindedTailDecodeErrorZ which has the same data as `orig`
26392 * but with all dynamically-allocated buffers duplicated in new buffers.
26394 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_clone(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR orig);
26397 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26399 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
26402 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26404 void CVec_PathZ_free(struct LDKCVec_PathZ _res);
26407 * Creates a new CResult_RouteDecodeErrorZ in the success state.
26409 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
26412 * Creates a new CResult_RouteDecodeErrorZ in the error state.
26414 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
26417 * Checks if the given object is currently in the success state
26419 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
26422 * Frees any resources used by the CResult_RouteDecodeErrorZ.
26424 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
26427 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
26428 * but with all dynamically-allocated buffers duplicated in new buffers.
26430 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
26433 * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
26435 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
26438 * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
26440 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
26443 * Checks if the given object is currently in the success state
26445 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
26448 * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
26450 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
26453 * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
26454 * but with all dynamically-allocated buffers duplicated in new buffers.
26456 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
26459 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26461 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
26464 * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
26466 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
26469 * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
26471 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
26474 * Checks if the given object is currently in the success state
26476 bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
26479 * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
26481 void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
26484 * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
26485 * but with all dynamically-allocated buffers duplicated in new buffers.
26487 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
26490 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26492 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
26495 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26497 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
26500 * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
26502 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
26505 * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
26507 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
26510 * Checks if the given object is currently in the success state
26512 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
26515 * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
26517 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
26520 * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
26521 * but with all dynamically-allocated buffers duplicated in new buffers.
26523 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
26526 * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
26528 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
26531 * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
26533 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
26536 * Checks if the given object is currently in the success state
26538 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
26541 * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
26543 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
26546 * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
26547 * but with all dynamically-allocated buffers duplicated in new buffers.
26549 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
26552 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
26554 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
26557 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
26559 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
26562 * Checks if the given object is currently in the success state
26564 bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
26567 * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
26569 void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
26572 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ which has the same data as `orig`
26573 * but with all dynamically-allocated buffers duplicated in new buffers.
26575 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig);
26578 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26580 void CVec_NodeIdZ_free(struct LDKCVec_NodeIdZ _res);
26583 * Creates a new tuple which has the same data as `orig`
26584 * but with all dynamically-allocated buffers duplicated in new buffers.
26586 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);
26589 * Creates a new C2Tuple_u64u64Z from the contained elements.
26591 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
26594 * Frees any resources used by the C2Tuple_u64u64Z.
26596 void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);
26599 * Constructs a new COption_C2Tuple_u64u64ZZ containing a crate::c_types::derived::C2Tuple_u64u64Z
26601 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_some(struct LDKC2Tuple_u64u64Z o);
26604 * Constructs a new COption_C2Tuple_u64u64ZZ containing nothing
26606 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_none(void);
26609 * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u64Z, if we are in the Some state
26611 void COption_C2Tuple_u64u64ZZ_free(struct LDKCOption_C2Tuple_u64u64ZZ _res);
26614 * Creates a new COption_C2Tuple_u64u64ZZ which has the same data as `orig`
26615 * but with all dynamically-allocated buffers duplicated in new buffers.
26617 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_clone(const struct LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR orig);
26620 * Creates a new C2Tuple_Z from the contained elements.
26622 struct LDKC2Tuple_Z C2Tuple_Z_new(struct LDKThirtyTwoU16s a, struct LDKThirtyTwoU16s b);
26625 * Frees any resources used by the C2Tuple_Z.
26627 void C2Tuple_Z_free(struct LDKC2Tuple_Z _res);
26630 * Creates a new C2Tuple__u1632_u1632Z from the contained elements.
26632 struct LDKC2Tuple__u1632_u1632Z C2Tuple__u1632_u1632Z_new(struct LDKThirtyTwoU16s a, struct LDKThirtyTwoU16s b);
26635 * Frees any resources used by the C2Tuple__u1632_u1632Z.
26637 void C2Tuple__u1632_u1632Z_free(struct LDKC2Tuple__u1632_u1632Z _res);
26640 * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing a crate::c_types::derived::C2Tuple__u1632_u1632Z
26642 struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_some(struct LDKC2Tuple__u1632_u1632Z o);
26645 * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing nothing
26647 struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_none(void);
26650 * Frees any resources associated with the crate::c_types::derived::C2Tuple__u1632_u1632Z, if we are in the Some state
26652 void COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_free(struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ _res);
26655 * Constructs a new COption_f64Z containing a f64
26657 struct LDKCOption_f64Z COption_f64Z_some(double o);
26660 * Constructs a new COption_f64Z containing nothing
26662 struct LDKCOption_f64Z COption_f64Z_none(void);
26665 * Frees any resources associated with the f64, if we are in the Some state
26667 void COption_f64Z_free(struct LDKCOption_f64Z _res);
26670 * Creates a new COption_f64Z which has the same data as `orig`
26671 * but with all dynamically-allocated buffers duplicated in new buffers.
26673 struct LDKCOption_f64Z COption_f64Z_clone(const struct LDKCOption_f64Z *NONNULL_PTR orig);
26676 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
26678 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
26681 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
26683 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
26686 * Checks if the given object is currently in the success state
26688 bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
26691 * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
26693 void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
26696 * Creates a new CResult_BestBlockDecodeErrorZ in the success state.
26698 struct LDKCResult_BestBlockDecodeErrorZ CResult_BestBlockDecodeErrorZ_ok(struct LDKBestBlock o);
26701 * Creates a new CResult_BestBlockDecodeErrorZ in the error state.
26703 struct LDKCResult_BestBlockDecodeErrorZ CResult_BestBlockDecodeErrorZ_err(struct LDKDecodeError e);
26706 * Checks if the given object is currently in the success state
26708 bool CResult_BestBlockDecodeErrorZ_is_ok(const struct LDKCResult_BestBlockDecodeErrorZ *NONNULL_PTR o);
26711 * Frees any resources used by the CResult_BestBlockDecodeErrorZ.
26713 void CResult_BestBlockDecodeErrorZ_free(struct LDKCResult_BestBlockDecodeErrorZ _res);
26716 * Creates a new CResult_BestBlockDecodeErrorZ which has the same data as `orig`
26717 * but with all dynamically-allocated buffers duplicated in new buffers.
26719 struct LDKCResult_BestBlockDecodeErrorZ CResult_BestBlockDecodeErrorZ_clone(const struct LDKCResult_BestBlockDecodeErrorZ *NONNULL_PTR orig);
26722 * Creates a new tuple which has the same data as `orig`
26723 * but with all dynamically-allocated buffers duplicated in new buffers.
26725 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
26728 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
26730 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
26733 * Frees any resources used by the C2Tuple_usizeTransactionZ.
26735 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
26738 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26740 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
26743 * Creates a new tuple which has the same data as `orig`
26744 * but with all dynamically-allocated buffers duplicated in new buffers.
26746 struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_clone(const struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ *NONNULL_PTR orig);
26749 * Creates a new C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ from the contained elements.
26751 struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_new(struct LDKThirtyTwoBytes a, uint32_t b, struct LDKCOption_ThirtyTwoBytesZ c);
26754 * Frees any resources used by the C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ.
26756 void C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_free(struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ _res);
26759 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26761 void CVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ_free(struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ _res);
26764 * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ in the success state.
26766 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_ok(enum LDKChannelMonitorUpdateStatus o);
26769 * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ in the error state.
26771 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_err(void);
26774 * Checks if the given object is currently in the success state
26776 bool CResult_ChannelMonitorUpdateStatusNoneZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR o);
26779 * Frees any resources used by the CResult_ChannelMonitorUpdateStatusNoneZ.
26781 void CResult_ChannelMonitorUpdateStatusNoneZ_free(struct LDKCResult_ChannelMonitorUpdateStatusNoneZ _res);
26784 * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ which has the same data as `orig`
26785 * but with all dynamically-allocated buffers duplicated in new buffers.
26787 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_clone(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR orig);
26790 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26792 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
26795 * Creates a new tuple which has the same data as `orig`
26796 * but with all dynamically-allocated buffers duplicated in new buffers.
26798 struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig);
26801 * Creates a new C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ from the contained elements.
26803 struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKChannelId b, struct LDKCVec_MonitorEventZ c, struct LDKPublicKey d);
26806 * Frees any resources used by the C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ.
26808 void C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_free(struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ _res);
26811 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26813 void CVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ _res);
26816 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
26818 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
26821 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
26823 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
26826 * Checks if the given object is currently in the success state
26828 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
26831 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
26833 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
26836 * Creates a new CResult_InitFeaturesDecodeErrorZ which has the same data as `orig`
26837 * but with all dynamically-allocated buffers duplicated in new buffers.
26839 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig);
26842 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
26844 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
26847 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
26849 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
26852 * Checks if the given object is currently in the success state
26854 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
26857 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
26859 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
26862 * Creates a new CResult_ChannelFeaturesDecodeErrorZ which has the same data as `orig`
26863 * but with all dynamically-allocated buffers duplicated in new buffers.
26865 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig);
26868 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
26870 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
26873 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
26875 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
26878 * Checks if the given object is currently in the success state
26880 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
26883 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
26885 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
26888 * Creates a new CResult_NodeFeaturesDecodeErrorZ which has the same data as `orig`
26889 * but with all dynamically-allocated buffers duplicated in new buffers.
26891 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig);
26894 * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the success state.
26896 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt11InvoiceFeatures o);
26899 * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the error state.
26901 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
26904 * Checks if the given object is currently in the success state
26906 bool CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
26909 * Frees any resources used by the CResult_Bolt11InvoiceFeaturesDecodeErrorZ.
26911 void CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ _res);
26914 * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
26915 * but with all dynamically-allocated buffers duplicated in new buffers.
26917 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
26920 * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the success state.
26922 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt12InvoiceFeatures o);
26925 * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the error state.
26927 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
26930 * Checks if the given object is currently in the success state
26932 bool CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
26935 * Frees any resources used by the CResult_Bolt12InvoiceFeaturesDecodeErrorZ.
26937 void CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ _res);
26940 * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
26941 * but with all dynamically-allocated buffers duplicated in new buffers.
26943 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
26946 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the success state.
26948 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_ok(struct LDKBlindedHopFeatures o);
26951 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the error state.
26953 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
26956 * Checks if the given object is currently in the success state
26958 bool CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR o);
26961 * Frees any resources used by the CResult_BlindedHopFeaturesDecodeErrorZ.
26963 void CResult_BlindedHopFeaturesDecodeErrorZ_free(struct LDKCResult_BlindedHopFeaturesDecodeErrorZ _res);
26966 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ which has the same data as `orig`
26967 * but with all dynamically-allocated buffers duplicated in new buffers.
26969 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_clone(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR orig);
26972 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
26974 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
26977 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
26979 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
26982 * Checks if the given object is currently in the success state
26984 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
26987 * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
26989 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
26992 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ which has the same data as `orig`
26993 * but with all dynamically-allocated buffers duplicated in new buffers.
26995 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig);
26998 * Creates a new CResult_OfferIdDecodeErrorZ in the success state.
27000 struct LDKCResult_OfferIdDecodeErrorZ CResult_OfferIdDecodeErrorZ_ok(struct LDKOfferId o);
27003 * Creates a new CResult_OfferIdDecodeErrorZ in the error state.
27005 struct LDKCResult_OfferIdDecodeErrorZ CResult_OfferIdDecodeErrorZ_err(struct LDKDecodeError e);
27008 * Checks if the given object is currently in the success state
27010 bool CResult_OfferIdDecodeErrorZ_is_ok(const struct LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR o);
27013 * Frees any resources used by the CResult_OfferIdDecodeErrorZ.
27015 void CResult_OfferIdDecodeErrorZ_free(struct LDKCResult_OfferIdDecodeErrorZ _res);
27018 * Creates a new CResult_OfferIdDecodeErrorZ which has the same data as `orig`
27019 * but with all dynamically-allocated buffers duplicated in new buffers.
27021 struct LDKCResult_OfferIdDecodeErrorZ CResult_OfferIdDecodeErrorZ_clone(const struct LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR orig);
27024 * Creates a new CResult_NoneBolt12SemanticErrorZ in the success state.
27026 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_ok(void);
27029 * Creates a new CResult_NoneBolt12SemanticErrorZ in the error state.
27031 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
27034 * Checks if the given object is currently in the success state
27036 bool CResult_NoneBolt12SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR o);
27039 * Frees any resources used by the CResult_NoneBolt12SemanticErrorZ.
27041 void CResult_NoneBolt12SemanticErrorZ_free(struct LDKCResult_NoneBolt12SemanticErrorZ _res);
27044 * Creates a new CResult_NoneBolt12SemanticErrorZ which has the same data as `orig`
27045 * but with all dynamically-allocated buffers duplicated in new buffers.
27047 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_clone(const struct LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR orig);
27050 * Creates a new CResult_OfferBolt12SemanticErrorZ in the success state.
27052 struct LDKCResult_OfferBolt12SemanticErrorZ CResult_OfferBolt12SemanticErrorZ_ok(struct LDKOffer o);
27055 * Creates a new CResult_OfferBolt12SemanticErrorZ in the error state.
27057 struct LDKCResult_OfferBolt12SemanticErrorZ CResult_OfferBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
27060 * Checks if the given object is currently in the success state
27062 bool CResult_OfferBolt12SemanticErrorZ_is_ok(const struct LDKCResult_OfferBolt12SemanticErrorZ *NONNULL_PTR o);
27065 * Frees any resources used by the CResult_OfferBolt12SemanticErrorZ.
27067 void CResult_OfferBolt12SemanticErrorZ_free(struct LDKCResult_OfferBolt12SemanticErrorZ _res);
27070 * Creates a new CResult_OfferBolt12SemanticErrorZ which has the same data as `orig`
27071 * but with all dynamically-allocated buffers duplicated in new buffers.
27073 struct LDKCResult_OfferBolt12SemanticErrorZ CResult_OfferBolt12SemanticErrorZ_clone(const struct LDKCResult_OfferBolt12SemanticErrorZ *NONNULL_PTR orig);
27076 * Creates a new CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ in the success state.
27078 struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceRequestWithDerivedPayerIdBuilder o);
27081 * Creates a new CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ in the error state.
27083 struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
27086 * Checks if the given object is currently in the success state
27088 bool CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
27091 * Frees any resources used by the CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ.
27093 void CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ _res);
27096 * Creates a new CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ in the success state.
27098 struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceRequestWithExplicitPayerIdBuilder o);
27101 * Creates a new CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ in the error state.
27103 struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
27106 * Checks if the given object is currently in the success state
27108 bool CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
27111 * Frees any resources used by the CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ.
27113 void CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ _res);
27116 * Creates a new CResult_OfferBolt12ParseErrorZ in the success state.
27118 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_ok(struct LDKOffer o);
27121 * Creates a new CResult_OfferBolt12ParseErrorZ in the error state.
27123 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
27126 * Checks if the given object is currently in the success state
27128 bool CResult_OfferBolt12ParseErrorZ_is_ok(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR o);
27131 * Frees any resources used by the CResult_OfferBolt12ParseErrorZ.
27133 void CResult_OfferBolt12ParseErrorZ_free(struct LDKCResult_OfferBolt12ParseErrorZ _res);
27136 * Creates a new CResult_OfferBolt12ParseErrorZ which has the same data as `orig`
27137 * but with all dynamically-allocated buffers duplicated in new buffers.
27139 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_clone(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR orig);
27142 * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
27144 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
27147 * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
27149 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
27152 * Checks if the given object is currently in the success state
27154 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
27157 * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
27159 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
27162 * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
27163 * but with all dynamically-allocated buffers duplicated in new buffers.
27165 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
27168 * Creates a new CResult_PublicKeySecp256k1ErrorZ in the success state.
27170 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_ok(struct LDKPublicKey o);
27173 * Creates a new CResult_PublicKeySecp256k1ErrorZ in the error state.
27175 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
27178 * Checks if the given object is currently in the success state
27180 bool CResult_PublicKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR o);
27183 * Frees any resources used by the CResult_PublicKeySecp256k1ErrorZ.
27185 void CResult_PublicKeySecp256k1ErrorZ_free(struct LDKCResult_PublicKeySecp256k1ErrorZ _res);
27188 * Creates a new CResult_PublicKeySecp256k1ErrorZ which has the same data as `orig`
27189 * but with all dynamically-allocated buffers duplicated in new buffers.
27191 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_clone(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR orig);
27194 * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate
27196 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
27199 * Constructs a new COption_NetworkUpdateZ containing nothing
27201 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
27204 * Frees any resources associated with the crate::lightning::routing::gossip::NetworkUpdate, if we are in the Some state
27206 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
27209 * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
27210 * but with all dynamically-allocated buffers duplicated in new buffers.
27212 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
27215 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
27217 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
27220 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
27222 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
27225 * Checks if the given object is currently in the success state
27227 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
27230 * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
27232 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
27235 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
27236 * but with all dynamically-allocated buffers duplicated in new buffers.
27238 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
27241 * Constructs a new COption_UtxoLookupZ containing a crate::lightning::routing::utxo::UtxoLookup
27243 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_some(struct LDKUtxoLookup o);
27246 * Constructs a new COption_UtxoLookupZ containing nothing
27248 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_none(void);
27251 * Frees any resources associated with the crate::lightning::routing::utxo::UtxoLookup, if we are in the Some state
27253 void COption_UtxoLookupZ_free(struct LDKCOption_UtxoLookupZ _res);
27256 * Creates a new CResult_NoneLightningErrorZ in the success state.
27258 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
27261 * Creates a new CResult_NoneLightningErrorZ in the error state.
27263 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
27266 * Checks if the given object is currently in the success state
27268 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
27271 * Frees any resources used by the CResult_NoneLightningErrorZ.
27273 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
27276 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
27277 * but with all dynamically-allocated buffers duplicated in new buffers.
27279 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
27282 * Creates a new CResult_boolLightningErrorZ in the success state.
27284 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
27287 * Creates a new CResult_boolLightningErrorZ in the error state.
27289 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
27292 * Checks if the given object is currently in the success state
27294 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
27297 * Frees any resources used by the CResult_boolLightningErrorZ.
27299 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
27302 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
27303 * but with all dynamically-allocated buffers duplicated in new buffers.
27305 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
27308 * Creates a new tuple which has the same data as `orig`
27309 * but with all dynamically-allocated buffers duplicated in new buffers.
27311 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
27314 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
27316 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
27319 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
27321 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
27324 * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
27326 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o);
27329 * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing nothing
27331 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none(void);
27334 * Frees any resources associated with the crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ, if we are in the Some state
27336 void COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
27339 * Creates a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ which has the same data as `orig`
27340 * but with all dynamically-allocated buffers duplicated in new buffers.
27342 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR orig);
27345 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27347 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
27350 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
27352 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
27355 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
27357 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
27360 * Checks if the given object is currently in the success state
27362 bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
27365 * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
27367 void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
27370 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
27371 * but with all dynamically-allocated buffers duplicated in new buffers.
27373 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
27376 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
27378 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
27381 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
27383 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
27386 * Checks if the given object is currently in the success state
27388 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
27391 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
27393 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
27396 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
27397 * but with all dynamically-allocated buffers duplicated in new buffers.
27399 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
27402 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
27404 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
27407 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
27409 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
27412 * Checks if the given object is currently in the success state
27414 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
27417 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
27419 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
27422 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
27423 * but with all dynamically-allocated buffers duplicated in new buffers.
27425 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
27428 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27430 void CVec_SocketAddressZ_free(struct LDKCVec_SocketAddressZ _res);
27433 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
27435 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
27438 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
27440 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
27443 * Checks if the given object is currently in the success state
27445 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
27448 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
27450 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
27453 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
27454 * but with all dynamically-allocated buffers duplicated in new buffers.
27456 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
27459 * Creates a new CResult_NodeAliasDecodeErrorZ in the success state.
27461 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_ok(struct LDKNodeAlias o);
27464 * Creates a new CResult_NodeAliasDecodeErrorZ in the error state.
27466 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_err(struct LDKDecodeError e);
27469 * Checks if the given object is currently in the success state
27471 bool CResult_NodeAliasDecodeErrorZ_is_ok(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR o);
27474 * Frees any resources used by the CResult_NodeAliasDecodeErrorZ.
27476 void CResult_NodeAliasDecodeErrorZ_free(struct LDKCResult_NodeAliasDecodeErrorZ _res);
27479 * Creates a new CResult_NodeAliasDecodeErrorZ which has the same data as `orig`
27480 * but with all dynamically-allocated buffers duplicated in new buffers.
27482 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig);
27485 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
27487 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
27490 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
27492 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
27495 * Checks if the given object is currently in the success state
27497 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
27500 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
27502 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
27505 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
27506 * but with all dynamically-allocated buffers duplicated in new buffers.
27508 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
27511 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
27513 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
27516 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
27518 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
27521 * Checks if the given object is currently in the success state
27523 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
27526 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
27528 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
27531 * Constructs a new COption_CVec_SocketAddressZZ containing a crate::c_types::derived::CVec_SocketAddressZ
27533 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_some(struct LDKCVec_SocketAddressZ o);
27536 * Constructs a new COption_CVec_SocketAddressZZ containing nothing
27538 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_none(void);
27541 * Frees any resources associated with the crate::c_types::derived::CVec_SocketAddressZ, if we are in the Some state
27543 void COption_CVec_SocketAddressZZ_free(struct LDKCOption_CVec_SocketAddressZZ _res);
27546 * Creates a new COption_CVec_SocketAddressZZ which has the same data as `orig`
27547 * but with all dynamically-allocated buffers duplicated in new buffers.
27549 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_clone(const struct LDKCOption_CVec_SocketAddressZZ *NONNULL_PTR orig);
27552 * Creates a new CResult_u64ShortChannelIdErrorZ in the success state.
27554 struct LDKCResult_u64ShortChannelIdErrorZ CResult_u64ShortChannelIdErrorZ_ok(uint64_t o);
27557 * Creates a new CResult_u64ShortChannelIdErrorZ in the error state.
27559 struct LDKCResult_u64ShortChannelIdErrorZ CResult_u64ShortChannelIdErrorZ_err(enum LDKShortChannelIdError e);
27562 * Checks if the given object is currently in the success state
27564 bool CResult_u64ShortChannelIdErrorZ_is_ok(const struct LDKCResult_u64ShortChannelIdErrorZ *NONNULL_PTR o);
27567 * Frees any resources used by the CResult_u64ShortChannelIdErrorZ.
27569 void CResult_u64ShortChannelIdErrorZ_free(struct LDKCResult_u64ShortChannelIdErrorZ _res);
27572 * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ in the success state.
27574 struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ CResult_PendingHTLCInfoInboundHTLCErrZ_ok(struct LDKPendingHTLCInfo o);
27577 * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ in the error state.
27579 struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ CResult_PendingHTLCInfoInboundHTLCErrZ_err(struct LDKInboundHTLCErr e);
27582 * Checks if the given object is currently in the success state
27584 bool CResult_PendingHTLCInfoInboundHTLCErrZ_is_ok(const struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ *NONNULL_PTR o);
27587 * Frees any resources used by the CResult_PendingHTLCInfoInboundHTLCErrZ.
27589 void CResult_PendingHTLCInfoInboundHTLCErrZ_free(struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ _res);
27592 * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ which has the same data as `orig`
27593 * but with all dynamically-allocated buffers duplicated in new buffers.
27595 struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ CResult_PendingHTLCInfoInboundHTLCErrZ_clone(const struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ *NONNULL_PTR orig);
27598 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27600 void CVec_HTLCOutputInCommitmentZ_free(struct LDKCVec_HTLCOutputInCommitmentZ _res);
27603 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27605 void CVec_HTLCDescriptorZ_free(struct LDKCVec_HTLCDescriptorZ _res);
27608 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27610 void CVec_UtxoZ_free(struct LDKCVec_UtxoZ _res);
27613 * Constructs a new COption_TxOutZ containing a crate::c_types::TxOut
27615 struct LDKCOption_TxOutZ COption_TxOutZ_some(struct LDKTxOut o);
27618 * Constructs a new COption_TxOutZ containing nothing
27620 struct LDKCOption_TxOutZ COption_TxOutZ_none(void);
27623 * Frees any resources associated with the crate::c_types::TxOut, if we are in the Some state
27625 void COption_TxOutZ_free(struct LDKCOption_TxOutZ _res);
27628 * Creates a new COption_TxOutZ which has the same data as `orig`
27629 * but with all dynamically-allocated buffers duplicated in new buffers.
27631 struct LDKCOption_TxOutZ COption_TxOutZ_clone(const struct LDKCOption_TxOutZ *NONNULL_PTR orig);
27634 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27636 void CVec_InputZ_free(struct LDKCVec_InputZ _res);
27639 * Creates a new CResult_CoinSelectionNoneZ in the success state.
27641 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_ok(struct LDKCoinSelection o);
27644 * Creates a new CResult_CoinSelectionNoneZ in the error state.
27646 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_err(void);
27649 * Checks if the given object is currently in the success state
27651 bool CResult_CoinSelectionNoneZ_is_ok(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR o);
27654 * Frees any resources used by the CResult_CoinSelectionNoneZ.
27656 void CResult_CoinSelectionNoneZ_free(struct LDKCResult_CoinSelectionNoneZ _res);
27659 * Creates a new CResult_CoinSelectionNoneZ which has the same data as `orig`
27660 * but with all dynamically-allocated buffers duplicated in new buffers.
27662 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_clone(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR orig);
27665 * Creates a new CResult_CVec_UtxoZNoneZ in the success state.
27667 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_ok(struct LDKCVec_UtxoZ o);
27670 * Creates a new CResult_CVec_UtxoZNoneZ in the error state.
27672 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_err(void);
27675 * Checks if the given object is currently in the success state
27677 bool CResult_CVec_UtxoZNoneZ_is_ok(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR o);
27680 * Frees any resources used by the CResult_CVec_UtxoZNoneZ.
27682 void CResult_CVec_UtxoZNoneZ_free(struct LDKCResult_CVec_UtxoZNoneZ _res);
27685 * Creates a new CResult_CVec_UtxoZNoneZ which has the same data as `orig`
27686 * but with all dynamically-allocated buffers duplicated in new buffers.
27688 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_clone(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR orig);
27691 * Constructs a new COption_PaymentContextZ containing a crate::lightning::blinded_path::payment::PaymentContext
27693 struct LDKCOption_PaymentContextZ COption_PaymentContextZ_some(struct LDKPaymentContext o);
27696 * Constructs a new COption_PaymentContextZ containing nothing
27698 struct LDKCOption_PaymentContextZ COption_PaymentContextZ_none(void);
27701 * Frees any resources associated with the crate::lightning::blinded_path::payment::PaymentContext, if we are in the Some state
27703 void COption_PaymentContextZ_free(struct LDKCOption_PaymentContextZ _res);
27706 * Creates a new COption_PaymentContextZ which has the same data as `orig`
27707 * but with all dynamically-allocated buffers duplicated in new buffers.
27709 struct LDKCOption_PaymentContextZ COption_PaymentContextZ_clone(const struct LDKCOption_PaymentContextZ *NONNULL_PTR orig);
27712 * Creates a new tuple which has the same data as `orig`
27713 * but with all dynamically-allocated buffers duplicated in new buffers.
27715 struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_clone(const struct LDKC2Tuple_u64u16Z *NONNULL_PTR orig);
27718 * Creates a new C2Tuple_u64u16Z from the contained elements.
27720 struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_new(uint64_t a, uint16_t b);
27723 * Frees any resources used by the C2Tuple_u64u16Z.
27725 void C2Tuple_u64u16Z_free(struct LDKC2Tuple_u64u16Z _res);
27728 * Constructs a new COption_C2Tuple_u64u16ZZ containing a crate::c_types::derived::C2Tuple_u64u16Z
27730 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_some(struct LDKC2Tuple_u64u16Z o);
27733 * Constructs a new COption_C2Tuple_u64u16ZZ containing nothing
27735 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_none(void);
27738 * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u16Z, if we are in the Some state
27740 void COption_C2Tuple_u64u16ZZ_free(struct LDKCOption_C2Tuple_u64u16ZZ _res);
27743 * Creates a new COption_C2Tuple_u64u16ZZ which has the same data as `orig`
27744 * but with all dynamically-allocated buffers duplicated in new buffers.
27746 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_clone(const struct LDKCOption_C2Tuple_u64u16ZZ *NONNULL_PTR orig);
27749 * Constructs a new COption_ChannelShutdownStateZ containing a crate::lightning::ln::channelmanager::ChannelShutdownState
27751 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_some(enum LDKChannelShutdownState o);
27754 * Constructs a new COption_ChannelShutdownStateZ containing nothing
27756 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_none(void);
27759 * Frees any resources associated with the crate::lightning::ln::channelmanager::ChannelShutdownState, if we are in the Some state
27761 void COption_ChannelShutdownStateZ_free(struct LDKCOption_ChannelShutdownStateZ _res);
27764 * Creates a new COption_ChannelShutdownStateZ which has the same data as `orig`
27765 * but with all dynamically-allocated buffers duplicated in new buffers.
27767 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_clone(const struct LDKCOption_ChannelShutdownStateZ *NONNULL_PTR orig);
27770 * Creates a new CResult_ChannelIdAPIErrorZ in the success state.
27772 struct LDKCResult_ChannelIdAPIErrorZ CResult_ChannelIdAPIErrorZ_ok(struct LDKChannelId o);
27775 * Creates a new CResult_ChannelIdAPIErrorZ in the error state.
27777 struct LDKCResult_ChannelIdAPIErrorZ CResult_ChannelIdAPIErrorZ_err(struct LDKAPIError e);
27780 * Checks if the given object is currently in the success state
27782 bool CResult_ChannelIdAPIErrorZ_is_ok(const struct LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR o);
27785 * Frees any resources used by the CResult_ChannelIdAPIErrorZ.
27787 void CResult_ChannelIdAPIErrorZ_free(struct LDKCResult_ChannelIdAPIErrorZ _res);
27790 * Creates a new CResult_ChannelIdAPIErrorZ which has the same data as `orig`
27791 * but with all dynamically-allocated buffers duplicated in new buffers.
27793 struct LDKCResult_ChannelIdAPIErrorZ CResult_ChannelIdAPIErrorZ_clone(const struct LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR orig);
27796 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27798 void CVec_RecentPaymentDetailsZ_free(struct LDKCVec_RecentPaymentDetailsZ _res);
27801 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
27803 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
27806 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
27808 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
27811 * Checks if the given object is currently in the success state
27813 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
27816 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
27818 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
27821 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
27822 * but with all dynamically-allocated buffers duplicated in new buffers.
27824 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
27827 * Creates a new CResult_NoneRetryableSendFailureZ in the success state.
27829 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_ok(void);
27832 * Creates a new CResult_NoneRetryableSendFailureZ in the error state.
27834 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
27837 * Checks if the given object is currently in the success state
27839 bool CResult_NoneRetryableSendFailureZ_is_ok(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR o);
27842 * Frees any resources used by the CResult_NoneRetryableSendFailureZ.
27844 void CResult_NoneRetryableSendFailureZ_free(struct LDKCResult_NoneRetryableSendFailureZ _res);
27847 * Creates a new CResult_NoneRetryableSendFailureZ which has the same data as `orig`
27848 * but with all dynamically-allocated buffers duplicated in new buffers.
27850 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_clone(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR orig);
27853 * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the success state.
27855 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
27858 * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the error state.
27860 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
27863 * Checks if the given object is currently in the success state
27865 bool CResult_ThirtyTwoBytesPaymentSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR o);
27868 * Frees any resources used by the CResult_ThirtyTwoBytesPaymentSendFailureZ.
27870 void CResult_ThirtyTwoBytesPaymentSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ _res);
27873 * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ which has the same data as `orig`
27874 * but with all dynamically-allocated buffers duplicated in new buffers.
27876 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR orig);
27879 * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ in the success state.
27881 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_ok(struct LDKThirtyTwoBytes o);
27884 * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ in the error state.
27886 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
27889 * Checks if the given object is currently in the success state
27891 bool CResult_ThirtyTwoBytesRetryableSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR o);
27894 * Frees any resources used by the CResult_ThirtyTwoBytesRetryableSendFailureZ.
27896 void CResult_ThirtyTwoBytesRetryableSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ _res);
27899 * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ which has the same data as `orig`
27900 * but with all dynamically-allocated buffers duplicated in new buffers.
27902 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR orig);
27905 * Creates a new tuple which has the same data as `orig`
27906 * but with all dynamically-allocated buffers duplicated in new buffers.
27908 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *NONNULL_PTR orig);
27911 * Creates a new C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ from the contained elements.
27913 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
27916 * Frees any resources used by the C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ.
27918 void C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_free(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ _res);
27921 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the success state.
27923 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o);
27926 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the error state.
27928 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
27931 * Checks if the given object is currently in the success state
27933 bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR o);
27936 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.
27938 void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ _res);
27941 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ which has the same data as `orig`
27942 * but with all dynamically-allocated buffers duplicated in new buffers.
27944 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR orig);
27947 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27949 void CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ _res);
27952 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the success state.
27954 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ o);
27957 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the error state.
27959 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_err(struct LDKProbeSendFailure e);
27962 * Checks if the given object is currently in the success state
27964 bool CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR o);
27967 * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.
27969 void CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ _res);
27972 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ which has the same data as `orig`
27973 * but with all dynamically-allocated buffers duplicated in new buffers.
27975 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR orig);
27978 * Creates a new tuple which has the same data as `orig`
27979 * but with all dynamically-allocated buffers duplicated in new buffers.
27981 struct LDKC2Tuple_ChannelIdPublicKeyZ C2Tuple_ChannelIdPublicKeyZ_clone(const struct LDKC2Tuple_ChannelIdPublicKeyZ *NONNULL_PTR orig);
27984 * Creates a new C2Tuple_ChannelIdPublicKeyZ from the contained elements.
27986 struct LDKC2Tuple_ChannelIdPublicKeyZ C2Tuple_ChannelIdPublicKeyZ_new(struct LDKChannelId a, struct LDKPublicKey b);
27989 * Frees any resources used by the C2Tuple_ChannelIdPublicKeyZ.
27991 void C2Tuple_ChannelIdPublicKeyZ_free(struct LDKC2Tuple_ChannelIdPublicKeyZ _res);
27994 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27996 void CVec_C2Tuple_ChannelIdPublicKeyZZ_free(struct LDKCVec_C2Tuple_ChannelIdPublicKeyZZ _res);
27999 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28001 void CVec_ChannelIdZ_free(struct LDKCVec_ChannelIdZ _res);
28004 * Creates a new CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ in the success state.
28006 struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(struct LDKOfferWithDerivedMetadataBuilder o);
28009 * Creates a new CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ in the error state.
28011 struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
28014 * Checks if the given object is currently in the success state
28016 bool CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
28019 * Frees any resources used by the CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ.
28021 void CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ _res);
28024 * Creates a new CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ which has the same data as `orig`
28025 * but with all dynamically-allocated buffers duplicated in new buffers.
28027 struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(const struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR orig);
28030 * Constructs a new COption_StrZ containing a crate::c_types::Str
28032 struct LDKCOption_StrZ COption_StrZ_some(struct LDKStr o);
28035 * Constructs a new COption_StrZ containing nothing
28037 struct LDKCOption_StrZ COption_StrZ_none(void);
28040 * Frees any resources associated with the crate::c_types::Str, if we are in the Some state
28042 void COption_StrZ_free(struct LDKCOption_StrZ _res);
28045 * Creates a new COption_StrZ which has the same data as `orig`
28046 * but with all dynamically-allocated buffers duplicated in new buffers.
28048 struct LDKCOption_StrZ COption_StrZ_clone(const struct LDKCOption_StrZ *NONNULL_PTR orig);
28051 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the success state.
28053 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o);
28056 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the error state.
28058 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_err(void);
28061 * Checks if the given object is currently in the success state
28063 bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR o);
28066 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ.
28068 void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ _res);
28071 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ which has the same data as `orig`
28072 * but with all dynamically-allocated buffers duplicated in new buffers.
28074 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR orig);
28077 * Creates a new CResult_ThirtyTwoBytesAPIErrorZ in the success state.
28079 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
28082 * Creates a new CResult_ThirtyTwoBytesAPIErrorZ in the error state.
28084 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_err(struct LDKAPIError e);
28087 * Checks if the given object is currently in the success state
28089 bool CResult_ThirtyTwoBytesAPIErrorZ_is_ok(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR o);
28092 * Frees any resources used by the CResult_ThirtyTwoBytesAPIErrorZ.
28094 void CResult_ThirtyTwoBytesAPIErrorZ_free(struct LDKCResult_ThirtyTwoBytesAPIErrorZ _res);
28097 * Creates a new CResult_ThirtyTwoBytesAPIErrorZ which has the same data as `orig`
28098 * but with all dynamically-allocated buffers duplicated in new buffers.
28100 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_clone(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR orig);
28103 * Constructs a new COption_OffersMessageZ containing a crate::lightning::onion_message::offers::OffersMessage
28105 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_some(struct LDKOffersMessage o);
28108 * Constructs a new COption_OffersMessageZ containing nothing
28110 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_none(void);
28113 * Frees any resources associated with the crate::lightning::onion_message::offers::OffersMessage, if we are in the Some state
28115 void COption_OffersMessageZ_free(struct LDKCOption_OffersMessageZ _res);
28118 * Creates a new COption_OffersMessageZ which has the same data as `orig`
28119 * but with all dynamically-allocated buffers duplicated in new buffers.
28121 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_clone(const struct LDKCOption_OffersMessageZ *NONNULL_PTR orig);
28124 * Creates a new tuple which has the same data as `orig`
28125 * but with all dynamically-allocated buffers duplicated in new buffers.
28127 struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ C3Tuple_OffersMessageDestinationBlindedPathZ_clone(const struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR orig);
28130 * Creates a new C3Tuple_OffersMessageDestinationBlindedPathZ from the contained elements.
28132 struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ C3Tuple_OffersMessageDestinationBlindedPathZ_new(struct LDKOffersMessage a, struct LDKDestination b, struct LDKBlindedPath c);
28135 * Frees any resources used by the C3Tuple_OffersMessageDestinationBlindedPathZ.
28137 void C3Tuple_OffersMessageDestinationBlindedPathZ_free(struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ _res);
28140 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28142 void CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ _res);
28145 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
28147 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
28150 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
28152 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
28155 * Checks if the given object is currently in the success state
28157 bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
28160 * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
28162 void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
28165 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
28166 * but with all dynamically-allocated buffers duplicated in new buffers.
28168 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
28171 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
28173 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
28176 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
28178 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
28181 * Checks if the given object is currently in the success state
28183 bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
28186 * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
28188 void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
28191 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
28192 * but with all dynamically-allocated buffers duplicated in new buffers.
28194 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
28197 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
28199 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
28202 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
28204 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
28207 * Checks if the given object is currently in the success state
28209 bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
28212 * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
28214 void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
28217 * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
28218 * but with all dynamically-allocated buffers duplicated in new buffers.
28220 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
28223 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
28225 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
28228 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
28230 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
28233 * Checks if the given object is currently in the success state
28235 bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
28238 * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
28240 void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
28243 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ which has the same data as `orig`
28244 * but with all dynamically-allocated buffers duplicated in new buffers.
28246 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig);
28249 * Creates a new CResult_BlindedForwardDecodeErrorZ in the success state.
28251 struct LDKCResult_BlindedForwardDecodeErrorZ CResult_BlindedForwardDecodeErrorZ_ok(struct LDKBlindedForward o);
28254 * Creates a new CResult_BlindedForwardDecodeErrorZ in the error state.
28256 struct LDKCResult_BlindedForwardDecodeErrorZ CResult_BlindedForwardDecodeErrorZ_err(struct LDKDecodeError e);
28259 * Checks if the given object is currently in the success state
28261 bool CResult_BlindedForwardDecodeErrorZ_is_ok(const struct LDKCResult_BlindedForwardDecodeErrorZ *NONNULL_PTR o);
28264 * Frees any resources used by the CResult_BlindedForwardDecodeErrorZ.
28266 void CResult_BlindedForwardDecodeErrorZ_free(struct LDKCResult_BlindedForwardDecodeErrorZ _res);
28269 * Creates a new CResult_BlindedForwardDecodeErrorZ which has the same data as `orig`
28270 * but with all dynamically-allocated buffers duplicated in new buffers.
28272 struct LDKCResult_BlindedForwardDecodeErrorZ CResult_BlindedForwardDecodeErrorZ_clone(const struct LDKCResult_BlindedForwardDecodeErrorZ *NONNULL_PTR orig);
28275 * Creates a new CResult_PendingHTLCRoutingDecodeErrorZ in the success state.
28277 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ CResult_PendingHTLCRoutingDecodeErrorZ_ok(struct LDKPendingHTLCRouting o);
28280 * Creates a new CResult_PendingHTLCRoutingDecodeErrorZ in the error state.
28282 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ CResult_PendingHTLCRoutingDecodeErrorZ_err(struct LDKDecodeError e);
28285 * Checks if the given object is currently in the success state
28287 bool CResult_PendingHTLCRoutingDecodeErrorZ_is_ok(const struct LDKCResult_PendingHTLCRoutingDecodeErrorZ *NONNULL_PTR o);
28290 * Frees any resources used by the CResult_PendingHTLCRoutingDecodeErrorZ.
28292 void CResult_PendingHTLCRoutingDecodeErrorZ_free(struct LDKCResult_PendingHTLCRoutingDecodeErrorZ _res);
28295 * Creates a new CResult_PendingHTLCRoutingDecodeErrorZ which has the same data as `orig`
28296 * but with all dynamically-allocated buffers duplicated in new buffers.
28298 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ CResult_PendingHTLCRoutingDecodeErrorZ_clone(const struct LDKCResult_PendingHTLCRoutingDecodeErrorZ *NONNULL_PTR orig);
28301 * Creates a new CResult_PendingHTLCInfoDecodeErrorZ in the success state.
28303 struct LDKCResult_PendingHTLCInfoDecodeErrorZ CResult_PendingHTLCInfoDecodeErrorZ_ok(struct LDKPendingHTLCInfo o);
28306 * Creates a new CResult_PendingHTLCInfoDecodeErrorZ in the error state.
28308 struct LDKCResult_PendingHTLCInfoDecodeErrorZ CResult_PendingHTLCInfoDecodeErrorZ_err(struct LDKDecodeError e);
28311 * Checks if the given object is currently in the success state
28313 bool CResult_PendingHTLCInfoDecodeErrorZ_is_ok(const struct LDKCResult_PendingHTLCInfoDecodeErrorZ *NONNULL_PTR o);
28316 * Frees any resources used by the CResult_PendingHTLCInfoDecodeErrorZ.
28318 void CResult_PendingHTLCInfoDecodeErrorZ_free(struct LDKCResult_PendingHTLCInfoDecodeErrorZ _res);
28321 * Creates a new CResult_PendingHTLCInfoDecodeErrorZ which has the same data as `orig`
28322 * but with all dynamically-allocated buffers duplicated in new buffers.
28324 struct LDKCResult_PendingHTLCInfoDecodeErrorZ CResult_PendingHTLCInfoDecodeErrorZ_clone(const struct LDKCResult_PendingHTLCInfoDecodeErrorZ *NONNULL_PTR orig);
28327 * Creates a new CResult_BlindedFailureDecodeErrorZ in the success state.
28329 struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_ok(enum LDKBlindedFailure o);
28332 * Creates a new CResult_BlindedFailureDecodeErrorZ in the error state.
28334 struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_err(struct LDKDecodeError e);
28337 * Checks if the given object is currently in the success state
28339 bool CResult_BlindedFailureDecodeErrorZ_is_ok(const struct LDKCResult_BlindedFailureDecodeErrorZ *NONNULL_PTR o);
28342 * Frees any resources used by the CResult_BlindedFailureDecodeErrorZ.
28344 void CResult_BlindedFailureDecodeErrorZ_free(struct LDKCResult_BlindedFailureDecodeErrorZ _res);
28347 * Creates a new CResult_BlindedFailureDecodeErrorZ which has the same data as `orig`
28348 * but with all dynamically-allocated buffers duplicated in new buffers.
28350 struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_clone(const struct LDKCResult_BlindedFailureDecodeErrorZ *NONNULL_PTR orig);
28353 * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the success state.
28355 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_ok(enum LDKChannelShutdownState o);
28358 * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the error state.
28360 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_err(struct LDKDecodeError e);
28363 * Checks if the given object is currently in the success state
28365 bool CResult_ChannelShutdownStateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR o);
28368 * Frees any resources used by the CResult_ChannelShutdownStateDecodeErrorZ.
28370 void CResult_ChannelShutdownStateDecodeErrorZ_free(struct LDKCResult_ChannelShutdownStateDecodeErrorZ _res);
28373 * Creates a new CResult_ChannelShutdownStateDecodeErrorZ which has the same data as `orig`
28374 * but with all dynamically-allocated buffers duplicated in new buffers.
28376 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_clone(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR orig);
28379 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28381 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
28384 * Creates a new C2Tuple_ThirtyTwoBytesChannelManagerZ from the contained elements.
28386 struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ C2Tuple_ThirtyTwoBytesChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
28389 * Frees any resources used by the C2Tuple_ThirtyTwoBytesChannelManagerZ.
28391 void C2Tuple_ThirtyTwoBytesChannelManagerZ_free(struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ _res);
28394 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the success state.
28396 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ o);
28399 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the error state.
28401 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
28404 * Checks if the given object is currently in the success state
28406 bool CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ *NONNULL_PTR o);
28409 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.
28411 void CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ _res);
28414 * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the success state.
28416 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_ok(struct LDKMaxDustHTLCExposure o);
28419 * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the error state.
28421 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_err(struct LDKDecodeError e);
28424 * Checks if the given object is currently in the success state
28426 bool CResult_MaxDustHTLCExposureDecodeErrorZ_is_ok(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR o);
28429 * Frees any resources used by the CResult_MaxDustHTLCExposureDecodeErrorZ.
28431 void CResult_MaxDustHTLCExposureDecodeErrorZ_free(struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ _res);
28434 * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ which has the same data as `orig`
28435 * but with all dynamically-allocated buffers duplicated in new buffers.
28437 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_clone(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR orig);
28440 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
28442 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
28445 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
28447 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
28450 * Checks if the given object is currently in the success state
28452 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
28455 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
28457 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
28460 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
28461 * but with all dynamically-allocated buffers duplicated in new buffers.
28463 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
28466 * Constructs a new COption_MaxDustHTLCExposureZ containing a crate::lightning::util::config::MaxDustHTLCExposure
28468 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_some(struct LDKMaxDustHTLCExposure o);
28471 * Constructs a new COption_MaxDustHTLCExposureZ containing nothing
28473 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_none(void);
28476 * Frees any resources associated with the crate::lightning::util::config::MaxDustHTLCExposure, if we are in the Some state
28478 void COption_MaxDustHTLCExposureZ_free(struct LDKCOption_MaxDustHTLCExposureZ _res);
28481 * Creates a new COption_MaxDustHTLCExposureZ which has the same data as `orig`
28482 * but with all dynamically-allocated buffers duplicated in new buffers.
28484 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_clone(const struct LDKCOption_MaxDustHTLCExposureZ *NONNULL_PTR orig);
28487 * Constructs a new COption_APIErrorZ containing a crate::lightning::util::errors::APIError
28489 struct LDKCOption_APIErrorZ COption_APIErrorZ_some(struct LDKAPIError o);
28492 * Constructs a new COption_APIErrorZ containing nothing
28494 struct LDKCOption_APIErrorZ COption_APIErrorZ_none(void);
28497 * Frees any resources associated with the crate::lightning::util::errors::APIError, if we are in the Some state
28499 void COption_APIErrorZ_free(struct LDKCOption_APIErrorZ _res);
28502 * Creates a new COption_APIErrorZ which has the same data as `orig`
28503 * but with all dynamically-allocated buffers duplicated in new buffers.
28505 struct LDKCOption_APIErrorZ COption_APIErrorZ_clone(const struct LDKCOption_APIErrorZ *NONNULL_PTR orig);
28508 * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the success state.
28510 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_ok(struct LDKCOption_APIErrorZ o);
28513 * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the error state.
28515 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_err(struct LDKDecodeError e);
28518 * Checks if the given object is currently in the success state
28520 bool CResult_COption_APIErrorZDecodeErrorZ_is_ok(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR o);
28523 * Frees any resources used by the CResult_COption_APIErrorZDecodeErrorZ.
28525 void CResult_COption_APIErrorZDecodeErrorZ_free(struct LDKCResult_COption_APIErrorZDecodeErrorZ _res);
28528 * Creates a new CResult_COption_APIErrorZDecodeErrorZ which has the same data as `orig`
28529 * but with all dynamically-allocated buffers duplicated in new buffers.
28531 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_clone(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR orig);
28534 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
28536 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
28539 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
28541 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
28544 * Checks if the given object is currently in the success state
28546 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
28549 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
28551 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
28554 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
28555 * but with all dynamically-allocated buffers duplicated in new buffers.
28557 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
28560 * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
28562 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
28565 * Constructs a new COption_MonitorEventZ containing nothing
28567 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
28570 * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
28572 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
28575 * Creates a new COption_MonitorEventZ which has the same data as `orig`
28576 * but with all dynamically-allocated buffers duplicated in new buffers.
28578 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
28581 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
28583 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
28586 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
28588 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
28591 * Checks if the given object is currently in the success state
28593 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
28596 * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
28598 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
28601 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
28602 * but with all dynamically-allocated buffers duplicated in new buffers.
28604 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
28607 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
28609 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
28612 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
28614 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
28617 * Checks if the given object is currently in the success state
28619 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
28622 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
28624 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
28627 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
28628 * but with all dynamically-allocated buffers duplicated in new buffers.
28630 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
28633 * Creates a new tuple which has the same data as `orig`
28634 * but with all dynamically-allocated buffers duplicated in new buffers.
28636 struct LDKC2Tuple_OutPointCVec_u8ZZ C2Tuple_OutPointCVec_u8ZZ_clone(const struct LDKC2Tuple_OutPointCVec_u8ZZ *NONNULL_PTR orig);
28639 * Creates a new C2Tuple_OutPointCVec_u8ZZ from the contained elements.
28641 struct LDKC2Tuple_OutPointCVec_u8ZZ C2Tuple_OutPointCVec_u8ZZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
28644 * Frees any resources used by the C2Tuple_OutPointCVec_u8ZZ.
28646 void C2Tuple_OutPointCVec_u8ZZ_free(struct LDKC2Tuple_OutPointCVec_u8ZZ _res);
28649 * Creates a new tuple which has the same data as `orig`
28650 * but with all dynamically-allocated buffers duplicated in new buffers.
28652 struct LDKC2Tuple_u32CVec_u8ZZ C2Tuple_u32CVec_u8ZZ_clone(const struct LDKC2Tuple_u32CVec_u8ZZ *NONNULL_PTR orig);
28655 * Creates a new C2Tuple_u32CVec_u8ZZ from the contained elements.
28657 struct LDKC2Tuple_u32CVec_u8ZZ C2Tuple_u32CVec_u8ZZ_new(uint32_t a, struct LDKCVec_u8Z b);
28660 * Frees any resources used by the C2Tuple_u32CVec_u8ZZ.
28662 void C2Tuple_u32CVec_u8ZZ_free(struct LDKC2Tuple_u32CVec_u8ZZ _res);
28665 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28667 void CVec_C2Tuple_u32CVec_u8ZZZ_free(struct LDKCVec_C2Tuple_u32CVec_u8ZZZ _res);
28670 * Creates a new tuple which has the same data as `orig`
28671 * but with all dynamically-allocated buffers duplicated in new buffers.
28673 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *NONNULL_PTR orig);
28676 * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ from the contained elements.
28678 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32CVec_u8ZZZ b);
28681 * Frees any resources used by the C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ.
28683 void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ _res);
28686 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28688 void CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ _res);
28691 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28693 void CVec_CommitmentTransactionZ_free(struct LDKCVec_CommitmentTransactionZ _res);
28696 * Creates a new tuple which has the same data as `orig`
28697 * but with all dynamically-allocated buffers duplicated in new buffers.
28699 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
28702 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
28704 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
28707 * Frees any resources used by the C2Tuple_u32TxOutZ.
28709 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
28712 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28714 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
28717 * Creates a new tuple which has the same data as `orig`
28718 * but with all dynamically-allocated buffers duplicated in new buffers.
28720 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
28723 * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ from the contained elements.
28725 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
28728 * Frees any resources used by the C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ.
28730 void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ _res);
28733 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28735 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
28738 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28740 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
28743 * Creates a new tuple which has the same data as `orig`
28744 * but with all dynamically-allocated buffers duplicated in new buffers.
28746 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *NONNULL_PTR orig);
28749 * Creates a new C2Tuple_ThirtyTwoBytesChannelMonitorZ from the contained elements.
28751 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
28754 * Frees any resources used by the C2Tuple_ThirtyTwoBytesChannelMonitorZ.
28756 void C2Tuple_ThirtyTwoBytesChannelMonitorZ_free(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ _res);
28759 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the success state.
28761 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ o);
28764 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the error state.
28766 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
28769 * Checks if the given object is currently in the success state
28771 bool CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
28774 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.
28776 void CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ _res);
28779 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ which has the same data as `orig`
28780 * but with all dynamically-allocated buffers duplicated in new buffers.
28782 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ *NONNULL_PTR orig);
28785 * Creates a new tuple which has the same data as `orig`
28786 * but with all dynamically-allocated buffers duplicated in new buffers.
28788 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_clone(const struct LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR orig);
28791 * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
28793 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
28796 * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
28798 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
28801 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28803 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
28806 * Creates a new tuple which has the same data as `orig`
28807 * but with all dynamically-allocated buffers duplicated in new buffers.
28809 struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(const struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR orig);
28812 * Creates a new C2Tuple_PublicKeyCVec_SocketAddressZZ from the contained elements.
28814 struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ C2Tuple_PublicKeyCVec_SocketAddressZZ_new(struct LDKPublicKey a, struct LDKCVec_SocketAddressZ b);
28817 * Frees any resources used by the C2Tuple_PublicKeyCVec_SocketAddressZZ.
28819 void C2Tuple_PublicKeyCVec_SocketAddressZZ_free(struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ _res);
28822 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28824 void CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_free(struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ _res);
28827 * Constructs a new COption_OnionMessageContentsZ containing a crate::lightning::onion_message::packet::OnionMessageContents
28829 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_some(struct LDKOnionMessageContents o);
28832 * Constructs a new COption_OnionMessageContentsZ containing nothing
28834 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_none(void);
28837 * Frees any resources associated with the crate::lightning::onion_message::packet::OnionMessageContents, if we are in the Some state
28839 void COption_OnionMessageContentsZ_free(struct LDKCOption_OnionMessageContentsZ _res);
28842 * Creates a new COption_OnionMessageContentsZ which has the same data as `orig`
28843 * but with all dynamically-allocated buffers duplicated in new buffers.
28845 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_clone(const struct LDKCOption_OnionMessageContentsZ *NONNULL_PTR orig);
28848 * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ in the success state.
28850 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_ok(struct LDKCOption_OnionMessageContentsZ o);
28853 * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ in the error state.
28855 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_err(struct LDKDecodeError e);
28858 * Checks if the given object is currently in the success state
28860 bool CResult_COption_OnionMessageContentsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR o);
28863 * Frees any resources used by the CResult_COption_OnionMessageContentsZDecodeErrorZ.
28865 void CResult_COption_OnionMessageContentsZDecodeErrorZ_free(struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ _res);
28868 * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ which has the same data as `orig`
28869 * but with all dynamically-allocated buffers duplicated in new buffers.
28871 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_clone(const struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR orig);
28874 * Creates a new tuple which has the same data as `orig`
28875 * but with all dynamically-allocated buffers duplicated in new buffers.
28877 struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(const struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR orig);
28880 * Creates a new C3Tuple_OnionMessageContentsDestinationBlindedPathZ from the contained elements.
28882 struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(struct LDKOnionMessageContents a, struct LDKDestination b, struct LDKBlindedPath c);
28885 * Frees any resources used by the C3Tuple_OnionMessageContentsDestinationBlindedPathZ.
28887 void C3Tuple_OnionMessageContentsDestinationBlindedPathZ_free(struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ _res);
28890 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28892 void CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_free(struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ _res);
28895 * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
28897 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
28900 * Constructs a new COption_TypeZ containing nothing
28902 struct LDKCOption_TypeZ COption_TypeZ_none(void);
28905 * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
28907 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
28910 * Creates a new COption_TypeZ which has the same data as `orig`
28911 * but with all dynamically-allocated buffers duplicated in new buffers.
28913 struct LDKCOption_TypeZ COption_TypeZ_clone(const struct LDKCOption_TypeZ *NONNULL_PTR orig);
28916 * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
28918 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
28921 * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
28923 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
28926 * Checks if the given object is currently in the success state
28928 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
28931 * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
28933 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
28936 * Creates a new CResult_COption_TypeZDecodeErrorZ which has the same data as `orig`
28937 * but with all dynamically-allocated buffers duplicated in new buffers.
28939 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_clone(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR orig);
28942 * Constructs a new COption_SocketAddressZ containing a crate::lightning::ln::msgs::SocketAddress
28944 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_some(struct LDKSocketAddress o);
28947 * Constructs a new COption_SocketAddressZ containing nothing
28949 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_none(void);
28952 * Frees any resources associated with the crate::lightning::ln::msgs::SocketAddress, if we are in the Some state
28954 void COption_SocketAddressZ_free(struct LDKCOption_SocketAddressZ _res);
28957 * Creates a new COption_SocketAddressZ which has the same data as `orig`
28958 * but with all dynamically-allocated buffers duplicated in new buffers.
28960 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_clone(const struct LDKCOption_SocketAddressZ *NONNULL_PTR orig);
28963 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28965 void CVec_PeerDetailsZ_free(struct LDKCVec_PeerDetailsZ _res);
28968 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
28970 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
28973 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
28975 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
28978 * Checks if the given object is currently in the success state
28980 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
28983 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
28985 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
28988 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
28989 * but with all dynamically-allocated buffers duplicated in new buffers.
28991 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
28994 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
28996 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
28999 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
29001 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
29004 * Checks if the given object is currently in the success state
29006 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
29009 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
29011 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
29014 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
29015 * but with all dynamically-allocated buffers duplicated in new buffers.
29017 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
29020 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
29022 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
29025 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
29027 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
29030 * Checks if the given object is currently in the success state
29032 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
29035 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
29037 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
29040 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
29041 * but with all dynamically-allocated buffers duplicated in new buffers.
29043 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
29046 * Creates a new CResult_u32GraphSyncErrorZ in the success state.
29048 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o);
29051 * Creates a new CResult_u32GraphSyncErrorZ in the error state.
29053 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e);
29056 * Checks if the given object is currently in the success state
29058 bool CResult_u32GraphSyncErrorZ_is_ok(const struct LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR o);
29061 * Frees any resources used by the CResult_u32GraphSyncErrorZ.
29063 void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res);
29066 * Creates a new CResult_CVec_u8ZIOErrorZ in the success state.
29068 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_ok(struct LDKCVec_u8Z o);
29071 * Creates a new CResult_CVec_u8ZIOErrorZ in the error state.
29073 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_err(enum LDKIOError e);
29076 * Checks if the given object is currently in the success state
29078 bool CResult_CVec_u8ZIOErrorZ_is_ok(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR o);
29081 * Frees any resources used by the CResult_CVec_u8ZIOErrorZ.
29083 void CResult_CVec_u8ZIOErrorZ_free(struct LDKCResult_CVec_u8ZIOErrorZ _res);
29086 * Creates a new CResult_CVec_u8ZIOErrorZ which has the same data as `orig`
29087 * but with all dynamically-allocated buffers duplicated in new buffers.
29089 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_clone(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR orig);
29092 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29094 void CVec_StrZ_free(struct LDKCVec_StrZ _res);
29097 * Creates a new CResult_CVec_StrZIOErrorZ in the success state.
29099 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_ok(struct LDKCVec_StrZ o);
29102 * Creates a new CResult_CVec_StrZIOErrorZ in the error state.
29104 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_err(enum LDKIOError e);
29107 * Checks if the given object is currently in the success state
29109 bool CResult_CVec_StrZIOErrorZ_is_ok(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR o);
29112 * Frees any resources used by the CResult_CVec_StrZIOErrorZ.
29114 void CResult_CVec_StrZIOErrorZ_free(struct LDKCResult_CVec_StrZIOErrorZ _res);
29117 * Creates a new CResult_CVec_StrZIOErrorZ which has the same data as `orig`
29118 * but with all dynamically-allocated buffers duplicated in new buffers.
29120 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_clone(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR orig);
29123 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29125 void CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ _res);
29128 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the success state.
29130 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ o);
29133 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the error state.
29135 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_err(enum LDKIOError e);
29138 * Checks if the given object is currently in the success state
29140 bool CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR o);
29143 * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ.
29145 void CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ _res);
29148 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ which has the same data as `orig`
29149 * but with all dynamically-allocated buffers duplicated in new buffers.
29151 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR orig);
29154 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the success state.
29156 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ o);
29159 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the error state.
29161 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_err(enum LDKIOError e);
29164 * Checks if the given object is currently in the success state
29166 bool CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR o);
29169 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ.
29171 void CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ _res);
29174 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ which has the same data as `orig`
29175 * but with all dynamically-allocated buffers duplicated in new buffers.
29177 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR orig);
29180 * Creates a new CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ in the success state.
29182 struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_ok(struct LDKUnsignedInvoiceRequest o);
29185 * Creates a new CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ in the error state.
29187 struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
29190 * Checks if the given object is currently in the success state
29192 bool CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok(const struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR o);
29195 * Frees any resources used by the CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ.
29197 void CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_free(struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ _res);
29200 * Creates a new CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ which has the same data as `orig`
29201 * but with all dynamically-allocated buffers duplicated in new buffers.
29203 struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone(const struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR orig);
29206 * Creates a new CResult_InvoiceRequestBolt12SemanticErrorZ in the success state.
29208 struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_ok(struct LDKInvoiceRequest o);
29211 * Creates a new CResult_InvoiceRequestBolt12SemanticErrorZ in the error state.
29213 struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
29216 * Checks if the given object is currently in the success state
29218 bool CResult_InvoiceRequestBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR o);
29221 * Frees any resources used by the CResult_InvoiceRequestBolt12SemanticErrorZ.
29223 void CResult_InvoiceRequestBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ _res);
29226 * Creates a new CResult_InvoiceRequestBolt12SemanticErrorZ which has the same data as `orig`
29227 * but with all dynamically-allocated buffers duplicated in new buffers.
29229 struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_clone(const struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR orig);
29232 * Constructs a new COption_SecretKeyZ containing a crate::c_types::SecretKey
29234 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_some(struct LDKSecretKey o);
29237 * Constructs a new COption_SecretKeyZ containing nothing
29239 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_none(void);
29242 * Frees any resources associated with the crate::c_types::SecretKey, if we are in the Some state
29244 void COption_SecretKeyZ_free(struct LDKCOption_SecretKeyZ _res);
29247 * Creates a new COption_SecretKeyZ which has the same data as `orig`
29248 * but with all dynamically-allocated buffers duplicated in new buffers.
29250 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_clone(const struct LDKCOption_SecretKeyZ *NONNULL_PTR orig);
29253 * Creates a new CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ in the success state.
29255 struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceWithExplicitSigningPubkeyBuilder o);
29258 * Creates a new CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ in the error state.
29260 struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
29263 * Checks if the given object is currently in the success state
29265 bool CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
29268 * Frees any resources used by the CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ.
29270 void CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ _res);
29273 * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the success state.
29275 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_ok(struct LDKVerifiedInvoiceRequest o);
29278 * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the error state.
29280 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_err(void);
29283 * Checks if the given object is currently in the success state
29285 bool CResult_VerifiedInvoiceRequestNoneZ_is_ok(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR o);
29288 * Frees any resources used by the CResult_VerifiedInvoiceRequestNoneZ.
29290 void CResult_VerifiedInvoiceRequestNoneZ_free(struct LDKCResult_VerifiedInvoiceRequestNoneZ _res);
29293 * Creates a new CResult_VerifiedInvoiceRequestNoneZ which has the same data as `orig`
29294 * but with all dynamically-allocated buffers duplicated in new buffers.
29296 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_clone(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR orig);
29299 * Creates a new CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ in the success state.
29301 struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceWithDerivedSigningPubkeyBuilder o);
29304 * Creates a new CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ in the error state.
29306 struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
29309 * Checks if the given object is currently in the success state
29311 bool CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
29314 * Frees any resources used by the CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ.
29316 void CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ _res);
29319 * Creates a new CResult_InvoiceRequestFieldsDecodeErrorZ in the success state.
29321 struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ CResult_InvoiceRequestFieldsDecodeErrorZ_ok(struct LDKInvoiceRequestFields o);
29324 * Creates a new CResult_InvoiceRequestFieldsDecodeErrorZ in the error state.
29326 struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ CResult_InvoiceRequestFieldsDecodeErrorZ_err(struct LDKDecodeError e);
29329 * Checks if the given object is currently in the success state
29331 bool CResult_InvoiceRequestFieldsDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR o);
29334 * Frees any resources used by the CResult_InvoiceRequestFieldsDecodeErrorZ.
29336 void CResult_InvoiceRequestFieldsDecodeErrorZ_free(struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ _res);
29339 * Creates a new CResult_InvoiceRequestFieldsDecodeErrorZ which has the same data as `orig`
29340 * but with all dynamically-allocated buffers duplicated in new buffers.
29342 struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ CResult_InvoiceRequestFieldsDecodeErrorZ_clone(const struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR orig);
29345 * Constructs a new COption_NoneZ containing a
29347 enum LDKCOption_NoneZ COption_NoneZ_some(void);
29350 * Constructs a new COption_NoneZ containing nothing
29352 enum LDKCOption_NoneZ COption_NoneZ_none(void);
29355 * Frees any resources associated with the , if we are in the Some state
29357 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
29360 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29362 void CVec_WitnessZ_free(struct LDKCVec_WitnessZ _res);
29365 * Constructs a new COption_ECDSASignatureZ containing a crate::c_types::ECDSASignature
29367 struct LDKCOption_ECDSASignatureZ COption_ECDSASignatureZ_some(struct LDKECDSASignature o);
29370 * Constructs a new COption_ECDSASignatureZ containing nothing
29372 struct LDKCOption_ECDSASignatureZ COption_ECDSASignatureZ_none(void);
29375 * Frees any resources associated with the crate::c_types::ECDSASignature, if we are in the Some state
29377 void COption_ECDSASignatureZ_free(struct LDKCOption_ECDSASignatureZ _res);
29380 * Creates a new COption_ECDSASignatureZ which has the same data as `orig`
29381 * but with all dynamically-allocated buffers duplicated in new buffers.
29383 struct LDKCOption_ECDSASignatureZ COption_ECDSASignatureZ_clone(const struct LDKCOption_ECDSASignatureZ *NONNULL_PTR orig);
29386 * Constructs a new COption_i64Z containing a i64
29388 struct LDKCOption_i64Z COption_i64Z_some(int64_t o);
29391 * Constructs a new COption_i64Z containing nothing
29393 struct LDKCOption_i64Z COption_i64Z_none(void);
29396 * Frees any resources associated with the i64, if we are in the Some state
29398 void COption_i64Z_free(struct LDKCOption_i64Z _res);
29401 * Creates a new COption_i64Z which has the same data as `orig`
29402 * but with all dynamically-allocated buffers duplicated in new buffers.
29404 struct LDKCOption_i64Z COption_i64Z_clone(const struct LDKCOption_i64Z *NONNULL_PTR orig);
29407 * Creates a new CResult_SocketAddressDecodeErrorZ in the success state.
29409 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_ok(struct LDKSocketAddress o);
29412 * Creates a new CResult_SocketAddressDecodeErrorZ in the error state.
29414 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_err(struct LDKDecodeError e);
29417 * Checks if the given object is currently in the success state
29419 bool CResult_SocketAddressDecodeErrorZ_is_ok(const struct LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR o);
29422 * Frees any resources used by the CResult_SocketAddressDecodeErrorZ.
29424 void CResult_SocketAddressDecodeErrorZ_free(struct LDKCResult_SocketAddressDecodeErrorZ _res);
29427 * Creates a new CResult_SocketAddressDecodeErrorZ which has the same data as `orig`
29428 * but with all dynamically-allocated buffers duplicated in new buffers.
29430 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_clone(const struct LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR orig);
29433 * Creates a new CResult_SocketAddressSocketAddressParseErrorZ in the success state.
29435 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_ok(struct LDKSocketAddress o);
29438 * Creates a new CResult_SocketAddressSocketAddressParseErrorZ in the error state.
29440 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_err(enum LDKSocketAddressParseError e);
29443 * Checks if the given object is currently in the success state
29445 bool CResult_SocketAddressSocketAddressParseErrorZ_is_ok(const struct LDKCResult_SocketAddressSocketAddressParseErrorZ *NONNULL_PTR o);
29448 * Frees any resources used by the CResult_SocketAddressSocketAddressParseErrorZ.
29450 void CResult_SocketAddressSocketAddressParseErrorZ_free(struct LDKCResult_SocketAddressSocketAddressParseErrorZ _res);
29453 * Creates a new CResult_SocketAddressSocketAddressParseErrorZ which has the same data as `orig`
29454 * but with all dynamically-allocated buffers duplicated in new buffers.
29456 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_clone(const struct LDKCResult_SocketAddressSocketAddressParseErrorZ *NONNULL_PTR orig);
29459 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29461 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
29464 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29466 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
29469 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29471 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
29474 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29476 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
29479 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
29481 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
29484 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
29486 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
29489 * Checks if the given object is currently in the success state
29491 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
29494 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
29496 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
29499 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
29500 * but with all dynamically-allocated buffers duplicated in new buffers.
29502 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
29505 * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the success state.
29507 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_ok(struct LDKAcceptChannelV2 o);
29510 * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the error state.
29512 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
29515 * Checks if the given object is currently in the success state
29517 bool CResult_AcceptChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR o);
29520 * Frees any resources used by the CResult_AcceptChannelV2DecodeErrorZ.
29522 void CResult_AcceptChannelV2DecodeErrorZ_free(struct LDKCResult_AcceptChannelV2DecodeErrorZ _res);
29525 * Creates a new CResult_AcceptChannelV2DecodeErrorZ which has the same data as `orig`
29526 * but with all dynamically-allocated buffers duplicated in new buffers.
29528 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_clone(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR orig);
29531 * Creates a new CResult_StfuDecodeErrorZ in the success state.
29533 struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_ok(struct LDKStfu o);
29536 * Creates a new CResult_StfuDecodeErrorZ in the error state.
29538 struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_err(struct LDKDecodeError e);
29541 * Checks if the given object is currently in the success state
29543 bool CResult_StfuDecodeErrorZ_is_ok(const struct LDKCResult_StfuDecodeErrorZ *NONNULL_PTR o);
29546 * Frees any resources used by the CResult_StfuDecodeErrorZ.
29548 void CResult_StfuDecodeErrorZ_free(struct LDKCResult_StfuDecodeErrorZ _res);
29551 * Creates a new CResult_StfuDecodeErrorZ which has the same data as `orig`
29552 * but with all dynamically-allocated buffers duplicated in new buffers.
29554 struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_clone(const struct LDKCResult_StfuDecodeErrorZ *NONNULL_PTR orig);
29557 * Creates a new CResult_SpliceDecodeErrorZ in the success state.
29559 struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_ok(struct LDKSplice o);
29562 * Creates a new CResult_SpliceDecodeErrorZ in the error state.
29564 struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_err(struct LDKDecodeError e);
29567 * Checks if the given object is currently in the success state
29569 bool CResult_SpliceDecodeErrorZ_is_ok(const struct LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR o);
29572 * Frees any resources used by the CResult_SpliceDecodeErrorZ.
29574 void CResult_SpliceDecodeErrorZ_free(struct LDKCResult_SpliceDecodeErrorZ _res);
29577 * Creates a new CResult_SpliceDecodeErrorZ which has the same data as `orig`
29578 * but with all dynamically-allocated buffers duplicated in new buffers.
29580 struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_clone(const struct LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR orig);
29583 * Creates a new CResult_SpliceAckDecodeErrorZ in the success state.
29585 struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_ok(struct LDKSpliceAck o);
29588 * Creates a new CResult_SpliceAckDecodeErrorZ in the error state.
29590 struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_err(struct LDKDecodeError e);
29593 * Checks if the given object is currently in the success state
29595 bool CResult_SpliceAckDecodeErrorZ_is_ok(const struct LDKCResult_SpliceAckDecodeErrorZ *NONNULL_PTR o);
29598 * Frees any resources used by the CResult_SpliceAckDecodeErrorZ.
29600 void CResult_SpliceAckDecodeErrorZ_free(struct LDKCResult_SpliceAckDecodeErrorZ _res);
29603 * Creates a new CResult_SpliceAckDecodeErrorZ which has the same data as `orig`
29604 * but with all dynamically-allocated buffers duplicated in new buffers.
29606 struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_clone(const struct LDKCResult_SpliceAckDecodeErrorZ *NONNULL_PTR orig);
29609 * Creates a new CResult_SpliceLockedDecodeErrorZ in the success state.
29611 struct LDKCResult_SpliceLockedDecodeErrorZ CResult_SpliceLockedDecodeErrorZ_ok(struct LDKSpliceLocked o);
29614 * Creates a new CResult_SpliceLockedDecodeErrorZ in the error state.
29616 struct LDKCResult_SpliceLockedDecodeErrorZ CResult_SpliceLockedDecodeErrorZ_err(struct LDKDecodeError e);
29619 * Checks if the given object is currently in the success state
29621 bool CResult_SpliceLockedDecodeErrorZ_is_ok(const struct LDKCResult_SpliceLockedDecodeErrorZ *NONNULL_PTR o);
29624 * Frees any resources used by the CResult_SpliceLockedDecodeErrorZ.
29626 void CResult_SpliceLockedDecodeErrorZ_free(struct LDKCResult_SpliceLockedDecodeErrorZ _res);
29629 * Creates a new CResult_SpliceLockedDecodeErrorZ which has the same data as `orig`
29630 * but with all dynamically-allocated buffers duplicated in new buffers.
29632 struct LDKCResult_SpliceLockedDecodeErrorZ CResult_SpliceLockedDecodeErrorZ_clone(const struct LDKCResult_SpliceLockedDecodeErrorZ *NONNULL_PTR orig);
29635 * Creates a new CResult_TxAddInputDecodeErrorZ in the success state.
29637 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_ok(struct LDKTxAddInput o);
29640 * Creates a new CResult_TxAddInputDecodeErrorZ in the error state.
29642 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_err(struct LDKDecodeError e);
29645 * Checks if the given object is currently in the success state
29647 bool CResult_TxAddInputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR o);
29650 * Frees any resources used by the CResult_TxAddInputDecodeErrorZ.
29652 void CResult_TxAddInputDecodeErrorZ_free(struct LDKCResult_TxAddInputDecodeErrorZ _res);
29655 * Creates a new CResult_TxAddInputDecodeErrorZ which has the same data as `orig`
29656 * but with all dynamically-allocated buffers duplicated in new buffers.
29658 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_clone(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR orig);
29661 * Creates a new CResult_TxAddOutputDecodeErrorZ in the success state.
29663 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_ok(struct LDKTxAddOutput o);
29666 * Creates a new CResult_TxAddOutputDecodeErrorZ in the error state.
29668 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_err(struct LDKDecodeError e);
29671 * Checks if the given object is currently in the success state
29673 bool CResult_TxAddOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR o);
29676 * Frees any resources used by the CResult_TxAddOutputDecodeErrorZ.
29678 void CResult_TxAddOutputDecodeErrorZ_free(struct LDKCResult_TxAddOutputDecodeErrorZ _res);
29681 * Creates a new CResult_TxAddOutputDecodeErrorZ which has the same data as `orig`
29682 * but with all dynamically-allocated buffers duplicated in new buffers.
29684 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_clone(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR orig);
29687 * Creates a new CResult_TxRemoveInputDecodeErrorZ in the success state.
29689 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_ok(struct LDKTxRemoveInput o);
29692 * Creates a new CResult_TxRemoveInputDecodeErrorZ in the error state.
29694 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_err(struct LDKDecodeError e);
29697 * Checks if the given object is currently in the success state
29699 bool CResult_TxRemoveInputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR o);
29702 * Frees any resources used by the CResult_TxRemoveInputDecodeErrorZ.
29704 void CResult_TxRemoveInputDecodeErrorZ_free(struct LDKCResult_TxRemoveInputDecodeErrorZ _res);
29707 * Creates a new CResult_TxRemoveInputDecodeErrorZ which has the same data as `orig`
29708 * but with all dynamically-allocated buffers duplicated in new buffers.
29710 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR orig);
29713 * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the success state.
29715 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_ok(struct LDKTxRemoveOutput o);
29718 * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the error state.
29720 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_err(struct LDKDecodeError e);
29723 * Checks if the given object is currently in the success state
29725 bool CResult_TxRemoveOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR o);
29728 * Frees any resources used by the CResult_TxRemoveOutputDecodeErrorZ.
29730 void CResult_TxRemoveOutputDecodeErrorZ_free(struct LDKCResult_TxRemoveOutputDecodeErrorZ _res);
29733 * Creates a new CResult_TxRemoveOutputDecodeErrorZ which has the same data as `orig`
29734 * but with all dynamically-allocated buffers duplicated in new buffers.
29736 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR orig);
29739 * Creates a new CResult_TxCompleteDecodeErrorZ in the success state.
29741 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_ok(struct LDKTxComplete o);
29744 * Creates a new CResult_TxCompleteDecodeErrorZ in the error state.
29746 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_err(struct LDKDecodeError e);
29749 * Checks if the given object is currently in the success state
29751 bool CResult_TxCompleteDecodeErrorZ_is_ok(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR o);
29754 * Frees any resources used by the CResult_TxCompleteDecodeErrorZ.
29756 void CResult_TxCompleteDecodeErrorZ_free(struct LDKCResult_TxCompleteDecodeErrorZ _res);
29759 * Creates a new CResult_TxCompleteDecodeErrorZ which has the same data as `orig`
29760 * but with all dynamically-allocated buffers duplicated in new buffers.
29762 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_clone(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR orig);
29765 * Creates a new CResult_TxSignaturesDecodeErrorZ in the success state.
29767 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_ok(struct LDKTxSignatures o);
29770 * Creates a new CResult_TxSignaturesDecodeErrorZ in the error state.
29772 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
29775 * Checks if the given object is currently in the success state
29777 bool CResult_TxSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR o);
29780 * Frees any resources used by the CResult_TxSignaturesDecodeErrorZ.
29782 void CResult_TxSignaturesDecodeErrorZ_free(struct LDKCResult_TxSignaturesDecodeErrorZ _res);
29785 * Creates a new CResult_TxSignaturesDecodeErrorZ which has the same data as `orig`
29786 * but with all dynamically-allocated buffers duplicated in new buffers.
29788 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_clone(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR orig);
29791 * Creates a new CResult_TxInitRbfDecodeErrorZ in the success state.
29793 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_ok(struct LDKTxInitRbf o);
29796 * Creates a new CResult_TxInitRbfDecodeErrorZ in the error state.
29798 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_err(struct LDKDecodeError e);
29801 * Checks if the given object is currently in the success state
29803 bool CResult_TxInitRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR o);
29806 * Frees any resources used by the CResult_TxInitRbfDecodeErrorZ.
29808 void CResult_TxInitRbfDecodeErrorZ_free(struct LDKCResult_TxInitRbfDecodeErrorZ _res);
29811 * Creates a new CResult_TxInitRbfDecodeErrorZ which has the same data as `orig`
29812 * but with all dynamically-allocated buffers duplicated in new buffers.
29814 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_clone(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR orig);
29817 * Creates a new CResult_TxAckRbfDecodeErrorZ in the success state.
29819 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_ok(struct LDKTxAckRbf o);
29822 * Creates a new CResult_TxAckRbfDecodeErrorZ in the error state.
29824 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_err(struct LDKDecodeError e);
29827 * Checks if the given object is currently in the success state
29829 bool CResult_TxAckRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR o);
29832 * Frees any resources used by the CResult_TxAckRbfDecodeErrorZ.
29834 void CResult_TxAckRbfDecodeErrorZ_free(struct LDKCResult_TxAckRbfDecodeErrorZ _res);
29837 * Creates a new CResult_TxAckRbfDecodeErrorZ which has the same data as `orig`
29838 * but with all dynamically-allocated buffers duplicated in new buffers.
29840 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_clone(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR orig);
29843 * Creates a new CResult_TxAbortDecodeErrorZ in the success state.
29845 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_ok(struct LDKTxAbort o);
29848 * Creates a new CResult_TxAbortDecodeErrorZ in the error state.
29850 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_err(struct LDKDecodeError e);
29853 * Checks if the given object is currently in the success state
29855 bool CResult_TxAbortDecodeErrorZ_is_ok(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR o);
29858 * Frees any resources used by the CResult_TxAbortDecodeErrorZ.
29860 void CResult_TxAbortDecodeErrorZ_free(struct LDKCResult_TxAbortDecodeErrorZ _res);
29863 * Creates a new CResult_TxAbortDecodeErrorZ which has the same data as `orig`
29864 * but with all dynamically-allocated buffers duplicated in new buffers.
29866 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_clone(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR orig);
29869 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
29871 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
29874 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
29876 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
29879 * Checks if the given object is currently in the success state
29881 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
29884 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
29886 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
29889 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
29890 * but with all dynamically-allocated buffers duplicated in new buffers.
29892 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
29895 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
29897 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
29900 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
29902 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
29905 * Checks if the given object is currently in the success state
29907 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
29910 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
29912 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
29915 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
29916 * but with all dynamically-allocated buffers duplicated in new buffers.
29918 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
29921 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
29923 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
29926 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
29928 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
29931 * Checks if the given object is currently in the success state
29933 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
29936 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
29938 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
29941 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
29942 * but with all dynamically-allocated buffers duplicated in new buffers.
29944 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
29947 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
29949 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
29952 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
29954 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
29957 * Checks if the given object is currently in the success state
29959 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
29962 * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
29964 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
29967 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
29968 * but with all dynamically-allocated buffers duplicated in new buffers.
29970 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
29973 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
29975 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
29978 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
29980 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
29983 * Checks if the given object is currently in the success state
29985 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
29988 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
29990 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
29993 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
29994 * but with all dynamically-allocated buffers duplicated in new buffers.
29996 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
29999 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
30001 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
30004 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
30006 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
30009 * Checks if the given object is currently in the success state
30011 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
30014 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
30016 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
30019 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
30020 * but with all dynamically-allocated buffers duplicated in new buffers.
30022 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
30025 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
30027 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
30030 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
30032 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
30035 * Checks if the given object is currently in the success state
30037 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
30040 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
30042 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
30045 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
30046 * but with all dynamically-allocated buffers duplicated in new buffers.
30048 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
30051 * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state.
30053 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_ok(struct LDKChannelReady o);
30056 * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state.
30058 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_err(struct LDKDecodeError e);
30061 * Checks if the given object is currently in the success state
30063 bool CResult_ChannelReadyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR o);
30066 * Frees any resources used by the CResult_ChannelReadyDecodeErrorZ.
30068 void CResult_ChannelReadyDecodeErrorZ_free(struct LDKCResult_ChannelReadyDecodeErrorZ _res);
30071 * Creates a new CResult_ChannelReadyDecodeErrorZ which has the same data as `orig`
30072 * but with all dynamically-allocated buffers duplicated in new buffers.
30074 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_clone(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR orig);
30077 * Creates a new CResult_InitDecodeErrorZ in the success state.
30079 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
30082 * Creates a new CResult_InitDecodeErrorZ in the error state.
30084 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
30087 * Checks if the given object is currently in the success state
30089 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
30092 * Frees any resources used by the CResult_InitDecodeErrorZ.
30094 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
30097 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
30098 * but with all dynamically-allocated buffers duplicated in new buffers.
30100 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
30103 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
30105 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
30108 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
30110 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
30113 * Checks if the given object is currently in the success state
30115 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
30118 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
30120 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
30123 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
30124 * but with all dynamically-allocated buffers duplicated in new buffers.
30126 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
30129 * Creates a new CResult_OpenChannelV2DecodeErrorZ in the success state.
30131 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_ok(struct LDKOpenChannelV2 o);
30134 * Creates a new CResult_OpenChannelV2DecodeErrorZ in the error state.
30136 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
30139 * Checks if the given object is currently in the success state
30141 bool CResult_OpenChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR o);
30144 * Frees any resources used by the CResult_OpenChannelV2DecodeErrorZ.
30146 void CResult_OpenChannelV2DecodeErrorZ_free(struct LDKCResult_OpenChannelV2DecodeErrorZ _res);
30149 * Creates a new CResult_OpenChannelV2DecodeErrorZ which has the same data as `orig`
30150 * but with all dynamically-allocated buffers duplicated in new buffers.
30152 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_clone(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR orig);
30155 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
30157 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
30160 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
30162 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
30165 * Checks if the given object is currently in the success state
30167 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
30170 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
30172 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
30175 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
30176 * but with all dynamically-allocated buffers duplicated in new buffers.
30178 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
30181 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
30183 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
30186 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
30188 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
30191 * Checks if the given object is currently in the success state
30193 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
30196 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
30198 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
30201 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
30202 * but with all dynamically-allocated buffers duplicated in new buffers.
30204 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
30207 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
30209 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
30212 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
30214 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
30217 * Checks if the given object is currently in the success state
30219 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
30222 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
30224 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
30227 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
30228 * but with all dynamically-allocated buffers duplicated in new buffers.
30230 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
30233 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
30235 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
30238 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
30240 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
30243 * Checks if the given object is currently in the success state
30245 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
30248 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
30250 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
30253 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
30254 * but with all dynamically-allocated buffers duplicated in new buffers.
30256 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
30259 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
30261 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
30264 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
30266 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
30269 * Checks if the given object is currently in the success state
30271 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
30274 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
30276 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
30279 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
30280 * but with all dynamically-allocated buffers duplicated in new buffers.
30282 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
30285 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
30287 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
30290 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
30292 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
30295 * Checks if the given object is currently in the success state
30297 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
30300 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
30302 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
30305 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
30306 * but with all dynamically-allocated buffers duplicated in new buffers.
30308 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
30311 * Creates a new CResult_OnionPacketDecodeErrorZ in the success state.
30313 struct LDKCResult_OnionPacketDecodeErrorZ CResult_OnionPacketDecodeErrorZ_ok(struct LDKOnionPacket o);
30316 * Creates a new CResult_OnionPacketDecodeErrorZ in the error state.
30318 struct LDKCResult_OnionPacketDecodeErrorZ CResult_OnionPacketDecodeErrorZ_err(struct LDKDecodeError e);
30321 * Checks if the given object is currently in the success state
30323 bool CResult_OnionPacketDecodeErrorZ_is_ok(const struct LDKCResult_OnionPacketDecodeErrorZ *NONNULL_PTR o);
30326 * Frees any resources used by the CResult_OnionPacketDecodeErrorZ.
30328 void CResult_OnionPacketDecodeErrorZ_free(struct LDKCResult_OnionPacketDecodeErrorZ _res);
30331 * Creates a new CResult_OnionPacketDecodeErrorZ which has the same data as `orig`
30332 * but with all dynamically-allocated buffers duplicated in new buffers.
30334 struct LDKCResult_OnionPacketDecodeErrorZ CResult_OnionPacketDecodeErrorZ_clone(const struct LDKCResult_OnionPacketDecodeErrorZ *NONNULL_PTR orig);
30337 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
30339 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
30342 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
30344 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
30347 * Checks if the given object is currently in the success state
30349 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
30352 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
30354 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
30357 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
30358 * but with all dynamically-allocated buffers duplicated in new buffers.
30360 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
30363 * Creates a new CResult_OnionMessageDecodeErrorZ in the success state.
30365 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_ok(struct LDKOnionMessage o);
30368 * Creates a new CResult_OnionMessageDecodeErrorZ in the error state.
30370 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_err(struct LDKDecodeError e);
30373 * Checks if the given object is currently in the success state
30375 bool CResult_OnionMessageDecodeErrorZ_is_ok(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR o);
30378 * Frees any resources used by the CResult_OnionMessageDecodeErrorZ.
30380 void CResult_OnionMessageDecodeErrorZ_free(struct LDKCResult_OnionMessageDecodeErrorZ _res);
30383 * Creates a new CResult_OnionMessageDecodeErrorZ which has the same data as `orig`
30384 * but with all dynamically-allocated buffers duplicated in new buffers.
30386 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_clone(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR orig);
30389 * Creates a new CResult_FinalOnionHopDataDecodeErrorZ in the success state.
30391 struct LDKCResult_FinalOnionHopDataDecodeErrorZ CResult_FinalOnionHopDataDecodeErrorZ_ok(struct LDKFinalOnionHopData o);
30394 * Creates a new CResult_FinalOnionHopDataDecodeErrorZ in the error state.
30396 struct LDKCResult_FinalOnionHopDataDecodeErrorZ CResult_FinalOnionHopDataDecodeErrorZ_err(struct LDKDecodeError e);
30399 * Checks if the given object is currently in the success state
30401 bool CResult_FinalOnionHopDataDecodeErrorZ_is_ok(const struct LDKCResult_FinalOnionHopDataDecodeErrorZ *NONNULL_PTR o);
30404 * Frees any resources used by the CResult_FinalOnionHopDataDecodeErrorZ.
30406 void CResult_FinalOnionHopDataDecodeErrorZ_free(struct LDKCResult_FinalOnionHopDataDecodeErrorZ _res);
30409 * Creates a new CResult_FinalOnionHopDataDecodeErrorZ which has the same data as `orig`
30410 * but with all dynamically-allocated buffers duplicated in new buffers.
30412 struct LDKCResult_FinalOnionHopDataDecodeErrorZ CResult_FinalOnionHopDataDecodeErrorZ_clone(const struct LDKCResult_FinalOnionHopDataDecodeErrorZ *NONNULL_PTR orig);
30415 * Creates a new CResult_PingDecodeErrorZ in the success state.
30417 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
30420 * Creates a new CResult_PingDecodeErrorZ in the error state.
30422 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
30425 * Checks if the given object is currently in the success state
30427 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
30430 * Frees any resources used by the CResult_PingDecodeErrorZ.
30432 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
30435 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
30436 * but with all dynamically-allocated buffers duplicated in new buffers.
30438 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
30441 * Creates a new CResult_PongDecodeErrorZ in the success state.
30443 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
30446 * Creates a new CResult_PongDecodeErrorZ in the error state.
30448 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
30451 * Checks if the given object is currently in the success state
30453 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
30456 * Frees any resources used by the CResult_PongDecodeErrorZ.
30458 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
30461 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
30462 * but with all dynamically-allocated buffers duplicated in new buffers.
30464 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
30467 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
30469 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
30472 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
30474 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
30477 * Checks if the given object is currently in the success state
30479 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
30482 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
30484 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
30487 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
30488 * but with all dynamically-allocated buffers duplicated in new buffers.
30490 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
30493 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
30495 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
30498 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
30500 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
30503 * Checks if the given object is currently in the success state
30505 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
30508 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
30510 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
30513 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
30514 * but with all dynamically-allocated buffers duplicated in new buffers.
30516 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
30519 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
30521 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
30524 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
30526 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
30529 * Checks if the given object is currently in the success state
30531 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
30534 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
30536 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
30539 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
30540 * but with all dynamically-allocated buffers duplicated in new buffers.
30542 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
30545 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
30547 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
30550 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
30552 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
30555 * Checks if the given object is currently in the success state
30557 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
30560 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
30562 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
30565 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
30566 * but with all dynamically-allocated buffers duplicated in new buffers.
30568 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
30571 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
30573 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
30576 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
30578 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
30581 * Checks if the given object is currently in the success state
30583 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
30586 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
30588 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
30591 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
30592 * but with all dynamically-allocated buffers duplicated in new buffers.
30594 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
30597 * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
30599 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
30602 * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
30604 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
30607 * Checks if the given object is currently in the success state
30609 bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
30612 * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
30614 void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
30617 * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
30618 * but with all dynamically-allocated buffers duplicated in new buffers.
30620 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
30623 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
30625 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
30628 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
30630 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
30633 * Checks if the given object is currently in the success state
30635 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
30638 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
30640 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
30643 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
30644 * but with all dynamically-allocated buffers duplicated in new buffers.
30646 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
30649 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
30651 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
30654 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
30656 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
30659 * Checks if the given object is currently in the success state
30661 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
30664 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
30666 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
30669 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
30670 * but with all dynamically-allocated buffers duplicated in new buffers.
30672 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
30675 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
30677 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
30680 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
30682 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
30685 * Checks if the given object is currently in the success state
30687 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
30690 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
30692 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
30695 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
30696 * but with all dynamically-allocated buffers duplicated in new buffers.
30698 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
30701 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
30703 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
30706 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
30708 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
30711 * Checks if the given object is currently in the success state
30713 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
30716 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
30718 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
30721 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
30722 * but with all dynamically-allocated buffers duplicated in new buffers.
30724 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
30727 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
30729 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
30732 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
30734 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
30737 * Checks if the given object is currently in the success state
30739 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
30742 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
30744 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
30747 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
30748 * but with all dynamically-allocated buffers duplicated in new buffers.
30750 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
30753 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
30755 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
30758 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
30760 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
30763 * Checks if the given object is currently in the success state
30765 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
30768 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
30770 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
30773 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
30774 * but with all dynamically-allocated buffers duplicated in new buffers.
30776 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
30779 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
30781 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
30784 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
30786 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
30789 * Checks if the given object is currently in the success state
30791 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
30794 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
30796 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
30799 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
30800 * but with all dynamically-allocated buffers duplicated in new buffers.
30802 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
30805 * Frees the buffer pointed to by `data` if `datalen` is non-0.
30807 void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
30810 * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the success state.
30812 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(struct LDKBolt11Invoice o);
30815 * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the error state.
30817 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
30820 * Checks if the given object is currently in the success state
30822 bool CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
30825 * Frees any resources used by the CResult_Bolt11InvoiceSignOrCreationErrorZ.
30827 void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res);
30830 * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ which has the same data as `orig`
30831 * but with all dynamically-allocated buffers duplicated in new buffers.
30833 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
30836 * Frees the buffer pointed to by `data` if `datalen` is non-0.
30838 void CVec_FutureZ_free(struct LDKCVec_FutureZ _res);
30841 * Creates a new CResult_OffersMessageDecodeErrorZ in the success state.
30843 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_ok(struct LDKOffersMessage o);
30846 * Creates a new CResult_OffersMessageDecodeErrorZ in the error state.
30848 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_err(struct LDKDecodeError e);
30851 * Checks if the given object is currently in the success state
30853 bool CResult_OffersMessageDecodeErrorZ_is_ok(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR o);
30856 * Frees any resources used by the CResult_OffersMessageDecodeErrorZ.
30858 void CResult_OffersMessageDecodeErrorZ_free(struct LDKCResult_OffersMessageDecodeErrorZ _res);
30861 * Creates a new CResult_OffersMessageDecodeErrorZ which has the same data as `orig`
30862 * but with all dynamically-allocated buffers duplicated in new buffers.
30864 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_clone(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR orig);
30867 * Constructs a new COption_HTLCClaimZ containing a crate::lightning::ln::chan_utils::HTLCClaim
30869 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_some(enum LDKHTLCClaim o);
30872 * Constructs a new COption_HTLCClaimZ containing nothing
30874 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_none(void);
30877 * Frees any resources associated with the crate::lightning::ln::chan_utils::HTLCClaim, if we are in the Some state
30879 void COption_HTLCClaimZ_free(struct LDKCOption_HTLCClaimZ _res);
30882 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
30884 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
30887 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
30889 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
30892 * Checks if the given object is currently in the success state
30894 bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
30897 * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
30899 void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
30902 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
30903 * but with all dynamically-allocated buffers duplicated in new buffers.
30905 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
30908 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
30910 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
30913 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
30915 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
30918 * Checks if the given object is currently in the success state
30920 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
30923 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
30925 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
30928 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
30929 * but with all dynamically-allocated buffers duplicated in new buffers.
30931 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
30934 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
30936 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
30939 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
30941 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
30944 * Checks if the given object is currently in the success state
30946 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
30949 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
30951 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
30954 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
30955 * but with all dynamically-allocated buffers duplicated in new buffers.
30957 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
30960 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
30962 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
30965 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
30967 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
30970 * Checks if the given object is currently in the success state
30972 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
30975 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
30977 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
30980 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
30981 * but with all dynamically-allocated buffers duplicated in new buffers.
30983 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
30986 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
30988 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
30991 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
30993 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
30996 * Checks if the given object is currently in the success state
30998 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
31001 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
31003 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
31006 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
31007 * but with all dynamically-allocated buffers duplicated in new buffers.
31009 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
31012 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
31014 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
31017 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
31019 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
31022 * Checks if the given object is currently in the success state
31024 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
31027 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
31029 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
31032 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
31033 * but with all dynamically-allocated buffers duplicated in new buffers.
31035 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
31038 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
31040 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
31043 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
31045 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
31048 * Checks if the given object is currently in the success state
31050 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
31053 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
31055 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
31058 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
31059 * but with all dynamically-allocated buffers duplicated in new buffers.
31061 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
31064 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
31066 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
31069 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
31071 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
31074 * Checks if the given object is currently in the success state
31076 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
31079 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
31081 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
31084 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
31085 * but with all dynamically-allocated buffers duplicated in new buffers.
31087 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
31090 * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
31092 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
31095 * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
31097 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
31100 * Checks if the given object is currently in the success state
31102 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
31105 * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
31107 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
31110 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
31112 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
31115 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
31117 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
31120 * Checks if the given object is currently in the success state
31122 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
31125 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
31127 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
31130 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
31131 * but with all dynamically-allocated buffers duplicated in new buffers.
31133 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
31136 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
31138 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
31141 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
31143 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
31146 * Checks if the given object is currently in the success state
31148 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
31151 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
31153 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
31156 * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the success state.
31158 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_ok(struct LDKCVec_ECDSASignatureZ o);
31161 * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the error state.
31163 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_err(void);
31166 * Checks if the given object is currently in the success state
31168 bool CResult_CVec_ECDSASignatureZNoneZ_is_ok(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR o);
31171 * Frees any resources used by the CResult_CVec_ECDSASignatureZNoneZ.
31173 void CResult_CVec_ECDSASignatureZNoneZ_free(struct LDKCResult_CVec_ECDSASignatureZNoneZ _res);
31176 * Creates a new CResult_CVec_ECDSASignatureZNoneZ which has the same data as `orig`
31177 * but with all dynamically-allocated buffers duplicated in new buffers.
31179 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_clone(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR orig);
31182 * Constructs a new COption_usizeZ containing a usize
31184 struct LDKCOption_usizeZ COption_usizeZ_some(uintptr_t o);
31187 * Constructs a new COption_usizeZ containing nothing
31189 struct LDKCOption_usizeZ COption_usizeZ_none(void);
31192 * Frees any resources associated with the usize, if we are in the Some state
31194 void COption_usizeZ_free(struct LDKCOption_usizeZ _res);
31197 * Creates a new COption_usizeZ which has the same data as `orig`
31198 * but with all dynamically-allocated buffers duplicated in new buffers.
31200 struct LDKCOption_usizeZ COption_usizeZ_clone(const struct LDKCOption_usizeZ *NONNULL_PTR orig);
31203 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
31205 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
31208 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
31210 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
31213 * Checks if the given object is currently in the success state
31215 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
31218 * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
31220 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
31223 * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
31224 * but with all dynamically-allocated buffers duplicated in new buffers.
31226 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
31229 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
31231 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
31234 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
31236 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
31239 * Checks if the given object is currently in the success state
31241 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
31244 * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
31246 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
31249 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
31250 * but with all dynamically-allocated buffers duplicated in new buffers.
31252 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
31255 * Frees the buffer pointed to by `data` if `datalen` is non-0.
31257 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
31260 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state.
31262 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o);
31265 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state.
31267 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e);
31270 * Checks if the given object is currently in the success state
31272 bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o);
31275 * Frees any resources used by the CResult_PaymentPurposeDecodeErrorZ.
31277 void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res);
31280 * Creates a new CResult_PaymentPurposeDecodeErrorZ which has the same data as `orig`
31281 * but with all dynamically-allocated buffers duplicated in new buffers.
31283 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig);
31286 * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the success state.
31288 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_ok(struct LDKClaimedHTLC o);
31291 * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the error state.
31293 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
31296 * Checks if the given object is currently in the success state
31298 bool CResult_ClaimedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR o);
31301 * Frees any resources used by the CResult_ClaimedHTLCDecodeErrorZ.
31303 void CResult_ClaimedHTLCDecodeErrorZ_free(struct LDKCResult_ClaimedHTLCDecodeErrorZ _res);
31306 * Creates a new CResult_ClaimedHTLCDecodeErrorZ which has the same data as `orig`
31307 * but with all dynamically-allocated buffers duplicated in new buffers.
31309 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_clone(const struct LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR orig);
31312 * Constructs a new COption_PathFailureZ containing a crate::lightning::events::PathFailure
31314 struct LDKCOption_PathFailureZ COption_PathFailureZ_some(struct LDKPathFailure o);
31317 * Constructs a new COption_PathFailureZ containing nothing
31319 struct LDKCOption_PathFailureZ COption_PathFailureZ_none(void);
31322 * Frees any resources associated with the crate::lightning::events::PathFailure, if we are in the Some state
31324 void COption_PathFailureZ_free(struct LDKCOption_PathFailureZ _res);
31327 * Creates a new COption_PathFailureZ which has the same data as `orig`
31328 * but with all dynamically-allocated buffers duplicated in new buffers.
31330 struct LDKCOption_PathFailureZ COption_PathFailureZ_clone(const struct LDKCOption_PathFailureZ *NONNULL_PTR orig);
31333 * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the success state.
31335 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_ok(struct LDKCOption_PathFailureZ o);
31338 * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the error state.
31340 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_err(struct LDKDecodeError e);
31343 * Checks if the given object is currently in the success state
31345 bool CResult_COption_PathFailureZDecodeErrorZ_is_ok(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR o);
31348 * Frees any resources used by the CResult_COption_PathFailureZDecodeErrorZ.
31350 void CResult_COption_PathFailureZDecodeErrorZ_free(struct LDKCResult_COption_PathFailureZDecodeErrorZ _res);
31353 * Creates a new CResult_COption_PathFailureZDecodeErrorZ which has the same data as `orig`
31354 * but with all dynamically-allocated buffers duplicated in new buffers.
31356 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_clone(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR orig);
31359 * Constructs a new COption_ClosureReasonZ containing a crate::lightning::events::ClosureReason
31361 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
31364 * Constructs a new COption_ClosureReasonZ containing nothing
31366 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
31369 * Frees any resources associated with the crate::lightning::events::ClosureReason, if we are in the Some state
31371 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
31374 * Creates a new COption_ClosureReasonZ which has the same data as `orig`
31375 * but with all dynamically-allocated buffers duplicated in new buffers.
31377 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
31380 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
31382 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
31385 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
31387 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
31390 * Checks if the given object is currently in the success state
31392 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
31395 * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
31397 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
31400 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
31401 * but with all dynamically-allocated buffers duplicated in new buffers.
31403 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
31406 * Constructs a new COption_HTLCDestinationZ containing a crate::lightning::events::HTLCDestination
31408 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_some(struct LDKHTLCDestination o);
31411 * Constructs a new COption_HTLCDestinationZ containing nothing
31413 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_none(void);
31416 * Frees any resources associated with the crate::lightning::events::HTLCDestination, if we are in the Some state
31418 void COption_HTLCDestinationZ_free(struct LDKCOption_HTLCDestinationZ _res);
31421 * Creates a new COption_HTLCDestinationZ which has the same data as `orig`
31422 * but with all dynamically-allocated buffers duplicated in new buffers.
31424 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_clone(const struct LDKCOption_HTLCDestinationZ *NONNULL_PTR orig);
31427 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the success state.
31429 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_ok(struct LDKCOption_HTLCDestinationZ o);
31432 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the error state.
31434 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_err(struct LDKDecodeError e);
31437 * Checks if the given object is currently in the success state
31439 bool CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR o);
31442 * Frees any resources used by the CResult_COption_HTLCDestinationZDecodeErrorZ.
31444 void CResult_COption_HTLCDestinationZDecodeErrorZ_free(struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res);
31447 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ which has the same data as `orig`
31448 * but with all dynamically-allocated buffers duplicated in new buffers.
31450 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig);
31453 * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the success state.
31455 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_ok(enum LDKPaymentFailureReason o);
31458 * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the error state.
31460 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_err(struct LDKDecodeError e);
31463 * Checks if the given object is currently in the success state
31465 bool CResult_PaymentFailureReasonDecodeErrorZ_is_ok(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR o);
31468 * Frees any resources used by the CResult_PaymentFailureReasonDecodeErrorZ.
31470 void CResult_PaymentFailureReasonDecodeErrorZ_free(struct LDKCResult_PaymentFailureReasonDecodeErrorZ _res);
31473 * Creates a new CResult_PaymentFailureReasonDecodeErrorZ which has the same data as `orig`
31474 * but with all dynamically-allocated buffers duplicated in new buffers.
31476 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_clone(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR orig);
31479 * Constructs a new COption_U128Z containing a crate::c_types::U128
31481 struct LDKCOption_U128Z COption_U128Z_some(struct LDKU128 o);
31484 * Constructs a new COption_U128Z containing nothing
31486 struct LDKCOption_U128Z COption_U128Z_none(void);
31489 * Frees any resources associated with the crate::c_types::U128, if we are in the Some state
31491 void COption_U128Z_free(struct LDKCOption_U128Z _res);
31494 * Creates a new COption_U128Z which has the same data as `orig`
31495 * but with all dynamically-allocated buffers duplicated in new buffers.
31497 struct LDKCOption_U128Z COption_U128Z_clone(const struct LDKCOption_U128Z *NONNULL_PTR orig);
31500 * Frees the buffer pointed to by `data` if `datalen` is non-0.
31502 void CVec_ClaimedHTLCZ_free(struct LDKCVec_ClaimedHTLCZ _res);
31505 * Constructs a new COption_PaymentFailureReasonZ containing a crate::lightning::events::PaymentFailureReason
31507 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_some(enum LDKPaymentFailureReason o);
31510 * Constructs a new COption_PaymentFailureReasonZ containing nothing
31512 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_none(void);
31515 * Frees any resources associated with the crate::lightning::events::PaymentFailureReason, if we are in the Some state
31517 void COption_PaymentFailureReasonZ_free(struct LDKCOption_PaymentFailureReasonZ _res);
31520 * Creates a new COption_PaymentFailureReasonZ which has the same data as `orig`
31521 * but with all dynamically-allocated buffers duplicated in new buffers.
31523 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_clone(const struct LDKCOption_PaymentFailureReasonZ *NONNULL_PTR orig);
31526 * Constructs a new COption_EventZ containing a crate::lightning::events::Event
31528 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
31531 * Constructs a new COption_EventZ containing nothing
31533 struct LDKCOption_EventZ COption_EventZ_none(void);
31536 * Frees any resources associated with the crate::lightning::events::Event, if we are in the Some state
31538 void COption_EventZ_free(struct LDKCOption_EventZ _res);
31541 * Creates a new COption_EventZ which has the same data as `orig`
31542 * but with all dynamically-allocated buffers duplicated in new buffers.
31544 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
31547 * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
31549 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
31552 * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
31554 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
31557 * Checks if the given object is currently in the success state
31559 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
31562 * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
31564 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
31567 * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
31568 * but with all dynamically-allocated buffers duplicated in new buffers.
31570 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
31573 * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the success state.
31575 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_ok(enum LDKSiPrefix o);
31578 * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the error state.
31580 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
31583 * Checks if the given object is currently in the success state
31585 bool CResult_SiPrefixBolt11ParseErrorZ_is_ok(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR o);
31588 * Frees any resources used by the CResult_SiPrefixBolt11ParseErrorZ.
31590 void CResult_SiPrefixBolt11ParseErrorZ_free(struct LDKCResult_SiPrefixBolt11ParseErrorZ _res);
31593 * Creates a new CResult_SiPrefixBolt11ParseErrorZ which has the same data as `orig`
31594 * but with all dynamically-allocated buffers duplicated in new buffers.
31596 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_clone(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR orig);
31599 * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the success state.
31601 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(struct LDKBolt11Invoice o);
31604 * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the error state.
31606 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e);
31609 * Checks if the given object is currently in the success state
31611 bool CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR o);
31614 * Frees any resources used by the CResult_Bolt11InvoiceParseOrSemanticErrorZ.
31616 void CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ _res);
31619 * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ which has the same data as `orig`
31620 * but with all dynamically-allocated buffers duplicated in new buffers.
31622 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig);
31625 * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the success state.
31627 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(struct LDKSignedRawBolt11Invoice o);
31630 * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the error state.
31632 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
31635 * Checks if the given object is currently in the success state
31637 bool CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR o);
31640 * Frees any resources used by the CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ.
31642 void CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ _res);
31645 * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ which has the same data as `orig`
31646 * but with all dynamically-allocated buffers duplicated in new buffers.
31648 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR orig);
31651 * Creates a new tuple which has the same data as `orig`
31652 * but with all dynamically-allocated buffers duplicated in new buffers.
31654 struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ *NONNULL_PTR orig);
31657 * Creates a new C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ from the contained elements.
31659 struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(struct LDKRawBolt11Invoice a, struct LDKThirtyTwoBytes b, struct LDKBolt11InvoiceSignature c);
31662 * Frees any resources used by the C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.
31664 void C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ _res);
31667 * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the success state.
31669 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_ok(struct LDKPayeePubKey o);
31672 * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the error state.
31674 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
31677 * Checks if the given object is currently in the success state
31679 bool CResult_PayeePubKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR o);
31682 * Frees any resources used by the CResult_PayeePubKeySecp256k1ErrorZ.
31684 void CResult_PayeePubKeySecp256k1ErrorZ_free(struct LDKCResult_PayeePubKeySecp256k1ErrorZ _res);
31687 * Creates a new CResult_PayeePubKeySecp256k1ErrorZ which has the same data as `orig`
31688 * but with all dynamically-allocated buffers duplicated in new buffers.
31690 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_clone(const struct LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR orig);
31693 * Frees the buffer pointed to by `data` if `datalen` is non-0.
31695 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
31698 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
31700 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
31703 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
31705 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
31708 * Checks if the given object is currently in the success state
31710 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
31713 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
31715 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
31718 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
31719 * but with all dynamically-allocated buffers duplicated in new buffers.
31721 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
31724 * Creates a new CResult_NoneBolt11SemanticErrorZ in the success state.
31726 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_ok(void);
31729 * Creates a new CResult_NoneBolt11SemanticErrorZ in the error state.
31731 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
31734 * Checks if the given object is currently in the success state
31736 bool CResult_NoneBolt11SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR o);
31739 * Frees any resources used by the CResult_NoneBolt11SemanticErrorZ.
31741 void CResult_NoneBolt11SemanticErrorZ_free(struct LDKCResult_NoneBolt11SemanticErrorZ _res);
31744 * Creates a new CResult_NoneBolt11SemanticErrorZ which has the same data as `orig`
31745 * but with all dynamically-allocated buffers duplicated in new buffers.
31747 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_clone(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR orig);
31750 * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the success state.
31752 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(struct LDKBolt11Invoice o);
31755 * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the error state.
31757 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
31760 * Checks if the given object is currently in the success state
31762 bool CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR o);
31765 * Frees any resources used by the CResult_Bolt11InvoiceBolt11SemanticErrorZ.
31767 void CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ _res);
31770 * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ which has the same data as `orig`
31771 * but with all dynamically-allocated buffers duplicated in new buffers.
31773 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR orig);
31776 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
31778 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
31781 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
31783 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
31786 * Checks if the given object is currently in the success state
31788 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
31791 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
31793 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
31796 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
31797 * but with all dynamically-allocated buffers duplicated in new buffers.
31799 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
31802 * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
31804 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
31807 * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
31809 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
31812 * Checks if the given object is currently in the success state
31814 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
31817 * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
31819 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
31822 * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
31823 * but with all dynamically-allocated buffers duplicated in new buffers.
31825 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
31828 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
31830 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
31833 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
31835 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
31838 * Checks if the given object is currently in the success state
31840 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
31843 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
31845 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
31848 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
31849 * but with all dynamically-allocated buffers duplicated in new buffers.
31851 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
31854 * Creates a new CResult_BigSizeDecodeErrorZ in the success state.
31856 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_ok(struct LDKBigSize o);
31859 * Creates a new CResult_BigSizeDecodeErrorZ in the error state.
31861 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_err(struct LDKDecodeError e);
31864 * Checks if the given object is currently in the success state
31866 bool CResult_BigSizeDecodeErrorZ_is_ok(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR o);
31869 * Frees any resources used by the CResult_BigSizeDecodeErrorZ.
31871 void CResult_BigSizeDecodeErrorZ_free(struct LDKCResult_BigSizeDecodeErrorZ _res);
31874 * Creates a new CResult_BigSizeDecodeErrorZ which has the same data as `orig`
31875 * but with all dynamically-allocated buffers duplicated in new buffers.
31877 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_clone(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR orig);
31880 * Creates a new CResult_HostnameDecodeErrorZ in the success state.
31882 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_ok(struct LDKHostname o);
31885 * Creates a new CResult_HostnameDecodeErrorZ in the error state.
31887 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_err(struct LDKDecodeError e);
31890 * Checks if the given object is currently in the success state
31892 bool CResult_HostnameDecodeErrorZ_is_ok(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR o);
31895 * Frees any resources used by the CResult_HostnameDecodeErrorZ.
31897 void CResult_HostnameDecodeErrorZ_free(struct LDKCResult_HostnameDecodeErrorZ _res);
31900 * Creates a new CResult_HostnameDecodeErrorZ which has the same data as `orig`
31901 * but with all dynamically-allocated buffers duplicated in new buffers.
31903 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_clone(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR orig);
31906 * Creates a new CResult_TransactionU16LenLimitedNoneZ in the success state.
31908 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_ok(struct LDKTransactionU16LenLimited o);
31911 * Creates a new CResult_TransactionU16LenLimitedNoneZ in the error state.
31913 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_err(void);
31916 * Checks if the given object is currently in the success state
31918 bool CResult_TransactionU16LenLimitedNoneZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR o);
31921 * Frees any resources used by the CResult_TransactionU16LenLimitedNoneZ.
31923 void CResult_TransactionU16LenLimitedNoneZ_free(struct LDKCResult_TransactionU16LenLimitedNoneZ _res);
31926 * Creates a new CResult_TransactionU16LenLimitedNoneZ which has the same data as `orig`
31927 * but with all dynamically-allocated buffers duplicated in new buffers.
31929 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_clone(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR orig);
31932 * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the success state.
31934 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_ok(struct LDKTransactionU16LenLimited o);
31937 * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the error state.
31939 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_err(struct LDKDecodeError e);
31942 * Checks if the given object is currently in the success state
31944 bool CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR o);
31947 * Frees any resources used by the CResult_TransactionU16LenLimitedDecodeErrorZ.
31949 void CResult_TransactionU16LenLimitedDecodeErrorZ_free(struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ _res);
31952 * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ which has the same data as `orig`
31953 * but with all dynamically-allocated buffers duplicated in new buffers.
31955 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_clone(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR orig);
31958 * Creates a new CResult_UntrustedStringDecodeErrorZ in the success state.
31960 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_ok(struct LDKUntrustedString o);
31963 * Creates a new CResult_UntrustedStringDecodeErrorZ in the error state.
31965 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_err(struct LDKDecodeError e);
31968 * Checks if the given object is currently in the success state
31970 bool CResult_UntrustedStringDecodeErrorZ_is_ok(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR o);
31973 * Frees any resources used by the CResult_UntrustedStringDecodeErrorZ.
31975 void CResult_UntrustedStringDecodeErrorZ_free(struct LDKCResult_UntrustedStringDecodeErrorZ _res);
31978 * Creates a new CResult_UntrustedStringDecodeErrorZ which has the same data as `orig`
31979 * but with all dynamically-allocated buffers duplicated in new buffers.
31981 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_clone(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR orig);
31984 * Creates a new CResult_ChannelIdDecodeErrorZ in the success state.
31986 struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_ok(struct LDKChannelId o);
31989 * Creates a new CResult_ChannelIdDecodeErrorZ in the error state.
31991 struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_err(struct LDKDecodeError e);
31994 * Checks if the given object is currently in the success state
31996 bool CResult_ChannelIdDecodeErrorZ_is_ok(const struct LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR o);
31999 * Frees any resources used by the CResult_ChannelIdDecodeErrorZ.
32001 void CResult_ChannelIdDecodeErrorZ_free(struct LDKCResult_ChannelIdDecodeErrorZ _res);
32004 * Creates a new CResult_ChannelIdDecodeErrorZ which has the same data as `orig`
32005 * but with all dynamically-allocated buffers duplicated in new buffers.
32007 struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_clone(const struct LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR orig);
32010 * Creates a new tuple which has the same data as `orig`
32011 * but with all dynamically-allocated buffers duplicated in new buffers.
32013 struct LDKC2Tuple__u832u16Z C2Tuple__u832u16Z_clone(const struct LDKC2Tuple__u832u16Z *NONNULL_PTR orig);
32016 * Creates a new C2Tuple__u832u16Z from the contained elements.
32018 struct LDKC2Tuple__u832u16Z C2Tuple__u832u16Z_new(struct LDKThirtyTwoBytes a, uint16_t b);
32021 * Frees any resources used by the C2Tuple__u832u16Z.
32023 void C2Tuple__u832u16Z_free(struct LDKC2Tuple__u832u16Z _res);
32026 * Creates a new CResult_PaymentRelayDecodeErrorZ in the success state.
32028 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_ok(struct LDKPaymentRelay o);
32031 * Creates a new CResult_PaymentRelayDecodeErrorZ in the error state.
32033 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_err(struct LDKDecodeError e);
32036 * Checks if the given object is currently in the success state
32038 bool CResult_PaymentRelayDecodeErrorZ_is_ok(const struct LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR o);
32041 * Frees any resources used by the CResult_PaymentRelayDecodeErrorZ.
32043 void CResult_PaymentRelayDecodeErrorZ_free(struct LDKCResult_PaymentRelayDecodeErrorZ _res);
32046 * Creates a new CResult_PaymentRelayDecodeErrorZ which has the same data as `orig`
32047 * but with all dynamically-allocated buffers duplicated in new buffers.
32049 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_clone(const struct LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR orig);
32052 * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the success state.
32054 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_ok(struct LDKPaymentConstraints o);
32057 * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the error state.
32059 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_err(struct LDKDecodeError e);
32062 * Checks if the given object is currently in the success state
32064 bool CResult_PaymentConstraintsDecodeErrorZ_is_ok(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR o);
32067 * Frees any resources used by the CResult_PaymentConstraintsDecodeErrorZ.
32069 void CResult_PaymentConstraintsDecodeErrorZ_free(struct LDKCResult_PaymentConstraintsDecodeErrorZ _res);
32072 * Creates a new CResult_PaymentConstraintsDecodeErrorZ which has the same data as `orig`
32073 * but with all dynamically-allocated buffers duplicated in new buffers.
32075 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_clone(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR orig);
32078 * Creates a new CResult_PaymentContextDecodeErrorZ in the success state.
32080 struct LDKCResult_PaymentContextDecodeErrorZ CResult_PaymentContextDecodeErrorZ_ok(struct LDKPaymentContext o);
32083 * Creates a new CResult_PaymentContextDecodeErrorZ in the error state.
32085 struct LDKCResult_PaymentContextDecodeErrorZ CResult_PaymentContextDecodeErrorZ_err(struct LDKDecodeError e);
32088 * Checks if the given object is currently in the success state
32090 bool CResult_PaymentContextDecodeErrorZ_is_ok(const struct LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR o);
32093 * Frees any resources used by the CResult_PaymentContextDecodeErrorZ.
32095 void CResult_PaymentContextDecodeErrorZ_free(struct LDKCResult_PaymentContextDecodeErrorZ _res);
32098 * Creates a new CResult_PaymentContextDecodeErrorZ which has the same data as `orig`
32099 * but with all dynamically-allocated buffers duplicated in new buffers.
32101 struct LDKCResult_PaymentContextDecodeErrorZ CResult_PaymentContextDecodeErrorZ_clone(const struct LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR orig);
32104 * Creates a new CResult_UnknownPaymentContextDecodeErrorZ in the success state.
32106 struct LDKCResult_UnknownPaymentContextDecodeErrorZ CResult_UnknownPaymentContextDecodeErrorZ_ok(struct LDKUnknownPaymentContext o);
32109 * Creates a new CResult_UnknownPaymentContextDecodeErrorZ in the error state.
32111 struct LDKCResult_UnknownPaymentContextDecodeErrorZ CResult_UnknownPaymentContextDecodeErrorZ_err(struct LDKDecodeError e);
32114 * Checks if the given object is currently in the success state
32116 bool CResult_UnknownPaymentContextDecodeErrorZ_is_ok(const struct LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR o);
32119 * Frees any resources used by the CResult_UnknownPaymentContextDecodeErrorZ.
32121 void CResult_UnknownPaymentContextDecodeErrorZ_free(struct LDKCResult_UnknownPaymentContextDecodeErrorZ _res);
32124 * Creates a new CResult_UnknownPaymentContextDecodeErrorZ which has the same data as `orig`
32125 * but with all dynamically-allocated buffers duplicated in new buffers.
32127 struct LDKCResult_UnknownPaymentContextDecodeErrorZ CResult_UnknownPaymentContextDecodeErrorZ_clone(const struct LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR orig);
32130 * Creates a new CResult_Bolt12OfferContextDecodeErrorZ in the success state.
32132 struct LDKCResult_Bolt12OfferContextDecodeErrorZ CResult_Bolt12OfferContextDecodeErrorZ_ok(struct LDKBolt12OfferContext o);
32135 * Creates a new CResult_Bolt12OfferContextDecodeErrorZ in the error state.
32137 struct LDKCResult_Bolt12OfferContextDecodeErrorZ CResult_Bolt12OfferContextDecodeErrorZ_err(struct LDKDecodeError e);
32140 * Checks if the given object is currently in the success state
32142 bool CResult_Bolt12OfferContextDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR o);
32145 * Frees any resources used by the CResult_Bolt12OfferContextDecodeErrorZ.
32147 void CResult_Bolt12OfferContextDecodeErrorZ_free(struct LDKCResult_Bolt12OfferContextDecodeErrorZ _res);
32150 * Creates a new CResult_Bolt12OfferContextDecodeErrorZ which has the same data as `orig`
32151 * but with all dynamically-allocated buffers duplicated in new buffers.
32153 struct LDKCResult_Bolt12OfferContextDecodeErrorZ CResult_Bolt12OfferContextDecodeErrorZ_clone(const struct LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR orig);
32156 * Creates a new CResult_Bolt12RefundContextDecodeErrorZ in the success state.
32158 struct LDKCResult_Bolt12RefundContextDecodeErrorZ CResult_Bolt12RefundContextDecodeErrorZ_ok(struct LDKBolt12RefundContext o);
32161 * Creates a new CResult_Bolt12RefundContextDecodeErrorZ in the error state.
32163 struct LDKCResult_Bolt12RefundContextDecodeErrorZ CResult_Bolt12RefundContextDecodeErrorZ_err(struct LDKDecodeError e);
32166 * Checks if the given object is currently in the success state
32168 bool CResult_Bolt12RefundContextDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR o);
32171 * Frees any resources used by the CResult_Bolt12RefundContextDecodeErrorZ.
32173 void CResult_Bolt12RefundContextDecodeErrorZ_free(struct LDKCResult_Bolt12RefundContextDecodeErrorZ _res);
32176 * Creates a new CResult_Bolt12RefundContextDecodeErrorZ which has the same data as `orig`
32177 * but with all dynamically-allocated buffers duplicated in new buffers.
32179 struct LDKCResult_Bolt12RefundContextDecodeErrorZ CResult_Bolt12RefundContextDecodeErrorZ_clone(const struct LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR orig);
32182 * Creates a new CResult_StrSecp256k1ErrorZ in the success state.
32184 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_ok(struct LDKStr o);
32187 * Creates a new CResult_StrSecp256k1ErrorZ in the error state.
32189 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
32192 * Checks if the given object is currently in the success state
32194 bool CResult_StrSecp256k1ErrorZ_is_ok(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR o);
32197 * Frees any resources used by the CResult_StrSecp256k1ErrorZ.
32199 void CResult_StrSecp256k1ErrorZ_free(struct LDKCResult_StrSecp256k1ErrorZ _res);
32202 * Creates a new CResult_StrSecp256k1ErrorZ which has the same data as `orig`
32203 * but with all dynamically-allocated buffers duplicated in new buffers.
32205 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_clone(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR orig);
32208 * Creates a new tuple which has the same data as `orig`
32209 * but with all dynamically-allocated buffers duplicated in new buffers.
32211 struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(const struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR orig);
32214 * Creates a new C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ from the contained elements.
32216 struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(struct LDKThirtyTwoBytes a, struct LDKRecipientOnionFields b, struct LDKRouteParameters c);
32219 * Frees any resources used by the C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ.
32221 void C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ _res);
32224 * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ in the success state.
32226 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ o);
32229 * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ in the error state.
32231 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(void);
32234 * Checks if the given object is currently in the success state
32236 bool CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR o);
32239 * Frees any resources used by the CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ.
32241 void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ _res);
32244 * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ which has the same data as `orig`
32245 * but with all dynamically-allocated buffers duplicated in new buffers.
32247 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR orig);
32250 * Creates a new CResult_TxOutUtxoLookupErrorZ in the success state.
32252 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_ok(struct LDKTxOut o);
32255 * Creates a new CResult_TxOutUtxoLookupErrorZ in the error state.
32257 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_err(enum LDKUtxoLookupError e);
32260 * Checks if the given object is currently in the success state
32262 bool CResult_TxOutUtxoLookupErrorZ_is_ok(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR o);
32265 * Frees any resources used by the CResult_TxOutUtxoLookupErrorZ.
32267 void CResult_TxOutUtxoLookupErrorZ_free(struct LDKCResult_TxOutUtxoLookupErrorZ _res);
32270 * Creates a new CResult_TxOutUtxoLookupErrorZ which has the same data as `orig`
32271 * but with all dynamically-allocated buffers duplicated in new buffers.
32273 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_clone(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR orig);
32276 * Creates a new tuple which has the same data as `orig`
32277 * but with all dynamically-allocated buffers duplicated in new buffers.
32279 struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(const struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR orig);
32282 * Creates a new C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ from the contained elements.
32284 struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_new(struct LDKPublicKey a, struct LDKOnionMessage b, struct LDKCOption_CVec_SocketAddressZZ c);
32287 * Frees any resources used by the C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ.
32289 void C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_free(struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ _res);
32292 * Creates a new CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ in the success state.
32294 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok(struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ o);
32297 * Creates a new CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ in the error state.
32299 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_err(struct LDKSendError e);
32302 * Checks if the given object is currently in the success state
32304 bool CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_is_ok(const struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR o);
32307 * Frees any resources used by the CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.
32309 void CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ _res);
32312 * Creates a new CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ which has the same data as `orig`
32313 * but with all dynamically-allocated buffers duplicated in new buffers.
32315 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(const struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR orig);
32318 * Creates a new CResult_PeeledOnionNoneZ in the success state.
32320 struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_ok(struct LDKPeeledOnion o);
32323 * Creates a new CResult_PeeledOnionNoneZ in the error state.
32325 struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_err(void);
32328 * Checks if the given object is currently in the success state
32330 bool CResult_PeeledOnionNoneZ_is_ok(const struct LDKCResult_PeeledOnionNoneZ *NONNULL_PTR o);
32333 * Frees any resources used by the CResult_PeeledOnionNoneZ.
32335 void CResult_PeeledOnionNoneZ_free(struct LDKCResult_PeeledOnionNoneZ _res);
32338 * Creates a new CResult_PeeledOnionNoneZ which has the same data as `orig`
32339 * but with all dynamically-allocated buffers duplicated in new buffers.
32341 struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_clone(const struct LDKCResult_PeeledOnionNoneZ *NONNULL_PTR orig);
32344 * Creates a new CResult_SendSuccessSendErrorZ in the success state.
32346 struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_ok(struct LDKSendSuccess o);
32349 * Creates a new CResult_SendSuccessSendErrorZ in the error state.
32351 struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_err(struct LDKSendError e);
32354 * Checks if the given object is currently in the success state
32356 bool CResult_SendSuccessSendErrorZ_is_ok(const struct LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR o);
32359 * Frees any resources used by the CResult_SendSuccessSendErrorZ.
32361 void CResult_SendSuccessSendErrorZ_free(struct LDKCResult_SendSuccessSendErrorZ _res);
32364 * Creates a new CResult_SendSuccessSendErrorZ which has the same data as `orig`
32365 * but with all dynamically-allocated buffers duplicated in new buffers.
32367 struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_clone(const struct LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR orig);
32370 * Creates a new CResult_BlindedPathNoneZ in the success state.
32372 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_ok(struct LDKBlindedPath o);
32375 * Creates a new CResult_BlindedPathNoneZ in the error state.
32377 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_err(void);
32380 * Checks if the given object is currently in the success state
32382 bool CResult_BlindedPathNoneZ_is_ok(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR o);
32385 * Frees any resources used by the CResult_BlindedPathNoneZ.
32387 void CResult_BlindedPathNoneZ_free(struct LDKCResult_BlindedPathNoneZ _res);
32390 * Creates a new CResult_BlindedPathNoneZ which has the same data as `orig`
32391 * but with all dynamically-allocated buffers duplicated in new buffers.
32393 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_clone(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR orig);
32396 * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the success state.
32398 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ o);
32401 * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the error state.
32403 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err(void);
32406 * Checks if the given object is currently in the success state
32408 bool CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR o);
32411 * Frees any resources used by the CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.
32413 void CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ _res);
32416 * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ which has the same data as `orig`
32417 * but with all dynamically-allocated buffers duplicated in new buffers.
32419 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR orig);
32422 * Frees the buffer pointed to by `data` if `datalen` is non-0.
32424 void CVec_ForwardNodeZ_free(struct LDKCVec_ForwardNodeZ _res);
32427 * Creates a new CResult_BlindedPathDecodeErrorZ in the success state.
32429 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_ok(struct LDKBlindedPath o);
32432 * Creates a new CResult_BlindedPathDecodeErrorZ in the error state.
32434 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_err(struct LDKDecodeError e);
32437 * Checks if the given object is currently in the success state
32439 bool CResult_BlindedPathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR o);
32442 * Frees any resources used by the CResult_BlindedPathDecodeErrorZ.
32444 void CResult_BlindedPathDecodeErrorZ_free(struct LDKCResult_BlindedPathDecodeErrorZ _res);
32447 * Creates a new CResult_BlindedPathDecodeErrorZ which has the same data as `orig`
32448 * but with all dynamically-allocated buffers duplicated in new buffers.
32450 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_clone(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR orig);
32453 * Creates a new CResult_BlindedHopDecodeErrorZ in the success state.
32455 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o);
32458 * Creates a new CResult_BlindedHopDecodeErrorZ in the error state.
32460 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e);
32463 * Checks if the given object is currently in the success state
32465 bool CResult_BlindedHopDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR o);
32468 * Frees any resources used by the CResult_BlindedHopDecodeErrorZ.
32470 void CResult_BlindedHopDecodeErrorZ_free(struct LDKCResult_BlindedHopDecodeErrorZ _res);
32473 * Creates a new CResult_BlindedHopDecodeErrorZ which has the same data as `orig`
32474 * but with all dynamically-allocated buffers duplicated in new buffers.
32476 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_clone(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR orig);
32479 * Creates a new CResult_InvoiceErrorDecodeErrorZ in the success state.
32481 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_ok(struct LDKInvoiceError o);
32484 * Creates a new CResult_InvoiceErrorDecodeErrorZ in the error state.
32486 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_err(struct LDKDecodeError e);
32489 * Checks if the given object is currently in the success state
32491 bool CResult_InvoiceErrorDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR o);
32494 * Frees any resources used by the CResult_InvoiceErrorDecodeErrorZ.
32496 void CResult_InvoiceErrorDecodeErrorZ_free(struct LDKCResult_InvoiceErrorDecodeErrorZ _res);
32499 * Creates a new CResult_InvoiceErrorDecodeErrorZ which has the same data as `orig`
32500 * but with all dynamically-allocated buffers duplicated in new buffers.
32502 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_clone(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR orig);
32505 * Creates a new CResult_TrackedSpendableOutputDecodeErrorZ in the success state.
32507 struct LDKCResult_TrackedSpendableOutputDecodeErrorZ CResult_TrackedSpendableOutputDecodeErrorZ_ok(struct LDKTrackedSpendableOutput o);
32510 * Creates a new CResult_TrackedSpendableOutputDecodeErrorZ in the error state.
32512 struct LDKCResult_TrackedSpendableOutputDecodeErrorZ CResult_TrackedSpendableOutputDecodeErrorZ_err(struct LDKDecodeError e);
32515 * Checks if the given object is currently in the success state
32517 bool CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(const struct LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR o);
32520 * Frees any resources used by the CResult_TrackedSpendableOutputDecodeErrorZ.
32522 void CResult_TrackedSpendableOutputDecodeErrorZ_free(struct LDKCResult_TrackedSpendableOutputDecodeErrorZ _res);
32525 * Creates a new CResult_TrackedSpendableOutputDecodeErrorZ which has the same data as `orig`
32526 * but with all dynamically-allocated buffers duplicated in new buffers.
32528 struct LDKCResult_TrackedSpendableOutputDecodeErrorZ CResult_TrackedSpendableOutputDecodeErrorZ_clone(const struct LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR orig);
32531 * Creates a new CResult_OutputSpendStatusDecodeErrorZ in the success state.
32533 struct LDKCResult_OutputSpendStatusDecodeErrorZ CResult_OutputSpendStatusDecodeErrorZ_ok(struct LDKOutputSpendStatus o);
32536 * Creates a new CResult_OutputSpendStatusDecodeErrorZ in the error state.
32538 struct LDKCResult_OutputSpendStatusDecodeErrorZ CResult_OutputSpendStatusDecodeErrorZ_err(struct LDKDecodeError e);
32541 * Checks if the given object is currently in the success state
32543 bool CResult_OutputSpendStatusDecodeErrorZ_is_ok(const struct LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR o);
32546 * Frees any resources used by the CResult_OutputSpendStatusDecodeErrorZ.
32548 void CResult_OutputSpendStatusDecodeErrorZ_free(struct LDKCResult_OutputSpendStatusDecodeErrorZ _res);
32551 * Creates a new CResult_OutputSpendStatusDecodeErrorZ which has the same data as `orig`
32552 * but with all dynamically-allocated buffers duplicated in new buffers.
32554 struct LDKCResult_OutputSpendStatusDecodeErrorZ CResult_OutputSpendStatusDecodeErrorZ_clone(const struct LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR orig);
32557 * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
32559 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
32562 * Constructs a new COption_FilterZ containing nothing
32564 struct LDKCOption_FilterZ COption_FilterZ_none(void);
32567 * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
32569 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
32572 * Frees the buffer pointed to by `data` if `datalen` is non-0.
32574 void CVec_TrackedSpendableOutputZ_free(struct LDKCVec_TrackedSpendableOutputZ _res);
32577 * Creates a new CResult_OutputSweeperDecodeErrorZ in the success state.
32579 struct LDKCResult_OutputSweeperDecodeErrorZ CResult_OutputSweeperDecodeErrorZ_ok(struct LDKOutputSweeper o);
32582 * Creates a new CResult_OutputSweeperDecodeErrorZ in the error state.
32584 struct LDKCResult_OutputSweeperDecodeErrorZ CResult_OutputSweeperDecodeErrorZ_err(struct LDKDecodeError e);
32587 * Checks if the given object is currently in the success state
32589 bool CResult_OutputSweeperDecodeErrorZ_is_ok(const struct LDKCResult_OutputSweeperDecodeErrorZ *NONNULL_PTR o);
32592 * Frees any resources used by the CResult_OutputSweeperDecodeErrorZ.
32594 void CResult_OutputSweeperDecodeErrorZ_free(struct LDKCResult_OutputSweeperDecodeErrorZ _res);
32597 * Creates a new C2Tuple_BestBlockOutputSweeperZ from the contained elements.
32599 struct LDKC2Tuple_BestBlockOutputSweeperZ C2Tuple_BestBlockOutputSweeperZ_new(struct LDKBestBlock a, struct LDKOutputSweeper b);
32602 * Frees any resources used by the C2Tuple_BestBlockOutputSweeperZ.
32604 void C2Tuple_BestBlockOutputSweeperZ_free(struct LDKC2Tuple_BestBlockOutputSweeperZ _res);
32607 * Creates a new CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ in the success state.
32609 struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok(struct LDKC2Tuple_BestBlockOutputSweeperZ o);
32612 * Creates a new CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ in the error state.
32614 struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_err(struct LDKDecodeError e);
32617 * Checks if the given object is currently in the success state
32619 bool CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ *NONNULL_PTR o);
32622 * Frees any resources used by the CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ.
32624 void CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ _res);
32627 * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ in the success state.
32629 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_ok(struct LDKDelayedPaymentBasepoint o);
32632 * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ in the error state.
32634 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_err(struct LDKDecodeError e);
32637 * Checks if the given object is currently in the success state
32639 bool CResult_DelayedPaymentBasepointDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR o);
32642 * Frees any resources used by the CResult_DelayedPaymentBasepointDecodeErrorZ.
32644 void CResult_DelayedPaymentBasepointDecodeErrorZ_free(struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ _res);
32647 * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ which has the same data as `orig`
32648 * but with all dynamically-allocated buffers duplicated in new buffers.
32650 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR orig);
32653 * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ in the success state.
32655 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ CResult_DelayedPaymentKeyDecodeErrorZ_ok(struct LDKDelayedPaymentKey o);
32658 * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ in the error state.
32660 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ CResult_DelayedPaymentKeyDecodeErrorZ_err(struct LDKDecodeError e);
32663 * Checks if the given object is currently in the success state
32665 bool CResult_DelayedPaymentKeyDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR o);
32668 * Frees any resources used by the CResult_DelayedPaymentKeyDecodeErrorZ.
32670 void CResult_DelayedPaymentKeyDecodeErrorZ_free(struct LDKCResult_DelayedPaymentKeyDecodeErrorZ _res);
32673 * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ which has the same data as `orig`
32674 * but with all dynamically-allocated buffers duplicated in new buffers.
32676 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ CResult_DelayedPaymentKeyDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR orig);
32679 * Creates a new CResult_HtlcBasepointDecodeErrorZ in the success state.
32681 struct LDKCResult_HtlcBasepointDecodeErrorZ CResult_HtlcBasepointDecodeErrorZ_ok(struct LDKHtlcBasepoint o);
32684 * Creates a new CResult_HtlcBasepointDecodeErrorZ in the error state.
32686 struct LDKCResult_HtlcBasepointDecodeErrorZ CResult_HtlcBasepointDecodeErrorZ_err(struct LDKDecodeError e);
32689 * Checks if the given object is currently in the success state
32691 bool CResult_HtlcBasepointDecodeErrorZ_is_ok(const struct LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR o);
32694 * Frees any resources used by the CResult_HtlcBasepointDecodeErrorZ.
32696 void CResult_HtlcBasepointDecodeErrorZ_free(struct LDKCResult_HtlcBasepointDecodeErrorZ _res);
32699 * Creates a new CResult_HtlcBasepointDecodeErrorZ which has the same data as `orig`
32700 * but with all dynamically-allocated buffers duplicated in new buffers.
32702 struct LDKCResult_HtlcBasepointDecodeErrorZ CResult_HtlcBasepointDecodeErrorZ_clone(const struct LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR orig);
32705 * Creates a new CResult_HtlcKeyDecodeErrorZ in the success state.
32707 struct LDKCResult_HtlcKeyDecodeErrorZ CResult_HtlcKeyDecodeErrorZ_ok(struct LDKHtlcKey o);
32710 * Creates a new CResult_HtlcKeyDecodeErrorZ in the error state.
32712 struct LDKCResult_HtlcKeyDecodeErrorZ CResult_HtlcKeyDecodeErrorZ_err(struct LDKDecodeError e);
32715 * Checks if the given object is currently in the success state
32717 bool CResult_HtlcKeyDecodeErrorZ_is_ok(const struct LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR o);
32720 * Frees any resources used by the CResult_HtlcKeyDecodeErrorZ.
32722 void CResult_HtlcKeyDecodeErrorZ_free(struct LDKCResult_HtlcKeyDecodeErrorZ _res);
32725 * Creates a new CResult_HtlcKeyDecodeErrorZ which has the same data as `orig`
32726 * but with all dynamically-allocated buffers duplicated in new buffers.
32728 struct LDKCResult_HtlcKeyDecodeErrorZ CResult_HtlcKeyDecodeErrorZ_clone(const struct LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR orig);
32731 * Creates a new CResult_RevocationBasepointDecodeErrorZ in the success state.
32733 struct LDKCResult_RevocationBasepointDecodeErrorZ CResult_RevocationBasepointDecodeErrorZ_ok(struct LDKRevocationBasepoint o);
32736 * Creates a new CResult_RevocationBasepointDecodeErrorZ in the error state.
32738 struct LDKCResult_RevocationBasepointDecodeErrorZ CResult_RevocationBasepointDecodeErrorZ_err(struct LDKDecodeError e);
32741 * Checks if the given object is currently in the success state
32743 bool CResult_RevocationBasepointDecodeErrorZ_is_ok(const struct LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR o);
32746 * Frees any resources used by the CResult_RevocationBasepointDecodeErrorZ.
32748 void CResult_RevocationBasepointDecodeErrorZ_free(struct LDKCResult_RevocationBasepointDecodeErrorZ _res);
32751 * Creates a new CResult_RevocationBasepointDecodeErrorZ which has the same data as `orig`
32752 * but with all dynamically-allocated buffers duplicated in new buffers.
32754 struct LDKCResult_RevocationBasepointDecodeErrorZ CResult_RevocationBasepointDecodeErrorZ_clone(const struct LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR orig);
32757 * Creates a new CResult_RevocationKeyDecodeErrorZ in the success state.
32759 struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_ok(struct LDKRevocationKey o);
32762 * Creates a new CResult_RevocationKeyDecodeErrorZ in the error state.
32764 struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_err(struct LDKDecodeError e);
32767 * Checks if the given object is currently in the success state
32769 bool CResult_RevocationKeyDecodeErrorZ_is_ok(const struct LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR o);
32772 * Frees any resources used by the CResult_RevocationKeyDecodeErrorZ.
32774 void CResult_RevocationKeyDecodeErrorZ_free(struct LDKCResult_RevocationKeyDecodeErrorZ _res);
32777 * Creates a new CResult_RevocationKeyDecodeErrorZ which has the same data as `orig`
32778 * but with all dynamically-allocated buffers duplicated in new buffers.
32780 struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_clone(const struct LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR orig);
32783 * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
32785 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
32788 * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
32790 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
32793 * Checks if the given object is currently in the success state
32795 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
32798 * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
32800 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
32803 * Creates a new tuple which has the same data as `orig`
32804 * but with all dynamically-allocated buffers duplicated in new buffers.
32806 struct LDKC2Tuple_OutPointChannelIdZ C2Tuple_OutPointChannelIdZ_clone(const struct LDKC2Tuple_OutPointChannelIdZ *NONNULL_PTR orig);
32809 * Creates a new C2Tuple_OutPointChannelIdZ from the contained elements.
32811 struct LDKC2Tuple_OutPointChannelIdZ C2Tuple_OutPointChannelIdZ_new(struct LDKOutPoint a, struct LDKChannelId b);
32814 * Frees any resources used by the C2Tuple_OutPointChannelIdZ.
32816 void C2Tuple_OutPointChannelIdZ_free(struct LDKC2Tuple_OutPointChannelIdZ _res);
32819 * Frees the buffer pointed to by `data` if `datalen` is non-0.
32821 void CVec_C2Tuple_OutPointChannelIdZZ_free(struct LDKCVec_C2Tuple_OutPointChannelIdZZ _res);
32824 * Frees the buffer pointed to by `data` if `datalen` is non-0.
32826 void CVec_MonitorUpdateIdZ_free(struct LDKCVec_MonitorUpdateIdZ _res);
32829 * Creates a new tuple which has the same data as `orig`
32830 * but with all dynamically-allocated buffers duplicated in new buffers.
32832 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR orig);
32835 * Creates a new C2Tuple_OutPointCVec_MonitorUpdateIdZZ from the contained elements.
32837 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorUpdateIdZ b);
32840 * Frees any resources used by the C2Tuple_OutPointCVec_MonitorUpdateIdZZ.
32842 void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res);
32845 * Frees the buffer pointed to by `data` if `datalen` is non-0.
32847 void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res);
32850 * Frees any resources used by the APIError
32852 void APIError_free(struct LDKAPIError this_ptr);
32855 * Creates a copy of the APIError
32857 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
32860 * Utility method to constructs a new APIMisuseError-variant APIError
32862 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
32865 * Utility method to constructs a new FeeRateTooHigh-variant APIError
32867 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
32870 * Utility method to constructs a new InvalidRoute-variant APIError
32872 struct LDKAPIError APIError_invalid_route(struct LDKStr err);
32875 * Utility method to constructs a new ChannelUnavailable-variant APIError
32877 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
32880 * Utility method to constructs a new MonitorUpdateInProgress-variant APIError
32882 struct LDKAPIError APIError_monitor_update_in_progress(void);
32885 * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
32887 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
32890 * Checks if two APIErrors contain equal inner contents.
32891 * This ignores pointers and is_owned flags and looks at the values in fields.
32893 bool APIError_eq(const struct LDKAPIError *NONNULL_PTR a, const struct LDKAPIError *NONNULL_PTR b);
32896 * Serialize the APIError object into a byte array which can be read by APIError_read
32898 struct LDKCVec_u8Z APIError_write(const struct LDKAPIError *NONNULL_PTR obj);
32901 * Read a APIError from a byte array, created by APIError_write
32903 struct LDKCResult_COption_APIErrorZDecodeErrorZ APIError_read(struct LDKu8slice ser);
32906 * Frees any resources used by the BigSize, if is_owned is set and inner is non-NULL.
32908 void BigSize_free(struct LDKBigSize this_obj);
32910 uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr);
32912 void BigSize_set_a(struct LDKBigSize *NONNULL_PTR this_ptr, uint64_t val);
32915 * Constructs a new BigSize given each field
32917 MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg);
32920 * Creates a copy of the BigSize
32922 struct LDKBigSize BigSize_clone(const struct LDKBigSize *NONNULL_PTR orig);
32925 * Generates a non-cryptographic 64-bit hash of the BigSize.
32927 uint64_t BigSize_hash(const struct LDKBigSize *NONNULL_PTR o);
32930 * Checks if two BigSizes contain equal inner contents.
32931 * This ignores pointers and is_owned flags and looks at the values in fields.
32932 * Two objects with NULL inner values will be considered "equal" here.
32934 bool BigSize_eq(const struct LDKBigSize *NONNULL_PTR a, const struct LDKBigSize *NONNULL_PTR b);
32937 * Serialize the BigSize object into a byte array which can be read by BigSize_read
32939 struct LDKCVec_u8Z BigSize_write(const struct LDKBigSize *NONNULL_PTR obj);
32942 * Read a BigSize from a byte array, created by BigSize_write
32944 struct LDKCResult_BigSizeDecodeErrorZ BigSize_read(struct LDKu8slice ser);
32947 * Frees any resources used by the Hostname, if is_owned is set and inner is non-NULL.
32949 void Hostname_free(struct LDKHostname this_obj);
32952 * Creates a copy of the Hostname
32954 struct LDKHostname Hostname_clone(const struct LDKHostname *NONNULL_PTR orig);
32957 * Generates a non-cryptographic 64-bit hash of the Hostname.
32959 uint64_t Hostname_hash(const struct LDKHostname *NONNULL_PTR o);
32962 * Checks if two Hostnames contain equal inner contents.
32963 * This ignores pointers and is_owned flags and looks at the values in fields.
32964 * Two objects with NULL inner values will be considered "equal" here.
32966 bool Hostname_eq(const struct LDKHostname *NONNULL_PTR a, const struct LDKHostname *NONNULL_PTR b);
32969 * Returns the length of the hostname.
32971 MUST_USE_RES uint8_t Hostname_len(const struct LDKHostname *NONNULL_PTR this_arg);
32974 * Serialize the Hostname object into a byte array which can be read by Hostname_read
32976 struct LDKCVec_u8Z Hostname_write(const struct LDKHostname *NONNULL_PTR obj);
32979 * Read a Hostname from a byte array, created by Hostname_write
32981 struct LDKCResult_HostnameDecodeErrorZ Hostname_read(struct LDKu8slice ser);
32984 * Frees any resources used by the TransactionU16LenLimited, if is_owned is set and inner is non-NULL.
32986 void TransactionU16LenLimited_free(struct LDKTransactionU16LenLimited this_obj);
32989 * Creates a copy of the TransactionU16LenLimited
32991 struct LDKTransactionU16LenLimited TransactionU16LenLimited_clone(const struct LDKTransactionU16LenLimited *NONNULL_PTR orig);
32994 * Generates a non-cryptographic 64-bit hash of the TransactionU16LenLimited.
32996 uint64_t TransactionU16LenLimited_hash(const struct LDKTransactionU16LenLimited *NONNULL_PTR o);
32999 * Checks if two TransactionU16LenLimiteds contain equal inner contents.
33000 * This ignores pointers and is_owned flags and looks at the values in fields.
33001 * Two objects with NULL inner values will be considered "equal" here.
33003 bool TransactionU16LenLimited_eq(const struct LDKTransactionU16LenLimited *NONNULL_PTR a, const struct LDKTransactionU16LenLimited *NONNULL_PTR b);
33006 * Constructs a new `TransactionU16LenLimited` from a `Transaction` only if it's consensus-
33007 * serialized length is <= u16::MAX.
33009 MUST_USE_RES struct LDKCResult_TransactionU16LenLimitedNoneZ TransactionU16LenLimited_new(struct LDKTransaction transaction);
33012 * Consumes this `TransactionU16LenLimited` and returns its contained `Transaction`.
33014 MUST_USE_RES struct LDKTransaction TransactionU16LenLimited_into_transaction(struct LDKTransactionU16LenLimited this_arg);
33017 * Returns a reference to the contained `Transaction`
33019 MUST_USE_RES struct LDKTransaction TransactionU16LenLimited_as_transaction(const struct LDKTransactionU16LenLimited *NONNULL_PTR this_arg);
33022 * Serialize the TransactionU16LenLimited object into a byte array which can be read by TransactionU16LenLimited_read
33024 struct LDKCVec_u8Z TransactionU16LenLimited_write(const struct LDKTransactionU16LenLimited *NONNULL_PTR obj);
33027 * Read a TransactionU16LenLimited from a byte array, created by TransactionU16LenLimited_write
33029 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ TransactionU16LenLimited_read(struct LDKu8slice ser);
33032 * Creates a digital signature of a message given a SecretKey, like the node's secret.
33033 * 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.
33034 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
33036 struct LDKCResult_StrSecp256k1ErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
33039 * Recovers the PublicKey of the signer of the message given the message and the signature.
33041 struct LDKCResult_PublicKeySecp256k1ErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
33044 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
33045 * and the PublicKey.
33047 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
33050 * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
33052 struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z data_without_signature);
33055 * Calls the free function if one is set
33057 void KVStore_free(struct LDKKVStore this_ptr);
33060 * Calls the free function if one is set
33062 void Persister_free(struct LDKPersister this_ptr);
33065 * Read previously persisted [`ChannelMonitor`]s from the store.
33067 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ read_channel_monitors(struct LDKKVStore kv_store, struct LDKEntropySource entropy_source, struct LDKSignerProvider signer_provider);
33070 * Frees any resources used by the MonitorUpdatingPersister, if is_owned is set and inner is non-NULL.
33072 void MonitorUpdatingPersister_free(struct LDKMonitorUpdatingPersister this_obj);
33075 * Constructs a new [`MonitorUpdatingPersister`].
33077 * The `maximum_pending_updates` parameter controls how many updates may be stored before a
33078 * [`MonitorUpdatingPersister`] consolidates updates by writing a full monitor. Note that
33079 * consolidation will frequently occur with fewer updates than what you set here; this number
33080 * is merely the maximum that may be stored. When setting this value, consider that for higher
33081 * values of `maximum_pending_updates`:
33083 * - [`MonitorUpdatingPersister`] will tend to write more [`ChannelMonitorUpdate`]s than
33084 * [`ChannelMonitor`]s, approaching one [`ChannelMonitor`] write for every
33085 * `maximum_pending_updates` [`ChannelMonitorUpdate`]s.
33086 * - [`MonitorUpdatingPersister`] will issue deletes differently. Lazy deletes will come in
33087 * \"waves\" for each [`ChannelMonitor`] write. A larger `maximum_pending_updates` means bigger,
33088 * less frequent \"waves.\"
33089 * - [`MonitorUpdatingPersister`] will potentially have more listing to do if you need to run
33090 * [`MonitorUpdatingPersister::cleanup_stale_updates`].
33092 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);
33095 * Reads all stored channel monitors, along with any stored updates for them.
33097 * It is extremely important that your [`KVStore::read`] implementation uses the
33098 * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
33099 * documentation for [`MonitorUpdatingPersister`].
33101 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);
33104 * Read a single channel monitor, along with any stored updates for it.
33106 * It is extremely important that your [`KVStore::read`] implementation uses the
33107 * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
33108 * documentation for [`MonitorUpdatingPersister`].
33110 * For `monitor_key`, channel storage keys be the channel's transaction ID and index, or
33111 * [`OutPoint`], with an underscore `_` between them. For example, given:
33113 * - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
33116 * The correct `monitor_key` would be:
33117 * `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
33119 * Loading a large number of monitors will be faster if done in parallel. You can use this
33120 * function to accomplish this. Take care to limit the number of parallel readers.
33122 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);
33125 * Cleans up stale updates for all monitors.
33127 * This function works by first listing all monitors, and then for each of them, listing all
33128 * updates. The updates that have an `update_id` less than or equal to than the stored monitor
33129 * are deleted. The deletion can either be lazy or non-lazy based on the `lazy` flag; this will
33130 * be passed to [`KVStore::remove`].
33132 MUST_USE_RES struct LDKCResult_NoneIOErrorZ MonitorUpdatingPersister_cleanup_stale_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, bool lazy);
33135 * Constructs a new Persist which calls the relevant methods on this_arg.
33136 * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
33138 struct LDKPersist MonitorUpdatingPersister_as_Persist(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg);
33141 * Creates a copy of the ShortChannelIdError
33143 enum LDKShortChannelIdError ShortChannelIdError_clone(const enum LDKShortChannelIdError *NONNULL_PTR orig);
33146 * Utility method to constructs a new BlockOverflow-variant ShortChannelIdError
33148 enum LDKShortChannelIdError ShortChannelIdError_block_overflow(void);
33151 * Utility method to constructs a new TxIndexOverflow-variant ShortChannelIdError
33153 enum LDKShortChannelIdError ShortChannelIdError_tx_index_overflow(void);
33156 * Utility method to constructs a new VoutIndexOverflow-variant ShortChannelIdError
33158 enum LDKShortChannelIdError ShortChannelIdError_vout_index_overflow(void);
33161 * Checks if two ShortChannelIdErrors contain equal inner contents.
33162 * This ignores pointers and is_owned flags and looks at the values in fields.
33164 bool ShortChannelIdError_eq(const enum LDKShortChannelIdError *NONNULL_PTR a, const enum LDKShortChannelIdError *NONNULL_PTR b);
33167 * Extracts the block height (most significant 3-bytes) from the `short_channel_id`
33169 uint32_t block_from_scid(uint64_t short_channel_id);
33172 * Extracts the tx index (bytes [2..4]) from the `short_channel_id`
33174 uint32_t tx_index_from_scid(uint64_t short_channel_id);
33177 * Extracts the vout (bytes [0..2]) from the `short_channel_id`
33179 uint16_t vout_from_scid(uint64_t short_channel_id);
33182 * Constructs a `short_channel_id` using the components pieces. Results in an error
33183 * if the block height, tx index, or vout index overflow the maximum sizes.
33185 struct LDKCResult_u64ShortChannelIdErrorZ scid_from_parts(uint64_t block, uint64_t tx_index, uint64_t vout_index);
33188 * Frees any resources used by the UntrustedString, if is_owned is set and inner is non-NULL.
33190 void UntrustedString_free(struct LDKUntrustedString this_obj);
33192 struct LDKStr UntrustedString_get_a(const struct LDKUntrustedString *NONNULL_PTR this_ptr);
33194 void UntrustedString_set_a(struct LDKUntrustedString *NONNULL_PTR this_ptr, struct LDKStr val);
33197 * Constructs a new UntrustedString given each field
33199 MUST_USE_RES struct LDKUntrustedString UntrustedString_new(struct LDKStr a_arg);
33202 * Creates a copy of the UntrustedString
33204 struct LDKUntrustedString UntrustedString_clone(const struct LDKUntrustedString *NONNULL_PTR orig);
33207 * Checks if two UntrustedStrings contain equal inner contents.
33208 * This ignores pointers and is_owned flags and looks at the values in fields.
33209 * Two objects with NULL inner values will be considered "equal" here.
33211 bool UntrustedString_eq(const struct LDKUntrustedString *NONNULL_PTR a, const struct LDKUntrustedString *NONNULL_PTR b);
33214 * Generates a non-cryptographic 64-bit hash of the UntrustedString.
33216 uint64_t UntrustedString_hash(const struct LDKUntrustedString *NONNULL_PTR o);
33219 * Serialize the UntrustedString object into a byte array which can be read by UntrustedString_read
33221 struct LDKCVec_u8Z UntrustedString_write(const struct LDKUntrustedString *NONNULL_PTR obj);
33224 * Read a UntrustedString from a byte array, created by UntrustedString_write
33226 struct LDKCResult_UntrustedStringDecodeErrorZ UntrustedString_read(struct LDKu8slice ser);
33229 * Frees any resources used by the PrintableString, if is_owned is set and inner is non-NULL.
33231 void PrintableString_free(struct LDKPrintableString this_obj);
33233 struct LDKStr PrintableString_get_a(const struct LDKPrintableString *NONNULL_PTR this_ptr);
33235 void PrintableString_set_a(struct LDKPrintableString *NONNULL_PTR this_ptr, struct LDKStr val);
33238 * Constructs a new PrintableString given each field
33240 MUST_USE_RES struct LDKPrintableString PrintableString_new(struct LDKStr a_arg);
33243 * Frees any resources used by the TrackedSpendableOutput, if is_owned is set and inner is non-NULL.
33245 void TrackedSpendableOutput_free(struct LDKTrackedSpendableOutput this_obj);
33248 * The tracked output descriptor.
33250 struct LDKSpendableOutputDescriptor TrackedSpendableOutput_get_descriptor(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr);
33253 * The tracked output descriptor.
33255 void TrackedSpendableOutput_set_descriptor(struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr, struct LDKSpendableOutputDescriptor val);
33258 * The channel this output belongs to.
33260 * Will be `None` if no `channel_id` was given to [`OutputSweeper::track_spendable_outputs`]
33262 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33264 struct LDKChannelId TrackedSpendableOutput_get_channel_id(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr);
33267 * The channel this output belongs to.
33269 * Will be `None` if no `channel_id` was given to [`OutputSweeper::track_spendable_outputs`]
33271 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
33273 void TrackedSpendableOutput_set_channel_id(struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr, struct LDKChannelId val);
33276 * The current status of the output spend.
33278 struct LDKOutputSpendStatus TrackedSpendableOutput_get_status(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr);
33281 * The current status of the output spend.
33283 void TrackedSpendableOutput_set_status(struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr, struct LDKOutputSpendStatus val);
33286 * Constructs a new TrackedSpendableOutput given each field
33288 * Note that channel_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
33290 MUST_USE_RES struct LDKTrackedSpendableOutput TrackedSpendableOutput_new(struct LDKSpendableOutputDescriptor descriptor_arg, struct LDKChannelId channel_id_arg, struct LDKOutputSpendStatus status_arg);
33293 * Creates a copy of the TrackedSpendableOutput
33295 struct LDKTrackedSpendableOutput TrackedSpendableOutput_clone(const struct LDKTrackedSpendableOutput *NONNULL_PTR orig);
33298 * Checks if two TrackedSpendableOutputs contain equal inner contents.
33299 * This ignores pointers and is_owned flags and looks at the values in fields.
33300 * Two objects with NULL inner values will be considered "equal" here.
33302 bool TrackedSpendableOutput_eq(const struct LDKTrackedSpendableOutput *NONNULL_PTR a, const struct LDKTrackedSpendableOutput *NONNULL_PTR b);
33305 * Returns whether the output is spent in the given transaction.
33307 MUST_USE_RES bool TrackedSpendableOutput_is_spent_in(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_arg, struct LDKTransaction tx);
33310 * Serialize the TrackedSpendableOutput object into a byte array which can be read by TrackedSpendableOutput_read
33312 struct LDKCVec_u8Z TrackedSpendableOutput_write(const struct LDKTrackedSpendableOutput *NONNULL_PTR obj);
33315 * Read a TrackedSpendableOutput from a byte array, created by TrackedSpendableOutput_write
33317 struct LDKCResult_TrackedSpendableOutputDecodeErrorZ TrackedSpendableOutput_read(struct LDKu8slice ser);
33320 * Frees any resources used by the OutputSpendStatus
33322 void OutputSpendStatus_free(struct LDKOutputSpendStatus this_ptr);
33325 * Creates a copy of the OutputSpendStatus
33327 struct LDKOutputSpendStatus OutputSpendStatus_clone(const struct LDKOutputSpendStatus *NONNULL_PTR orig);
33330 * Utility method to constructs a new PendingInitialBroadcast-variant OutputSpendStatus
33332 struct LDKOutputSpendStatus OutputSpendStatus_pending_initial_broadcast(struct LDKCOption_u32Z delayed_until_height);
33335 * Utility method to constructs a new PendingFirstConfirmation-variant OutputSpendStatus
33337 struct LDKOutputSpendStatus OutputSpendStatus_pending_first_confirmation(struct LDKThirtyTwoBytes first_broadcast_hash, uint32_t latest_broadcast_height, struct LDKTransaction latest_spending_tx);
33340 * Utility method to constructs a new PendingThresholdConfirmations-variant OutputSpendStatus
33342 struct LDKOutputSpendStatus OutputSpendStatus_pending_threshold_confirmations(struct LDKThirtyTwoBytes first_broadcast_hash, uint32_t latest_broadcast_height, struct LDKTransaction latest_spending_tx, uint32_t confirmation_height, struct LDKThirtyTwoBytes confirmation_hash);
33345 * Checks if two OutputSpendStatuss contain equal inner contents.
33346 * This ignores pointers and is_owned flags and looks at the values in fields.
33348 bool OutputSpendStatus_eq(const struct LDKOutputSpendStatus *NONNULL_PTR a, const struct LDKOutputSpendStatus *NONNULL_PTR b);
33351 * Serialize the OutputSpendStatus object into a byte array which can be read by OutputSpendStatus_read
33353 struct LDKCVec_u8Z OutputSpendStatus_write(const struct LDKOutputSpendStatus *NONNULL_PTR obj);
33356 * Read a OutputSpendStatus from a byte array, created by OutputSpendStatus_write
33358 struct LDKCResult_OutputSpendStatusDecodeErrorZ OutputSpendStatus_read(struct LDKu8slice ser);
33361 * Frees any resources used by the OutputSweeper, if is_owned is set and inner is non-NULL.
33363 void OutputSweeper_free(struct LDKOutputSweeper this_obj);
33366 * Constructs a new [`OutputSweeper`].
33368 * If chain data is provided via the [`Confirm`] interface or via filtered blocks, users also
33369 * need to register their [`Filter`] implementation via the given `chain_data_source`.
33371 MUST_USE_RES struct LDKOutputSweeper OutputSweeper_new(struct LDKBestBlock best_block, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKCOption_FilterZ chain_data_source, struct LDKOutputSpender output_spender, struct LDKChangeDestinationSource change_destination_source, struct LDKKVStore kv_store, struct LDKLogger logger);
33374 * Tells the sweeper to track the given outputs descriptors.
33376 * Usually, this should be called based on the values emitted by the
33377 * [`Event::SpendableOutputs`].
33379 * The given `exclude_static_outputs` flag controls whether the sweeper will filter out
33380 * [`SpendableOutputDescriptor::StaticOutput`]s, which may be handled directly by the on-chain
33381 * wallet implementation.
33383 * If `delay_until_height` is set, we will delay the spending until the respective block
33384 * height is reached. This can be used to batch spends, e.g., to reduce on-chain fees.
33386 * Returns `Err` on persistence failure, in which case the call may be safely retried.
33388 * [`Event::SpendableOutputs`]: crate::events::Event::SpendableOutputs
33390 * Note that channel_id (or a relevant inner pointer) may be NULL or all-0s to represent None
33392 MUST_USE_RES struct LDKCResult_NoneNoneZ OutputSweeper_track_spendable_outputs(const struct LDKOutputSweeper *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ output_descriptors, struct LDKChannelId channel_id, bool exclude_static_outputs, struct LDKCOption_u32Z delay_until_height);
33395 * Returns a list of the currently tracked spendable outputs.
33397 MUST_USE_RES struct LDKCVec_TrackedSpendableOutputZ OutputSweeper_tracked_spendable_outputs(const struct LDKOutputSweeper *NONNULL_PTR this_arg);
33400 * Gets the latest best block which was connected either via the [`Listen`] or
33401 * [`Confirm`] interfaces.
33403 MUST_USE_RES struct LDKBestBlock OutputSweeper_current_best_block(const struct LDKOutputSweeper *NONNULL_PTR this_arg);
33406 * Constructs a new Listen which calls the relevant methods on this_arg.
33407 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
33409 struct LDKListen OutputSweeper_as_Listen(const struct LDKOutputSweeper *NONNULL_PTR this_arg);
33412 * Constructs a new Confirm which calls the relevant methods on this_arg.
33413 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
33415 struct LDKConfirm OutputSweeper_as_Confirm(const struct LDKOutputSweeper *NONNULL_PTR this_arg);
33418 * Frees any resources used by the SpendingDelay
33420 void SpendingDelay_free(struct LDKSpendingDelay this_ptr);
33423 * Creates a copy of the SpendingDelay
33425 struct LDKSpendingDelay SpendingDelay_clone(const struct LDKSpendingDelay *NONNULL_PTR orig);
33428 * Utility method to constructs a new Relative-variant SpendingDelay
33430 struct LDKSpendingDelay SpendingDelay_relative(uint32_t num_blocks);
33433 * Utility method to constructs a new Absolute-variant SpendingDelay
33435 struct LDKSpendingDelay SpendingDelay_absolute(uint32_t height);
33438 * Read a OutputSweeper from a byte array, created by OutputSweeper_write
33440 struct LDKCResult_OutputSweeperDecodeErrorZ OutputSweeper_read(struct LDKu8slice ser, struct LDKBroadcasterInterface arg_a, struct LDKFeeEstimator arg_b, struct LDKCOption_FilterZ arg_c, struct LDKOutputSpender arg_d, struct LDKChangeDestinationSource arg_e, struct LDKKVStore arg_f, struct LDKLogger arg_g);
33443 * Read a C2Tuple_BestBlockOutputSweeperZ from a byte array, created by C2Tuple_BestBlockOutputSweeperZ_write
33445 struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ C2Tuple_BestBlockOutputSweeperZ_read(struct LDKu8slice ser, struct LDKBroadcasterInterface arg_a, struct LDKFeeEstimator arg_b, struct LDKCOption_FilterZ arg_c, struct LDKOutputSpender arg_d, struct LDKChangeDestinationSource arg_e, struct LDKKVStore arg_f, struct LDKLogger arg_g);
33448 * Calls the free function if one is set
33450 void FutureCallback_free(struct LDKFutureCallback this_ptr);
33453 * Frees any resources used by the Future, if is_owned is set and inner is non-NULL.
33455 void Future_free(struct LDKFuture this_obj);
33458 * Registers a callback to be called upon completion of this future. If the future has already
33459 * completed, the callback will be called immediately.
33461 void Future_register_callback_fn(const struct LDKFuture *NONNULL_PTR this_arg, struct LDKFutureCallback callback);
33464 * Waits until this [`Future`] completes.
33466 void Future_wait(const struct LDKFuture *NONNULL_PTR this_arg);
33469 * Waits until this [`Future`] completes or the given amount of time has elapsed.
33471 * Returns true if the [`Future`] completed, false if the time elapsed.
33473 MUST_USE_RES bool Future_wait_timeout(const struct LDKFuture *NONNULL_PTR this_arg, uint64_t max_wait);
33476 * Frees any resources used by the Sleeper, if is_owned is set and inner is non-NULL.
33478 void Sleeper_free(struct LDKSleeper this_obj);
33481 * Constructs a new sleeper from one future, allowing blocking on it.
33483 MUST_USE_RES struct LDKSleeper Sleeper_from_single_future(const struct LDKFuture *NONNULL_PTR future);
33486 * Constructs a new sleeper from two futures, allowing blocking on both at once.
33488 MUST_USE_RES struct LDKSleeper Sleeper_from_two_futures(const struct LDKFuture *NONNULL_PTR fut_a, const struct LDKFuture *NONNULL_PTR fut_b);
33491 * Constructs a new sleeper on many futures, allowing blocking on all at once.
33493 MUST_USE_RES struct LDKSleeper Sleeper_new(struct LDKCVec_FutureZ futures);
33496 * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed.
33498 void Sleeper_wait(const struct LDKSleeper *NONNULL_PTR this_arg);
33501 * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed or the
33502 * given amount of time has elapsed. Returns true if a [`Future`] completed, false if the time
33505 MUST_USE_RES bool Sleeper_wait_timeout(const struct LDKSleeper *NONNULL_PTR this_arg, uint64_t max_wait);
33508 * Creates a copy of the Level
33510 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
33513 * Utility method to constructs a new Gossip-variant Level
33515 enum LDKLevel Level_gossip(void);
33518 * Utility method to constructs a new Trace-variant Level
33520 enum LDKLevel Level_trace(void);
33523 * Utility method to constructs a new Debug-variant Level
33525 enum LDKLevel Level_debug(void);
33528 * Utility method to constructs a new Info-variant Level
33530 enum LDKLevel Level_info(void);
33533 * Utility method to constructs a new Warn-variant Level
33535 enum LDKLevel Level_warn(void);
33538 * Utility method to constructs a new Error-variant Level
33540 enum LDKLevel Level_error(void);
33543 * Checks if two Levels contain equal inner contents.
33544 * This ignores pointers and is_owned flags and looks at the values in fields.
33546 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
33549 * Generates a non-cryptographic 64-bit hash of the Level.
33551 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
33554 * Returns the most verbose logging level.
33556 MUST_USE_RES enum LDKLevel Level_max(void);
33559 * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
33561 void Record_free(struct LDKRecord this_obj);
33564 * The verbosity level of the message.
33566 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
33569 * The verbosity level of the message.
33571 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
33574 * The node id of the peer pertaining to the logged record.
33576 * Note that in some cases a [`Self::channel_id`] may be filled in but this may still be
33577 * `None`, depending on if the peer information is readily available in LDK when the log is
33580 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33582 struct LDKPublicKey Record_get_peer_id(const struct LDKRecord *NONNULL_PTR this_ptr);
33585 * The node id of the peer pertaining to the logged record.
33587 * Note that in some cases a [`Self::channel_id`] may be filled in but this may still be
33588 * `None`, depending on if the peer information is readily available in LDK when the log is
33591 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
33593 void Record_set_peer_id(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33596 * The channel id of the channel pertaining to the logged record. May be a temporary id before
33597 * the channel has been funded.
33599 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33601 struct LDKChannelId Record_get_channel_id(const struct LDKRecord *NONNULL_PTR this_ptr);
33604 * The channel id of the channel pertaining to the logged record. May be a temporary id before
33605 * the channel has been funded.
33607 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
33609 void Record_set_channel_id(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKChannelId val);
33612 * The message body.
33614 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
33617 * The message body.
33619 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
33622 * The module path of the message.
33624 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
33627 * The module path of the message.
33629 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
33632 * The source file containing the message.
33634 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
33637 * The source file containing the message.
33639 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
33642 * The line containing the message.
33644 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
33647 * The line containing the message.
33649 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
33652 * Constructs a new Record given each field
33654 * Note that peer_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
33655 * Note that channel_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
33657 MUST_USE_RES struct LDKRecord Record_new(enum LDKLevel level_arg, struct LDKPublicKey peer_id_arg, struct LDKChannelId channel_id_arg, struct LDKStr args_arg, struct LDKStr module_path_arg, struct LDKStr file_arg, uint32_t line_arg);
33660 * Creates a copy of the Record
33662 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
33665 * Calls the free function if one is set
33667 void Logger_free(struct LDKLogger this_ptr);
33670 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
33672 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
33675 * Confirmations we will wait for before considering the channel locked in.
33676 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
33677 * equivalent limit applied to outbound channels).
33679 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
33680 * transaction before operation. If you wish to accept channels with zero confirmations, see
33681 * [`UserConfig::manually_accept_inbound_channels`] and
33682 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
33684 * Default value: 6.
33686 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
33687 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
33689 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33692 * Confirmations we will wait for before considering the channel locked in.
33693 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
33694 * equivalent limit applied to outbound channels).
33696 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
33697 * transaction before operation. If you wish to accept channels with zero confirmations, see
33698 * [`UserConfig::manually_accept_inbound_channels`] and
33699 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
33701 * Default value: 6.
33703 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
33704 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
33706 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
33709 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
33710 * the number of blocks we have to punish our counterparty if they broadcast a revoked
33713 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
33714 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
33715 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
33716 * possibly with time in between to RBF the spending transaction).
33718 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
33719 * case of an honest unilateral channel close, which implicitly decrease the economic value of
33722 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
33723 * can tweak config to ask for more security, not less.
33725 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33728 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
33729 * the number of blocks we have to punish our counterparty if they broadcast a revoked
33732 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
33733 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
33734 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
33735 * possibly with time in between to RBF the spending transaction).
33737 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
33738 * case of an honest unilateral channel close, which implicitly decrease the economic value of
33741 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
33742 * can tweak config to ask for more security, not less.
33744 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
33747 * Set to the smallest value HTLC we will accept to process.
33749 * This value is sent to our counterparty on channel-open and we close the channel any time
33750 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
33752 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
33755 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33758 * Set to the smallest value HTLC we will accept to process.
33760 * This value is sent to our counterparty on channel-open and we close the channel any time
33761 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
33763 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
33766 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
33769 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
33772 * This can be set to a value between 1-100, where the value corresponds to the percent of the
33773 * channel value in whole percentages.
33776 * * If configured to another value than the default value 10, any new channels created with
33777 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
33778 * `ChannelManager`.
33780 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
33781 * no way to configure the cap for the total value of outbound HTLCs in-flight.
33783 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
33784 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
33785 * restrict exposure to loss due to being offline for too long.
33786 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
33787 * for more information.
33789 * Default value: 10.
33790 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
33791 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
33793 uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33796 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
33799 * This can be set to a value between 1-100, where the value corresponds to the percent of the
33800 * channel value in whole percentages.
33803 * * If configured to another value than the default value 10, any new channels created with
33804 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
33805 * `ChannelManager`.
33807 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
33808 * no way to configure the cap for the total value of outbound HTLCs in-flight.
33810 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
33811 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
33812 * restrict exposure to loss due to being offline for too long.
33813 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
33814 * for more information.
33816 * Default value: 10.
33817 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
33818 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
33820 void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val);
33823 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
33824 * BOLTs) option for outbound private channels. This provides better privacy by not including
33825 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
33826 * relay HTLCs to us using the channel's SCID alias.
33828 * If this option is set, channels may be created that will not be readable by LDK versions
33829 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
33830 * [`DecodeError::InvalidValue`].
33832 * Note that setting this to true does *not* prevent us from opening channels with
33833 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
33834 * private channel without that option.
33836 * Ignored if the channel is negotiated to be announced, see
33837 * [`ChannelHandshakeConfig::announced_channel`] and
33838 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
33840 * Default value: false. This value is likely to change to true in the future.
33842 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
33843 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
33845 bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33848 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
33849 * BOLTs) option for outbound private channels. This provides better privacy by not including
33850 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
33851 * relay HTLCs to us using the channel's SCID alias.
33853 * If this option is set, channels may be created that will not be readable by LDK versions
33854 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
33855 * [`DecodeError::InvalidValue`].
33857 * Note that setting this to true does *not* prevent us from opening channels with
33858 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
33859 * private channel without that option.
33861 * Ignored if the channel is negotiated to be announced, see
33862 * [`ChannelHandshakeConfig::announced_channel`] and
33863 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
33865 * Default value: false. This value is likely to change to true in the future.
33867 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
33868 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
33870 void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
33873 * Set to announce the channel publicly and notify all nodes that they can route via this
33876 * This should only be set to true for nodes which expect to be online reliably.
33878 * As the node which funds a channel picks this value this will only apply for new outbound
33879 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
33881 * Default value: false.
33883 bool ChannelHandshakeConfig_get_announced_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33886 * Set to announce the channel publicly and notify all nodes that they can route via this
33889 * This should only be set to true for nodes which expect to be online reliably.
33891 * As the node which funds a channel picks this value this will only apply for new outbound
33892 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
33894 * Default value: false.
33896 void ChannelHandshakeConfig_set_announced_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
33899 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
33900 * supports it, they will then enforce the mutual-close output to us matches what we provided
33901 * at intialization, preventing us from closing to an alternate pubkey.
33903 * This is set to true by default to provide a slight increase in security, though ultimately
33904 * any attacker who is able to take control of a channel can just as easily send the funds via
33905 * lightning payments, so we never require that our counterparties support this option.
33907 * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
33909 * Default value: true.
33911 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
33913 bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33916 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
33917 * supports it, they will then enforce the mutual-close output to us matches what we provided
33918 * at intialization, preventing us from closing to an alternate pubkey.
33920 * This is set to true by default to provide a slight increase in security, though ultimately
33921 * any attacker who is able to take control of a channel can just as easily send the funds via
33922 * lightning payments, so we never require that our counterparties support this option.
33924 * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
33926 * Default value: true.
33928 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
33930 void ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
33933 * The Proportion of the channel value to configure as counterparty's channel reserve,
33934 * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
33936 * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
33937 * on their side, at all times.
33938 * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
33939 * claiming at least this value on chain.
33941 * Channel reserve values greater than 30% could be considered highly unreasonable, since that
33942 * amount can never be used for payments.
33943 * Also, if our selected channel reserve for counterparty and counterparty's selected
33944 * channel reserve for us sum up to equal or greater than channel value, channel negotiations
33947 * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
33948 * other than the default value.
33950 * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
33951 * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
33952 * as 1000 sats instead, which is a safe implementation-specific lower bound.
33953 * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
33954 * instead, although channel negotiations will fail in that case.
33956 uint32_t ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33959 * The Proportion of the channel value to configure as counterparty's channel reserve,
33960 * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
33962 * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
33963 * on their side, at all times.
33964 * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
33965 * claiming at least this value on chain.
33967 * Channel reserve values greater than 30% could be considered highly unreasonable, since that
33968 * amount can never be used for payments.
33969 * Also, if our selected channel reserve for counterparty and counterparty's selected
33970 * channel reserve for us sum up to equal or greater than channel value, channel negotiations
33973 * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
33974 * other than the default value.
33976 * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
33977 * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
33978 * as 1000 sats instead, which is a safe implementation-specific lower bound.
33979 * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
33980 * instead, although channel negotiations will fail in that case.
33982 void ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
33985 * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
33986 * channels. This feature requires having a reserve of onchain funds readily available to bump
33987 * transactions in the event of a channel force close to avoid the possibility of losing funds.
33989 * Note that if you wish accept inbound channels with anchor outputs, you must enable
33990 * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
33991 * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
33992 * whether your reserve of onchain funds is enough to cover the fees for all existing and new
33993 * channels featuring anchor outputs in the event of a force close.
33995 * If this option is set, channels may be created that will not be readable by LDK versions
33996 * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
33997 * [`DecodeError::InvalidValue`].
33999 * Note that setting this to true does *not* prevent us from opening channels with
34000 * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
34001 * fall back to a `static_remote_key` channel.
34003 * LDK will not support the legacy `option_anchors` commitment version due to a discovered
34004 * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
34005 * Considered Harmful`] mailing list post.
34007 * Default value: false. This value is likely to change to true in the future.
34009 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
34010 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
34011 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
34012 * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
34014 bool ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
34017 * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
34018 * channels. This feature requires having a reserve of onchain funds readily available to bump
34019 * transactions in the event of a channel force close to avoid the possibility of losing funds.
34021 * Note that if you wish accept inbound channels with anchor outputs, you must enable
34022 * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
34023 * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
34024 * whether your reserve of onchain funds is enough to cover the fees for all existing and new
34025 * channels featuring anchor outputs in the event of a force close.
34027 * If this option is set, channels may be created that will not be readable by LDK versions
34028 * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
34029 * [`DecodeError::InvalidValue`].
34031 * Note that setting this to true does *not* prevent us from opening channels with
34032 * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
34033 * fall back to a `static_remote_key` channel.
34035 * LDK will not support the legacy `option_anchors` commitment version due to a discovered
34036 * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
34037 * Considered Harmful`] mailing list post.
34039 * Default value: false. This value is likely to change to true in the future.
34041 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
34042 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
34043 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
34044 * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
34046 void ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
34049 * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
34051 * Increasing the value can help improve liquidity and stability in
34052 * routing at the cost of higher long term disk / DB usage.
34054 * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
34055 * other than the default value.
34057 * Default value: 50
34058 * Maximum value: 483, any values larger will be treated as 483.
34059 * This is the BOLT #2 spec limit on `max_accepted_htlcs`.
34061 uint16_t ChannelHandshakeConfig_get_our_max_accepted_htlcs(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
34064 * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
34066 * Increasing the value can help improve liquidity and stability in
34067 * routing at the cost of higher long term disk / DB usage.
34069 * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
34070 * other than the default value.
34072 * Default value: 50
34073 * Maximum value: 483, any values larger will be treated as 483.
34074 * This is the BOLT #2 spec limit on `max_accepted_htlcs`.
34076 void ChannelHandshakeConfig_set_our_max_accepted_htlcs(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
34079 * Constructs a new ChannelHandshakeConfig given each field
34081 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);
34084 * Creates a copy of the ChannelHandshakeConfig
34086 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
34089 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
34091 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
34094 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
34096 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
34099 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
34100 * only applies to inbound channels.
34102 * Default value: 0.
34104 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34107 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
34108 * only applies to inbound channels.
34110 * Default value: 0.
34112 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
34115 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
34116 * only applies to inbound channels.
34118 * Default value: 2^24 - 1.
34120 uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34123 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
34124 * only applies to inbound channels.
34126 * Default value: 2^24 - 1.
34128 void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
34131 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
34132 * you to limit the maximum minimum-size they can require.
34134 * Default value: u64::max_value.
34136 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34139 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
34140 * you to limit the maximum minimum-size they can require.
34142 * Default value: u64::max_value.
34144 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
34147 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
34148 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
34150 * Default value: 0.
34152 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34155 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
34156 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
34158 * Default value: 0.
34160 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
34163 * The remote node will require we keep a certain amount in direct payment to ourselves at all
34164 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
34165 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
34167 * Default value: u64::max_value.
34169 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34172 * The remote node will require we keep a certain amount in direct payment to ourselves at all
34173 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
34174 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
34176 * Default value: u64::max_value.
34178 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
34181 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
34182 * time. This allows you to set a minimum such value.
34184 * Default value: 0.
34186 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34189 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
34190 * time. This allows you to set a minimum such value.
34192 * Default value: 0.
34194 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
34197 * Before a channel is usable the funding transaction will need to be confirmed by at least a
34198 * certain number of blocks, specified by the node which is not the funder (as the funder can
34199 * assume they aren't going to double-spend themselves).
34200 * This config allows you to set a limit on the maximum amount of time to wait.
34202 * Default value: 144, or roughly one day and only applies to outbound channels.
34204 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34207 * Before a channel is usable the funding transaction will need to be confirmed by at least a
34208 * certain number of blocks, specified by the node which is not the funder (as the funder can
34209 * assume they aren't going to double-spend themselves).
34210 * This config allows you to set a limit on the maximum amount of time to wait.
34212 * Default value: 144, or roughly one day and only applies to outbound channels.
34214 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
34217 * Whether we implicitly trust funding transactions generated by us for our own outbound
34218 * channels to not be double-spent.
34220 * If this is set, we assume that our own funding transactions are *never* double-spent, and
34221 * thus we can trust them without any confirmations. This is generally a reasonable
34222 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
34223 * control of the signing keys).
34225 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
34226 * double-spend the funding transaction to RBF with an alternative channel open.
34228 * This only applies if our counterparty set their confirmations-required value to 0, and we
34229 * always trust our own funding transaction at 1 confirmation irrespective of this value.
34230 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
34231 * `true` (0) and `false` (1).
34233 * Default value: true
34235 bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34238 * Whether we implicitly trust funding transactions generated by us for our own outbound
34239 * channels to not be double-spent.
34241 * If this is set, we assume that our own funding transactions are *never* double-spent, and
34242 * thus we can trust them without any confirmations. This is generally a reasonable
34243 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
34244 * control of the signing keys).
34246 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
34247 * double-spend the funding transaction to RBF with an alternative channel open.
34249 * This only applies if our counterparty set their confirmations-required value to 0, and we
34250 * always trust our own funding transaction at 1 confirmation irrespective of this value.
34251 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
34252 * `true` (0) and `false` (1).
34254 * Default value: true
34256 void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
34259 * Set to force an incoming channel to match our announced channel preference in
34260 * [`ChannelHandshakeConfig::announced_channel`].
34262 * For a node which is not online reliably, this should be set to true and
34263 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
34264 * channels will ever be opened.
34266 * Default value: true.
34268 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34271 * Set to force an incoming channel to match our announced channel preference in
34272 * [`ChannelHandshakeConfig::announced_channel`].
34274 * For a node which is not online reliably, this should be set to true and
34275 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
34276 * channels will ever be opened.
34278 * Default value: true.
34280 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
34283 * Set to the amount of time we're willing to wait to claim money back to us.
34285 * Not checking this value would be a security issue, as our peer would be able to set it to
34286 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
34288 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
34289 * reduce the loss of having useless locked funds (if your peer accepts)
34291 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34294 * Set to the amount of time we're willing to wait to claim money back to us.
34296 * Not checking this value would be a security issue, as our peer would be able to set it to
34297 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
34299 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
34300 * reduce the loss of having useless locked funds (if your peer accepts)
34302 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
34305 * Constructs a new ChannelHandshakeLimits given each field
34307 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);
34310 * Creates a copy of the ChannelHandshakeLimits
34312 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
34315 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
34317 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
34320 * Frees any resources used by the MaxDustHTLCExposure
34322 void MaxDustHTLCExposure_free(struct LDKMaxDustHTLCExposure this_ptr);
34325 * Creates a copy of the MaxDustHTLCExposure
34327 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_clone(const struct LDKMaxDustHTLCExposure *NONNULL_PTR orig);
34330 * Utility method to constructs a new FixedLimitMsat-variant MaxDustHTLCExposure
34332 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fixed_limit_msat(uint64_t a);
34335 * Utility method to constructs a new FeeRateMultiplier-variant MaxDustHTLCExposure
34337 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fee_rate_multiplier(uint64_t a);
34340 * Checks if two MaxDustHTLCExposures contain equal inner contents.
34341 * This ignores pointers and is_owned flags and looks at the values in fields.
34343 bool MaxDustHTLCExposure_eq(const struct LDKMaxDustHTLCExposure *NONNULL_PTR a, const struct LDKMaxDustHTLCExposure *NONNULL_PTR b);
34346 * Serialize the MaxDustHTLCExposure object into a byte array which can be read by MaxDustHTLCExposure_read
34348 struct LDKCVec_u8Z MaxDustHTLCExposure_write(const struct LDKMaxDustHTLCExposure *NONNULL_PTR obj);
34351 * Read a MaxDustHTLCExposure from a byte array, created by MaxDustHTLCExposure_write
34353 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ MaxDustHTLCExposure_read(struct LDKu8slice ser);
34356 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
34358 void ChannelConfig_free(struct LDKChannelConfig this_obj);
34361 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
34362 * over the channel.
34363 * This may be allowed to change at runtime in a later update, however doing so must result in
34364 * update messages sent to notify all nodes of our updated relay fee.
34366 * Default value: 0.
34368 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
34371 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
34372 * over the channel.
34373 * This may be allowed to change at runtime in a later update, however doing so must result in
34374 * update messages sent to notify all nodes of our updated relay fee.
34376 * Default value: 0.
34378 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
34381 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
34382 * excess of [`forwarding_fee_proportional_millionths`].
34383 * This may be allowed to change at runtime in a later update, however doing so must result in
34384 * update messages sent to notify all nodes of our updated relay fee.
34386 * The default value of a single satoshi roughly matches the market rate on many routing nodes
34387 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
34390 * Default value: 1000.
34392 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
34394 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
34397 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
34398 * excess of [`forwarding_fee_proportional_millionths`].
34399 * This may be allowed to change at runtime in a later update, however doing so must result in
34400 * update messages sent to notify all nodes of our updated relay fee.
34402 * The default value of a single satoshi roughly matches the market rate on many routing nodes
34403 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
34406 * Default value: 1000.
34408 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
34410 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
34413 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
34414 * the channel this config applies to.
34416 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
34417 * HTLC balance when a channel appears on-chain whereas
34418 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
34419 * (non-HTLC-encumbered) balance.
34421 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
34422 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
34423 * commitment transaction at least once per this many blocks (minus some margin to allow us
34424 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
34425 * the spending transaction).
34427 * Default value: 72 (12 hours at an average of 6 blocks/hour).
34428 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
34429 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
34431 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
34433 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
34436 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
34437 * the channel this config applies to.
34439 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
34440 * HTLC balance when a channel appears on-chain whereas
34441 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
34442 * (non-HTLC-encumbered) balance.
34444 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
34445 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
34446 * commitment transaction at least once per this many blocks (minus some margin to allow us
34447 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
34448 * the spending transaction).
34450 * Default value: 72 (12 hours at an average of 6 blocks/hour).
34451 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
34452 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
34454 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
34456 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
34459 * Limit our total exposure to potential loss to on-chain fees on close, including in-flight
34460 * HTLCs which are burned to fees as they are too small to claim on-chain and fees on
34461 * commitment transaction(s) broadcasted by our counterparty in excess of our own fee estimate.
34463 * # HTLC-based Dust Exposure
34465 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
34466 * not be claimable on-chain, instead being turned into additional miner fees if either
34467 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
34468 * to such payments may be substantial if there are many dust HTLCs present when the
34469 * channel is force-closed.
34471 * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
34472 * channel negotiated throughout the channel open process, along with the fees required to have
34473 * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
34474 * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
34475 * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
34476 * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
34477 * variant is primarily intended for use with pre-anchor channels.
34479 * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
34480 * exposure across all three types per-channel.
34482 * # Transaction Fee Dust Exposure
34484 * Further, counterparties broadcasting a commitment transaction in a force-close may result
34485 * in other balance being burned to fees, and thus all fees on commitment and HTLC
34486 * transactions in excess of our local fee estimates are included in the dust calculation.
34488 * Because of this, another way to look at this limit is to divide it by 43,000 (or 218,750
34489 * for non-anchor channels) and see it as the maximum feerate disagreement (in sats/vB) per
34490 * non-dust HTLC we're allowed to have with our peers before risking a force-closure for
34491 * inbound channels.
34493 * Thus, for the default value of 10_000 * a current feerate estimate of 10 sat/vB (or 2,500
34494 * sat/KW), we risk force-closure if we disagree with our peer by:
34495 * * `10_000 * 2_500 / 43_000 / (483*2)` = 0.6 sat/vB for anchor channels with 483 HTLCs in
34496 * both directions (the maximum),
34497 * * `10_000 * 2_500 / 43_000 / (50*2)` = 5.8 sat/vB for anchor channels with 50 HTLCs in both
34498 * directions (the LDK default max from [`ChannelHandshakeConfig::our_max_accepted_htlcs`])
34499 * * `10_000 * 2_500 / 218_750 / (483*2)` = 0.1 sat/vB for non-anchor channels with 483 HTLCs
34500 * in both directions (the maximum),
34501 * * `10_000 * 2_500 / 218_750 / (50*2)` = 1.1 sat/vB for non-anchor channels with 50 HTLCs
34502 * in both (the LDK default maximum from [`ChannelHandshakeConfig::our_max_accepted_htlcs`])
34504 * Note that when using [`MaxDustHTLCExposure::FeeRateMultiplier`] this maximum disagreement
34505 * will scale linearly with increases (or decreases) in the our feerate estimates. Further,
34506 * for anchor channels we expect our counterparty to use a relatively low feerate estimate
34507 * while we use [`ConfirmationTarget::OnChainSweep`] (which should be relatively high) and
34508 * feerate disagreement force-closures should only occur when theirs is higher than ours.
34510 * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 10_000.
34512 * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep
34514 struct LDKMaxDustHTLCExposure ChannelConfig_get_max_dust_htlc_exposure(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
34517 * Limit our total exposure to potential loss to on-chain fees on close, including in-flight
34518 * HTLCs which are burned to fees as they are too small to claim on-chain and fees on
34519 * commitment transaction(s) broadcasted by our counterparty in excess of our own fee estimate.
34521 * # HTLC-based Dust Exposure
34523 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
34524 * not be claimable on-chain, instead being turned into additional miner fees if either
34525 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
34526 * to such payments may be substantial if there are many dust HTLCs present when the
34527 * channel is force-closed.
34529 * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
34530 * channel negotiated throughout the channel open process, along with the fees required to have
34531 * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
34532 * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
34533 * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
34534 * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
34535 * variant is primarily intended for use with pre-anchor channels.
34537 * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
34538 * exposure across all three types per-channel.
34540 * # Transaction Fee Dust Exposure
34542 * Further, counterparties broadcasting a commitment transaction in a force-close may result
34543 * in other balance being burned to fees, and thus all fees on commitment and HTLC
34544 * transactions in excess of our local fee estimates are included in the dust calculation.
34546 * Because of this, another way to look at this limit is to divide it by 43,000 (or 218,750
34547 * for non-anchor channels) and see it as the maximum feerate disagreement (in sats/vB) per
34548 * non-dust HTLC we're allowed to have with our peers before risking a force-closure for
34549 * inbound channels.
34551 * Thus, for the default value of 10_000 * a current feerate estimate of 10 sat/vB (or 2,500
34552 * sat/KW), we risk force-closure if we disagree with our peer by:
34553 * * `10_000 * 2_500 / 43_000 / (483*2)` = 0.6 sat/vB for anchor channels with 483 HTLCs in
34554 * both directions (the maximum),
34555 * * `10_000 * 2_500 / 43_000 / (50*2)` = 5.8 sat/vB for anchor channels with 50 HTLCs in both
34556 * directions (the LDK default max from [`ChannelHandshakeConfig::our_max_accepted_htlcs`])
34557 * * `10_000 * 2_500 / 218_750 / (483*2)` = 0.1 sat/vB for non-anchor channels with 483 HTLCs
34558 * in both directions (the maximum),
34559 * * `10_000 * 2_500 / 218_750 / (50*2)` = 1.1 sat/vB for non-anchor channels with 50 HTLCs
34560 * in both (the LDK default maximum from [`ChannelHandshakeConfig::our_max_accepted_htlcs`])
34562 * Note that when using [`MaxDustHTLCExposure::FeeRateMultiplier`] this maximum disagreement
34563 * will scale linearly with increases (or decreases) in the our feerate estimates. Further,
34564 * for anchor channels we expect our counterparty to use a relatively low feerate estimate
34565 * while we use [`ConfirmationTarget::OnChainSweep`] (which should be relatively high) and
34566 * feerate disagreement force-closures should only occur when theirs is higher than ours.
34568 * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 10_000.
34570 * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep
34572 void ChannelConfig_set_max_dust_htlc_exposure(struct LDKChannelConfig *NONNULL_PTR this_ptr, struct LDKMaxDustHTLCExposure val);
34575 * The additional fee we're willing to pay to avoid waiting for the counterparty's
34576 * `to_self_delay` to reclaim funds.
34578 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
34579 * closing transaction which both sides find acceptable, ultimately paid by the channel
34580 * funder/initiator.
34582 * When we are the funder, because we have to pay the channel closing fee, we bound the
34583 * acceptable fee by our [`ChannelCloseMinimum`] and [`NonAnchorChannelFee`] fees, with the upper bound increased by
34584 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
34585 * [`NonAnchorChannelFee`] feerate during normal operation, this value represents the additional fee we're
34586 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
34589 * When we are not the funder, we require the closing transaction fee pay at least our
34590 * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like.
34591 * Thus, this value is ignored when we are not the funder.
34593 * Default value: 1000 satoshis.
34595 * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
34596 * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
34598 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
34601 * The additional fee we're willing to pay to avoid waiting for the counterparty's
34602 * `to_self_delay` to reclaim funds.
34604 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
34605 * closing transaction which both sides find acceptable, ultimately paid by the channel
34606 * funder/initiator.
34608 * When we are the funder, because we have to pay the channel closing fee, we bound the
34609 * acceptable fee by our [`ChannelCloseMinimum`] and [`NonAnchorChannelFee`] fees, with the upper bound increased by
34610 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
34611 * [`NonAnchorChannelFee`] feerate during normal operation, this value represents the additional fee we're
34612 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
34615 * When we are not the funder, we require the closing transaction fee pay at least our
34616 * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like.
34617 * Thus, this value is ignored when we are not the funder.
34619 * Default value: 1000 satoshis.
34621 * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
34622 * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
34624 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
34627 * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
34628 * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
34631 * - The payee will set this option and set its invoice route hints to use [intercept scids]
34632 * generated by this channel's counterparty.
34633 * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
34634 * [`forward_intercepted_htlc`] with less than the amount provided in
34635 * [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
34636 * actual forward amounts is their fee. See
34637 * <https://github.com/BitcoinAndLightningLayerSpecs/lsp/tree/main/LSPS2#flow-lsp-trusts-client-model>
34638 * for how this feature may be used in the LSP use case.
34641 * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
34642 * as-expected if this feature is activated, otherwise they may lose money!
34643 * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
34647 * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
34648 * Unsetting this flag between restarts may lead to payment receive failures.
34650 * Default value: false.
34652 * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
34653 * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
34654 * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
34655 * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
34656 * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
34657 * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
34659 bool ChannelConfig_get_accept_underpaying_htlcs(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
34662 * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
34663 * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
34666 * - The payee will set this option and set its invoice route hints to use [intercept scids]
34667 * generated by this channel's counterparty.
34668 * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
34669 * [`forward_intercepted_htlc`] with less than the amount provided in
34670 * [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
34671 * actual forward amounts is their fee. See
34672 * <https://github.com/BitcoinAndLightningLayerSpecs/lsp/tree/main/LSPS2#flow-lsp-trusts-client-model>
34673 * for how this feature may be used in the LSP use case.
34676 * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
34677 * as-expected if this feature is activated, otherwise they may lose money!
34678 * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
34682 * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
34683 * Unsetting this flag between restarts may lead to payment receive failures.
34685 * Default value: false.
34687 * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
34688 * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
34689 * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
34690 * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
34691 * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
34692 * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
34694 void ChannelConfig_set_accept_underpaying_htlcs(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
34697 * Constructs a new ChannelConfig given each field
34699 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);
34702 * Creates a copy of the ChannelConfig
34704 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
34707 * Checks if two ChannelConfigs contain equal inner contents.
34708 * This ignores pointers and is_owned flags and looks at the values in fields.
34709 * Two objects with NULL inner values will be considered "equal" here.
34711 bool ChannelConfig_eq(const struct LDKChannelConfig *NONNULL_PTR a, const struct LDKChannelConfig *NONNULL_PTR b);
34714 * Applies the given [`ChannelConfigUpdate`] as a partial update to the [`ChannelConfig`].
34716 void ChannelConfig_apply(struct LDKChannelConfig *NONNULL_PTR this_arg, const struct LDKChannelConfigUpdate *NONNULL_PTR update);
34719 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
34721 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
34724 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
34726 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
34729 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
34731 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
34734 * Frees any resources used by the ChannelConfigUpdate, if is_owned is set and inner is non-NULL.
34736 void ChannelConfigUpdate_free(struct LDKChannelConfigUpdate this_obj);
34738 struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
34740 void ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
34742 struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_base_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
34744 void ChannelConfigUpdate_set_forwarding_fee_base_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
34746 struct LDKCOption_u16Z ChannelConfigUpdate_get_cltv_expiry_delta(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
34748 void ChannelConfigUpdate_set_cltv_expiry_delta(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
34752 * Returns a copy of the field.
34754 struct LDKCOption_MaxDustHTLCExposureZ ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
34756 void ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_MaxDustHTLCExposureZ val);
34758 struct LDKCOption_u64Z ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
34760 void ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
34763 * Constructs a new ChannelConfigUpdate given each field
34765 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);
34768 * Creates a "default" ChannelConfigUpdate. See struct and individual field documentaiton for details on which values are used.
34770 MUST_USE_RES struct LDKChannelConfigUpdate ChannelConfigUpdate_default(void);
34773 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
34775 void UserConfig_free(struct LDKUserConfig this_obj);
34778 * Channel handshake config that we propose to our counterparty.
34780 struct LDKChannelHandshakeConfig UserConfig_get_channel_handshake_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
34783 * Channel handshake config that we propose to our counterparty.
34785 void UserConfig_set_channel_handshake_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
34788 * Limits applied to our counterparty's proposed channel handshake config settings.
34790 struct LDKChannelHandshakeLimits UserConfig_get_channel_handshake_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
34793 * Limits applied to our counterparty's proposed channel handshake config settings.
34795 void UserConfig_set_channel_handshake_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
34798 * Channel config which affects behavior during channel lifetime.
34800 struct LDKChannelConfig UserConfig_get_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
34803 * Channel config which affects behavior during channel lifetime.
34805 void UserConfig_set_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
34808 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
34809 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
34810 * node which is not online reliably.
34812 * For nodes which are not online reliably, you should set all channels to *not* be announced
34813 * (using [`ChannelHandshakeConfig::announced_channel`] and
34814 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
34815 * ensure you are not exposed to any forwarding risk.
34817 * Note that because you cannot change a channel's announced state after creation, there is no
34818 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
34819 * from a publicly-announced forwarding node to a private non-forwarding node you must close
34820 * all your channels and open new ones. For privacy, you should also change your node_id
34821 * (swapping all private and public key material for new ones) at that time.
34823 * Default value: false.
34825 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
34828 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
34829 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
34830 * node which is not online reliably.
34832 * For nodes which are not online reliably, you should set all channels to *not* be announced
34833 * (using [`ChannelHandshakeConfig::announced_channel`] and
34834 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
34835 * ensure you are not exposed to any forwarding risk.
34837 * Note that because you cannot change a channel's announced state after creation, there is no
34838 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
34839 * from a publicly-announced forwarding node to a private non-forwarding node you must close
34840 * all your channels and open new ones. For privacy, you should also change your node_id
34841 * (swapping all private and public key material for new ones) at that time.
34843 * Default value: false.
34845 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
34848 * If this is set to false, we do not accept inbound requests to open a new channel.
34849 * Default value: true.
34851 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
34854 * If this is set to false, we do not accept inbound requests to open a new channel.
34855 * Default value: true.
34857 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
34860 * If this is set to true, the user needs to manually accept inbound requests to open a new
34863 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
34864 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
34865 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
34866 * user explicitly chooses to accept the request.
34868 * Default value: false.
34870 * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
34871 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
34872 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
34874 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
34877 * If this is set to true, the user needs to manually accept inbound requests to open a new
34880 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
34881 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
34882 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
34883 * user explicitly chooses to accept the request.
34885 * Default value: false.
34887 * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
34888 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
34889 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
34891 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
34894 * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
34895 * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
34896 * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
34898 * Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
34900 * Default value: false.
34902 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
34903 * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
34905 bool UserConfig_get_accept_intercept_htlcs(const struct LDKUserConfig *NONNULL_PTR this_ptr);
34908 * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
34909 * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
34910 * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
34912 * Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
34914 * Default value: false.
34916 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
34917 * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
34919 void UserConfig_set_accept_intercept_htlcs(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
34922 * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
34923 * parts. If this is set to true, we'll accept the payment.
34925 * Setting this to true will break backwards compatibility upon downgrading to an LDK
34926 * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
34927 * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
34929 * Default value: false.
34931 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
34933 bool UserConfig_get_accept_mpp_keysend(const struct LDKUserConfig *NONNULL_PTR this_ptr);
34936 * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
34937 * parts. If this is set to true, we'll accept the payment.
34939 * Setting this to true will break backwards compatibility upon downgrading to an LDK
34940 * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
34941 * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
34943 * Default value: false.
34945 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
34947 void UserConfig_set_accept_mpp_keysend(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
34950 * Constructs a new UserConfig given each field
34952 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);
34955 * Creates a copy of the UserConfig
34957 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
34960 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
34962 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
34965 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
34967 void BestBlock_free(struct LDKBestBlock this_obj);
34972 const uint8_t (*BestBlock_get_block_hash(const struct LDKBestBlock *NONNULL_PTR this_ptr))[32];
34977 void BestBlock_set_block_hash(struct LDKBestBlock *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34980 * The height at which the block was confirmed.
34982 uint32_t BestBlock_get_height(const struct LDKBestBlock *NONNULL_PTR this_ptr);
34985 * The height at which the block was confirmed.
34987 void BestBlock_set_height(struct LDKBestBlock *NONNULL_PTR this_ptr, uint32_t val);
34990 * Constructs a new BestBlock given each field
34992 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash_arg, uint32_t height_arg);
34995 * Creates a copy of the BestBlock
34997 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
35000 * Generates a non-cryptographic 64-bit hash of the BestBlock.
35002 uint64_t BestBlock_hash(const struct LDKBestBlock *NONNULL_PTR o);
35005 * Checks if two BestBlocks contain equal inner contents.
35006 * This ignores pointers and is_owned flags and looks at the values in fields.
35007 * Two objects with NULL inner values will be considered "equal" here.
35009 bool BestBlock_eq(const struct LDKBestBlock *NONNULL_PTR a, const struct LDKBestBlock *NONNULL_PTR b);
35012 * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
35015 MUST_USE_RES struct LDKBestBlock BestBlock_from_network(enum LDKNetwork network);
35018 * Serialize the BestBlock object into a byte array which can be read by BestBlock_read
35020 struct LDKCVec_u8Z BestBlock_write(const struct LDKBestBlock *NONNULL_PTR obj);
35023 * Read a BestBlock from a byte array, created by BestBlock_write
35025 struct LDKCResult_BestBlockDecodeErrorZ BestBlock_read(struct LDKu8slice ser);
35028 * Calls the free function if one is set
35030 void Listen_free(struct LDKListen this_ptr);
35033 * Calls the free function if one is set
35035 void Confirm_free(struct LDKConfirm this_ptr);
35038 * Creates a copy of the ChannelMonitorUpdateStatus
35040 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_clone(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR orig);
35043 * Utility method to constructs a new Completed-variant ChannelMonitorUpdateStatus
35045 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_completed(void);
35048 * Utility method to constructs a new InProgress-variant ChannelMonitorUpdateStatus
35050 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_in_progress(void);
35053 * Utility method to constructs a new UnrecoverableError-variant ChannelMonitorUpdateStatus
35055 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_unrecoverable_error(void);
35058 * Checks if two ChannelMonitorUpdateStatuss contain equal inner contents.
35059 * This ignores pointers and is_owned flags and looks at the values in fields.
35061 bool ChannelMonitorUpdateStatus_eq(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR a, const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR b);
35064 * Calls the free function if one is set
35066 void Watch_free(struct LDKWatch this_ptr);
35069 * Calls the free function if one is set
35071 void Filter_free(struct LDKFilter this_ptr);
35074 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
35076 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
35079 * First block where the transaction output may have been spent.
35081 struct LDKCOption_ThirtyTwoBytesZ WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
35084 * First block where the transaction output may have been spent.
35086 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
35089 * Outpoint identifying the transaction output.
35091 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
35094 * Outpoint identifying the transaction output.
35096 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
35099 * Spending condition of the transaction output.
35101 struct LDKCVec_u8Z WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
35104 * Spending condition of the transaction output.
35106 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
35109 * Constructs a new WatchedOutput given each field
35111 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKCOption_ThirtyTwoBytesZ block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
35114 * Creates a copy of the WatchedOutput
35116 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
35119 * Checks if two WatchedOutputs contain equal inner contents.
35120 * This ignores pointers and is_owned flags and looks at the values in fields.
35121 * Two objects with NULL inner values will be considered "equal" here.
35123 bool WatchedOutput_eq(const struct LDKWatchedOutput *NONNULL_PTR a, const struct LDKWatchedOutput *NONNULL_PTR b);
35126 * Generates a non-cryptographic 64-bit hash of the WatchedOutput.
35128 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
35131 * Calls the free function if one is set
35133 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
35136 * Creates a copy of the ConfirmationTarget
35138 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
35141 * Utility method to constructs a new OnChainSweep-variant ConfirmationTarget
35143 enum LDKConfirmationTarget ConfirmationTarget_on_chain_sweep(void);
35146 * Utility method to constructs a new MinAllowedAnchorChannelRemoteFee-variant ConfirmationTarget
35148 enum LDKConfirmationTarget ConfirmationTarget_min_allowed_anchor_channel_remote_fee(void);
35151 * Utility method to constructs a new MinAllowedNonAnchorChannelRemoteFee-variant ConfirmationTarget
35153 enum LDKConfirmationTarget ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee(void);
35156 * Utility method to constructs a new AnchorChannelFee-variant ConfirmationTarget
35158 enum LDKConfirmationTarget ConfirmationTarget_anchor_channel_fee(void);
35161 * Utility method to constructs a new NonAnchorChannelFee-variant ConfirmationTarget
35163 enum LDKConfirmationTarget ConfirmationTarget_non_anchor_channel_fee(void);
35166 * Utility method to constructs a new ChannelCloseMinimum-variant ConfirmationTarget
35168 enum LDKConfirmationTarget ConfirmationTarget_channel_close_minimum(void);
35171 * Utility method to constructs a new OutputSpendingFee-variant ConfirmationTarget
35173 enum LDKConfirmationTarget ConfirmationTarget_output_spending_fee(void);
35176 * Generates a non-cryptographic 64-bit hash of the ConfirmationTarget.
35178 uint64_t ConfirmationTarget_hash(const enum LDKConfirmationTarget *NONNULL_PTR o);
35181 * Checks if two ConfirmationTargets contain equal inner contents.
35182 * This ignores pointers and is_owned flags and looks at the values in fields.
35184 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
35187 * Calls the free function if one is set
35189 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
35192 * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
35194 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
35197 * Creates a copy of the MonitorUpdateId
35199 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
35202 * Generates a non-cryptographic 64-bit hash of the MonitorUpdateId.
35204 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
35207 * Checks if two MonitorUpdateIds contain equal inner contents.
35208 * This ignores pointers and is_owned flags and looks at the values in fields.
35209 * Two objects with NULL inner values will be considered "equal" here.
35211 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
35214 * Calls the free function if one is set
35216 void Persist_free(struct LDKPersist this_ptr);
35219 * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
35221 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
35224 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
35226 void ChainMonitor_free(struct LDKChainMonitor this_obj);
35229 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
35231 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
35232 * will call back to it indicating transactions and outputs of interest. This allows clients to
35233 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
35234 * always need to fetch full blocks absent another means for determining which blocks contain
35235 * transactions relevant to the watched channels.
35237 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
35240 * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
35241 * claims which are awaiting confirmation.
35243 * Includes the balances from each [`ChannelMonitor`] *except* those included in
35244 * `ignored_channels`, allowing you to filter out balances from channels which are still open
35245 * (and whose balance should likely be pulled from the [`ChannelDetails`]).
35247 * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
35248 * inclusion in the return value.
35250 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
35253 * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
35254 * such [`ChannelMonitor`] is currently being monitored for.
35256 * Note that the result holds a mutex over our monitor set, and should not be held
35259 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
35262 * Lists the funding outpoint and channel ID of each [`ChannelMonitor`] being monitored.
35264 * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
35265 * monitoring for on-chain state resolutions.
35267 MUST_USE_RES struct LDKCVec_C2Tuple_OutPointChannelIdZZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35270 * Lists the pending updates for each [`ChannelMonitor`] (by `OutPoint` being monitored).
35272 MUST_USE_RES struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ChainMonitor_list_pending_monitor_updates(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35275 * Indicates the persistence of a [`ChannelMonitor`] has completed after
35276 * [`ChannelMonitorUpdateStatus::InProgress`] was returned from an update operation.
35278 * Thus, the anticipated use is, at a high level:
35279 * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
35280 * update to disk and begins updating any remote (e.g. watchtower/backup) copies,
35281 * returning [`ChannelMonitorUpdateStatus::InProgress`],
35282 * 2) once all remote copies are updated, you call this function with the
35283 * `completed_update_id` that completed, and once all pending updates have completed the
35284 * channel will be re-enabled.
35286 * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
35287 * registered [`ChannelMonitor`]s.
35289 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);
35292 * Gets a [`Future`] that completes when an event is available either via
35293 * [`chain::Watch::release_pending_monitor_events`] or
35294 * [`EventsProvider::process_pending_events`].
35296 * Note that callbacks registered on the [`Future`] MUST NOT call back into this
35297 * [`ChainMonitor`] and should instead register actions to be taken later.
35299 * [`EventsProvider::process_pending_events`]: crate::events::EventsProvider::process_pending_events
35301 MUST_USE_RES struct LDKFuture ChainMonitor_get_update_future(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35304 * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
35305 * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
35306 * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
35307 * invoking this every 30 seconds, or lower if running in an environment with spotty
35308 * connections, like on mobile.
35310 void ChainMonitor_rebroadcast_pending_claims(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35313 * Triggers rebroadcasts of pending claims from force-closed channels after a transaction
35314 * signature generation failure.
35316 * `monitor_opt` can be used as a filter to only trigger them for a specific channel monitor.
35318 * Note that monitor_opt (or a relevant inner pointer) may be NULL or all-0s to represent None
35320 void ChainMonitor_signer_unblocked(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint monitor_opt);
35323 * Archives fully resolved channel monitors by calling [`Persist::archive_persisted_channel`].
35325 * This is useful for pruning fully resolved monitors from the monitor set and primary
35326 * storage so they are not kept in memory and reloaded on restart.
35328 * Should be called occasionally (once every handful of blocks or on startup).
35330 * Depending on the implementation of [`Persist::archive_persisted_channel`] the monitor
35331 * data could be moved to an archive location or removed entirely.
35333 void ChainMonitor_archive_fully_resolved_channel_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35336 * Constructs a new Listen which calls the relevant methods on this_arg.
35337 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
35339 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35342 * Constructs a new Confirm which calls the relevant methods on this_arg.
35343 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
35345 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35348 * Constructs a new Watch which calls the relevant methods on this_arg.
35349 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
35351 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35354 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
35355 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
35357 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35360 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
35362 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
35365 * The sequence number of this update. Updates *must* be replayed in-order according to this
35366 * sequence number (and updates may panic if they are not). The update_id values are strictly
35367 * increasing and increase by one for each new update, with two exceptions specified below.
35369 * This sequence number is also used to track up to which points updates which returned
35370 * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
35371 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
35373 * The only instances we allow where update_id values are not strictly increasing have a
35374 * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
35375 * will force close the channel by broadcasting the latest commitment transaction or
35376 * special post-force-close updates, like providing preimages necessary to claim outputs on the
35377 * broadcast commitment transaction. See its docs for more details.
35379 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
35381 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
35384 * The sequence number of this update. Updates *must* be replayed in-order according to this
35385 * sequence number (and updates may panic if they are not). The update_id values are strictly
35386 * increasing and increase by one for each new update, with two exceptions specified below.
35388 * This sequence number is also used to track up to which points updates which returned
35389 * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
35390 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
35392 * The only instances we allow where update_id values are not strictly increasing have a
35393 * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
35394 * will force close the channel by broadcasting the latest commitment transaction or
35395 * special post-force-close updates, like providing preimages necessary to claim outputs on the
35396 * broadcast commitment transaction. See its docs for more details.
35398 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
35400 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
35403 * The channel ID associated with these updates.
35405 * Will be `None` for `ChannelMonitorUpdate`s constructed on LDK versions prior to 0.0.121 and
35406 * always `Some` otherwise.
35408 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35410 struct LDKChannelId ChannelMonitorUpdate_get_channel_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
35413 * The channel ID associated with these updates.
35415 * Will be `None` for `ChannelMonitorUpdate`s constructed on LDK versions prior to 0.0.121 and
35416 * always `Some` otherwise.
35418 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
35420 void ChannelMonitorUpdate_set_channel_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, struct LDKChannelId val);
35423 * Creates a copy of the ChannelMonitorUpdate
35425 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
35428 * Checks if two ChannelMonitorUpdates contain equal inner contents.
35429 * This ignores pointers and is_owned flags and looks at the values in fields.
35430 * Two objects with NULL inner values will be considered "equal" here.
35432 bool ChannelMonitorUpdate_eq(const struct LDKChannelMonitorUpdate *NONNULL_PTR a, const struct LDKChannelMonitorUpdate *NONNULL_PTR b);
35435 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
35437 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
35440 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
35442 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
35445 * Frees any resources used by the MonitorEvent
35447 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
35450 * Creates a copy of the MonitorEvent
35452 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
35455 * Utility method to constructs a new HTLCEvent-variant MonitorEvent
35457 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
35460 * Utility method to constructs a new HolderForceClosedWithInfo-variant MonitorEvent
35462 struct LDKMonitorEvent MonitorEvent_holder_force_closed_with_info(struct LDKClosureReason reason, struct LDKOutPoint outpoint, struct LDKChannelId channel_id);
35465 * Utility method to constructs a new HolderForceClosed-variant MonitorEvent
35467 struct LDKMonitorEvent MonitorEvent_holder_force_closed(struct LDKOutPoint a);
35470 * Utility method to constructs a new Completed-variant MonitorEvent
35472 struct LDKMonitorEvent MonitorEvent_completed(struct LDKOutPoint funding_txo, struct LDKChannelId channel_id, uint64_t monitor_update_id);
35475 * Checks if two MonitorEvents contain equal inner contents.
35476 * This ignores pointers and is_owned flags and looks at the values in fields.
35478 bool MonitorEvent_eq(const struct LDKMonitorEvent *NONNULL_PTR a, const struct LDKMonitorEvent *NONNULL_PTR b);
35481 * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
35483 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
35486 * Read a MonitorEvent from a byte array, created by MonitorEvent_write
35488 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
35491 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
35493 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
35496 * Creates a copy of the HTLCUpdate
35498 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
35501 * Checks if two HTLCUpdates contain equal inner contents.
35502 * This ignores pointers and is_owned flags and looks at the values in fields.
35503 * Two objects with NULL inner values will be considered "equal" here.
35505 bool HTLCUpdate_eq(const struct LDKHTLCUpdate *NONNULL_PTR a, const struct LDKHTLCUpdate *NONNULL_PTR b);
35508 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
35510 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
35513 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
35515 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
35518 * Frees any resources used by the Balance
35520 void Balance_free(struct LDKBalance this_ptr);
35523 * Creates a copy of the Balance
35525 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
35528 * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
35530 struct LDKBalance Balance_claimable_on_channel_close(uint64_t amount_satoshis);
35533 * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
35535 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t amount_satoshis, uint32_t confirmation_height);
35538 * Utility method to constructs a new ContentiousClaimable-variant Balance
35540 struct LDKBalance Balance_contentious_claimable(uint64_t amount_satoshis, uint32_t timeout_height, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_preimage);
35543 * Utility method to constructs a new MaybeTimeoutClaimableHTLC-variant Balance
35545 struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t amount_satoshis, uint32_t claimable_height, struct LDKThirtyTwoBytes payment_hash);
35548 * Utility method to constructs a new MaybePreimageClaimableHTLC-variant Balance
35550 struct LDKBalance Balance_maybe_preimage_claimable_htlc(uint64_t amount_satoshis, uint32_t expiry_height, struct LDKThirtyTwoBytes payment_hash);
35553 * Utility method to constructs a new CounterpartyRevokedOutputClaimable-variant Balance
35555 struct LDKBalance Balance_counterparty_revoked_output_claimable(uint64_t amount_satoshis);
35558 * Checks if two Balances contain equal inner contents.
35559 * This ignores pointers and is_owned flags and looks at the values in fields.
35561 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
35564 * The amount claimable, in satoshis. This excludes balances that we are unsure if we are able
35565 * to claim, this is because we are waiting for a preimage or for a timeout to expire. For more
35566 * information on these balances see [`Balance::MaybeTimeoutClaimableHTLC`] and
35567 * [`Balance::MaybePreimageClaimableHTLC`].
35569 * On-chain fees required to claim the balance are not included in this amount.
35571 MUST_USE_RES uint64_t Balance_claimable_amount_satoshis(const struct LDKBalance *NONNULL_PTR this_arg);
35574 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
35576 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
35579 * Creates a copy of the ChannelMonitor
35581 struct LDKChannelMonitor ChannelMonitor_clone(const struct LDKChannelMonitor *NONNULL_PTR orig);
35584 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
35586 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
35589 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
35592 * panics if the given update is not the next update by update_id.
35594 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);
35597 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
35600 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35603 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
35605 MUST_USE_RES struct LDKC2Tuple_OutPointCVec_u8ZZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35608 * Gets the channel_id of the channel this ChannelMonitor is monitoring for.
35610 MUST_USE_RES struct LDKChannelId ChannelMonitor_channel_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35613 * Gets a list of txids, with their output scripts (in the order they appear in the
35614 * transaction), which we must learn about spends of via block_connected().
35616 MUST_USE_RES struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35619 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
35620 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
35621 * have been registered.
35623 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter, const struct LDKLogger *NONNULL_PTR logger);
35626 * Get the list of HTLCs who's status has been updated on chain. This should be called by
35627 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
35629 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35632 * Processes [`SpendableOutputs`] events produced from each [`ChannelMonitor`] upon maturity.
35634 * For channels featuring anchor outputs, this method will also process [`BumpTransaction`]
35635 * events produced from each [`ChannelMonitor`] while there is a balance to claim onchain
35636 * within each channel. As the confirmation of a commitment transaction may be critical to the
35637 * safety of funds, we recommend invoking this every 30 seconds, or lower if running in an
35638 * environment with spotty connections, like on mobile.
35640 * An [`EventHandler`] may safely call back to the provider, though this shouldn't be needed in
35641 * order to handle these events.
35643 * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
35644 * [`BumpTransaction`]: crate::events::Event::BumpTransaction
35646 void ChannelMonitor_process_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKEventHandler *NONNULL_PTR handler);
35649 * Gets the counterparty's initial commitment transaction. The returned commitment
35650 * transaction is unsigned. This is intended to be called during the initial persistence of
35651 * the monitor (inside an implementation of [`Persist::persist_new_channel`]), to allow for
35652 * watchtowers in the persistence pipeline to have enough data to form justice transactions.
35654 * This is similar to [`Self::counterparty_commitment_txs_from_update`], except
35655 * that for the initial commitment transaction, we don't have a corresponding update.
35657 * This will only return `Some` for channel monitors that have been created after upgrading
35660 * [`Persist::persist_new_channel`]: crate::chain::chainmonitor::Persist::persist_new_channel
35662 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35664 MUST_USE_RES struct LDKCommitmentTransaction ChannelMonitor_initial_counterparty_commitment_tx(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35667 * Gets all of the counterparty commitment transactions provided by the given update. This
35668 * may be empty if the update doesn't include any new counterparty commitments. Returned
35669 * commitment transactions are unsigned.
35671 * This is provided so that watchtower clients in the persistence pipeline are able to build
35672 * justice transactions for each counterparty commitment upon each update. It's intended to be
35673 * used within an implementation of [`Persist::update_persisted_channel`], which is provided
35674 * with a monitor and an update. Once revoked, signing a justice transaction can be done using
35675 * [`Self::sign_to_local_justice_tx`].
35677 * It is expected that a watchtower client may use this method to retrieve the latest counterparty
35678 * commitment transaction(s), and then hold the necessary data until a later update in which
35679 * the monitor has been updated with the corresponding revocation data, at which point the
35680 * monitor can sign the justice transaction.
35682 * This will only return a non-empty list for monitor updates that have been created after
35683 * upgrading to LDK 0.0.117+. Note that no restriction lies on the monitors themselves, which
35684 * may have been created prior to upgrading.
35686 * [`Persist::update_persisted_channel`]: crate::chain::chainmonitor::Persist::update_persisted_channel
35688 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);
35691 * Wrapper around [`EcdsaChannelSigner::sign_justice_revoked_output`] to make
35692 * signing the justice transaction easier for implementors of
35693 * [`chain::chainmonitor::Persist`]. On success this method returns the provided transaction
35694 * signing the input at `input_idx`. This method will only produce a valid signature for
35695 * a transaction spending the `to_local` output of a commitment transaction, i.e. this cannot
35696 * be used for revoked HTLC outputs.
35698 * `Value` is the value of the output being spent by the input at `input_idx`, committed
35699 * in the BIP 143 signature.
35701 * This method will only succeed if this monitor has received the revocation secret for the
35702 * provided `commitment_number`. If a commitment number is provided that does not correspond
35703 * to the commitment transaction being revoked, this will return a signed transaction, but
35704 * the signature will not be valid.
35706 * [`EcdsaChannelSigner::sign_justice_revoked_output`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_justice_revoked_output
35707 * [`Persist`]: crate::chain::chainmonitor::Persist
35709 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);
35712 * Gets the `node_id` of the counterparty for this channel.
35714 * Will be `None` for channels constructed on LDK versions prior to 0.0.110 and always `Some`
35717 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35719 MUST_USE_RES struct LDKPublicKey ChannelMonitor_get_counterparty_node_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35722 * You may use this to broadcast the latest local commitment transaction, either because
35723 * a monitor update failed or because we've fallen behind (i.e. we've received proof that our
35724 * counterparty side knows a revocation secret we gave them that they shouldn't know).
35726 * Broadcasting these transactions in this manner is UNSAFE, as they allow counterparty
35727 * side to punish you. Nevertheless you may want to broadcast them if counterparty doesn't
35728 * close channel with their commitment transaction after a substantial amount of time. Best
35729 * may be to contact the other node operator out-of-band to coordinate other options available
35732 void ChannelMonitor_broadcast_latest_holder_commitment_txn(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
35735 * Processes transactions in a newly connected block, which may result in any of the following:
35736 * - update the monitor's state against resolved HTLCs
35737 * - punish the counterparty in the case of seeing a revoked commitment transaction
35738 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
35739 * - detect settled outputs for later spending
35740 * - schedule and bump any in-flight claims
35742 * Returns any new outputs to watch from `txdata`; after called, these are also included in
35743 * [`get_outputs_to_watch`].
35745 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
35747 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_block_connected(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
35750 * Determines if the disconnected block contained any transactions of interest and updates
35753 void ChannelMonitor_block_disconnected(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
35756 * Processes transactions confirmed in a block with the given header and height, returning new
35757 * outputs to watch. See [`block_connected`] for details.
35759 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
35760 * blocks. See [`chain::Confirm`] for calling expectations.
35762 * [`block_connected`]: Self::block_connected
35764 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_transactions_confirmed(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
35767 * Processes a transaction that was reorganized out of the chain.
35769 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
35770 * than blocks. See [`chain::Confirm`] for calling expectations.
35772 * [`block_disconnected`]: Self::block_disconnected
35774 void ChannelMonitor_transaction_unconfirmed(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*txid)[32], struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
35777 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
35778 * [`block_connected`] for details.
35780 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
35781 * blocks. See [`chain::Confirm`] for calling expectations.
35783 * [`block_connected`]: Self::block_connected
35785 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_best_block_updated(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
35788 * Returns the set of txids that should be monitored for re-organization out of the chain.
35790 MUST_USE_RES struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35793 * Gets the latest best block which was connected either via the [`chain::Listen`] or
35794 * [`chain::Confirm`] interfaces.
35796 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35799 * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
35800 * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
35801 * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
35802 * invoking this every 30 seconds, or lower if running in an environment with spotty
35803 * connections, like on mobile.
35805 void ChannelMonitor_rebroadcast_pending_claims(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
35808 * Triggers rebroadcasts of pending claims from a force-closed channel after a transaction
35809 * signature generation failure.
35811 void ChannelMonitor_signer_unblocked(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
35814 * Returns the descriptors for relevant outputs (i.e., those that we can spend) within the
35815 * transaction if they exist and the transaction has at least [`ANTI_REORG_DELAY`]
35816 * confirmations. For [`SpendableOutputDescriptor::DelayedPaymentOutput`] descriptors to be
35817 * returned, the transaction must have at least `max(ANTI_REORG_DELAY, to_self_delay)`
35820 * Descriptors returned by this method are primarily exposed via [`Event::SpendableOutputs`]
35821 * once they are no longer under reorg risk. This method serves as a way to retrieve these
35822 * descriptors at a later time, either for historical purposes, or to replay any
35823 * missed/unhandled descriptors. For the purpose of gathering historical records, if the
35824 * channel close has fully resolved (i.e., [`ChannelMonitor::get_claimable_balances`] returns
35825 * an empty set), you can retrieve all spendable outputs by providing all descendant spending
35826 * transactions starting from the channel's funding transaction and going down three levels.
35828 * `tx` is a transaction we'll scan the outputs of. Any transaction can be provided. If any
35829 * outputs which can be spent by us are found, at least one descriptor is returned.
35831 * `confirmation_height` must be the height of the block in which `tx` was included in.
35833 MUST_USE_RES struct LDKCVec_SpendableOutputDescriptorZ ChannelMonitor_get_spendable_outputs(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKTransaction tx, uint32_t confirmation_height);
35836 * Checks if the monitor is fully resolved. Resolved monitor is one that has claimed all of
35837 * its outputs and balances (i.e. [`Self::get_claimable_balances`] returns an empty set).
35839 * This function returns true only if [`Self::get_claimable_balances`] has been empty for at least
35840 * 4032 blocks as an additional protection against any bugs resulting in spuriously empty balance sets.
35842 MUST_USE_RES bool ChannelMonitor_is_fully_resolved(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKLogger *NONNULL_PTR logger);
35845 * Gets the balances in this channel which are either claimable by us if we were to
35846 * force-close the channel now or which are claimable on-chain (possibly awaiting
35849 * Any balances in the channel which are available on-chain (excluding on-chain fees) are
35850 * included here until an [`Event::SpendableOutputs`] event has been generated for the
35851 * balance, or until our counterparty has claimed the balance and accrued several
35852 * confirmations on the claim transaction.
35854 * Note that for `ChannelMonitors` which track a channel which went on-chain with versions of
35855 * LDK prior to 0.0.111, not all or excess balances may be included.
35857 * See [`Balance`] for additional details on the types of claimable balances which
35858 * may be returned here and their meanings.
35860 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35863 * Read a C2Tuple_ThirtyTwoBytesChannelMonitorZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelMonitorZ_write
35865 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKEntropySource *NONNULL_PTR arg_a, const struct LDKSignerProvider *NONNULL_PTR arg_b);
35868 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
35870 void OutPoint_free(struct LDKOutPoint this_obj);
35873 * The referenced transaction's txid.
35875 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
35878 * The referenced transaction's txid.
35880 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35883 * The index of the referenced output in its transaction's vout.
35885 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
35888 * The index of the referenced output in its transaction's vout.
35890 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
35893 * Constructs a new OutPoint given each field
35895 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
35898 * Creates a copy of the OutPoint
35900 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
35903 * Checks if two OutPoints contain equal inner contents.
35904 * This ignores pointers and is_owned flags and looks at the values in fields.
35905 * Two objects with NULL inner values will be considered "equal" here.
35907 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
35910 * Generates a non-cryptographic 64-bit hash of the OutPoint.
35912 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
35915 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
35917 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
35920 * Read a OutPoint from a byte array, created by OutPoint_write
35922 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
35925 * Frees any resources used by the InboundHTLCErr, if is_owned is set and inner is non-NULL.
35927 void InboundHTLCErr_free(struct LDKInboundHTLCErr this_obj);
35930 * BOLT 4 error code.
35932 uint16_t InboundHTLCErr_get_err_code(const struct LDKInboundHTLCErr *NONNULL_PTR this_ptr);
35935 * BOLT 4 error code.
35937 void InboundHTLCErr_set_err_code(struct LDKInboundHTLCErr *NONNULL_PTR this_ptr, uint16_t val);
35940 * Data attached to this error.
35942 * Returns a copy of the field.
35944 struct LDKCVec_u8Z InboundHTLCErr_get_err_data(const struct LDKInboundHTLCErr *NONNULL_PTR this_ptr);
35947 * Data attached to this error.
35949 void InboundHTLCErr_set_err_data(struct LDKInboundHTLCErr *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
35952 * Error message text.
35954 struct LDKStr InboundHTLCErr_get_msg(const struct LDKInboundHTLCErr *NONNULL_PTR this_ptr);
35957 * Error message text.
35959 void InboundHTLCErr_set_msg(struct LDKInboundHTLCErr *NONNULL_PTR this_ptr, struct LDKStr val);
35962 * Constructs a new InboundHTLCErr given each field
35964 MUST_USE_RES struct LDKInboundHTLCErr InboundHTLCErr_new(uint16_t err_code_arg, struct LDKCVec_u8Z err_data_arg, struct LDKStr msg_arg);
35967 * Creates a copy of the InboundHTLCErr
35969 struct LDKInboundHTLCErr InboundHTLCErr_clone(const struct LDKInboundHTLCErr *NONNULL_PTR orig);
35972 * Generates a non-cryptographic 64-bit hash of the InboundHTLCErr.
35974 uint64_t InboundHTLCErr_hash(const struct LDKInboundHTLCErr *NONNULL_PTR o);
35977 * Checks if two InboundHTLCErrs contain equal inner contents.
35978 * This ignores pointers and is_owned flags and looks at the values in fields.
35979 * Two objects with NULL inner values will be considered "equal" here.
35981 bool InboundHTLCErr_eq(const struct LDKInboundHTLCErr *NONNULL_PTR a, const struct LDKInboundHTLCErr *NONNULL_PTR b);
35984 * Peel one layer off an incoming onion, returning a [`PendingHTLCInfo`] that contains information
35985 * about the intended next-hop for the HTLC.
35987 * This does all the relevant context-free checks that LDK requires for payment relay or
35988 * acceptance. If the payment is to be received, and the amount matches the expected amount for
35989 * a given invoice, this indicates the [`msgs::UpdateAddHTLC`], once fully committed in the
35990 * channel, will generate an [`Event::PaymentClaimable`].
35992 * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
35994 struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ peel_payment_onion(const struct LDKUpdateAddHTLC *NONNULL_PTR msg, const struct LDKNodeSigner *NONNULL_PTR node_signer, const struct LDKLogger *NONNULL_PTR logger, uint32_t cur_height, bool accept_mpp_keysend, bool allow_skimmed_fees);
35997 * Frees any resources used by the PendingHTLCRouting
35999 void PendingHTLCRouting_free(struct LDKPendingHTLCRouting this_ptr);
36002 * Creates a copy of the PendingHTLCRouting
36004 struct LDKPendingHTLCRouting PendingHTLCRouting_clone(const struct LDKPendingHTLCRouting *NONNULL_PTR orig);
36007 * Utility method to constructs a new Forward-variant PendingHTLCRouting
36009 struct LDKPendingHTLCRouting PendingHTLCRouting_forward(struct LDKOnionPacket onion_packet, uint64_t short_channel_id, struct LDKBlindedForward blinded);
36012 * Utility method to constructs a new Receive-variant PendingHTLCRouting
36014 struct LDKPendingHTLCRouting PendingHTLCRouting_receive(struct LDKFinalOnionHopData payment_data, struct LDKCOption_CVec_u8ZZ payment_metadata, struct LDKCOption_PaymentContextZ payment_context, uint32_t incoming_cltv_expiry, struct LDKThirtyTwoBytes phantom_shared_secret, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs, bool requires_blinded_error);
36017 * Utility method to constructs a new ReceiveKeysend-variant PendingHTLCRouting
36019 struct LDKPendingHTLCRouting PendingHTLCRouting_receive_keysend(struct LDKFinalOnionHopData payment_data, struct LDKThirtyTwoBytes payment_preimage, struct LDKCOption_CVec_u8ZZ payment_metadata, uint32_t incoming_cltv_expiry, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs, bool requires_blinded_error);
36022 * Frees any resources used by the BlindedForward, if is_owned is set and inner is non-NULL.
36024 void BlindedForward_free(struct LDKBlindedForward this_obj);
36027 * The `blinding_point` that was set in the inbound [`msgs::UpdateAddHTLC`], or in the inbound
36028 * onion payload if we're the introduction node. Useful for calculating the next hop's
36029 * [`msgs::UpdateAddHTLC::blinding_point`].
36031 struct LDKPublicKey BlindedForward_get_inbound_blinding_point(const struct LDKBlindedForward *NONNULL_PTR this_ptr);
36034 * The `blinding_point` that was set in the inbound [`msgs::UpdateAddHTLC`], or in the inbound
36035 * onion payload if we're the introduction node. Useful for calculating the next hop's
36036 * [`msgs::UpdateAddHTLC::blinding_point`].
36038 void BlindedForward_set_inbound_blinding_point(struct LDKBlindedForward *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36041 * If needed, this determines how this HTLC should be failed backwards, based on whether we are
36042 * the introduction node.
36044 enum LDKBlindedFailure BlindedForward_get_failure(const struct LDKBlindedForward *NONNULL_PTR this_ptr);
36047 * If needed, this determines how this HTLC should be failed backwards, based on whether we are
36048 * the introduction node.
36050 void BlindedForward_set_failure(struct LDKBlindedForward *NONNULL_PTR this_ptr, enum LDKBlindedFailure val);
36053 * Constructs a new BlindedForward given each field
36055 MUST_USE_RES struct LDKBlindedForward BlindedForward_new(struct LDKPublicKey inbound_blinding_point_arg, enum LDKBlindedFailure failure_arg);
36058 * Creates a copy of the BlindedForward
36060 struct LDKBlindedForward BlindedForward_clone(const struct LDKBlindedForward *NONNULL_PTR orig);
36063 * Generates a non-cryptographic 64-bit hash of the BlindedForward.
36065 uint64_t BlindedForward_hash(const struct LDKBlindedForward *NONNULL_PTR o);
36068 * Checks if two BlindedForwards contain equal inner contents.
36069 * This ignores pointers and is_owned flags and looks at the values in fields.
36070 * Two objects with NULL inner values will be considered "equal" here.
36072 bool BlindedForward_eq(const struct LDKBlindedForward *NONNULL_PTR a, const struct LDKBlindedForward *NONNULL_PTR b);
36075 * Frees any resources used by the PendingHTLCInfo, if is_owned is set and inner is non-NULL.
36077 void PendingHTLCInfo_free(struct LDKPendingHTLCInfo this_obj);
36080 * Further routing details based on whether the HTLC is being forwarded or received.
36082 struct LDKPendingHTLCRouting PendingHTLCInfo_get_routing(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
36085 * Further routing details based on whether the HTLC is being forwarded or received.
36087 void PendingHTLCInfo_set_routing(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKPendingHTLCRouting val);
36090 * The onion shared secret we build with the sender used to decrypt the onion.
36092 * This is later used to encrypt failure packets in the event that the HTLC is failed.
36094 const uint8_t (*PendingHTLCInfo_get_incoming_shared_secret(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr))[32];
36097 * The onion shared secret we build with the sender used to decrypt the onion.
36099 * This is later used to encrypt failure packets in the event that the HTLC is failed.
36101 void PendingHTLCInfo_set_incoming_shared_secret(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36104 * Hash of the payment preimage, to lock the payment until the receiver releases the preimage.
36106 const uint8_t (*PendingHTLCInfo_get_payment_hash(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr))[32];
36109 * Hash of the payment preimage, to lock the payment until the receiver releases the preimage.
36111 void PendingHTLCInfo_set_payment_hash(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36114 * Amount received in the incoming HTLC.
36116 * This field was added in LDK 0.0.113 and will be `None` for objects written by prior
36119 struct LDKCOption_u64Z PendingHTLCInfo_get_incoming_amt_msat(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
36122 * Amount received in the incoming HTLC.
36124 * This field was added in LDK 0.0.113 and will be `None` for objects written by prior
36127 void PendingHTLCInfo_set_incoming_amt_msat(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36130 * The amount the sender indicated should be forwarded on to the next hop or amount the sender
36131 * intended for us to receive for received payments.
36133 * If the received amount is less than this for received payments, an intermediary hop has
36134 * attempted to steal some of our funds and we should fail the HTLC (the sender should retry
36135 * it along another path).
36137 * Because nodes can take less than their required fees, and because senders may wish to
36138 * improve their own privacy, this amount may be less than [`Self::incoming_amt_msat`] for
36139 * received payments. In such cases, recipients must handle this HTLC as if it had received
36140 * [`Self::outgoing_amt_msat`].
36142 uint64_t PendingHTLCInfo_get_outgoing_amt_msat(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
36145 * The amount the sender indicated should be forwarded on to the next hop or amount the sender
36146 * intended for us to receive for received payments.
36148 * If the received amount is less than this for received payments, an intermediary hop has
36149 * attempted to steal some of our funds and we should fail the HTLC (the sender should retry
36150 * it along another path).
36152 * Because nodes can take less than their required fees, and because senders may wish to
36153 * improve their own privacy, this amount may be less than [`Self::incoming_amt_msat`] for
36154 * received payments. In such cases, recipients must handle this HTLC as if it had received
36155 * [`Self::outgoing_amt_msat`].
36157 void PendingHTLCInfo_set_outgoing_amt_msat(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, uint64_t val);
36160 * The CLTV the sender has indicated we should set on the forwarded HTLC (or has indicated
36161 * should have been set on the received HTLC for received payments).
36163 uint32_t PendingHTLCInfo_get_outgoing_cltv_value(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
36166 * The CLTV the sender has indicated we should set on the forwarded HTLC (or has indicated
36167 * should have been set on the received HTLC for received payments).
36169 void PendingHTLCInfo_set_outgoing_cltv_value(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, uint32_t val);
36172 * The fee taken for this HTLC in addition to the standard protocol HTLC fees.
36174 * If this is a payment for forwarding, this is the fee we are taking before forwarding the
36177 * If this is a received payment, this is the fee that our counterparty took.
36179 * This is used to allow LSPs to take fees as a part of payments, without the sender having to
36182 struct LDKCOption_u64Z PendingHTLCInfo_get_skimmed_fee_msat(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
36185 * The fee taken for this HTLC in addition to the standard protocol HTLC fees.
36187 * If this is a payment for forwarding, this is the fee we are taking before forwarding the
36190 * If this is a received payment, this is the fee that our counterparty took.
36192 * This is used to allow LSPs to take fees as a part of payments, without the sender having to
36195 void PendingHTLCInfo_set_skimmed_fee_msat(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36198 * Constructs a new PendingHTLCInfo given each field
36200 MUST_USE_RES struct LDKPendingHTLCInfo PendingHTLCInfo_new(struct LDKPendingHTLCRouting routing_arg, struct LDKThirtyTwoBytes incoming_shared_secret_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_u64Z incoming_amt_msat_arg, uint64_t outgoing_amt_msat_arg, uint32_t outgoing_cltv_value_arg, struct LDKCOption_u64Z skimmed_fee_msat_arg);
36203 * Creates a copy of the PendingHTLCInfo
36205 struct LDKPendingHTLCInfo PendingHTLCInfo_clone(const struct LDKPendingHTLCInfo *NONNULL_PTR orig);
36208 * Creates a copy of the BlindedFailure
36210 enum LDKBlindedFailure BlindedFailure_clone(const enum LDKBlindedFailure *NONNULL_PTR orig);
36213 * Utility method to constructs a new FromIntroductionNode-variant BlindedFailure
36215 enum LDKBlindedFailure BlindedFailure_from_introduction_node(void);
36218 * Utility method to constructs a new FromBlindedNode-variant BlindedFailure
36220 enum LDKBlindedFailure BlindedFailure_from_blinded_node(void);
36223 * Generates a non-cryptographic 64-bit hash of the BlindedFailure.
36225 uint64_t BlindedFailure_hash(const enum LDKBlindedFailure *NONNULL_PTR o);
36228 * Checks if two BlindedFailures contain equal inner contents.
36229 * This ignores pointers and is_owned flags and looks at the values in fields.
36231 bool BlindedFailure_eq(const enum LDKBlindedFailure *NONNULL_PTR a, const enum LDKBlindedFailure *NONNULL_PTR b);
36234 * Frees any resources used by the FailureCode
36236 void FailureCode_free(struct LDKFailureCode this_ptr);
36239 * Creates a copy of the FailureCode
36241 struct LDKFailureCode FailureCode_clone(const struct LDKFailureCode *NONNULL_PTR orig);
36244 * Utility method to constructs a new TemporaryNodeFailure-variant FailureCode
36246 struct LDKFailureCode FailureCode_temporary_node_failure(void);
36249 * Utility method to constructs a new RequiredNodeFeatureMissing-variant FailureCode
36251 struct LDKFailureCode FailureCode_required_node_feature_missing(void);
36254 * Utility method to constructs a new IncorrectOrUnknownPaymentDetails-variant FailureCode
36256 struct LDKFailureCode FailureCode_incorrect_or_unknown_payment_details(void);
36259 * Utility method to constructs a new InvalidOnionPayload-variant FailureCode
36261 struct LDKFailureCode FailureCode_invalid_onion_payload(struct LDKCOption_C2Tuple_u64u16ZZ a);
36264 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
36266 void ChannelManager_free(struct LDKChannelManager this_obj);
36269 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
36271 void ChainParameters_free(struct LDKChainParameters this_obj);
36274 * The network for determining the `chain_hash` in Lightning messages.
36276 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
36279 * The network for determining the `chain_hash` in Lightning messages.
36281 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
36284 * The hash and height of the latest block successfully connected.
36286 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
36288 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
36291 * The hash and height of the latest block successfully connected.
36293 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
36295 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
36298 * Constructs a new ChainParameters given each field
36300 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
36303 * Creates a copy of the ChainParameters
36305 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
36308 * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
36310 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
36313 * Base routing fee in millisatoshis.
36315 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
36318 * Base routing fee in millisatoshis.
36320 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
36323 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
36325 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
36328 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
36330 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
36333 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
36334 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
36335 * `cltv_expiry_delta` for more details.
36337 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
36340 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
36341 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
36342 * `cltv_expiry_delta` for more details.
36344 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
36347 * Constructs a new CounterpartyForwardingInfo given each field
36349 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);
36352 * Creates a copy of the CounterpartyForwardingInfo
36354 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
36357 * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
36359 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
36362 * The node_id of our counterparty
36364 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
36367 * The node_id of our counterparty
36369 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36372 * The Features the channel counterparty provided upon last connection.
36373 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
36374 * many routing-relevant features are present in the init context.
36376 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
36379 * The Features the channel counterparty provided upon last connection.
36380 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
36381 * many routing-relevant features are present in the init context.
36383 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
36386 * The value, in satoshis, that must always be held in the channel for our counterparty. This
36387 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
36388 * claiming at least this value on chain.
36390 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
36392 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
36394 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
36397 * The value, in satoshis, that must always be held in the channel for our counterparty. This
36398 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
36399 * claiming at least this value on chain.
36401 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
36403 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
36405 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
36408 * Information on the fees and requirements that the counterparty requires when forwarding
36409 * payments to us through this channel.
36411 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36413 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
36416 * Information on the fees and requirements that the counterparty requires when forwarding
36417 * payments to us through this channel.
36419 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36421 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
36424 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
36425 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
36426 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
36428 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
36431 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
36432 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
36433 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
36435 void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36438 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
36440 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
36443 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
36445 void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36448 * Constructs a new ChannelCounterparty given each field
36450 * Note that forwarding_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
36452 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);
36455 * Creates a copy of the ChannelCounterparty
36457 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
36460 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
36462 void ChannelDetails_free(struct LDKChannelDetails this_obj);
36465 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
36466 * thereafter this is the txid of the funding transaction xor the funding transaction output).
36467 * Note that this means this value is *not* persistent - it can change once during the
36468 * lifetime of the channel.
36470 struct LDKChannelId ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36473 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
36474 * thereafter this is the txid of the funding transaction xor the funding transaction output).
36475 * Note that this means this value is *not* persistent - it can change once during the
36476 * lifetime of the channel.
36478 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelId val);
36481 * Parameters which apply to our counterparty. See individual fields for more information.
36483 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36486 * Parameters which apply to our counterparty. See individual fields for more information.
36488 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
36491 * The Channel's funding transaction output, if we've negotiated the funding transaction with
36492 * our counterparty already.
36494 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36496 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36499 * The Channel's funding transaction output, if we've negotiated the funding transaction with
36500 * our counterparty already.
36502 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36504 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
36507 * The features which this channel operates with. See individual features for more info.
36509 * `None` until negotiation completes and the channel type is finalized.
36511 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36513 struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36516 * The features which this channel operates with. See individual features for more info.
36518 * `None` until negotiation completes and the channel type is finalized.
36520 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36522 void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
36525 * The position of the funding transaction in the chain. None if the funding transaction has
36526 * not yet been confirmed and the channel fully opened.
36528 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
36529 * payments instead of this. See [`get_inbound_payment_scid`].
36531 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
36532 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
36534 * [`inbound_scid_alias`]: Self::inbound_scid_alias
36535 * [`outbound_scid_alias`]: Self::outbound_scid_alias
36536 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
36537 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
36538 * [`confirmations_required`]: Self::confirmations_required
36540 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36543 * The position of the funding transaction in the chain. None if the funding transaction has
36544 * not yet been confirmed and the channel fully opened.
36546 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
36547 * payments instead of this. See [`get_inbound_payment_scid`].
36549 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
36550 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
36552 * [`inbound_scid_alias`]: Self::inbound_scid_alias
36553 * [`outbound_scid_alias`]: Self::outbound_scid_alias
36554 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
36555 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
36556 * [`confirmations_required`]: Self::confirmations_required
36558 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36561 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
36562 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
36563 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
36566 * This will be `None` as long as the channel is not available for routing outbound payments.
36568 * [`short_channel_id`]: Self::short_channel_id
36569 * [`confirmations_required`]: Self::confirmations_required
36571 struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36574 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
36575 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
36576 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
36579 * This will be `None` as long as the channel is not available for routing outbound payments.
36581 * [`short_channel_id`]: Self::short_channel_id
36582 * [`confirmations_required`]: Self::confirmations_required
36584 void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36587 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
36588 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
36589 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
36590 * when they see a payment to be routed to us.
36592 * Our counterparty may choose to rotate this value at any time, though will always recognize
36593 * previous values for inbound payment forwarding.
36595 * [`short_channel_id`]: Self::short_channel_id
36597 struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36600 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
36601 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
36602 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
36603 * when they see a payment to be routed to us.
36605 * Our counterparty may choose to rotate this value at any time, though will always recognize
36606 * previous values for inbound payment forwarding.
36608 * [`short_channel_id`]: Self::short_channel_id
36610 void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36613 * The value, in satoshis, of this channel as appears in the funding output
36615 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36618 * The value, in satoshis, of this channel as appears in the funding output
36620 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
36623 * The value, in satoshis, that must always be held in the channel for us. This value ensures
36624 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
36625 * this value on chain.
36627 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
36629 * This value will be `None` for outbound channels until the counterparty accepts the channel.
36631 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
36633 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36636 * The value, in satoshis, that must always be held in the channel for us. This value ensures
36637 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
36638 * this value on chain.
36640 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
36642 * This value will be `None` for outbound channels until the counterparty accepts the channel.
36644 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
36646 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36649 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
36650 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
36651 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
36652 * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
36653 * serialized with LDK versions prior to 0.0.113.
36655 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
36656 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
36657 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
36659 struct LDKU128 ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36662 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
36663 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
36664 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
36665 * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
36666 * serialized with LDK versions prior to 0.0.113.
36668 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
36669 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
36670 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
36672 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKU128 val);
36675 * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
36676 * which is applied to commitment and HTLC transactions.
36678 * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
36680 struct LDKCOption_u32Z ChannelDetails_get_feerate_sat_per_1000_weight(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36683 * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
36684 * which is applied to commitment and HTLC transactions.
36686 * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
36688 void ChannelDetails_set_feerate_sat_per_1000_weight(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
36691 * Our total balance. This is the amount we would get if we close the channel.
36692 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
36693 * amount is not likely to be recoverable on close.
36695 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
36696 * balance is not available for inclusion in new outbound HTLCs). This further does not include
36697 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
36698 * This does not consider any on-chain fees.
36700 * See also [`ChannelDetails::outbound_capacity_msat`]
36702 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36705 * Our total balance. This is the amount we would get if we close the channel.
36706 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
36707 * amount is not likely to be recoverable on close.
36709 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
36710 * balance is not available for inclusion in new outbound HTLCs). This further does not include
36711 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
36712 * This does not consider any on-chain fees.
36714 * See also [`ChannelDetails::outbound_capacity_msat`]
36716 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
36719 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
36720 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
36721 * available for inclusion in new outbound HTLCs). This further does not include any pending
36722 * outgoing HTLCs which are awaiting some other resolution to be sent.
36724 * See also [`ChannelDetails::balance_msat`]
36726 * This value is not exact. Due to various in-flight changes, feerate changes, and our
36727 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
36728 * should be able to spend nearly this amount.
36730 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36733 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
36734 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
36735 * available for inclusion in new outbound HTLCs). This further does not include any pending
36736 * outgoing HTLCs which are awaiting some other resolution to be sent.
36738 * See also [`ChannelDetails::balance_msat`]
36740 * This value is not exact. Due to various in-flight changes, feerate changes, and our
36741 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
36742 * should be able to spend nearly this amount.
36744 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
36747 * The available outbound capacity for sending a single HTLC to the remote peer. This is
36748 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
36749 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
36750 * to use a limit as close as possible to the HTLC limit we can currently send.
36752 * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
36753 * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
36755 uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36758 * The available outbound capacity for sending a single HTLC to the remote peer. This is
36759 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
36760 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
36761 * to use a limit as close as possible to the HTLC limit we can currently send.
36763 * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
36764 * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
36766 void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
36769 * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
36770 * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
36771 * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
36772 * route which is valid.
36774 uint64_t ChannelDetails_get_next_outbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36777 * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
36778 * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
36779 * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
36780 * route which is valid.
36782 void ChannelDetails_set_next_outbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
36785 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
36786 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
36787 * available for inclusion in new inbound HTLCs).
36788 * Note that there are some corner cases not fully handled here, so the actual available
36789 * inbound capacity may be slightly higher than this.
36791 * This value is not exact. Due to various in-flight changes, feerate changes, and our
36792 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
36793 * However, our counterparty should be able to spend nearly this amount.
36795 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36798 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
36799 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
36800 * available for inclusion in new inbound HTLCs).
36801 * Note that there are some corner cases not fully handled here, so the actual available
36802 * inbound capacity may be slightly higher than this.
36804 * This value is not exact. Due to various in-flight changes, feerate changes, and our
36805 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
36806 * However, our counterparty should be able to spend nearly this amount.
36808 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
36811 * The number of required confirmations on the funding transaction before the funding will be
36812 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
36813 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
36814 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
36815 * [`ChannelHandshakeLimits::max_minimum_depth`].
36817 * This value will be `None` for outbound channels until the counterparty accepts the channel.
36819 * [`is_outbound`]: ChannelDetails::is_outbound
36820 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
36821 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
36823 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36826 * The number of required confirmations on the funding transaction before the funding will be
36827 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
36828 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
36829 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
36830 * [`ChannelHandshakeLimits::max_minimum_depth`].
36832 * This value will be `None` for outbound channels until the counterparty accepts the channel.
36834 * [`is_outbound`]: ChannelDetails::is_outbound
36835 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
36836 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
36838 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
36841 * The current number of confirmations on the funding transaction.
36843 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
36845 struct LDKCOption_u32Z ChannelDetails_get_confirmations(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36848 * The current number of confirmations on the funding transaction.
36850 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
36852 void ChannelDetails_set_confirmations(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
36855 * The number of blocks (after our commitment transaction confirms) that we will need to wait
36856 * until we can claim our funds after we force-close the channel. During this time our
36857 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
36858 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
36859 * time to claim our non-HTLC-encumbered funds.
36861 * This value will be `None` for outbound channels until the counterparty accepts the channel.
36863 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36866 * The number of blocks (after our commitment transaction confirms) that we will need to wait
36867 * until we can claim our funds after we force-close the channel. During this time our
36868 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
36869 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
36870 * time to claim our non-HTLC-encumbered funds.
36872 * This value will be `None` for outbound channels until the counterparty accepts the channel.
36874 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
36877 * True if the channel was initiated (and thus funded) by us.
36879 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36882 * True if the channel was initiated (and thus funded) by us.
36884 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
36887 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
36888 * channel is not currently being shut down. `channel_ready` message exchange implies the
36889 * required confirmation count has been reached (and we were connected to the peer at some
36890 * point after the funding transaction received enough confirmations). The required
36891 * confirmation count is provided in [`confirmations_required`].
36893 * [`confirmations_required`]: ChannelDetails::confirmations_required
36895 bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36898 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
36899 * channel is not currently being shut down. `channel_ready` message exchange implies the
36900 * required confirmation count has been reached (and we were connected to the peer at some
36901 * point after the funding transaction received enough confirmations). The required
36902 * confirmation count is provided in [`confirmations_required`].
36904 * [`confirmations_required`]: ChannelDetails::confirmations_required
36906 void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
36909 * The stage of the channel's shutdown.
36910 * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
36912 * Returns a copy of the field.
36914 struct LDKCOption_ChannelShutdownStateZ ChannelDetails_get_channel_shutdown_state(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36917 * The stage of the channel's shutdown.
36918 * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
36920 void ChannelDetails_set_channel_shutdown_state(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_ChannelShutdownStateZ val);
36923 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
36924 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
36926 * This is a strict superset of `is_channel_ready`.
36928 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36931 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
36932 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
36934 * This is a strict superset of `is_channel_ready`.
36936 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
36939 * True if this channel is (or will be) publicly-announced.
36941 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36944 * True if this channel is (or will be) publicly-announced.
36946 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
36949 * The smallest value HTLC (in msat) we will accept, for this channel. This field
36950 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
36952 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36955 * The smallest value HTLC (in msat) we will accept, for this channel. This field
36956 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
36958 void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36961 * The largest value HTLC (in msat) we currently will accept, for this channel.
36963 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36966 * The largest value HTLC (in msat) we currently will accept, for this channel.
36968 void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36971 * Set of configurable parameters that affect channel operation.
36973 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
36975 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36977 struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36980 * Set of configurable parameters that affect channel operation.
36982 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
36984 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36986 void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
36989 * Creates a copy of the ChannelDetails
36991 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
36994 * Gets the current SCID which should be used to identify this channel for inbound payments.
36995 * This should be used for providing invoice hints or in any other context where our
36996 * counterparty will forward a payment to us.
36998 * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
36999 * [`ChannelDetails::short_channel_id`]. See those for more information.
37001 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
37004 * Gets the current SCID which should be used to identify this channel for outbound payments.
37005 * This should be used in [`Route`]s to describe the first hop or in other contexts where
37006 * we're sending or forwarding a payment outbound over this channel.
37008 * This is either the [`ChannelDetails::short_channel_id`], if set, or the
37009 * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
37011 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
37014 * Creates a copy of the ChannelShutdownState
37016 enum LDKChannelShutdownState ChannelShutdownState_clone(const enum LDKChannelShutdownState *NONNULL_PTR orig);
37019 * Utility method to constructs a new NotShuttingDown-variant ChannelShutdownState
37021 enum LDKChannelShutdownState ChannelShutdownState_not_shutting_down(void);
37024 * Utility method to constructs a new ShutdownInitiated-variant ChannelShutdownState
37026 enum LDKChannelShutdownState ChannelShutdownState_shutdown_initiated(void);
37029 * Utility method to constructs a new ResolvingHTLCs-variant ChannelShutdownState
37031 enum LDKChannelShutdownState ChannelShutdownState_resolving_htlcs(void);
37034 * Utility method to constructs a new NegotiatingClosingFee-variant ChannelShutdownState
37036 enum LDKChannelShutdownState ChannelShutdownState_negotiating_closing_fee(void);
37039 * Utility method to constructs a new ShutdownComplete-variant ChannelShutdownState
37041 enum LDKChannelShutdownState ChannelShutdownState_shutdown_complete(void);
37044 * Checks if two ChannelShutdownStates contain equal inner contents.
37045 * This ignores pointers and is_owned flags and looks at the values in fields.
37047 bool ChannelShutdownState_eq(const enum LDKChannelShutdownState *NONNULL_PTR a, const enum LDKChannelShutdownState *NONNULL_PTR b);
37050 * Frees any resources used by the RecentPaymentDetails
37052 void RecentPaymentDetails_free(struct LDKRecentPaymentDetails this_ptr);
37055 * Creates a copy of the RecentPaymentDetails
37057 struct LDKRecentPaymentDetails RecentPaymentDetails_clone(const struct LDKRecentPaymentDetails *NONNULL_PTR orig);
37060 * Utility method to constructs a new AwaitingInvoice-variant RecentPaymentDetails
37062 struct LDKRecentPaymentDetails RecentPaymentDetails_awaiting_invoice(struct LDKThirtyTwoBytes payment_id);
37065 * Utility method to constructs a new Pending-variant RecentPaymentDetails
37067 struct LDKRecentPaymentDetails RecentPaymentDetails_pending(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, uint64_t total_msat);
37070 * Utility method to constructs a new Fulfilled-variant RecentPaymentDetails
37072 struct LDKRecentPaymentDetails RecentPaymentDetails_fulfilled(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash);
37075 * Utility method to constructs a new Abandoned-variant RecentPaymentDetails
37077 struct LDKRecentPaymentDetails RecentPaymentDetails_abandoned(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
37080 * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
37082 void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
37085 * The list of channels to be included in the invoice route hints.
37087 struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
37090 * The list of channels to be included in the invoice route hints.
37092 void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
37095 * A fake scid used for representing the phantom node's fake channel in generating the invoice
37098 uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
37101 * A fake scid used for representing the phantom node's fake channel in generating the invoice
37104 void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
37107 * The pubkey of the real backing node that would ultimately receive the payment.
37109 struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
37112 * The pubkey of the real backing node that would ultimately receive the payment.
37114 void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
37117 * Constructs a new PhantomRouteHints given each field
37119 MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
37122 * Creates a copy of the PhantomRouteHints
37124 struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
37127 * Constructs a new `ChannelManager` to hold several channels and route between them.
37129 * The current time or latest block header time can be provided as the `current_timestamp`.
37131 * This is the main \"logic hub\" for all channel-related actions, and implements
37132 * [`ChannelMessageHandler`].
37134 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
37136 * Users need to notify the new `ChannelManager` when a new block is connected or
37137 * disconnected using its [`block_connected`] and [`block_disconnected`] methods, starting
37138 * from after [`params.best_block.block_hash`]. See [`chain::Listen`] and [`chain::Confirm`] for
37141 * [`block_connected`]: chain::Listen::block_connected
37142 * [`block_disconnected`]: chain::Listen::block_disconnected
37143 * [`params.best_block.block_hash`]: chain::BestBlock::block_hash
37145 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);
37148 * Gets the current configuration applied to all new channels.
37150 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
37153 * Creates a new outbound channel to the given remote node and with the given value.
37155 * `user_channel_id` will be provided back as in
37156 * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
37157 * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to a
37158 * randomized value for inbound channels. `user_channel_id` has no meaning inside of LDK, it
37159 * is simply copied to events and otherwise ignored.
37161 * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
37162 * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
37164 * Raises [`APIError::ChannelUnavailable`] if the channel cannot be opened due to failing to
37165 * generate a shutdown scriptpubkey or destination script set by
37166 * [`SignerProvider::get_shutdown_scriptpubkey`] or [`SignerProvider::get_destination_script`].
37168 * Note that we do not check if you are currently connected to the given peer. If no
37169 * connection is available, the outbound `open_channel` message may fail to send, resulting in
37170 * the channel eventually being silently forgotten (dropped on reload).
37172 * If `temporary_channel_id` is specified, it will be used as the temporary channel ID of the
37173 * channel. Otherwise, a random one will be generated for you.
37175 * Returns the new Channel's temporary `channel_id`. This ID will appear as
37176 * [`Event::FundingGenerationReady::temporary_channel_id`] and in
37177 * [`ChannelDetails::channel_id`] until after
37178 * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
37179 * one derived from the funding transaction's TXID. If the counterparty rejects the channel
37180 * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
37182 * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
37183 * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
37184 * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
37186 * Note that temporary_channel_id (or a relevant inner pointer) may be NULL or all-0s to represent None
37187 * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
37189 MUST_USE_RES struct LDKCResult_ChannelIdAPIErrorZ 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 LDKChannelId temporary_channel_id, struct LDKUserConfig override_config);
37192 * Gets the list of open channels, in random order. See [`ChannelDetails`] field documentation for
37193 * more information.
37195 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
37198 * Gets the list of usable channels, in random order. Useful as an argument to
37199 * [`Router::find_route`] to ensure non-announced channels are used.
37201 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
37202 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
37205 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
37208 * Gets the list of channels we have with a given counterparty, in random order.
37210 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels_with_counterparty(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id);
37213 * Returns in an undefined order recent payments that -- if not fulfilled -- have yet to find a
37214 * successful path, or have unresolved HTLCs.
37216 * This can be useful for payments that may have been prepared, but ultimately not sent, as a
37217 * result of a crash. If such a payment exists, is not listed here, and an
37218 * [`Event::PaymentSent`] has not been received, you may consider resending the payment.
37220 * [`Event::PaymentSent`]: events::Event::PaymentSent
37222 MUST_USE_RES struct LDKCVec_RecentPaymentDetailsZ ChannelManager_list_recent_payments(const struct LDKChannelManager *NONNULL_PTR this_arg);
37225 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
37226 * will be accepted on the given channel, and after additional timeout/the closing of all
37227 * pending HTLCs, the channel will be closed on chain.
37229 * * If we are the channel initiator, we will pay between our [`ChannelCloseMinimum`] and
37230 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
37232 * * If our counterparty is the channel initiator, we will require a channel closing
37233 * transaction feerate of at least our [`ChannelCloseMinimum`] feerate or the feerate which
37234 * would appear on a force-closure transaction, whichever is lower. We will allow our
37235 * counterparty to pay as much fee as they'd like, however.
37237 * May generate a [`SendShutdown`] message event on success, which should be relayed.
37239 * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
37240 * generate a shutdown scriptpubkey or destination script set by
37241 * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
37244 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
37245 * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
37246 * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
37247 * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
37249 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id);
37252 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
37253 * will be accepted on the given channel, and after additional timeout/the closing of all
37254 * pending HTLCs, the channel will be closed on chain.
37256 * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
37257 * the channel being closed or not:
37258 * * If we are the channel initiator, we will pay at least this feerate on the closing
37259 * transaction. The upper-bound is set by
37260 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
37261 * fee estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
37262 * * If our counterparty is the channel initiator, we will refuse to accept a channel closure
37263 * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
37264 * will appear on a force-closure transaction, whichever is lower).
37266 * The `shutdown_script` provided will be used as the `scriptPubKey` for the closing transaction.
37267 * Will fail if a shutdown script has already been set for this channel by
37268 * ['ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must
37269 * also be compatible with our and the counterparty's features.
37271 * May generate a [`SendShutdown`] message event on success, which should be relayed.
37273 * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
37274 * generate a shutdown scriptpubkey or destination script set by
37275 * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
37278 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
37279 * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
37280 * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
37282 * Note that shutdown_script (or a relevant inner pointer) may be NULL or all-0s to represent None
37284 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel_with_feerate_and_script(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id, struct LDKCOption_u32Z target_feerate_sats_per_1000_weight, struct LDKShutdownScript shutdown_script);
37287 * Force closes a channel, immediately broadcasting the latest local transaction(s) and
37288 * rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to
37289 * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding
37292 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id);
37295 * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting
37296 * the latest local transaction(s). Fails if `channel_id` is unknown to the manager, or if the
37297 * `counterparty_node_id` isn't the counterparty of the corresponding channel.
37299 * You can always broadcast the latest local transaction(s) via
37300 * [`ChannelMonitor::broadcast_latest_holder_commitment_txn`].
37302 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id);
37305 * Force close all channels, immediately broadcasting the latest local commitment transaction
37306 * for each to the chain and rejecting new HTLCs on each.
37308 void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
37311 * Force close all channels rejecting new HTLCs on each but without broadcasting the latest
37312 * local transaction(s).
37314 void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
37317 * Sends a payment along a given route.
37319 * Value parameters are provided via the last hop in route, see documentation for [`RouteHop`]
37320 * fields for more info.
37322 * May generate [`UpdateHTLCs`] message(s) event on success, which should be relayed (e.g. via
37323 * [`PeerManager::process_events`]).
37325 * # Avoiding Duplicate Payments
37327 * If a pending payment is currently in-flight with the same [`PaymentId`] provided, this
37328 * method will error with an [`APIError::InvalidRoute`]. Note, however, that once a payment
37329 * is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of an
37330 * [`Event::PaymentSent`] or [`Event::PaymentFailed`]) LDK will not stop you from sending a
37331 * second payment with the same [`PaymentId`].
37333 * Thus, in order to ensure duplicate payments are not sent, you should implement your own
37334 * tracking of payments, including state to indicate once a payment has completed. Because you
37335 * should also ensure that [`PaymentHash`]es are not re-used, for simplicity, you should
37336 * consider using the [`PaymentHash`] as the key for tracking payments. In that case, the
37337 * [`PaymentId`] should be a copy of the [`PaymentHash`] bytes.
37339 * Additionally, in the scenario where we begin the process of sending a payment, but crash
37340 * before `send_payment` returns (or prior to [`ChannelMonitorUpdate`] persistence if you're
37341 * using [`ChannelMonitorUpdateStatus::InProgress`]), the payment may be lost on restart. See
37342 * [`ChannelManager::list_recent_payments`] for more information.
37344 * # Possible Error States on [`PaymentSendFailure`]
37346 * Each path may have a different return value, and [`PaymentSendFailure`] may return a `Vec` with
37347 * each entry matching the corresponding-index entry in the route paths, see
37348 * [`PaymentSendFailure`] for more info.
37350 * In general, a path may raise:
37351 * * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee,
37352 * node public key) is specified.
37353 * * [`APIError::ChannelUnavailable`] if the next-hop channel is not available as it has been
37354 * closed, doesn't exist, or the peer is currently disconnected.
37355 * * [`APIError::MonitorUpdateInProgress`] if a new monitor update failure prevented sending the
37356 * relevant updates.
37358 * Note that depending on the type of the [`PaymentSendFailure`] the HTLC may have been
37359 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
37360 * different route unless you intend to pay twice!
37362 * [`RouteHop`]: crate::routing::router::RouteHop
37363 * [`Event::PaymentSent`]: events::Event::PaymentSent
37364 * [`Event::PaymentFailed`]: events::Event::PaymentFailed
37365 * [`UpdateHTLCs`]: events::MessageSendEvent::UpdateHTLCs
37366 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
37367 * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
37369 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);
37372 * Similar to [`ChannelManager::send_payment_with_route`], but will automatically find a route based on
37373 * `route_params` and retry failed payment paths based on `retry_strategy`.
37375 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);
37378 * Signals that no further attempts for the given payment should occur. Useful if you have a
37379 * pending outbound payment with retries remaining, but wish to stop retrying the payment before
37380 * retries are exhausted.
37382 * # Event Generation
37384 * If no [`Event::PaymentFailed`] event had been generated before, one will be generated as soon
37385 * as there are no remaining pending HTLCs for this payment.
37387 * Note that calling this method does *not* prevent a payment from succeeding. You must still
37388 * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
37389 * determine the ultimate status of a payment.
37391 * # Requested Invoices
37393 * In the case of paying a [`Bolt12Invoice`] via [`ChannelManager::pay_for_offer`], abandoning
37394 * the payment prior to receiving the invoice will result in an [`Event::InvoiceRequestFailed`]
37395 * and prevent any attempts at paying it once received. The other events may only be generated
37396 * once the invoice has been received.
37398 * # Restart Behavior
37400 * If an [`Event::PaymentFailed`] is generated and we restart without first persisting the
37401 * [`ChannelManager`], another [`Event::PaymentFailed`] may be generated; likewise for
37402 * [`Event::InvoiceRequestFailed`].
37404 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
37406 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
37409 * Send a spontaneous payment, which is a payment that does not require the recipient to have
37410 * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
37411 * the preimage, it must be a cryptographically secure random value that no intermediate node
37412 * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
37413 * never reach the recipient.
37415 * See [`send_payment`] documentation for more details on the return value of this function
37416 * and idempotency guarantees provided by the [`PaymentId`] key.
37418 * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
37419 * [`send_payment`] for more information about the risks of duplicate preimage usage.
37421 * [`send_payment`]: Self::send_payment
37423 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);
37426 * Similar to [`ChannelManager::send_spontaneous_payment`], but will automatically find a route
37427 * based on `route_params` and retry failed payment paths based on `retry_strategy`.
37429 * See [`PaymentParameters::for_keysend`] for help in constructing `route_params` for spontaneous
37432 * [`PaymentParameters::for_keysend`]: crate::routing::router::PaymentParameters::for_keysend
37434 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);
37437 * Send a payment that is probing the given route for liquidity. We calculate the
37438 * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows
37439 * us to easily discern them from real payments.
37441 MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPath path);
37444 * Sends payment probes over all paths of a route that would be used to pay the given
37445 * amount to the given `node_id`.
37447 * See [`ChannelManager::send_preflight_probes`] for more information.
37449 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);
37452 * Sends payment probes over all paths of a route that would be used to pay a route found
37453 * according to the given [`RouteParameters`].
37455 * This may be used to send \"pre-flight\" probes, i.e., to train our scorer before conducting
37456 * the actual payment. Note this is only useful if there likely is sufficient time for the
37457 * probe to settle before sending out the actual payment, e.g., when waiting for user
37458 * confirmation in a wallet UI.
37460 * Otherwise, there is a chance the probe could take up some liquidity needed to complete the
37461 * actual payment. Users should therefore be cautious and might avoid sending probes if
37462 * liquidity is scarce and/or they don't expect the probe to return before they send the
37463 * payment. To mitigate this issue, channels with available liquidity less than the required
37464 * amount times the given `liquidity_limit_multiplier` won't be used to send pre-flight
37465 * probes. If `None` is given as `liquidity_limit_multiplier`, it defaults to `3`.
37467 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);
37470 * Call this upon creation of a funding transaction for the given channel.
37472 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
37473 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
37475 * Returns [`APIError::APIMisuseError`] if the funding transaction is not final for propagation
37476 * across the p2p network.
37478 * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
37479 * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
37481 * May panic if the output found in the funding transaction is duplicative with some other
37482 * channel (note that this should be trivially prevented by using unique funding transaction
37483 * keys per-channel).
37485 * Do NOT broadcast the funding transaction yourself. When we have safely received our
37486 * counterparty's signature the funding transaction will automatically be broadcast via the
37487 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
37489 * Note that this includes RBF or similar transaction replacement strategies - lightning does
37490 * not currently support replacing a funding transaction on an existing channel. Instead,
37491 * create a new channel with a conflicting funding transaction.
37493 * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
37494 * the wallet software generating the funding transaction to apply anti-fee sniping as
37495 * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/>
37496 * for more details.
37498 * [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady
37499 * [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed
37501 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKTransaction funding_transaction);
37504 * Call this upon creation of a batch funding transaction for the given channels.
37506 * Return values are identical to [`Self::funding_transaction_generated`], respective to
37507 * each individual channel and transaction output.
37509 * Do NOT broadcast the funding transaction yourself. This batch funding transaction
37510 * will only be broadcast when we have safely received and persisted the counterparty's
37511 * signature for each channel.
37513 * If there is an error, all channels in the batch are to be considered closed.
37515 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_batch_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_ChannelIdPublicKeyZZ temporary_channels, struct LDKTransaction funding_transaction);
37518 * Atomically applies partial updates to the [`ChannelConfig`] of the given channels.
37520 * Once the updates are applied, each eligible channel (advertised with a known short channel
37521 * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
37522 * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
37523 * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
37525 * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
37526 * `counterparty_node_id` is provided.
37528 * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
37529 * below [`MIN_CLTV_EXPIRY_DELTA`].
37531 * If an error is returned, none of the updates should be considered applied.
37533 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
37534 * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
37535 * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
37536 * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
37537 * [`ChannelUpdate`]: msgs::ChannelUpdate
37538 * [`ChannelUnavailable`]: APIError::ChannelUnavailable
37539 * [`APIMisuseError`]: APIError::APIMisuseError
37541 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_ChannelIdZ channel_ids, const struct LDKChannelConfigUpdate *NONNULL_PTR config_update);
37544 * Atomically updates the [`ChannelConfig`] for the given channels.
37546 * Once the updates are applied, each eligible channel (advertised with a known short channel
37547 * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
37548 * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
37549 * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
37551 * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
37552 * `counterparty_node_id` is provided.
37554 * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
37555 * below [`MIN_CLTV_EXPIRY_DELTA`].
37557 * If an error is returned, none of the updates should be considered applied.
37559 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
37560 * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
37561 * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
37562 * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
37563 * [`ChannelUpdate`]: msgs::ChannelUpdate
37564 * [`ChannelUnavailable`]: APIError::ChannelUnavailable
37565 * [`APIMisuseError`]: APIError::APIMisuseError
37567 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ChannelIdZ channel_ids, const struct LDKChannelConfig *NONNULL_PTR config);
37570 * Attempts to forward an intercepted HTLC over the provided channel id and with the provided
37571 * amount to forward. Should only be called in response to an [`HTLCIntercepted`] event.
37573 * Intercepted HTLCs can be useful for Lightning Service Providers (LSPs) to open a just-in-time
37574 * channel to a receiving node if the node lacks sufficient inbound liquidity.
37576 * To make use of intercepted HTLCs, set [`UserConfig::accept_intercept_htlcs`] and use
37577 * [`ChannelManager::get_intercept_scid`] to generate short channel id(s) to put in the
37578 * receiver's invoice route hints. These route hints will signal to LDK to generate an
37579 * [`HTLCIntercepted`] event when it receives the forwarded HTLC, and this method or
37580 * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event.
37582 * Note that LDK does not enforce fee requirements in `amt_to_forward_msat`, and will not stop
37583 * you from forwarding more than you received. See
37584 * [`HTLCIntercepted::expected_outbound_amount_msat`] for more on forwarding a different amount
37587 * Errors if the event was not handled in time, in which case the HTLC was automatically failed
37590 * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
37591 * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
37592 * [`HTLCIntercepted::expected_outbound_amount_msat`]: events::Event::HTLCIntercepted::expected_outbound_amount_msat
37594 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_forward_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id, const struct LDKChannelId *NONNULL_PTR next_hop_channel_id, struct LDKPublicKey next_node_id, uint64_t amt_to_forward_msat);
37597 * Fails the intercepted HTLC indicated by intercept_id. Should only be called in response to
37598 * an [`HTLCIntercepted`] event. See [`ChannelManager::forward_intercepted_htlc`].
37600 * Errors if the event was not handled in time, in which case the HTLC was automatically failed
37603 * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
37605 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_fail_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id);
37608 * Processes HTLCs which are pending waiting on random forward delay.
37610 * Should only really ever be called in response to a PendingHTLCsForwardable event.
37611 * Will likely generate further events.
37613 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
37616 * Performs actions which should happen on startup and roughly once per minute thereafter.
37618 * This currently includes:
37619 * * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
37620 * * Broadcasting [`ChannelUpdate`] messages if we've been disconnected from our peer for more
37621 * than a minute, informing the network that they should no longer attempt to route over
37623 * * Expiring a channel's previous [`ChannelConfig`] if necessary to only allow forwarding HTLCs
37624 * with the current [`ChannelConfig`].
37625 * * Removing peers which have disconnected but and no longer have any channels.
37626 * * Force-closing and removing channels which have not completed establishment in a timely manner.
37627 * * Forgetting about stale outbound payments, either those that have already been fulfilled
37628 * or those awaiting an invoice that hasn't been delivered in the necessary amount of time.
37629 * The latter is determined using the system clock in `std` and the highest seen block time
37630 * minus two hours in `no-std`.
37632 * Note that this may cause reentrancy through [`chain::Watch::update_channel`] calls or feerate
37633 * estimate fetches.
37635 * [`ChannelUpdate`]: msgs::ChannelUpdate
37636 * [`ChannelConfig`]: crate::util::config::ChannelConfig
37638 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
37641 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
37642 * after a PaymentClaimable event, failing the HTLC back to its origin and freeing resources
37643 * along the path (including in our own channel on which we received it).
37645 * Note that in some cases around unclean shutdown, it is possible the payment may have
37646 * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
37647 * second copy of) the [`events::Event::PaymentClaimable`] event. Alternatively, the payment
37648 * may have already been failed automatically by LDK if it was nearing its expiration time.
37650 * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
37651 * [`ChannelManager::claim_funds`]), you should still monitor for
37652 * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
37653 * startup during which time claims that were in-progress at shutdown may be replayed.
37655 void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
37658 * This is a variant of [`ChannelManager::fail_htlc_backwards`] that allows you to specify the
37659 * reason for the failure.
37661 * See [`FailureCode`] for valid failure codes.
37663 void ChannelManager_fail_htlc_backwards_with_reason(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32], struct LDKFailureCode failure_code);
37666 * Provides a payment preimage in response to [`Event::PaymentClaimable`], generating any
37667 * [`MessageSendEvent`]s needed to claim the payment.
37669 * This method is guaranteed to ensure the payment has been claimed but only if the current
37670 * height is strictly below [`Event::PaymentClaimable::claim_deadline`]. To avoid race
37671 * conditions, you should wait for an [`Event::PaymentClaimed`] before considering the payment
37672 * successful. It will generally be available in the next [`process_pending_events`] call.
37674 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
37675 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentClaimable`
37676 * event matches your expectation. If you fail to do so and call this method, you may provide
37677 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
37679 * This function will fail the payment if it has custom TLVs with even type numbers, as we
37680 * will assume they are unknown. If you intend to accept even custom TLVs, you should use
37681 * [`claim_funds_with_known_custom_tlvs`].
37683 * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
37684 * [`Event::PaymentClaimable::claim_deadline`]: crate::events::Event::PaymentClaimable::claim_deadline
37685 * [`Event::PaymentClaimed`]: crate::events::Event::PaymentClaimed
37686 * [`process_pending_events`]: EventsProvider::process_pending_events
37687 * [`create_inbound_payment`]: Self::create_inbound_payment
37688 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
37689 * [`claim_funds_with_known_custom_tlvs`]: Self::claim_funds_with_known_custom_tlvs
37691 void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
37694 * This is a variant of [`claim_funds`] that allows accepting a payment with custom TLVs with
37695 * even type numbers.
37699 * You MUST check you've understood all even TLVs before using this to
37700 * claim, otherwise you may unintentionally agree to some protocol you do not understand.
37702 * [`claim_funds`]: Self::claim_funds
37704 void ChannelManager_claim_funds_with_known_custom_tlvs(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
37707 * Gets the node_id held by this ChannelManager
37709 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
37712 * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
37714 * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
37715 * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
37718 * The `user_channel_id` parameter will be provided back in
37719 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
37720 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
37722 * Note that this method will return an error and reject the channel, if it requires support
37723 * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
37724 * used to accept such channels.
37726 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
37727 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
37729 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id);
37732 * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
37733 * it as confirmed immediately.
37735 * The `user_channel_id` parameter will be provided back in
37736 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
37737 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
37739 * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
37740 * and (if the counterparty agrees), enables forwarding of payments immediately.
37742 * This fully trusts that the counterparty has honestly and correctly constructed the funding
37743 * transaction and blindly assumes that it will eventually confirm.
37745 * If it does not confirm before we decide to close the channel, or if the funding transaction
37746 * does not pay to the correct script the correct amount, *you will lose funds*.
37748 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
37749 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
37751 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id);
37754 * Creates an [`OfferBuilder`] such that the [`Offer`] it builds is recognized by the
37755 * [`ChannelManager`] when handling [`InvoiceRequest`] messages for the offer. The offer will
37756 * not have an expiration unless otherwise set on the builder.
37760 * Uses [`MessageRouter::create_blinded_paths`] to construct a [`BlindedPath`] for the offer.
37761 * However, if one is not found, uses a one-hop [`BlindedPath`] with
37762 * [`ChannelManager::get_our_node_id`] as the introduction node instead. In the latter case,
37763 * the node must be announced, otherwise, there is no way to find a path to the introduction in
37764 * order to send the [`InvoiceRequest`].
37766 * Also, uses a derived signing pubkey in the offer for recipient privacy.
37770 * Requires a direct connection to the introduction node in the responding [`InvoiceRequest`]'s
37775 * Errors if the parameterized [`Router`] is unable to create a blinded path for the offer.
37777 * [`Offer`]: crate::offers::offer::Offer
37778 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
37780 MUST_USE_RES struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ ChannelManager_create_offer_builder(const struct LDKChannelManager *NONNULL_PTR this_arg);
37783 * Creates a [`RefundBuilder`] such that the [`Refund`] it builds is recognized by the
37784 * [`ChannelManager`] when handling [`Bolt12Invoice`] messages for the refund.
37788 * The provided `payment_id` is used to ensure that only one invoice is paid for the refund.
37789 * See [Avoiding Duplicate Payments] for other requirements once the payment has been sent.
37791 * The builder will have the provided expiration set. Any changes to the expiration on the
37792 * returned builder will not be honored by [`ChannelManager`]. For `no-std`, the highest seen
37793 * block time minus two hours is used for the current time when determining if the refund has
37796 * To revoke the refund, use [`ChannelManager::abandon_payment`] prior to receiving the
37797 * invoice. If abandoned, or an invoice isn't received before expiration, the payment will fail
37798 * with an [`Event::InvoiceRequestFailed`].
37800 * If `max_total_routing_fee_msat` is not specified, The default from
37801 * [`RouteParameters::from_payment_params_and_value`] is applied.
37805 * Uses [`MessageRouter::create_blinded_paths`] to construct a [`BlindedPath`] for the refund.
37806 * However, if one is not found, uses a one-hop [`BlindedPath`] with
37807 * [`ChannelManager::get_our_node_id`] as the introduction node instead. In the latter case,
37808 * the node must be announced, otherwise, there is no way to find a path to the introduction in
37809 * order to send the [`Bolt12Invoice`].
37811 * Also, uses a derived payer id in the refund for payer privacy.
37815 * Requires a direct connection to an introduction node in the responding
37816 * [`Bolt12Invoice::payment_paths`].
37821 * - a duplicate `payment_id` is provided given the caveats in the aforementioned link,
37822 * - `amount_msats` is invalid, or
37823 * - the parameterized [`Router`] is unable to create a blinded path for the refund.
37825 * [`Refund`]: crate::offers::refund::Refund
37826 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
37827 * [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
37828 * [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
37830 MUST_USE_RES struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ ChannelManager_create_refund_builder(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t amount_msats, uint64_t absolute_expiry, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, struct LDKCOption_u64Z max_total_routing_fee_msat);
37833 * Pays for an [`Offer`] using the given parameters by creating an [`InvoiceRequest`] and
37834 * enqueuing it to be sent via an onion message. [`ChannelManager`] will pay the actual
37835 * [`Bolt12Invoice`] once it is received.
37837 * Uses [`InvoiceRequestBuilder`] such that the [`InvoiceRequest`] it builds is recognized by
37838 * the [`ChannelManager`] when handling a [`Bolt12Invoice`] message in response to the request.
37839 * The optional parameters are used in the builder, if `Some`:
37840 * - `quantity` for [`InvoiceRequest::quantity`] which must be set if
37841 * [`Offer::expects_quantity`] is `true`.
37842 * - `amount_msats` if overpaying what is required for the given `quantity` is desired, and
37843 * - `payer_note` for [`InvoiceRequest::payer_note`].
37845 * If `max_total_routing_fee_msat` is not specified, The default from
37846 * [`RouteParameters::from_payment_params_and_value`] is applied.
37850 * The provided `payment_id` is used to ensure that only one invoice is paid for the request
37851 * when received. See [Avoiding Duplicate Payments] for other requirements once the payment has
37854 * To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving the
37855 * invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the
37856 * payment will fail with an [`Event::InvoiceRequestFailed`].
37860 * Uses a one-hop [`BlindedPath`] for the reply path with [`ChannelManager::get_our_node_id`]
37861 * as the introduction node and a derived payer id for payer privacy. As such, currently, the
37862 * node must be announced. Otherwise, there is no way to find a path to the introduction node
37863 * in order to send the [`Bolt12Invoice`].
37867 * Requires a direct connection to an introduction node in [`Offer::paths`] or to
37868 * [`Offer::signing_pubkey`], if empty. A similar restriction applies to the responding
37869 * [`Bolt12Invoice::payment_paths`].
37874 * - a duplicate `payment_id` is provided given the caveats in the aforementioned link,
37875 * - the provided parameters are invalid for the offer,
37876 * - the offer is for an unsupported chain, or
37877 * - the parameterized [`Router`] is unable to create a blinded reply path for the invoice
37880 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
37881 * [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
37882 * [`InvoiceRequest::payer_note`]: crate::offers::invoice_request::InvoiceRequest::payer_note
37883 * [`InvoiceRequestBuilder`]: crate::offers::invoice_request::InvoiceRequestBuilder
37884 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
37885 * [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
37886 * [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
37888 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);
37891 * Creates a [`Bolt12Invoice`] for a [`Refund`] and enqueues it to be sent via an onion
37894 * The resulting invoice uses a [`PaymentHash`] recognized by the [`ChannelManager`] and a
37895 * [`BlindedPath`] containing the [`PaymentSecret`] needed to reconstruct the corresponding
37896 * [`PaymentPreimage`]. It is returned purely for informational purposes.
37900 * Requires a direct connection to an introduction node in [`Refund::paths`] or to
37901 * [`Refund::payer_id`], if empty. This request is best effort; an invoice will be sent to each
37902 * node meeting the aforementioned criteria, but there's no guarantee that they will be
37903 * received and no retries will be made.
37908 * - the refund is for an unsupported chain, or
37909 * - the parameterized [`Router`] is unable to create a blinded payment path or reply path for
37912 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
37914 MUST_USE_RES struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ ChannelManager_request_refund_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRefund *NONNULL_PTR refund);
37917 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
37920 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
37921 * [`PaymentHash`] and [`PaymentPreimage`] for you.
37923 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`] event, which
37924 * will have the [`PaymentClaimable::purpose`] return `Some` for [`PaymentPurpose::preimage`]. That
37925 * should then be passed directly to [`claim_funds`].
37927 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
37929 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
37930 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
37934 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
37935 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
37937 * Errors if `min_value_msat` is greater than total bitcoin supply.
37939 * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
37940 * on versions of LDK prior to 0.0.114.
37942 * [`claim_funds`]: Self::claim_funds
37943 * [`PaymentClaimable`]: events::Event::PaymentClaimable
37944 * [`PaymentClaimable::purpose`]: events::Event::PaymentClaimable::purpose
37945 * [`PaymentPurpose::preimage`]: events::PaymentPurpose::preimage
37946 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
37948 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);
37951 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
37952 * stored external to LDK.
37954 * A [`PaymentClaimable`] event will only be generated if the [`PaymentSecret`] matches a
37955 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
37956 * the `min_value_msat` provided here, if one is provided.
37958 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
37959 * note that LDK will not stop you from registering duplicate payment hashes for inbound
37962 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
37963 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
37964 * before a [`PaymentClaimable`] event will be generated, ensuring that we do not provide the
37965 * sender \"proof-of-payment\" unless they have paid the required amount.
37967 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
37968 * in excess of the current time. This should roughly match the expiry time set in the invoice.
37969 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
37970 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
37971 * invoices when no timeout is set.
37973 * Note that we use block header time to time-out pending inbound payments (with some margin
37974 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
37975 * accept a payment and generate a [`PaymentClaimable`] event for some time after the expiry.
37976 * If you need exact expiry semantics, you should enforce them upon receipt of
37977 * [`PaymentClaimable`].
37979 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry_delta`
37980 * set to at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
37982 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
37983 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
37987 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
37988 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
37990 * Errors if `min_value_msat` is greater than total bitcoin supply.
37992 * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
37993 * on versions of LDK prior to 0.0.114.
37995 * [`create_inbound_payment`]: Self::create_inbound_payment
37996 * [`PaymentClaimable`]: events::Event::PaymentClaimable
37998 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);
38001 * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
38002 * previously returned from [`create_inbound_payment`].
38004 * [`create_inbound_payment`]: Self::create_inbound_payment
38006 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);
38009 * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
38010 * are used when constructing the phantom invoice's route hints.
38012 * [phantom node payments]: crate::sign::PhantomKeysManager
38014 MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
38017 * Gets route hints for use in receiving [phantom node payments].
38019 * [phantom node payments]: crate::sign::PhantomKeysManager
38021 MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
38024 * Gets a fake short channel id for use in receiving intercepted payments. These fake scids are
38025 * used when constructing the route hints for HTLCs intended to be intercepted. See
38026 * [`ChannelManager::forward_intercepted_htlc`].
38028 * Note that this method is not guaranteed to return unique values, you may need to call it a few
38029 * times to get a unique scid.
38031 MUST_USE_RES uint64_t ChannelManager_get_intercept_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
38034 * Gets inflight HTLC information by processing pending outbound payments that are in
38035 * our channels. May be used during pathfinding to account for in-use channel liquidity.
38037 MUST_USE_RES struct LDKInFlightHtlcs ChannelManager_compute_inflight_htlcs(const struct LDKChannelManager *NONNULL_PTR this_arg);
38040 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
38041 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
38043 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
38046 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
38047 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
38049 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
38052 * Constructs a new Listen which calls the relevant methods on this_arg.
38053 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
38055 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
38058 * Constructs a new Confirm which calls the relevant methods on this_arg.
38059 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
38061 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
38064 * Gets a [`Future`] that completes when this [`ChannelManager`] may need to be persisted or
38065 * may have events that need processing.
38067 * In order to check if this [`ChannelManager`] needs persisting, call
38068 * [`Self::get_and_clear_needs_persistence`].
38070 * Note that callbacks registered on the [`Future`] MUST NOT call back into this
38071 * [`ChannelManager`] and should instead register actions to be taken later.
38073 MUST_USE_RES struct LDKFuture ChannelManager_get_event_or_persistence_needed_future(const struct LDKChannelManager *NONNULL_PTR this_arg);
38076 * Returns true if this [`ChannelManager`] needs to be persisted.
38078 * See [`Self::get_event_or_persistence_needed_future`] for retrieving a [`Future`] that
38079 * indicates this should be checked.
38081 MUST_USE_RES bool ChannelManager_get_and_clear_needs_persistence(const struct LDKChannelManager *NONNULL_PTR this_arg);
38084 * Gets the latest best block which was connected either via the [`chain::Listen`] or
38085 * [`chain::Confirm`] interfaces.
38087 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
38090 * Fetches the set of [`NodeFeatures`] flags that are provided by or required by
38091 * [`ChannelManager`].
38093 MUST_USE_RES struct LDKNodeFeatures ChannelManager_node_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
38096 * Fetches the set of [`ChannelFeatures`] flags that are provided by or required by
38097 * [`ChannelManager`].
38099 MUST_USE_RES struct LDKChannelFeatures ChannelManager_channel_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
38102 * Fetches the set of [`ChannelTypeFeatures`] flags that are provided by or required by
38103 * [`ChannelManager`].
38105 MUST_USE_RES struct LDKChannelTypeFeatures ChannelManager_channel_type_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
38108 * Fetches the set of [`InitFeatures`] flags that are provided by or required by
38109 * [`ChannelManager`].
38111 MUST_USE_RES struct LDKInitFeatures ChannelManager_init_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
38114 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
38115 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
38117 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
38120 * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
38121 * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
38123 struct LDKOffersMessageHandler ChannelManager_as_OffersMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
38126 * Constructs a new NodeIdLookUp which calls the relevant methods on this_arg.
38127 * This copies the `inner` pointer in this_arg and thus the returned NodeIdLookUp must be freed before this_arg is
38129 struct LDKNodeIdLookUp ChannelManager_as_NodeIdLookUp(const struct LDKChannelManager *NONNULL_PTR this_arg);
38132 * Fetches the set of [`InitFeatures`] flags that are provided by or required by
38133 * [`ChannelManager`].
38135 struct LDKInitFeatures provided_init_features(const struct LDKUserConfig *NONNULL_PTR config);
38138 * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
38140 struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
38143 * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
38145 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
38148 * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
38150 struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
38153 * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
38155 struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
38158 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
38160 struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
38163 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
38165 struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
38168 * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
38170 struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
38173 * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
38175 struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
38178 * Serialize the BlindedForward object into a byte array which can be read by BlindedForward_read
38180 struct LDKCVec_u8Z BlindedForward_write(const struct LDKBlindedForward *NONNULL_PTR obj);
38183 * Read a BlindedForward from a byte array, created by BlindedForward_write
38185 struct LDKCResult_BlindedForwardDecodeErrorZ BlindedForward_read(struct LDKu8slice ser);
38188 * Serialize the PendingHTLCRouting object into a byte array which can be read by PendingHTLCRouting_read
38190 struct LDKCVec_u8Z PendingHTLCRouting_write(const struct LDKPendingHTLCRouting *NONNULL_PTR obj);
38193 * Read a PendingHTLCRouting from a byte array, created by PendingHTLCRouting_write
38195 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ PendingHTLCRouting_read(struct LDKu8slice ser);
38198 * Serialize the PendingHTLCInfo object into a byte array which can be read by PendingHTLCInfo_read
38200 struct LDKCVec_u8Z PendingHTLCInfo_write(const struct LDKPendingHTLCInfo *NONNULL_PTR obj);
38203 * Read a PendingHTLCInfo from a byte array, created by PendingHTLCInfo_write
38205 struct LDKCResult_PendingHTLCInfoDecodeErrorZ PendingHTLCInfo_read(struct LDKu8slice ser);
38208 * Serialize the BlindedFailure object into a byte array which can be read by BlindedFailure_read
38210 struct LDKCVec_u8Z BlindedFailure_write(const enum LDKBlindedFailure *NONNULL_PTR obj);
38213 * Read a BlindedFailure from a byte array, created by BlindedFailure_write
38215 struct LDKCResult_BlindedFailureDecodeErrorZ BlindedFailure_read(struct LDKu8slice ser);
38218 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
38220 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
38223 * Serialize the ChannelShutdownState object into a byte array which can be read by ChannelShutdownState_read
38225 struct LDKCVec_u8Z ChannelShutdownState_write(const enum LDKChannelShutdownState *NONNULL_PTR obj);
38228 * Read a ChannelShutdownState from a byte array, created by ChannelShutdownState_write
38230 struct LDKCResult_ChannelShutdownStateDecodeErrorZ ChannelShutdownState_read(struct LDKu8slice ser);
38233 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
38235 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
38238 * A cryptographically secure source of entropy.
38240 const struct LDKEntropySource *ChannelManagerReadArgs_get_entropy_source(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38243 * A cryptographically secure source of entropy.
38245 void ChannelManagerReadArgs_set_entropy_source(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKEntropySource val);
38248 * A signer that is able to perform node-scoped cryptographic operations.
38250 const struct LDKNodeSigner *ChannelManagerReadArgs_get_node_signer(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38253 * A signer that is able to perform node-scoped cryptographic operations.
38255 void ChannelManagerReadArgs_set_node_signer(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKNodeSigner val);
38258 * The keys provider which will give us relevant keys. Some keys will be loaded during
38259 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
38262 const struct LDKSignerProvider *ChannelManagerReadArgs_get_signer_provider(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38265 * The keys provider which will give us relevant keys. Some keys will be loaded during
38266 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
38269 void ChannelManagerReadArgs_set_signer_provider(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKSignerProvider val);
38272 * The fee_estimator for use in the ChannelManager in the future.
38274 * No calls to the FeeEstimator will be made during deserialization.
38276 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38279 * The fee_estimator for use in the ChannelManager in the future.
38281 * No calls to the FeeEstimator will be made during deserialization.
38283 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
38286 * The chain::Watch for use in the ChannelManager in the future.
38288 * No calls to the chain::Watch will be made during deserialization. It is assumed that
38289 * you have deserialized ChannelMonitors separately and will add them to your
38290 * chain::Watch after deserializing this ChannelManager.
38292 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38295 * The chain::Watch for use in the ChannelManager in the future.
38297 * No calls to the chain::Watch will be made during deserialization. It is assumed that
38298 * you have deserialized ChannelMonitors separately and will add them to your
38299 * chain::Watch after deserializing this ChannelManager.
38301 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
38304 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
38305 * used to broadcast the latest local commitment transactions of channels which must be
38306 * force-closed during deserialization.
38308 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38311 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
38312 * used to broadcast the latest local commitment transactions of channels which must be
38313 * force-closed during deserialization.
38315 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
38318 * The router which will be used in the ChannelManager in the future for finding routes
38319 * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
38321 * No calls to the router will be made during deserialization.
38323 const struct LDKRouter *ChannelManagerReadArgs_get_router(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38326 * The router which will be used in the ChannelManager in the future for finding routes
38327 * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
38329 * No calls to the router will be made during deserialization.
38331 void ChannelManagerReadArgs_set_router(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKRouter val);
38334 * The Logger for use in the ChannelManager and which may be used to log information during
38337 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38340 * The Logger for use in the ChannelManager and which may be used to log information during
38343 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
38346 * Default settings used for new channels. Any existing channels will continue to use the
38347 * runtime settings which were stored when the ChannelManager was serialized.
38349 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38352 * Default settings used for new channels. Any existing channels will continue to use the
38353 * runtime settings which were stored when the ChannelManager was serialized.
38355 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
38358 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
38359 * HashMap for you. This is primarily useful for C bindings where it is not practical to
38360 * populate a HashMap directly from C.
38362 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);
38365 * Read a C2Tuple_ThirtyTwoBytesChannelManagerZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelManagerZ_write
38367 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
38370 * Frees any resources used by the DelayedPaymentBasepoint, if is_owned is set and inner is non-NULL.
38372 void DelayedPaymentBasepoint_free(struct LDKDelayedPaymentBasepoint this_obj);
38374 struct LDKPublicKey DelayedPaymentBasepoint_get_a(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_ptr);
38376 void DelayedPaymentBasepoint_set_a(struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38379 * Constructs a new DelayedPaymentBasepoint given each field
38381 MUST_USE_RES struct LDKDelayedPaymentBasepoint DelayedPaymentBasepoint_new(struct LDKPublicKey a_arg);
38384 * Checks if two DelayedPaymentBasepoints contain equal inner contents.
38385 * This ignores pointers and is_owned flags and looks at the values in fields.
38386 * Two objects with NULL inner values will be considered "equal" here.
38388 bool DelayedPaymentBasepoint_eq(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR a, const struct LDKDelayedPaymentBasepoint *NONNULL_PTR b);
38391 * Creates a copy of the DelayedPaymentBasepoint
38393 struct LDKDelayedPaymentBasepoint DelayedPaymentBasepoint_clone(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR orig);
38396 * Generates a non-cryptographic 64-bit hash of the DelayedPaymentBasepoint.
38398 uint64_t DelayedPaymentBasepoint_hash(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR o);
38401 * Get inner Public Key
38403 MUST_USE_RES struct LDKPublicKey DelayedPaymentBasepoint_to_public_key(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_arg);
38406 *Derives the \"tweak\" used in calculate [`DelayedPaymentKey::from_basepoint`].\n\n[`DelayedPaymentKey::from_basepoint`] calculates a private key as:\n`privkey = basepoint_secret + SHA256(per_commitment_point || basepoint)`\n\nThis calculates the hash part in the tweak derivation process, which is used to\nensure that each key is unique and cannot be guessed by an external party.
38408 MUST_USE_RES struct LDKThirtyTwoBytes DelayedPaymentBasepoint_derive_add_tweak(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_arg, struct LDKPublicKey per_commitment_point);
38411 * Serialize the DelayedPaymentBasepoint object into a byte array which can be read by DelayedPaymentBasepoint_read
38413 struct LDKCVec_u8Z DelayedPaymentBasepoint_write(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR obj);
38416 * Read a DelayedPaymentBasepoint from a byte array, created by DelayedPaymentBasepoint_write
38418 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ DelayedPaymentBasepoint_read(struct LDKu8slice ser);
38421 * Frees any resources used by the DelayedPaymentKey, if is_owned is set and inner is non-NULL.
38423 void DelayedPaymentKey_free(struct LDKDelayedPaymentKey this_obj);
38425 struct LDKPublicKey DelayedPaymentKey_get_a(const struct LDKDelayedPaymentKey *NONNULL_PTR this_ptr);
38427 void DelayedPaymentKey_set_a(struct LDKDelayedPaymentKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38430 * Constructs a new DelayedPaymentKey given each field
38432 MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_new(struct LDKPublicKey a_arg);
38435 * Checks if two DelayedPaymentKeys contain equal inner contents.
38436 * This ignores pointers and is_owned flags and looks at the values in fields.
38437 * Two objects with NULL inner values will be considered "equal" here.
38439 bool DelayedPaymentKey_eq(const struct LDKDelayedPaymentKey *NONNULL_PTR a, const struct LDKDelayedPaymentKey *NONNULL_PTR b);
38442 * Creates a copy of the DelayedPaymentKey
38444 struct LDKDelayedPaymentKey DelayedPaymentKey_clone(const struct LDKDelayedPaymentKey *NONNULL_PTR orig);
38447 *Derive a public delayedpubkey using one node\'s `per_commitment_point` and its countersignatory\'s `basepoint`
38449 MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_from_basepoint(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
38452 *Build a delayedpubkey directly from an already-derived private key
38454 MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_from_secret_key(const uint8_t (*sk)[32]);
38457 * Get inner Public Key
38459 MUST_USE_RES struct LDKPublicKey DelayedPaymentKey_to_public_key(const struct LDKDelayedPaymentKey *NONNULL_PTR this_arg);
38462 * Serialize the DelayedPaymentKey object into a byte array which can be read by DelayedPaymentKey_read
38464 struct LDKCVec_u8Z DelayedPaymentKey_write(const struct LDKDelayedPaymentKey *NONNULL_PTR obj);
38467 * Read a DelayedPaymentKey from a byte array, created by DelayedPaymentKey_write
38469 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ DelayedPaymentKey_read(struct LDKu8slice ser);
38472 * Frees any resources used by the HtlcBasepoint, if is_owned is set and inner is non-NULL.
38474 void HtlcBasepoint_free(struct LDKHtlcBasepoint this_obj);
38476 struct LDKPublicKey HtlcBasepoint_get_a(const struct LDKHtlcBasepoint *NONNULL_PTR this_ptr);
38478 void HtlcBasepoint_set_a(struct LDKHtlcBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38481 * Constructs a new HtlcBasepoint given each field
38483 MUST_USE_RES struct LDKHtlcBasepoint HtlcBasepoint_new(struct LDKPublicKey a_arg);
38486 * Checks if two HtlcBasepoints contain equal inner contents.
38487 * This ignores pointers and is_owned flags and looks at the values in fields.
38488 * Two objects with NULL inner values will be considered "equal" here.
38490 bool HtlcBasepoint_eq(const struct LDKHtlcBasepoint *NONNULL_PTR a, const struct LDKHtlcBasepoint *NONNULL_PTR b);
38493 * Creates a copy of the HtlcBasepoint
38495 struct LDKHtlcBasepoint HtlcBasepoint_clone(const struct LDKHtlcBasepoint *NONNULL_PTR orig);
38498 * Generates a non-cryptographic 64-bit hash of the HtlcBasepoint.
38500 uint64_t HtlcBasepoint_hash(const struct LDKHtlcBasepoint *NONNULL_PTR o);
38503 * Get inner Public Key
38505 MUST_USE_RES struct LDKPublicKey HtlcBasepoint_to_public_key(const struct LDKHtlcBasepoint *NONNULL_PTR this_arg);
38508 *Derives the \"tweak\" used in calculate [`HtlcKey::from_basepoint`].\n\n[`HtlcKey::from_basepoint`] calculates a private key as:\n`privkey = basepoint_secret + SHA256(per_commitment_point || basepoint)`\n\nThis calculates the hash part in the tweak derivation process, which is used to\nensure that each key is unique and cannot be guessed by an external party.
38510 MUST_USE_RES struct LDKThirtyTwoBytes HtlcBasepoint_derive_add_tweak(const struct LDKHtlcBasepoint *NONNULL_PTR this_arg, struct LDKPublicKey per_commitment_point);
38513 * Serialize the HtlcBasepoint object into a byte array which can be read by HtlcBasepoint_read
38515 struct LDKCVec_u8Z HtlcBasepoint_write(const struct LDKHtlcBasepoint *NONNULL_PTR obj);
38518 * Read a HtlcBasepoint from a byte array, created by HtlcBasepoint_write
38520 struct LDKCResult_HtlcBasepointDecodeErrorZ HtlcBasepoint_read(struct LDKu8slice ser);
38523 * Frees any resources used by the HtlcKey, if is_owned is set and inner is non-NULL.
38525 void HtlcKey_free(struct LDKHtlcKey this_obj);
38527 struct LDKPublicKey HtlcKey_get_a(const struct LDKHtlcKey *NONNULL_PTR this_ptr);
38529 void HtlcKey_set_a(struct LDKHtlcKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38532 * Constructs a new HtlcKey given each field
38534 MUST_USE_RES struct LDKHtlcKey HtlcKey_new(struct LDKPublicKey a_arg);
38537 * Checks if two HtlcKeys contain equal inner contents.
38538 * This ignores pointers and is_owned flags and looks at the values in fields.
38539 * Two objects with NULL inner values will be considered "equal" here.
38541 bool HtlcKey_eq(const struct LDKHtlcKey *NONNULL_PTR a, const struct LDKHtlcKey *NONNULL_PTR b);
38544 * Creates a copy of the HtlcKey
38546 struct LDKHtlcKey HtlcKey_clone(const struct LDKHtlcKey *NONNULL_PTR orig);
38549 *Derive a public htlcpubkey using one node\'s `per_commitment_point` and its countersignatory\'s `basepoint`
38551 MUST_USE_RES struct LDKHtlcKey HtlcKey_from_basepoint(const struct LDKHtlcBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
38554 *Build a htlcpubkey directly from an already-derived private key
38556 MUST_USE_RES struct LDKHtlcKey HtlcKey_from_secret_key(const uint8_t (*sk)[32]);
38559 * Get inner Public Key
38561 MUST_USE_RES struct LDKPublicKey HtlcKey_to_public_key(const struct LDKHtlcKey *NONNULL_PTR this_arg);
38564 * Serialize the HtlcKey object into a byte array which can be read by HtlcKey_read
38566 struct LDKCVec_u8Z HtlcKey_write(const struct LDKHtlcKey *NONNULL_PTR obj);
38569 * Read a HtlcKey from a byte array, created by HtlcKey_write
38571 struct LDKCResult_HtlcKeyDecodeErrorZ HtlcKey_read(struct LDKu8slice ser);
38574 * Adds a tweak to a public key to derive a new public key.
38576 * May panic if `tweak` is not the output of a SHA-256 hash.
38578 struct LDKPublicKey add_public_key_tweak(struct LDKPublicKey base_point, const uint8_t (*tweak)[32]);
38581 * Frees any resources used by the RevocationBasepoint, if is_owned is set and inner is non-NULL.
38583 void RevocationBasepoint_free(struct LDKRevocationBasepoint this_obj);
38585 struct LDKPublicKey RevocationBasepoint_get_a(const struct LDKRevocationBasepoint *NONNULL_PTR this_ptr);
38587 void RevocationBasepoint_set_a(struct LDKRevocationBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38590 * Constructs a new RevocationBasepoint given each field
38592 MUST_USE_RES struct LDKRevocationBasepoint RevocationBasepoint_new(struct LDKPublicKey a_arg);
38595 * Checks if two RevocationBasepoints contain equal inner contents.
38596 * This ignores pointers and is_owned flags and looks at the values in fields.
38597 * Two objects with NULL inner values will be considered "equal" here.
38599 bool RevocationBasepoint_eq(const struct LDKRevocationBasepoint *NONNULL_PTR a, const struct LDKRevocationBasepoint *NONNULL_PTR b);
38602 * Creates a copy of the RevocationBasepoint
38604 struct LDKRevocationBasepoint RevocationBasepoint_clone(const struct LDKRevocationBasepoint *NONNULL_PTR orig);
38607 * Generates a non-cryptographic 64-bit hash of the RevocationBasepoint.
38609 uint64_t RevocationBasepoint_hash(const struct LDKRevocationBasepoint *NONNULL_PTR o);
38612 * Get inner Public Key
38614 MUST_USE_RES struct LDKPublicKey RevocationBasepoint_to_public_key(const struct LDKRevocationBasepoint *NONNULL_PTR this_arg);
38617 * Serialize the RevocationBasepoint object into a byte array which can be read by RevocationBasepoint_read
38619 struct LDKCVec_u8Z RevocationBasepoint_write(const struct LDKRevocationBasepoint *NONNULL_PTR obj);
38622 * Read a RevocationBasepoint from a byte array, created by RevocationBasepoint_write
38624 struct LDKCResult_RevocationBasepointDecodeErrorZ RevocationBasepoint_read(struct LDKu8slice ser);
38627 * Frees any resources used by the RevocationKey, if is_owned is set and inner is non-NULL.
38629 void RevocationKey_free(struct LDKRevocationKey this_obj);
38631 struct LDKPublicKey RevocationKey_get_a(const struct LDKRevocationKey *NONNULL_PTR this_ptr);
38633 void RevocationKey_set_a(struct LDKRevocationKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38636 * Constructs a new RevocationKey given each field
38638 MUST_USE_RES struct LDKRevocationKey RevocationKey_new(struct LDKPublicKey a_arg);
38641 * Checks if two RevocationKeys contain equal inner contents.
38642 * This ignores pointers and is_owned flags and looks at the values in fields.
38643 * Two objects with NULL inner values will be considered "equal" here.
38645 bool RevocationKey_eq(const struct LDKRevocationKey *NONNULL_PTR a, const struct LDKRevocationKey *NONNULL_PTR b);
38648 * Creates a copy of the RevocationKey
38650 struct LDKRevocationKey RevocationKey_clone(const struct LDKRevocationKey *NONNULL_PTR orig);
38653 * Generates a non-cryptographic 64-bit hash of the RevocationKey.
38655 uint64_t RevocationKey_hash(const struct LDKRevocationKey *NONNULL_PTR o);
38658 * Derives a per-commitment-transaction revocation public key from one party's per-commitment
38659 * point and the other party's [`RevocationBasepoint`]. This is the public equivalent of
38660 * [`chan_utils::derive_private_revocation_key`] - using only public keys to derive a public
38661 * key instead of private keys.
38663 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
38664 * generated (ie our own).
38666 * [`chan_utils::derive_private_revocation_key`]: crate::ln::chan_utils::derive_private_revocation_key
38668 MUST_USE_RES struct LDKRevocationKey RevocationKey_from_basepoint(const struct LDKRevocationBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
38671 * Get inner Public Key
38673 MUST_USE_RES struct LDKPublicKey RevocationKey_to_public_key(const struct LDKRevocationKey *NONNULL_PTR this_arg);
38676 * Serialize the RevocationKey object into a byte array which can be read by RevocationKey_read
38678 struct LDKCVec_u8Z RevocationKey_write(const struct LDKRevocationKey *NONNULL_PTR obj);
38681 * Read a RevocationKey from a byte array, created by RevocationKey_write
38683 struct LDKCResult_RevocationKeyDecodeErrorZ RevocationKey_read(struct LDKu8slice ser);
38686 * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
38688 void ExpandedKey_free(struct LDKExpandedKey this_obj);
38691 * Create a new [`ExpandedKey`] for generating an inbound payment hash and secret.
38693 * It is recommended to cache this value and not regenerate it for each new inbound payment.
38695 MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
38698 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
38699 * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
38700 * a `ChannelManager`.
38702 * `keys` is generated by calling [`NodeSigner::get_inbound_payment_key_material`] and then
38703 * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
38704 * regenerate it for each new inbound payment.
38706 * `current_time` is a Unix timestamp representing the current time.
38708 * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
38709 * on versions of LDK prior to 0.0.114.
38711 * [phantom node payments]: crate::sign::PhantomKeysManager
38712 * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
38714 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);
38717 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
38718 * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
38719 * without a `ChannelManager`.
38721 * See [`create`] for information on the `keys` and `current_time` parameters.
38723 * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
38724 * on versions of LDK prior to 0.0.114.
38726 * [phantom node payments]: crate::sign::PhantomKeysManager
38728 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);
38731 * Frees any resources used by the DecodeError
38733 void DecodeError_free(struct LDKDecodeError this_ptr);
38736 * Creates a copy of the DecodeError
38738 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
38741 * Utility method to constructs a new UnknownVersion-variant DecodeError
38743 struct LDKDecodeError DecodeError_unknown_version(void);
38746 * Utility method to constructs a new UnknownRequiredFeature-variant DecodeError
38748 struct LDKDecodeError DecodeError_unknown_required_feature(void);
38751 * Utility method to constructs a new InvalidValue-variant DecodeError
38753 struct LDKDecodeError DecodeError_invalid_value(void);
38756 * Utility method to constructs a new ShortRead-variant DecodeError
38758 struct LDKDecodeError DecodeError_short_read(void);
38761 * Utility method to constructs a new BadLengthDescriptor-variant DecodeError
38763 struct LDKDecodeError DecodeError_bad_length_descriptor(void);
38766 * Utility method to constructs a new Io-variant DecodeError
38768 struct LDKDecodeError DecodeError_io(enum LDKIOError a);
38771 * Utility method to constructs a new UnsupportedCompression-variant DecodeError
38773 struct LDKDecodeError DecodeError_unsupported_compression(void);
38776 * Utility method to constructs a new DangerousValue-variant DecodeError
38778 struct LDKDecodeError DecodeError_dangerous_value(void);
38781 * Generates a non-cryptographic 64-bit hash of the DecodeError.
38783 uint64_t DecodeError_hash(const struct LDKDecodeError *NONNULL_PTR o);
38786 * Checks if two DecodeErrors contain equal inner contents.
38787 * This ignores pointers and is_owned flags and looks at the values in fields.
38789 bool DecodeError_eq(const struct LDKDecodeError *NONNULL_PTR a, const struct LDKDecodeError *NONNULL_PTR b);
38792 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
38794 void Init_free(struct LDKInit this_obj);
38797 * The relevant features which the sender supports.
38799 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
38802 * The relevant features which the sender supports.
38804 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
38807 * Indicates chains the sender is interested in.
38809 * If there are no common chains, the connection will be closed.
38811 * Returns a copy of the field.
38813 struct LDKCOption_CVec_ThirtyTwoBytesZZ Init_get_networks(const struct LDKInit *NONNULL_PTR this_ptr);
38816 * Indicates chains the sender is interested in.
38818 * If there are no common chains, the connection will be closed.
38820 void Init_set_networks(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_CVec_ThirtyTwoBytesZZ val);
38823 * The receipient's network address.
38825 * This adds the option to report a remote IP address back to a connecting peer using the init
38826 * message. A node can decide to use that information to discover a potential update to its
38827 * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
38830 struct LDKCOption_SocketAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
38833 * The receipient's network address.
38835 * This adds the option to report a remote IP address back to a connecting peer using the init
38836 * message. A node can decide to use that information to discover a potential update to its
38837 * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
38840 void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_SocketAddressZ val);
38843 * Constructs a new Init given each field
38845 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_CVec_ThirtyTwoBytesZZ networks_arg, struct LDKCOption_SocketAddressZ remote_network_address_arg);
38848 * Creates a copy of the Init
38850 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
38853 * Generates a non-cryptographic 64-bit hash of the Init.
38855 uint64_t Init_hash(const struct LDKInit *NONNULL_PTR o);
38858 * Checks if two Inits contain equal inner contents.
38859 * This ignores pointers and is_owned flags and looks at the values in fields.
38860 * Two objects with NULL inner values will be considered "equal" here.
38862 bool Init_eq(const struct LDKInit *NONNULL_PTR a, const struct LDKInit *NONNULL_PTR b);
38865 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
38867 void ErrorMessage_free(struct LDKErrorMessage this_obj);
38870 * The channel ID involved in the error.
38872 * All-0s indicates a general error unrelated to a specific channel, after which all channels
38873 * with the sending peer should be closed.
38875 struct LDKChannelId ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
38878 * The channel ID involved in the error.
38880 * All-0s indicates a general error unrelated to a specific channel, after which all channels
38881 * with the sending peer should be closed.
38883 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKChannelId val);
38886 * A possibly human-readable error description.
38888 * The string should be sanitized before it is used (e.g., emitted to logs or printed to
38889 * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
38890 * the terminal emulator or the logging subsystem.
38892 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
38895 * A possibly human-readable error description.
38897 * The string should be sanitized before it is used (e.g., emitted to logs or printed to
38898 * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
38899 * the terminal emulator or the logging subsystem.
38901 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
38904 * Constructs a new ErrorMessage given each field
38906 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKChannelId channel_id_arg, struct LDKStr data_arg);
38909 * Creates a copy of the ErrorMessage
38911 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
38914 * Generates a non-cryptographic 64-bit hash of the ErrorMessage.
38916 uint64_t ErrorMessage_hash(const struct LDKErrorMessage *NONNULL_PTR o);
38919 * Checks if two ErrorMessages contain equal inner contents.
38920 * This ignores pointers and is_owned flags and looks at the values in fields.
38921 * Two objects with NULL inner values will be considered "equal" here.
38923 bool ErrorMessage_eq(const struct LDKErrorMessage *NONNULL_PTR a, const struct LDKErrorMessage *NONNULL_PTR b);
38926 * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
38928 void WarningMessage_free(struct LDKWarningMessage this_obj);
38931 * The channel ID involved in the warning.
38933 * All-0s indicates a warning unrelated to a specific channel.
38935 struct LDKChannelId WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
38938 * The channel ID involved in the warning.
38940 * All-0s indicates a warning unrelated to a specific channel.
38942 void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKChannelId val);
38945 * A possibly human-readable warning description.
38947 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
38948 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
38949 * the terminal emulator or the logging subsystem.
38951 struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
38954 * A possibly human-readable warning description.
38956 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
38957 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
38958 * the terminal emulator or the logging subsystem.
38960 void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
38963 * Constructs a new WarningMessage given each field
38965 MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKChannelId channel_id_arg, struct LDKStr data_arg);
38968 * Creates a copy of the WarningMessage
38970 struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
38973 * Generates a non-cryptographic 64-bit hash of the WarningMessage.
38975 uint64_t WarningMessage_hash(const struct LDKWarningMessage *NONNULL_PTR o);
38978 * Checks if two WarningMessages contain equal inner contents.
38979 * This ignores pointers and is_owned flags and looks at the values in fields.
38980 * Two objects with NULL inner values will be considered "equal" here.
38982 bool WarningMessage_eq(const struct LDKWarningMessage *NONNULL_PTR a, const struct LDKWarningMessage *NONNULL_PTR b);
38985 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
38987 void Ping_free(struct LDKPing this_obj);
38990 * The desired response length.
38992 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
38995 * The desired response length.
38997 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
39000 * The ping packet size.
39002 * This field is not sent on the wire. byteslen zeros are sent.
39004 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
39007 * The ping packet size.
39009 * This field is not sent on the wire. byteslen zeros are sent.
39011 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
39014 * Constructs a new Ping given each field
39016 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
39019 * Creates a copy of the Ping
39021 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
39024 * Generates a non-cryptographic 64-bit hash of the Ping.
39026 uint64_t Ping_hash(const struct LDKPing *NONNULL_PTR o);
39029 * Checks if two Pings contain equal inner contents.
39030 * This ignores pointers and is_owned flags and looks at the values in fields.
39031 * Two objects with NULL inner values will be considered "equal" here.
39033 bool Ping_eq(const struct LDKPing *NONNULL_PTR a, const struct LDKPing *NONNULL_PTR b);
39036 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
39038 void Pong_free(struct LDKPong this_obj);
39041 * The pong packet size.
39043 * This field is not sent on the wire. byteslen zeros are sent.
39045 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
39048 * The pong packet size.
39050 * This field is not sent on the wire. byteslen zeros are sent.
39052 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
39055 * Constructs a new Pong given each field
39057 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
39060 * Creates a copy of the Pong
39062 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
39065 * Generates a non-cryptographic 64-bit hash of the Pong.
39067 uint64_t Pong_hash(const struct LDKPong *NONNULL_PTR o);
39070 * Checks if two Pongs contain equal inner contents.
39071 * This ignores pointers and is_owned flags and looks at the values in fields.
39072 * Two objects with NULL inner values will be considered "equal" here.
39074 bool Pong_eq(const struct LDKPong *NONNULL_PTR a, const struct LDKPong *NONNULL_PTR b);
39077 * Frees any resources used by the CommonOpenChannelFields, if is_owned is set and inner is non-NULL.
39079 void CommonOpenChannelFields_free(struct LDKCommonOpenChannelFields this_obj);
39082 * The genesis hash of the blockchain where the channel is to be opened
39084 const uint8_t (*CommonOpenChannelFields_get_chain_hash(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr))[32];
39087 * The genesis hash of the blockchain where the channel is to be opened
39089 void CommonOpenChannelFields_set_chain_hash(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
39092 * A temporary channel ID
39093 * For V2 channels: derived using a zeroed out value for the channel acceptor's revocation basepoint
39094 * For V1 channels: a temporary channel ID, until the funding outpoint is announced
39096 struct LDKChannelId CommonOpenChannelFields_get_temporary_channel_id(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
39099 * A temporary channel ID
39100 * For V2 channels: derived using a zeroed out value for the channel acceptor's revocation basepoint
39101 * For V1 channels: a temporary channel ID, until the funding outpoint is announced
39103 void CommonOpenChannelFields_set_temporary_channel_id(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKChannelId val);
39106 * For V1 channels: The channel value
39107 * For V2 channels: Part of the channel value contributed by the channel initiator
39109 uint64_t CommonOpenChannelFields_get_funding_satoshis(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
39112 * For V1 channels: The channel value
39113 * For V2 channels: Part of the channel value contributed by the channel initiator
39115 void CommonOpenChannelFields_set_funding_satoshis(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
39118 * The threshold below which outputs on transactions broadcast by the channel initiator will be
39121 uint64_t CommonOpenChannelFields_get_dust_limit_satoshis(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
39124 * The threshold below which outputs on transactions broadcast by the channel initiator will be
39127 void CommonOpenChannelFields_set_dust_limit_satoshis(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
39130 * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
39132 uint64_t CommonOpenChannelFields_get_max_htlc_value_in_flight_msat(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
39135 * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
39137 void CommonOpenChannelFields_set_max_htlc_value_in_flight_msat(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
39140 * The minimum HTLC size incoming to channel initiator, in milli-satoshi
39142 uint64_t CommonOpenChannelFields_get_htlc_minimum_msat(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
39145 * The minimum HTLC size incoming to channel initiator, in milli-satoshi
39147 void CommonOpenChannelFields_set_htlc_minimum_msat(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
39150 * The feerate for the commitment transaction set by the channel initiator until updated by
39153 uint32_t CommonOpenChannelFields_get_commitment_feerate_sat_per_1000_weight(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
39156 * The feerate for the commitment transaction set by the channel initiator until updated by
39159 void CommonOpenChannelFields_set_commitment_feerate_sat_per_1000_weight(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint32_t val);
39162 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
39163 * broadcast a commitment transaction
39165 uint16_t CommonOpenChannelFields_get_to_self_delay(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
39168 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
39169 * broadcast a commitment transaction
39171 void CommonOpenChannelFields_set_to_self_delay(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint16_t val);
39174 * The maximum number of inbound HTLCs towards channel initiator
39176 uint16_t CommonOpenChannelFields_get_max_accepted_htlcs(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
39179 * The maximum number of inbound HTLCs towards channel initiator
39181 void CommonOpenChannelFields_set_max_accepted_htlcs(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint16_t val);
39184 * The channel initiator's key controlling the funding transaction
39186 struct LDKPublicKey CommonOpenChannelFields_get_funding_pubkey(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
39189 * The channel initiator's key controlling the funding transaction
39191 void CommonOpenChannelFields_set_funding_pubkey(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39194 * Used to derive a revocation key for transactions broadcast by counterparty
39196 struct LDKPublicKey CommonOpenChannelFields_get_revocation_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
39199 * Used to derive a revocation key for transactions broadcast by counterparty
39201 void CommonOpenChannelFields_set_revocation_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39204 * A payment key to channel initiator for transactions broadcast by counterparty
39206 struct LDKPublicKey CommonOpenChannelFields_get_payment_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
39209 * A payment key to channel initiator for transactions broadcast by counterparty
39211 void CommonOpenChannelFields_set_payment_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39214 * Used to derive a payment key to channel initiator for transactions broadcast by channel
39217 struct LDKPublicKey CommonOpenChannelFields_get_delayed_payment_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
39220 * Used to derive a payment key to channel initiator for transactions broadcast by channel
39223 void CommonOpenChannelFields_set_delayed_payment_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39226 * Used to derive an HTLC payment key to channel initiator
39228 struct LDKPublicKey CommonOpenChannelFields_get_htlc_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
39231 * Used to derive an HTLC payment key to channel initiator
39233 void CommonOpenChannelFields_set_htlc_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39236 * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
39238 struct LDKPublicKey CommonOpenChannelFields_get_first_per_commitment_point(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
39241 * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
39243 void CommonOpenChannelFields_set_first_per_commitment_point(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39246 * The channel flags to be used
39248 uint8_t CommonOpenChannelFields_get_channel_flags(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
39251 * The channel flags to be used
39253 void CommonOpenChannelFields_set_channel_flags(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint8_t val);
39256 * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
39257 * collaboratively close
39259 struct LDKCOption_CVec_u8ZZ CommonOpenChannelFields_get_shutdown_scriptpubkey(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
39262 * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
39263 * collaboratively close
39265 void CommonOpenChannelFields_set_shutdown_scriptpubkey(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
39268 * The channel type that this channel will represent
39270 * If this is `None`, we derive the channel type from the intersection of our
39271 * feature bits with our counterparty's feature bits from the [`Init`] message.
39273 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39275 struct LDKChannelTypeFeatures CommonOpenChannelFields_get_channel_type(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
39278 * The channel type that this channel will represent
39280 * If this is `None`, we derive the channel type from the intersection of our
39281 * feature bits with our counterparty's feature bits from the [`Init`] message.
39283 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
39285 void CommonOpenChannelFields_set_channel_type(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
39288 * Constructs a new CommonOpenChannelFields given each field
39290 * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
39292 MUST_USE_RES struct LDKCommonOpenChannelFields CommonOpenChannelFields_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKChannelId 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 commitment_feerate_sat_per_1000_weight_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, uint8_t channel_flags_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg);
39295 * Creates a copy of the CommonOpenChannelFields
39297 struct LDKCommonOpenChannelFields CommonOpenChannelFields_clone(const struct LDKCommonOpenChannelFields *NONNULL_PTR orig);
39300 * Generates a non-cryptographic 64-bit hash of the CommonOpenChannelFields.
39302 uint64_t CommonOpenChannelFields_hash(const struct LDKCommonOpenChannelFields *NONNULL_PTR o);
39305 * Checks if two CommonOpenChannelFieldss contain equal inner contents.
39306 * This ignores pointers and is_owned flags and looks at the values in fields.
39307 * Two objects with NULL inner values will be considered "equal" here.
39309 bool CommonOpenChannelFields_eq(const struct LDKCommonOpenChannelFields *NONNULL_PTR a, const struct LDKCommonOpenChannelFields *NONNULL_PTR b);
39312 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
39314 void OpenChannel_free(struct LDKOpenChannel this_obj);
39317 * Common fields of `open_channel(2)`-like messages
39319 struct LDKCommonOpenChannelFields OpenChannel_get_common_fields(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
39322 * Common fields of `open_channel(2)`-like messages
39324 void OpenChannel_set_common_fields(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKCommonOpenChannelFields val);
39327 * The amount to push to the counterparty as part of the open, in milli-satoshi
39329 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
39332 * The amount to push to the counterparty as part of the open, in milli-satoshi
39334 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
39337 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
39339 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
39342 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
39344 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
39347 * Constructs a new OpenChannel given each field
39349 MUST_USE_RES struct LDKOpenChannel OpenChannel_new(struct LDKCommonOpenChannelFields common_fields_arg, uint64_t push_msat_arg, uint64_t channel_reserve_satoshis_arg);
39352 * Creates a copy of the OpenChannel
39354 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
39357 * Generates a non-cryptographic 64-bit hash of the OpenChannel.
39359 uint64_t OpenChannel_hash(const struct LDKOpenChannel *NONNULL_PTR o);
39362 * Checks if two OpenChannels contain equal inner contents.
39363 * This ignores pointers and is_owned flags and looks at the values in fields.
39364 * Two objects with NULL inner values will be considered "equal" here.
39366 bool OpenChannel_eq(const struct LDKOpenChannel *NONNULL_PTR a, const struct LDKOpenChannel *NONNULL_PTR b);
39369 * Frees any resources used by the OpenChannelV2, if is_owned is set and inner is non-NULL.
39371 void OpenChannelV2_free(struct LDKOpenChannelV2 this_obj);
39374 * Common fields of `open_channel(2)`-like messages
39376 struct LDKCommonOpenChannelFields OpenChannelV2_get_common_fields(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
39379 * Common fields of `open_channel(2)`-like messages
39381 void OpenChannelV2_set_common_fields(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKCommonOpenChannelFields val);
39384 * The feerate for the funding transaction set by the channel initiator
39386 uint32_t OpenChannelV2_get_funding_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
39389 * The feerate for the funding transaction set by the channel initiator
39391 void OpenChannelV2_set_funding_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
39394 * The locktime for the funding transaction
39396 uint32_t OpenChannelV2_get_locktime(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
39399 * The locktime for the funding transaction
39401 void OpenChannelV2_set_locktime(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
39404 * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
39406 struct LDKPublicKey OpenChannelV2_get_second_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
39409 * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
39411 void OpenChannelV2_set_second_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39414 * Optionally, a requirement that only confirmed inputs can be added
39416 enum LDKCOption_NoneZ OpenChannelV2_get_require_confirmed_inputs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
39419 * Optionally, a requirement that only confirmed inputs can be added
39421 void OpenChannelV2_set_require_confirmed_inputs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
39424 * Constructs a new OpenChannelV2 given each field
39426 MUST_USE_RES struct LDKOpenChannelV2 OpenChannelV2_new(struct LDKCommonOpenChannelFields common_fields_arg, uint32_t funding_feerate_sat_per_1000_weight_arg, uint32_t locktime_arg, struct LDKPublicKey second_per_commitment_point_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
39429 * Creates a copy of the OpenChannelV2
39431 struct LDKOpenChannelV2 OpenChannelV2_clone(const struct LDKOpenChannelV2 *NONNULL_PTR orig);
39434 * Generates a non-cryptographic 64-bit hash of the OpenChannelV2.
39436 uint64_t OpenChannelV2_hash(const struct LDKOpenChannelV2 *NONNULL_PTR o);
39439 * Checks if two OpenChannelV2s contain equal inner contents.
39440 * This ignores pointers and is_owned flags and looks at the values in fields.
39441 * Two objects with NULL inner values will be considered "equal" here.
39443 bool OpenChannelV2_eq(const struct LDKOpenChannelV2 *NONNULL_PTR a, const struct LDKOpenChannelV2 *NONNULL_PTR b);
39446 * Frees any resources used by the CommonAcceptChannelFields, if is_owned is set and inner is non-NULL.
39448 void CommonAcceptChannelFields_free(struct LDKCommonAcceptChannelFields this_obj);
39451 * The same `temporary_channel_id` received from the initiator's `open_channel2` or `open_channel` message.
39453 struct LDKChannelId CommonAcceptChannelFields_get_temporary_channel_id(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39456 * The same `temporary_channel_id` received from the initiator's `open_channel2` or `open_channel` message.
39458 void CommonAcceptChannelFields_set_temporary_channel_id(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKChannelId val);
39461 * The threshold below which outputs on transactions broadcast by the channel acceptor will be
39464 uint64_t CommonAcceptChannelFields_get_dust_limit_satoshis(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39467 * The threshold below which outputs on transactions broadcast by the channel acceptor will be
39470 void CommonAcceptChannelFields_set_dust_limit_satoshis(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val);
39473 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
39475 uint64_t CommonAcceptChannelFields_get_max_htlc_value_in_flight_msat(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39478 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
39480 void CommonAcceptChannelFields_set_max_htlc_value_in_flight_msat(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val);
39483 * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
39485 uint64_t CommonAcceptChannelFields_get_htlc_minimum_msat(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39488 * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
39490 void CommonAcceptChannelFields_set_htlc_minimum_msat(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val);
39493 * Minimum depth of the funding transaction before the channel is considered open
39495 uint32_t CommonAcceptChannelFields_get_minimum_depth(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39498 * Minimum depth of the funding transaction before the channel is considered open
39500 void CommonAcceptChannelFields_set_minimum_depth(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint32_t val);
39503 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
39504 * broadcast a commitment transaction
39506 uint16_t CommonAcceptChannelFields_get_to_self_delay(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39509 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
39510 * broadcast a commitment transaction
39512 void CommonAcceptChannelFields_set_to_self_delay(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint16_t val);
39515 * The maximum number of inbound HTLCs towards channel acceptor
39517 uint16_t CommonAcceptChannelFields_get_max_accepted_htlcs(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39520 * The maximum number of inbound HTLCs towards channel acceptor
39522 void CommonAcceptChannelFields_set_max_accepted_htlcs(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint16_t val);
39525 * The channel acceptor's key controlling the funding transaction
39527 struct LDKPublicKey CommonAcceptChannelFields_get_funding_pubkey(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39530 * The channel acceptor's key controlling the funding transaction
39532 void CommonAcceptChannelFields_set_funding_pubkey(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39535 * Used to derive a revocation key for transactions broadcast by counterparty
39537 struct LDKPublicKey CommonAcceptChannelFields_get_revocation_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39540 * Used to derive a revocation key for transactions broadcast by counterparty
39542 void CommonAcceptChannelFields_set_revocation_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39545 * A payment key to channel acceptor for transactions broadcast by counterparty
39547 struct LDKPublicKey CommonAcceptChannelFields_get_payment_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39550 * A payment key to channel acceptor for transactions broadcast by counterparty
39552 void CommonAcceptChannelFields_set_payment_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39555 * Used to derive a payment key to channel acceptor for transactions broadcast by channel
39558 struct LDKPublicKey CommonAcceptChannelFields_get_delayed_payment_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39561 * Used to derive a payment key to channel acceptor for transactions broadcast by channel
39564 void CommonAcceptChannelFields_set_delayed_payment_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39567 * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
39569 struct LDKPublicKey CommonAcceptChannelFields_get_htlc_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39572 * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
39574 void CommonAcceptChannelFields_set_htlc_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39577 * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
39579 struct LDKPublicKey CommonAcceptChannelFields_get_first_per_commitment_point(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39582 * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
39584 void CommonAcceptChannelFields_set_first_per_commitment_point(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39587 * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
39588 * collaboratively close
39590 struct LDKCOption_CVec_u8ZZ CommonAcceptChannelFields_get_shutdown_scriptpubkey(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39593 * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
39594 * collaboratively close
39596 void CommonAcceptChannelFields_set_shutdown_scriptpubkey(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
39599 * The channel type that this channel will represent. If none is set, we derive the channel
39600 * type from the intersection of our feature bits with our counterparty's feature bits from
39601 * the Init message.
39603 * This is required to match the equivalent field in [`OpenChannel`] or [`OpenChannelV2`]'s
39604 * [`CommonOpenChannelFields::channel_type`].
39606 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39608 struct LDKChannelTypeFeatures CommonAcceptChannelFields_get_channel_type(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39611 * The channel type that this channel will represent. If none is set, we derive the channel
39612 * type from the intersection of our feature bits with our counterparty's feature bits from
39613 * the Init message.
39615 * This is required to match the equivalent field in [`OpenChannel`] or [`OpenChannelV2`]'s
39616 * [`CommonOpenChannelFields::channel_type`].
39618 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
39620 void CommonAcceptChannelFields_set_channel_type(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
39623 * Constructs a new CommonAcceptChannelFields given each field
39625 * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
39627 MUST_USE_RES struct LDKCommonAcceptChannelFields CommonAcceptChannelFields_new(struct LDKChannelId temporary_channel_id_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 LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg);
39630 * Creates a copy of the CommonAcceptChannelFields
39632 struct LDKCommonAcceptChannelFields CommonAcceptChannelFields_clone(const struct LDKCommonAcceptChannelFields *NONNULL_PTR orig);
39635 * Generates a non-cryptographic 64-bit hash of the CommonAcceptChannelFields.
39637 uint64_t CommonAcceptChannelFields_hash(const struct LDKCommonAcceptChannelFields *NONNULL_PTR o);
39640 * Checks if two CommonAcceptChannelFieldss contain equal inner contents.
39641 * This ignores pointers and is_owned flags and looks at the values in fields.
39642 * Two objects with NULL inner values will be considered "equal" here.
39644 bool CommonAcceptChannelFields_eq(const struct LDKCommonAcceptChannelFields *NONNULL_PTR a, const struct LDKCommonAcceptChannelFields *NONNULL_PTR b);
39647 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
39649 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
39652 * Common fields of `accept_channel(2)`-like messages
39654 struct LDKCommonAcceptChannelFields AcceptChannel_get_common_fields(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
39657 * Common fields of `accept_channel(2)`-like messages
39659 void AcceptChannel_set_common_fields(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKCommonAcceptChannelFields val);
39662 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
39664 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
39667 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
39669 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
39672 * Constructs a new AcceptChannel given each field
39674 MUST_USE_RES struct LDKAcceptChannel AcceptChannel_new(struct LDKCommonAcceptChannelFields common_fields_arg, uint64_t channel_reserve_satoshis_arg);
39677 * Creates a copy of the AcceptChannel
39679 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
39682 * Generates a non-cryptographic 64-bit hash of the AcceptChannel.
39684 uint64_t AcceptChannel_hash(const struct LDKAcceptChannel *NONNULL_PTR o);
39687 * Checks if two AcceptChannels contain equal inner contents.
39688 * This ignores pointers and is_owned flags and looks at the values in fields.
39689 * Two objects with NULL inner values will be considered "equal" here.
39691 bool AcceptChannel_eq(const struct LDKAcceptChannel *NONNULL_PTR a, const struct LDKAcceptChannel *NONNULL_PTR b);
39694 * Frees any resources used by the AcceptChannelV2, if is_owned is set and inner is non-NULL.
39696 void AcceptChannelV2_free(struct LDKAcceptChannelV2 this_obj);
39699 * Common fields of `accept_channel(2)`-like messages
39701 struct LDKCommonAcceptChannelFields AcceptChannelV2_get_common_fields(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
39704 * Common fields of `accept_channel(2)`-like messages
39706 void AcceptChannelV2_set_common_fields(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKCommonAcceptChannelFields val);
39709 * Part of the channel value contributed by the channel acceptor
39711 uint64_t AcceptChannelV2_get_funding_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
39714 * Part of the channel value contributed by the channel acceptor
39716 void AcceptChannelV2_set_funding_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
39719 * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
39721 struct LDKPublicKey AcceptChannelV2_get_second_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
39724 * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
39726 void AcceptChannelV2_set_second_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39729 * Optionally, a requirement that only confirmed inputs can be added
39731 enum LDKCOption_NoneZ AcceptChannelV2_get_require_confirmed_inputs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
39734 * Optionally, a requirement that only confirmed inputs can be added
39736 void AcceptChannelV2_set_require_confirmed_inputs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
39739 * Constructs a new AcceptChannelV2 given each field
39741 MUST_USE_RES struct LDKAcceptChannelV2 AcceptChannelV2_new(struct LDKCommonAcceptChannelFields common_fields_arg, uint64_t funding_satoshis_arg, struct LDKPublicKey second_per_commitment_point_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
39744 * Creates a copy of the AcceptChannelV2
39746 struct LDKAcceptChannelV2 AcceptChannelV2_clone(const struct LDKAcceptChannelV2 *NONNULL_PTR orig);
39749 * Generates a non-cryptographic 64-bit hash of the AcceptChannelV2.
39751 uint64_t AcceptChannelV2_hash(const struct LDKAcceptChannelV2 *NONNULL_PTR o);
39754 * Checks if two AcceptChannelV2s contain equal inner contents.
39755 * This ignores pointers and is_owned flags and looks at the values in fields.
39756 * Two objects with NULL inner values will be considered "equal" here.
39758 bool AcceptChannelV2_eq(const struct LDKAcceptChannelV2 *NONNULL_PTR a, const struct LDKAcceptChannelV2 *NONNULL_PTR b);
39761 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
39763 void FundingCreated_free(struct LDKFundingCreated this_obj);
39766 * A temporary channel ID, until the funding is established
39768 struct LDKChannelId FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
39771 * A temporary channel ID, until the funding is established
39773 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKChannelId val);
39776 * The funding transaction ID
39778 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
39781 * The funding transaction ID
39783 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
39786 * The specific output index funding this channel
39788 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
39791 * The specific output index funding this channel
39793 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
39796 * The signature of the channel initiator (funder) on the initial commitment transaction
39798 struct LDKECDSASignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
39801 * The signature of the channel initiator (funder) on the initial commitment transaction
39803 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
39806 * Constructs a new FundingCreated given each field
39808 MUST_USE_RES struct LDKFundingCreated FundingCreated_new(struct LDKChannelId temporary_channel_id_arg, struct LDKThirtyTwoBytes funding_txid_arg, uint16_t funding_output_index_arg, struct LDKECDSASignature signature_arg);
39811 * Creates a copy of the FundingCreated
39813 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
39816 * Generates a non-cryptographic 64-bit hash of the FundingCreated.
39818 uint64_t FundingCreated_hash(const struct LDKFundingCreated *NONNULL_PTR o);
39821 * Checks if two FundingCreateds contain equal inner contents.
39822 * This ignores pointers and is_owned flags and looks at the values in fields.
39823 * Two objects with NULL inner values will be considered "equal" here.
39825 bool FundingCreated_eq(const struct LDKFundingCreated *NONNULL_PTR a, const struct LDKFundingCreated *NONNULL_PTR b);
39828 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
39830 void FundingSigned_free(struct LDKFundingSigned this_obj);
39835 struct LDKChannelId FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
39840 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKChannelId val);
39843 * The signature of the channel acceptor (fundee) on the initial commitment transaction
39845 struct LDKECDSASignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
39848 * The signature of the channel acceptor (fundee) on the initial commitment transaction
39850 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
39853 * Constructs a new FundingSigned given each field
39855 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKChannelId channel_id_arg, struct LDKECDSASignature signature_arg);
39858 * Creates a copy of the FundingSigned
39860 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
39863 * Generates a non-cryptographic 64-bit hash of the FundingSigned.
39865 uint64_t FundingSigned_hash(const struct LDKFundingSigned *NONNULL_PTR o);
39868 * Checks if two FundingSigneds contain equal inner contents.
39869 * This ignores pointers and is_owned flags and looks at the values in fields.
39870 * Two objects with NULL inner values will be considered "equal" here.
39872 bool FundingSigned_eq(const struct LDKFundingSigned *NONNULL_PTR a, const struct LDKFundingSigned *NONNULL_PTR b);
39875 * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
39877 void ChannelReady_free(struct LDKChannelReady this_obj);
39882 struct LDKChannelId ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr);
39887 void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKChannelId val);
39890 * The per-commitment point of the second commitment transaction
39892 struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
39895 * The per-commitment point of the second commitment transaction
39897 void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39900 * If set, provides a `short_channel_id` alias for this channel.
39902 * The sender will accept payments to be forwarded over this SCID and forward them to this
39903 * messages' recipient.
39905 struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
39908 * If set, provides a `short_channel_id` alias for this channel.
39910 * The sender will accept payments to be forwarded over this SCID and forward them to this
39911 * messages' recipient.
39913 void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
39916 * Constructs a new ChannelReady given each field
39918 MUST_USE_RES struct LDKChannelReady ChannelReady_new(struct LDKChannelId channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg, struct LDKCOption_u64Z short_channel_id_alias_arg);
39921 * Creates a copy of the ChannelReady
39923 struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
39926 * Generates a non-cryptographic 64-bit hash of the ChannelReady.
39928 uint64_t ChannelReady_hash(const struct LDKChannelReady *NONNULL_PTR o);
39931 * Checks if two ChannelReadys contain equal inner contents.
39932 * This ignores pointers and is_owned flags and looks at the values in fields.
39933 * Two objects with NULL inner values will be considered "equal" here.
39935 bool ChannelReady_eq(const struct LDKChannelReady *NONNULL_PTR a, const struct LDKChannelReady *NONNULL_PTR b);
39938 * Frees any resources used by the Stfu, if is_owned is set and inner is non-NULL.
39940 void Stfu_free(struct LDKStfu this_obj);
39943 * The channel ID where quiescence is intended
39945 struct LDKChannelId Stfu_get_channel_id(const struct LDKStfu *NONNULL_PTR this_ptr);
39948 * The channel ID where quiescence is intended
39950 void Stfu_set_channel_id(struct LDKStfu *NONNULL_PTR this_ptr, struct LDKChannelId val);
39953 * Initiator flag, 1 if initiating, 0 if replying to an stfu.
39955 uint8_t Stfu_get_initiator(const struct LDKStfu *NONNULL_PTR this_ptr);
39958 * Initiator flag, 1 if initiating, 0 if replying to an stfu.
39960 void Stfu_set_initiator(struct LDKStfu *NONNULL_PTR this_ptr, uint8_t val);
39963 * Constructs a new Stfu given each field
39965 MUST_USE_RES struct LDKStfu Stfu_new(struct LDKChannelId channel_id_arg, uint8_t initiator_arg);
39968 * Creates a copy of the Stfu
39970 struct LDKStfu Stfu_clone(const struct LDKStfu *NONNULL_PTR orig);
39973 * Checks if two Stfus contain equal inner contents.
39974 * This ignores pointers and is_owned flags and looks at the values in fields.
39975 * Two objects with NULL inner values will be considered "equal" here.
39977 bool Stfu_eq(const struct LDKStfu *NONNULL_PTR a, const struct LDKStfu *NONNULL_PTR b);
39980 * Frees any resources used by the Splice, if is_owned is set and inner is non-NULL.
39982 void Splice_free(struct LDKSplice this_obj);
39985 * The channel ID where splicing is intended
39987 struct LDKChannelId Splice_get_channel_id(const struct LDKSplice *NONNULL_PTR this_ptr);
39990 * The channel ID where splicing is intended
39992 void Splice_set_channel_id(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKChannelId val);
39995 * The genesis hash of the blockchain where the channel is intended to be spliced
39997 const uint8_t (*Splice_get_chain_hash(const struct LDKSplice *NONNULL_PTR this_ptr))[32];
40000 * The genesis hash of the blockchain where the channel is intended to be spliced
40002 void Splice_set_chain_hash(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
40005 * The intended change in channel capacity: the amount to be added (positive value)
40006 * or removed (negative value) by the sender (splice initiator) by splicing into/from the channel.
40008 int64_t Splice_get_relative_satoshis(const struct LDKSplice *NONNULL_PTR this_ptr);
40011 * The intended change in channel capacity: the amount to be added (positive value)
40012 * or removed (negative value) by the sender (splice initiator) by splicing into/from the channel.
40014 void Splice_set_relative_satoshis(struct LDKSplice *NONNULL_PTR this_ptr, int64_t val);
40017 * The feerate for the new funding transaction, set by the splice initiator
40019 uint32_t Splice_get_funding_feerate_perkw(const struct LDKSplice *NONNULL_PTR this_ptr);
40022 * The feerate for the new funding transaction, set by the splice initiator
40024 void Splice_set_funding_feerate_perkw(struct LDKSplice *NONNULL_PTR this_ptr, uint32_t val);
40027 * The locktime for the new funding transaction
40029 uint32_t Splice_get_locktime(const struct LDKSplice *NONNULL_PTR this_ptr);
40032 * The locktime for the new funding transaction
40034 void Splice_set_locktime(struct LDKSplice *NONNULL_PTR this_ptr, uint32_t val);
40037 * The key of the sender (splice initiator) controlling the new funding transaction
40039 struct LDKPublicKey Splice_get_funding_pubkey(const struct LDKSplice *NONNULL_PTR this_ptr);
40042 * The key of the sender (splice initiator) controlling the new funding transaction
40044 void Splice_set_funding_pubkey(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40047 * Constructs a new Splice given each field
40049 MUST_USE_RES struct LDKSplice Splice_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes chain_hash_arg, int64_t relative_satoshis_arg, uint32_t funding_feerate_perkw_arg, uint32_t locktime_arg, struct LDKPublicKey funding_pubkey_arg);
40052 * Creates a copy of the Splice
40054 struct LDKSplice Splice_clone(const struct LDKSplice *NONNULL_PTR orig);
40057 * Checks if two Splices contain equal inner contents.
40058 * This ignores pointers and is_owned flags and looks at the values in fields.
40059 * Two objects with NULL inner values will be considered "equal" here.
40061 bool Splice_eq(const struct LDKSplice *NONNULL_PTR a, const struct LDKSplice *NONNULL_PTR b);
40064 * Frees any resources used by the SpliceAck, if is_owned is set and inner is non-NULL.
40066 void SpliceAck_free(struct LDKSpliceAck this_obj);
40069 * The channel ID where splicing is intended
40071 struct LDKChannelId SpliceAck_get_channel_id(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
40074 * The channel ID where splicing is intended
40076 void SpliceAck_set_channel_id(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKChannelId val);
40079 * The genesis hash of the blockchain where the channel is intended to be spliced
40081 const uint8_t (*SpliceAck_get_chain_hash(const struct LDKSpliceAck *NONNULL_PTR this_ptr))[32];
40084 * The genesis hash of the blockchain where the channel is intended to be spliced
40086 void SpliceAck_set_chain_hash(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
40089 * The intended change in channel capacity: the amount to be added (positive value)
40090 * or removed (negative value) by the sender (splice acceptor) by splicing into/from the channel.
40092 int64_t SpliceAck_get_relative_satoshis(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
40095 * The intended change in channel capacity: the amount to be added (positive value)
40096 * or removed (negative value) by the sender (splice acceptor) by splicing into/from the channel.
40098 void SpliceAck_set_relative_satoshis(struct LDKSpliceAck *NONNULL_PTR this_ptr, int64_t val);
40101 * The key of the sender (splice acceptor) controlling the new funding transaction
40103 struct LDKPublicKey SpliceAck_get_funding_pubkey(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
40106 * The key of the sender (splice acceptor) controlling the new funding transaction
40108 void SpliceAck_set_funding_pubkey(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40111 * Constructs a new SpliceAck given each field
40113 MUST_USE_RES struct LDKSpliceAck SpliceAck_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes chain_hash_arg, int64_t relative_satoshis_arg, struct LDKPublicKey funding_pubkey_arg);
40116 * Creates a copy of the SpliceAck
40118 struct LDKSpliceAck SpliceAck_clone(const struct LDKSpliceAck *NONNULL_PTR orig);
40121 * Checks if two SpliceAcks contain equal inner contents.
40122 * This ignores pointers and is_owned flags and looks at the values in fields.
40123 * Two objects with NULL inner values will be considered "equal" here.
40125 bool SpliceAck_eq(const struct LDKSpliceAck *NONNULL_PTR a, const struct LDKSpliceAck *NONNULL_PTR b);
40128 * Frees any resources used by the SpliceLocked, if is_owned is set and inner is non-NULL.
40130 void SpliceLocked_free(struct LDKSpliceLocked this_obj);
40135 struct LDKChannelId SpliceLocked_get_channel_id(const struct LDKSpliceLocked *NONNULL_PTR this_ptr);
40140 void SpliceLocked_set_channel_id(struct LDKSpliceLocked *NONNULL_PTR this_ptr, struct LDKChannelId val);
40143 * Constructs a new SpliceLocked given each field
40145 MUST_USE_RES struct LDKSpliceLocked SpliceLocked_new(struct LDKChannelId channel_id_arg);
40148 * Creates a copy of the SpliceLocked
40150 struct LDKSpliceLocked SpliceLocked_clone(const struct LDKSpliceLocked *NONNULL_PTR orig);
40153 * Checks if two SpliceLockeds contain equal inner contents.
40154 * This ignores pointers and is_owned flags and looks at the values in fields.
40155 * Two objects with NULL inner values will be considered "equal" here.
40157 bool SpliceLocked_eq(const struct LDKSpliceLocked *NONNULL_PTR a, const struct LDKSpliceLocked *NONNULL_PTR b);
40160 * Frees any resources used by the TxAddInput, if is_owned is set and inner is non-NULL.
40162 void TxAddInput_free(struct LDKTxAddInput this_obj);
40167 struct LDKChannelId TxAddInput_get_channel_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
40172 void TxAddInput_set_channel_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKChannelId val);
40175 * A randomly chosen unique identifier for this input, which is even for initiators and odd for
40178 uint64_t TxAddInput_get_serial_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
40181 * A randomly chosen unique identifier for this input, which is even for initiators and odd for
40184 void TxAddInput_set_serial_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint64_t val);
40187 * Serialized transaction that contains the output this input spends to verify that it is non
40190 struct LDKTransactionU16LenLimited TxAddInput_get_prevtx(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
40193 * Serialized transaction that contains the output this input spends to verify that it is non
40196 void TxAddInput_set_prevtx(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKTransactionU16LenLimited val);
40199 * The index of the output being spent
40201 uint32_t TxAddInput_get_prevtx_out(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
40204 * The index of the output being spent
40206 void TxAddInput_set_prevtx_out(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
40209 * The sequence number of this input
40211 uint32_t TxAddInput_get_sequence(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
40214 * The sequence number of this input
40216 void TxAddInput_set_sequence(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
40219 * Constructs a new TxAddInput given each field
40221 MUST_USE_RES struct LDKTxAddInput TxAddInput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg, struct LDKTransactionU16LenLimited prevtx_arg, uint32_t prevtx_out_arg, uint32_t sequence_arg);
40224 * Creates a copy of the TxAddInput
40226 struct LDKTxAddInput TxAddInput_clone(const struct LDKTxAddInput *NONNULL_PTR orig);
40229 * Generates a non-cryptographic 64-bit hash of the TxAddInput.
40231 uint64_t TxAddInput_hash(const struct LDKTxAddInput *NONNULL_PTR o);
40234 * Checks if two TxAddInputs contain equal inner contents.
40235 * This ignores pointers and is_owned flags and looks at the values in fields.
40236 * Two objects with NULL inner values will be considered "equal" here.
40238 bool TxAddInput_eq(const struct LDKTxAddInput *NONNULL_PTR a, const struct LDKTxAddInput *NONNULL_PTR b);
40241 * Frees any resources used by the TxAddOutput, if is_owned is set and inner is non-NULL.
40243 void TxAddOutput_free(struct LDKTxAddOutput this_obj);
40248 struct LDKChannelId TxAddOutput_get_channel_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
40253 void TxAddOutput_set_channel_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKChannelId val);
40256 * A randomly chosen unique identifier for this output, which is even for initiators and odd for
40259 uint64_t TxAddOutput_get_serial_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
40262 * A randomly chosen unique identifier for this output, which is even for initiators and odd for
40265 void TxAddOutput_set_serial_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
40268 * The satoshi value of the output
40270 uint64_t TxAddOutput_get_sats(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
40273 * The satoshi value of the output
40275 void TxAddOutput_set_sats(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
40278 * The scriptPubKey for the output
40280 struct LDKCVec_u8Z TxAddOutput_get_script(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
40283 * The scriptPubKey for the output
40285 void TxAddOutput_set_script(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
40288 * Constructs a new TxAddOutput given each field
40290 MUST_USE_RES struct LDKTxAddOutput TxAddOutput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg, uint64_t sats_arg, struct LDKCVec_u8Z script_arg);
40293 * Creates a copy of the TxAddOutput
40295 struct LDKTxAddOutput TxAddOutput_clone(const struct LDKTxAddOutput *NONNULL_PTR orig);
40298 * Generates a non-cryptographic 64-bit hash of the TxAddOutput.
40300 uint64_t TxAddOutput_hash(const struct LDKTxAddOutput *NONNULL_PTR o);
40303 * Checks if two TxAddOutputs contain equal inner contents.
40304 * This ignores pointers and is_owned flags and looks at the values in fields.
40305 * Two objects with NULL inner values will be considered "equal" here.
40307 bool TxAddOutput_eq(const struct LDKTxAddOutput *NONNULL_PTR a, const struct LDKTxAddOutput *NONNULL_PTR b);
40310 * Frees any resources used by the TxRemoveInput, if is_owned is set and inner is non-NULL.
40312 void TxRemoveInput_free(struct LDKTxRemoveInput this_obj);
40317 struct LDKChannelId TxRemoveInput_get_channel_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr);
40322 void TxRemoveInput_set_channel_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, struct LDKChannelId val);
40325 * The serial ID of the input to be removed
40327 uint64_t TxRemoveInput_get_serial_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr);
40330 * The serial ID of the input to be removed
40332 void TxRemoveInput_set_serial_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, uint64_t val);
40335 * Constructs a new TxRemoveInput given each field
40337 MUST_USE_RES struct LDKTxRemoveInput TxRemoveInput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg);
40340 * Creates a copy of the TxRemoveInput
40342 struct LDKTxRemoveInput TxRemoveInput_clone(const struct LDKTxRemoveInput *NONNULL_PTR orig);
40345 * Generates a non-cryptographic 64-bit hash of the TxRemoveInput.
40347 uint64_t TxRemoveInput_hash(const struct LDKTxRemoveInput *NONNULL_PTR o);
40350 * Checks if two TxRemoveInputs contain equal inner contents.
40351 * This ignores pointers and is_owned flags and looks at the values in fields.
40352 * Two objects with NULL inner values will be considered "equal" here.
40354 bool TxRemoveInput_eq(const struct LDKTxRemoveInput *NONNULL_PTR a, const struct LDKTxRemoveInput *NONNULL_PTR b);
40357 * Frees any resources used by the TxRemoveOutput, if is_owned is set and inner is non-NULL.
40359 void TxRemoveOutput_free(struct LDKTxRemoveOutput this_obj);
40364 struct LDKChannelId TxRemoveOutput_get_channel_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr);
40369 void TxRemoveOutput_set_channel_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, struct LDKChannelId val);
40372 * The serial ID of the output to be removed
40374 uint64_t TxRemoveOutput_get_serial_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr);
40377 * The serial ID of the output to be removed
40379 void TxRemoveOutput_set_serial_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, uint64_t val);
40382 * Constructs a new TxRemoveOutput given each field
40384 MUST_USE_RES struct LDKTxRemoveOutput TxRemoveOutput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg);
40387 * Creates a copy of the TxRemoveOutput
40389 struct LDKTxRemoveOutput TxRemoveOutput_clone(const struct LDKTxRemoveOutput *NONNULL_PTR orig);
40392 * Generates a non-cryptographic 64-bit hash of the TxRemoveOutput.
40394 uint64_t TxRemoveOutput_hash(const struct LDKTxRemoveOutput *NONNULL_PTR o);
40397 * Checks if two TxRemoveOutputs contain equal inner contents.
40398 * This ignores pointers and is_owned flags and looks at the values in fields.
40399 * Two objects with NULL inner values will be considered "equal" here.
40401 bool TxRemoveOutput_eq(const struct LDKTxRemoveOutput *NONNULL_PTR a, const struct LDKTxRemoveOutput *NONNULL_PTR b);
40404 * Frees any resources used by the TxComplete, if is_owned is set and inner is non-NULL.
40406 void TxComplete_free(struct LDKTxComplete this_obj);
40411 struct LDKChannelId TxComplete_get_channel_id(const struct LDKTxComplete *NONNULL_PTR this_ptr);
40416 void TxComplete_set_channel_id(struct LDKTxComplete *NONNULL_PTR this_ptr, struct LDKChannelId val);
40419 * Constructs a new TxComplete given each field
40421 MUST_USE_RES struct LDKTxComplete TxComplete_new(struct LDKChannelId channel_id_arg);
40424 * Creates a copy of the TxComplete
40426 struct LDKTxComplete TxComplete_clone(const struct LDKTxComplete *NONNULL_PTR orig);
40429 * Generates a non-cryptographic 64-bit hash of the TxComplete.
40431 uint64_t TxComplete_hash(const struct LDKTxComplete *NONNULL_PTR o);
40434 * Checks if two TxCompletes contain equal inner contents.
40435 * This ignores pointers and is_owned flags and looks at the values in fields.
40436 * Two objects with NULL inner values will be considered "equal" here.
40438 bool TxComplete_eq(const struct LDKTxComplete *NONNULL_PTR a, const struct LDKTxComplete *NONNULL_PTR b);
40441 * Frees any resources used by the TxSignatures, if is_owned is set and inner is non-NULL.
40443 void TxSignatures_free(struct LDKTxSignatures this_obj);
40448 struct LDKChannelId TxSignatures_get_channel_id(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
40453 void TxSignatures_set_channel_id(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKChannelId val);
40458 const uint8_t (*TxSignatures_get_tx_hash(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32];
40463 void TxSignatures_set_tx_hash(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
40466 * The list of witnesses
40468 * Returns a copy of the field.
40470 struct LDKCVec_WitnessZ TxSignatures_get_witnesses(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
40473 * The list of witnesses
40475 void TxSignatures_set_witnesses(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCVec_WitnessZ val);
40478 * Optional signature for the shared input -- the previous funding outpoint -- signed by both peers
40480 struct LDKCOption_ECDSASignatureZ TxSignatures_get_funding_outpoint_sig(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
40483 * Optional signature for the shared input -- the previous funding outpoint -- signed by both peers
40485 void TxSignatures_set_funding_outpoint_sig(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCOption_ECDSASignatureZ val);
40488 * Constructs a new TxSignatures given each field
40490 MUST_USE_RES struct LDKTxSignatures TxSignatures_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes tx_hash_arg, struct LDKCVec_WitnessZ witnesses_arg, struct LDKCOption_ECDSASignatureZ funding_outpoint_sig_arg);
40493 * Creates a copy of the TxSignatures
40495 struct LDKTxSignatures TxSignatures_clone(const struct LDKTxSignatures *NONNULL_PTR orig);
40498 * Generates a non-cryptographic 64-bit hash of the TxSignatures.
40500 uint64_t TxSignatures_hash(const struct LDKTxSignatures *NONNULL_PTR o);
40503 * Checks if two TxSignaturess contain equal inner contents.
40504 * This ignores pointers and is_owned flags and looks at the values in fields.
40505 * Two objects with NULL inner values will be considered "equal" here.
40507 bool TxSignatures_eq(const struct LDKTxSignatures *NONNULL_PTR a, const struct LDKTxSignatures *NONNULL_PTR b);
40510 * Frees any resources used by the TxInitRbf, if is_owned is set and inner is non-NULL.
40512 void TxInitRbf_free(struct LDKTxInitRbf this_obj);
40517 struct LDKChannelId TxInitRbf_get_channel_id(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
40522 void TxInitRbf_set_channel_id(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKChannelId val);
40525 * The locktime of the transaction
40527 uint32_t TxInitRbf_get_locktime(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
40530 * The locktime of the transaction
40532 void TxInitRbf_set_locktime(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
40535 * The feerate of the transaction
40537 uint32_t TxInitRbf_get_feerate_sat_per_1000_weight(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
40540 * The feerate of the transaction
40542 void TxInitRbf_set_feerate_sat_per_1000_weight(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
40545 * The number of satoshis the sender will contribute to or, if negative, remove from
40546 * (e.g. splice-out) the funding output of the transaction
40548 struct LDKCOption_i64Z TxInitRbf_get_funding_output_contribution(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
40551 * The number of satoshis the sender will contribute to or, if negative, remove from
40552 * (e.g. splice-out) the funding output of the transaction
40554 void TxInitRbf_set_funding_output_contribution(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
40557 * Constructs a new TxInitRbf given each field
40559 MUST_USE_RES struct LDKTxInitRbf TxInitRbf_new(struct LDKChannelId channel_id_arg, uint32_t locktime_arg, uint32_t feerate_sat_per_1000_weight_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
40562 * Creates a copy of the TxInitRbf
40564 struct LDKTxInitRbf TxInitRbf_clone(const struct LDKTxInitRbf *NONNULL_PTR orig);
40567 * Generates a non-cryptographic 64-bit hash of the TxInitRbf.
40569 uint64_t TxInitRbf_hash(const struct LDKTxInitRbf *NONNULL_PTR o);
40572 * Checks if two TxInitRbfs contain equal inner contents.
40573 * This ignores pointers and is_owned flags and looks at the values in fields.
40574 * Two objects with NULL inner values will be considered "equal" here.
40576 bool TxInitRbf_eq(const struct LDKTxInitRbf *NONNULL_PTR a, const struct LDKTxInitRbf *NONNULL_PTR b);
40579 * Frees any resources used by the TxAckRbf, if is_owned is set and inner is non-NULL.
40581 void TxAckRbf_free(struct LDKTxAckRbf this_obj);
40586 struct LDKChannelId TxAckRbf_get_channel_id(const struct LDKTxAckRbf *NONNULL_PTR this_ptr);
40591 void TxAckRbf_set_channel_id(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKChannelId val);
40594 * The number of satoshis the sender will contribute to or, if negative, remove from
40595 * (e.g. splice-out) the funding output of the transaction
40597 struct LDKCOption_i64Z TxAckRbf_get_funding_output_contribution(const struct LDKTxAckRbf *NONNULL_PTR this_ptr);
40600 * The number of satoshis the sender will contribute to or, if negative, remove from
40601 * (e.g. splice-out) the funding output of the transaction
40603 void TxAckRbf_set_funding_output_contribution(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
40606 * Constructs a new TxAckRbf given each field
40608 MUST_USE_RES struct LDKTxAckRbf TxAckRbf_new(struct LDKChannelId channel_id_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
40611 * Creates a copy of the TxAckRbf
40613 struct LDKTxAckRbf TxAckRbf_clone(const struct LDKTxAckRbf *NONNULL_PTR orig);
40616 * Generates a non-cryptographic 64-bit hash of the TxAckRbf.
40618 uint64_t TxAckRbf_hash(const struct LDKTxAckRbf *NONNULL_PTR o);
40621 * Checks if two TxAckRbfs contain equal inner contents.
40622 * This ignores pointers and is_owned flags and looks at the values in fields.
40623 * Two objects with NULL inner values will be considered "equal" here.
40625 bool TxAckRbf_eq(const struct LDKTxAckRbf *NONNULL_PTR a, const struct LDKTxAckRbf *NONNULL_PTR b);
40628 * Frees any resources used by the TxAbort, if is_owned is set and inner is non-NULL.
40630 void TxAbort_free(struct LDKTxAbort this_obj);
40635 struct LDKChannelId TxAbort_get_channel_id(const struct LDKTxAbort *NONNULL_PTR this_ptr);
40640 void TxAbort_set_channel_id(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKChannelId val);
40645 * Returns a copy of the field.
40647 struct LDKCVec_u8Z TxAbort_get_data(const struct LDKTxAbort *NONNULL_PTR this_ptr);
40652 void TxAbort_set_data(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
40655 * Constructs a new TxAbort given each field
40657 MUST_USE_RES struct LDKTxAbort TxAbort_new(struct LDKChannelId channel_id_arg, struct LDKCVec_u8Z data_arg);
40660 * Creates a copy of the TxAbort
40662 struct LDKTxAbort TxAbort_clone(const struct LDKTxAbort *NONNULL_PTR orig);
40665 * Generates a non-cryptographic 64-bit hash of the TxAbort.
40667 uint64_t TxAbort_hash(const struct LDKTxAbort *NONNULL_PTR o);
40670 * Checks if two TxAborts contain equal inner contents.
40671 * This ignores pointers and is_owned flags and looks at the values in fields.
40672 * Two objects with NULL inner values will be considered "equal" here.
40674 bool TxAbort_eq(const struct LDKTxAbort *NONNULL_PTR a, const struct LDKTxAbort *NONNULL_PTR b);
40677 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
40679 void Shutdown_free(struct LDKShutdown this_obj);
40684 struct LDKChannelId Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr);
40689 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKChannelId val);
40692 * The destination of this peer's funds on closing.
40694 * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
40696 struct LDKCVec_u8Z Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
40699 * The destination of this peer's funds on closing.
40701 * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
40703 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
40706 * Constructs a new Shutdown given each field
40708 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKChannelId channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
40711 * Creates a copy of the Shutdown
40713 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
40716 * Generates a non-cryptographic 64-bit hash of the Shutdown.
40718 uint64_t Shutdown_hash(const struct LDKShutdown *NONNULL_PTR o);
40721 * Checks if two Shutdowns contain equal inner contents.
40722 * This ignores pointers and is_owned flags and looks at the values in fields.
40723 * Two objects with NULL inner values will be considered "equal" here.
40725 bool Shutdown_eq(const struct LDKShutdown *NONNULL_PTR a, const struct LDKShutdown *NONNULL_PTR b);
40728 * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
40730 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
40733 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
40736 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
40739 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
40742 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
40745 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
40748 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
40751 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
40754 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
40757 * Constructs a new ClosingSignedFeeRange given each field
40759 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
40762 * Creates a copy of the ClosingSignedFeeRange
40764 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
40767 * Generates a non-cryptographic 64-bit hash of the ClosingSignedFeeRange.
40769 uint64_t ClosingSignedFeeRange_hash(const struct LDKClosingSignedFeeRange *NONNULL_PTR o);
40772 * Checks if two ClosingSignedFeeRanges contain equal inner contents.
40773 * This ignores pointers and is_owned flags and looks at the values in fields.
40774 * Two objects with NULL inner values will be considered "equal" here.
40776 bool ClosingSignedFeeRange_eq(const struct LDKClosingSignedFeeRange *NONNULL_PTR a, const struct LDKClosingSignedFeeRange *NONNULL_PTR b);
40779 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
40781 void ClosingSigned_free(struct LDKClosingSigned this_obj);
40786 struct LDKChannelId ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
40791 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKChannelId val);
40794 * The proposed total fee for the closing transaction
40796 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
40799 * The proposed total fee for the closing transaction
40801 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
40804 * A signature on the closing transaction
40806 struct LDKECDSASignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
40809 * A signature on the closing transaction
40811 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
40814 * The minimum and maximum fees which the sender is willing to accept, provided only by new
40817 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40819 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
40822 * The minimum and maximum fees which the sender is willing to accept, provided only by new
40825 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40827 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
40830 * Constructs a new ClosingSigned given each field
40832 * Note that fee_range_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
40834 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKChannelId channel_id_arg, uint64_t fee_satoshis_arg, struct LDKECDSASignature signature_arg, struct LDKClosingSignedFeeRange fee_range_arg);
40837 * Creates a copy of the ClosingSigned
40839 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
40842 * Generates a non-cryptographic 64-bit hash of the ClosingSigned.
40844 uint64_t ClosingSigned_hash(const struct LDKClosingSigned *NONNULL_PTR o);
40847 * Checks if two ClosingSigneds contain equal inner contents.
40848 * This ignores pointers and is_owned flags and looks at the values in fields.
40849 * Two objects with NULL inner values will be considered "equal" here.
40851 bool ClosingSigned_eq(const struct LDKClosingSigned *NONNULL_PTR a, const struct LDKClosingSigned *NONNULL_PTR b);
40854 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
40856 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
40861 struct LDKChannelId UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
40866 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
40871 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
40876 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
40879 * The HTLC value in milli-satoshi
40881 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
40884 * The HTLC value in milli-satoshi
40886 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
40889 * The payment hash, the pre-image of which controls HTLC redemption
40891 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
40894 * The payment hash, the pre-image of which controls HTLC redemption
40896 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
40899 * The expiry height of the HTLC
40901 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
40904 * The expiry height of the HTLC
40906 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
40909 * The extra fee skimmed by the sender of this message. See
40910 * [`ChannelConfig::accept_underpaying_htlcs`].
40912 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
40914 struct LDKCOption_u64Z UpdateAddHTLC_get_skimmed_fee_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
40917 * The extra fee skimmed by the sender of this message. See
40918 * [`ChannelConfig::accept_underpaying_htlcs`].
40920 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
40922 void UpdateAddHTLC_set_skimmed_fee_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
40925 * The onion routing packet with encrypted data for the next hop.
40927 struct LDKOnionPacket UpdateAddHTLC_get_onion_routing_packet(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
40930 * The onion routing packet with encrypted data for the next hop.
40932 void UpdateAddHTLC_set_onion_routing_packet(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKOnionPacket val);
40935 * Provided if we are relaying or receiving a payment within a blinded path, to decrypt the onion
40936 * routing packet and the recipient-provided encrypted payload within.
40938 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40940 struct LDKPublicKey UpdateAddHTLC_get_blinding_point(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
40943 * Provided if we are relaying or receiving a payment within a blinded path, to decrypt the onion
40944 * routing packet and the recipient-provided encrypted payload within.
40946 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40948 void UpdateAddHTLC_set_blinding_point(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40951 * Constructs a new UpdateAddHTLC given each field
40953 * Note that blinding_point_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
40955 MUST_USE_RES struct LDKUpdateAddHTLC UpdateAddHTLC_new(struct LDKChannelId channel_id_arg, uint64_t htlc_id_arg, uint64_t amount_msat_arg, struct LDKThirtyTwoBytes payment_hash_arg, uint32_t cltv_expiry_arg, struct LDKCOption_u64Z skimmed_fee_msat_arg, struct LDKOnionPacket onion_routing_packet_arg, struct LDKPublicKey blinding_point_arg);
40958 * Creates a copy of the UpdateAddHTLC
40960 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
40963 * Generates a non-cryptographic 64-bit hash of the UpdateAddHTLC.
40965 uint64_t UpdateAddHTLC_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR o);
40968 * Checks if two UpdateAddHTLCs contain equal inner contents.
40969 * This ignores pointers and is_owned flags and looks at the values in fields.
40970 * Two objects with NULL inner values will be considered "equal" here.
40972 bool UpdateAddHTLC_eq(const struct LDKUpdateAddHTLC *NONNULL_PTR a, const struct LDKUpdateAddHTLC *NONNULL_PTR b);
40975 * Frees any resources used by the OnionMessage, if is_owned is set and inner is non-NULL.
40977 void OnionMessage_free(struct LDKOnionMessage this_obj);
40980 * Used in decrypting the onion packet's payload.
40982 struct LDKPublicKey OnionMessage_get_blinding_point(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
40985 * Used in decrypting the onion packet's payload.
40987 void OnionMessage_set_blinding_point(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40990 * The full onion packet including hop data, pubkey, and hmac
40992 struct LDKPacket OnionMessage_get_onion_routing_packet(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
40995 * The full onion packet including hop data, pubkey, and hmac
40997 void OnionMessage_set_onion_routing_packet(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPacket val);
41000 * Constructs a new OnionMessage given each field
41002 MUST_USE_RES struct LDKOnionMessage OnionMessage_new(struct LDKPublicKey blinding_point_arg, struct LDKPacket onion_routing_packet_arg);
41005 * Creates a copy of the OnionMessage
41007 struct LDKOnionMessage OnionMessage_clone(const struct LDKOnionMessage *NONNULL_PTR orig);
41010 * Generates a non-cryptographic 64-bit hash of the OnionMessage.
41012 uint64_t OnionMessage_hash(const struct LDKOnionMessage *NONNULL_PTR o);
41015 * Checks if two OnionMessages contain equal inner contents.
41016 * This ignores pointers and is_owned flags and looks at the values in fields.
41017 * Two objects with NULL inner values will be considered "equal" here.
41019 bool OnionMessage_eq(const struct LDKOnionMessage *NONNULL_PTR a, const struct LDKOnionMessage *NONNULL_PTR b);
41022 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
41024 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
41029 struct LDKChannelId UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
41034 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
41039 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
41044 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
41047 * The pre-image of the payment hash, allowing HTLC redemption
41049 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
41052 * The pre-image of the payment hash, allowing HTLC redemption
41054 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41057 * Constructs a new UpdateFulfillHTLC given each field
41059 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKChannelId channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
41062 * Creates a copy of the UpdateFulfillHTLC
41064 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
41067 * Generates a non-cryptographic 64-bit hash of the UpdateFulfillHTLC.
41069 uint64_t UpdateFulfillHTLC_hash(const struct LDKUpdateFulfillHTLC *NONNULL_PTR o);
41072 * Checks if two UpdateFulfillHTLCs contain equal inner contents.
41073 * This ignores pointers and is_owned flags and looks at the values in fields.
41074 * Two objects with NULL inner values will be considered "equal" here.
41076 bool UpdateFulfillHTLC_eq(const struct LDKUpdateFulfillHTLC *NONNULL_PTR a, const struct LDKUpdateFulfillHTLC *NONNULL_PTR b);
41079 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
41081 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
41086 struct LDKChannelId UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
41091 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
41096 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
41101 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
41104 * Creates a copy of the UpdateFailHTLC
41106 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
41109 * Generates a non-cryptographic 64-bit hash of the UpdateFailHTLC.
41111 uint64_t UpdateFailHTLC_hash(const struct LDKUpdateFailHTLC *NONNULL_PTR o);
41114 * Checks if two UpdateFailHTLCs contain equal inner contents.
41115 * This ignores pointers and is_owned flags and looks at the values in fields.
41116 * Two objects with NULL inner values will be considered "equal" here.
41118 bool UpdateFailHTLC_eq(const struct LDKUpdateFailHTLC *NONNULL_PTR a, const struct LDKUpdateFailHTLC *NONNULL_PTR b);
41121 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
41123 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
41128 struct LDKChannelId UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
41133 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
41138 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
41143 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
41148 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
41153 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
41156 * Creates a copy of the UpdateFailMalformedHTLC
41158 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
41161 * Generates a non-cryptographic 64-bit hash of the UpdateFailMalformedHTLC.
41163 uint64_t UpdateFailMalformedHTLC_hash(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR o);
41166 * Checks if two UpdateFailMalformedHTLCs contain equal inner contents.
41167 * This ignores pointers and is_owned flags and looks at the values in fields.
41168 * Two objects with NULL inner values will be considered "equal" here.
41170 bool UpdateFailMalformedHTLC_eq(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR a, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR b);
41173 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
41175 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
41180 struct LDKChannelId CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
41185 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKChannelId val);
41188 * A signature on the commitment transaction
41190 struct LDKECDSASignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
41193 * A signature on the commitment transaction
41195 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41198 * Signatures on the HTLC transactions
41200 * Returns a copy of the field.
41202 struct LDKCVec_ECDSASignatureZ CommitmentSigned_get_htlc_signatures(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
41205 * Signatures on the HTLC transactions
41207 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
41210 * Constructs a new CommitmentSigned given each field
41212 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKChannelId channel_id_arg, struct LDKECDSASignature signature_arg, struct LDKCVec_ECDSASignatureZ htlc_signatures_arg);
41215 * Creates a copy of the CommitmentSigned
41217 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
41220 * Generates a non-cryptographic 64-bit hash of the CommitmentSigned.
41222 uint64_t CommitmentSigned_hash(const struct LDKCommitmentSigned *NONNULL_PTR o);
41225 * Checks if two CommitmentSigneds contain equal inner contents.
41226 * This ignores pointers and is_owned flags and looks at the values in fields.
41227 * Two objects with NULL inner values will be considered "equal" here.
41229 bool CommitmentSigned_eq(const struct LDKCommitmentSigned *NONNULL_PTR a, const struct LDKCommitmentSigned *NONNULL_PTR b);
41232 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
41234 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
41239 struct LDKChannelId RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
41244 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKChannelId val);
41247 * The secret corresponding to the per-commitment point
41249 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
41252 * The secret corresponding to the per-commitment point
41254 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41257 * The next sender-broadcast commitment transaction's per-commitment point
41259 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
41262 * The next sender-broadcast commitment transaction's per-commitment point
41264 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
41267 * Constructs a new RevokeAndACK given each field
41269 MUST_USE_RES struct LDKRevokeAndACK RevokeAndACK_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes per_commitment_secret_arg, struct LDKPublicKey next_per_commitment_point_arg);
41272 * Creates a copy of the RevokeAndACK
41274 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
41277 * Generates a non-cryptographic 64-bit hash of the RevokeAndACK.
41279 uint64_t RevokeAndACK_hash(const struct LDKRevokeAndACK *NONNULL_PTR o);
41282 * Checks if two RevokeAndACKs contain equal inner contents.
41283 * This ignores pointers and is_owned flags and looks at the values in fields.
41284 * Two objects with NULL inner values will be considered "equal" here.
41286 bool RevokeAndACK_eq(const struct LDKRevokeAndACK *NONNULL_PTR a, const struct LDKRevokeAndACK *NONNULL_PTR b);
41289 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
41291 void UpdateFee_free(struct LDKUpdateFee this_obj);
41296 struct LDKChannelId UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
41301 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKChannelId val);
41304 * Fee rate per 1000-weight of the transaction
41306 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
41309 * Fee rate per 1000-weight of the transaction
41311 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
41314 * Constructs a new UpdateFee given each field
41316 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKChannelId channel_id_arg, uint32_t feerate_per_kw_arg);
41319 * Creates a copy of the UpdateFee
41321 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
41324 * Generates a non-cryptographic 64-bit hash of the UpdateFee.
41326 uint64_t UpdateFee_hash(const struct LDKUpdateFee *NONNULL_PTR o);
41329 * Checks if two UpdateFees contain equal inner contents.
41330 * This ignores pointers and is_owned flags and looks at the values in fields.
41331 * Two objects with NULL inner values will be considered "equal" here.
41333 bool UpdateFee_eq(const struct LDKUpdateFee *NONNULL_PTR a, const struct LDKUpdateFee *NONNULL_PTR b);
41336 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
41338 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
41343 struct LDKChannelId ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
41348 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKChannelId val);
41351 * The next commitment number for the sender
41353 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
41356 * The next commitment number for the sender
41358 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
41361 * The next commitment number for the recipient
41363 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
41366 * The next commitment number for the recipient
41368 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
41371 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
41372 * belonging to the recipient
41374 const uint8_t (*ChannelReestablish_get_your_last_per_commitment_secret(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
41377 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
41378 * belonging to the recipient
41380 void ChannelReestablish_set_your_last_per_commitment_secret(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41383 * The sender's per-commitment point for their current commitment transaction
41385 struct LDKPublicKey ChannelReestablish_get_my_current_per_commitment_point(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
41388 * The sender's per-commitment point for their current commitment transaction
41390 void ChannelReestablish_set_my_current_per_commitment_point(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKPublicKey val);
41393 * The next funding transaction ID
41395 struct LDKCOption_ThirtyTwoBytesZ ChannelReestablish_get_next_funding_txid(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
41398 * The next funding transaction ID
41400 void ChannelReestablish_set_next_funding_txid(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
41403 * Constructs a new ChannelReestablish given each field
41405 MUST_USE_RES struct LDKChannelReestablish ChannelReestablish_new(struct LDKChannelId 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);
41408 * Creates a copy of the ChannelReestablish
41410 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
41413 * Generates a non-cryptographic 64-bit hash of the ChannelReestablish.
41415 uint64_t ChannelReestablish_hash(const struct LDKChannelReestablish *NONNULL_PTR o);
41418 * Checks if two ChannelReestablishs contain equal inner contents.
41419 * This ignores pointers and is_owned flags and looks at the values in fields.
41420 * Two objects with NULL inner values will be considered "equal" here.
41422 bool ChannelReestablish_eq(const struct LDKChannelReestablish *NONNULL_PTR a, const struct LDKChannelReestablish *NONNULL_PTR b);
41425 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
41427 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
41432 struct LDKChannelId AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
41437 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKChannelId val);
41440 * The short channel ID
41442 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
41445 * The short channel ID
41447 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
41450 * A signature by the node key
41452 struct LDKECDSASignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
41455 * A signature by the node key
41457 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41460 * A signature by the funding key
41462 struct LDKECDSASignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
41465 * A signature by the funding key
41467 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41470 * Constructs a new AnnouncementSignatures given each field
41472 MUST_USE_RES struct LDKAnnouncementSignatures AnnouncementSignatures_new(struct LDKChannelId channel_id_arg, uint64_t short_channel_id_arg, struct LDKECDSASignature node_signature_arg, struct LDKECDSASignature bitcoin_signature_arg);
41475 * Creates a copy of the AnnouncementSignatures
41477 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
41480 * Generates a non-cryptographic 64-bit hash of the AnnouncementSignatures.
41482 uint64_t AnnouncementSignatures_hash(const struct LDKAnnouncementSignatures *NONNULL_PTR o);
41485 * Checks if two AnnouncementSignaturess contain equal inner contents.
41486 * This ignores pointers and is_owned flags and looks at the values in fields.
41487 * Two objects with NULL inner values will be considered "equal" here.
41489 bool AnnouncementSignatures_eq(const struct LDKAnnouncementSignatures *NONNULL_PTR a, const struct LDKAnnouncementSignatures *NONNULL_PTR b);
41492 * Frees any resources used by the SocketAddress
41494 void SocketAddress_free(struct LDKSocketAddress this_ptr);
41497 * Creates a copy of the SocketAddress
41499 struct LDKSocketAddress SocketAddress_clone(const struct LDKSocketAddress *NONNULL_PTR orig);
41502 * Utility method to constructs a new TcpIpV4-variant SocketAddress
41504 struct LDKSocketAddress SocketAddress_tcp_ip_v4(struct LDKFourBytes addr, uint16_t port);
41507 * Utility method to constructs a new TcpIpV6-variant SocketAddress
41509 struct LDKSocketAddress SocketAddress_tcp_ip_v6(struct LDKSixteenBytes addr, uint16_t port);
41512 * Utility method to constructs a new OnionV2-variant SocketAddress
41514 struct LDKSocketAddress SocketAddress_onion_v2(struct LDKTwelveBytes a);
41517 * Utility method to constructs a new OnionV3-variant SocketAddress
41519 struct LDKSocketAddress SocketAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
41522 * Utility method to constructs a new Hostname-variant SocketAddress
41524 struct LDKSocketAddress SocketAddress_hostname(struct LDKHostname hostname, uint16_t port);
41527 * Generates a non-cryptographic 64-bit hash of the SocketAddress.
41529 uint64_t SocketAddress_hash(const struct LDKSocketAddress *NONNULL_PTR o);
41532 * Checks if two SocketAddresss contain equal inner contents.
41533 * This ignores pointers and is_owned flags and looks at the values in fields.
41535 bool SocketAddress_eq(const struct LDKSocketAddress *NONNULL_PTR a, const struct LDKSocketAddress *NONNULL_PTR b);
41538 * Serialize the SocketAddress object into a byte array which can be read by SocketAddress_read
41540 struct LDKCVec_u8Z SocketAddress_write(const struct LDKSocketAddress *NONNULL_PTR obj);
41543 * Read a SocketAddress from a byte array, created by SocketAddress_write
41545 struct LDKCResult_SocketAddressDecodeErrorZ SocketAddress_read(struct LDKu8slice ser);
41548 * Creates a copy of the SocketAddressParseError
41550 enum LDKSocketAddressParseError SocketAddressParseError_clone(const enum LDKSocketAddressParseError *NONNULL_PTR orig);
41553 * Utility method to constructs a new SocketAddrParse-variant SocketAddressParseError
41555 enum LDKSocketAddressParseError SocketAddressParseError_socket_addr_parse(void);
41558 * Utility method to constructs a new InvalidInput-variant SocketAddressParseError
41560 enum LDKSocketAddressParseError SocketAddressParseError_invalid_input(void);
41563 * Utility method to constructs a new InvalidPort-variant SocketAddressParseError
41565 enum LDKSocketAddressParseError SocketAddressParseError_invalid_port(void);
41568 * Utility method to constructs a new InvalidOnionV3-variant SocketAddressParseError
41570 enum LDKSocketAddressParseError SocketAddressParseError_invalid_onion_v3(void);
41573 * Generates a non-cryptographic 64-bit hash of the SocketAddressParseError.
41575 uint64_t SocketAddressParseError_hash(const enum LDKSocketAddressParseError *NONNULL_PTR o);
41578 * Checks if two SocketAddressParseErrors contain equal inner contents.
41579 * This ignores pointers and is_owned flags and looks at the values in fields.
41581 bool SocketAddressParseError_eq(const enum LDKSocketAddressParseError *NONNULL_PTR a, const enum LDKSocketAddressParseError *NONNULL_PTR b);
41584 * Parses an OnionV3 host and port into a [`SocketAddress::OnionV3`].
41586 * The host part must end with \".onion\".
41588 struct LDKCResult_SocketAddressSocketAddressParseErrorZ parse_onion_address(struct LDKStr host, uint16_t port);
41591 * Get the string representation of a SocketAddress object
41593 struct LDKStr SocketAddress_to_str(const struct LDKSocketAddress *NONNULL_PTR o);
41596 * Read a SocketAddress object from a string
41598 struct LDKCResult_SocketAddressSocketAddressParseErrorZ SocketAddress_from_str(struct LDKStr s);
41601 * Frees any resources used by the UnsignedGossipMessage
41603 void UnsignedGossipMessage_free(struct LDKUnsignedGossipMessage this_ptr);
41606 * Creates a copy of the UnsignedGossipMessage
41608 struct LDKUnsignedGossipMessage UnsignedGossipMessage_clone(const struct LDKUnsignedGossipMessage *NONNULL_PTR orig);
41611 * Utility method to constructs a new ChannelAnnouncement-variant UnsignedGossipMessage
41613 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_announcement(struct LDKUnsignedChannelAnnouncement a);
41616 * Utility method to constructs a new ChannelUpdate-variant UnsignedGossipMessage
41618 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_update(struct LDKUnsignedChannelUpdate a);
41621 * Utility method to constructs a new NodeAnnouncement-variant UnsignedGossipMessage
41623 struct LDKUnsignedGossipMessage UnsignedGossipMessage_node_announcement(struct LDKUnsignedNodeAnnouncement a);
41626 * Serialize the UnsignedGossipMessage object into a byte array which can be read by UnsignedGossipMessage_read
41628 struct LDKCVec_u8Z UnsignedGossipMessage_write(const struct LDKUnsignedGossipMessage *NONNULL_PTR obj);
41631 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
41633 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
41636 * The advertised features
41638 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
41641 * The advertised features
41643 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
41646 * A strictly monotonic announcement counter, with gaps allowed
41648 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
41651 * A strictly monotonic announcement counter, with gaps allowed
41653 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
41656 * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
41659 struct LDKNodeId UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
41662 * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
41665 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
41668 * An RGB color for UI purposes
41670 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
41673 * An RGB color for UI purposes
41675 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
41678 * An alias, for UI purposes.
41680 * This should be sanitized before use. There is no guarantee of uniqueness.
41682 struct LDKNodeAlias UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
41685 * An alias, for UI purposes.
41687 * This should be sanitized before use. There is no guarantee of uniqueness.
41689 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
41692 * List of addresses on which this node is reachable
41694 * Returns a copy of the field.
41696 struct LDKCVec_SocketAddressZ UnsignedNodeAnnouncement_get_addresses(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
41699 * List of addresses on which this node is reachable
41701 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_SocketAddressZ val);
41704 * Excess address data which was signed as a part of the message which we do not (yet) understand how
41707 * This is stored to ensure forward-compatibility as new address types are added to the lightning gossip protocol.
41709 * Returns a copy of the field.
41711 struct LDKCVec_u8Z UnsignedNodeAnnouncement_get_excess_address_data(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
41714 * Excess address data which was signed as a part of the message which we do not (yet) understand how
41717 * This is stored to ensure forward-compatibility as new address types are added to the lightning gossip protocol.
41719 void UnsignedNodeAnnouncement_set_excess_address_data(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
41722 * Excess data which was signed as a part of the message which we do not (yet) understand how
41725 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
41727 * Returns a copy of the field.
41729 struct LDKCVec_u8Z UnsignedNodeAnnouncement_get_excess_data(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
41732 * Excess data which was signed as a part of the message which we do not (yet) understand how
41735 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
41737 void UnsignedNodeAnnouncement_set_excess_data(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
41740 * Constructs a new UnsignedNodeAnnouncement given each field
41742 MUST_USE_RES struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_new(struct LDKNodeFeatures features_arg, uint32_t timestamp_arg, struct LDKNodeId node_id_arg, struct LDKThreeBytes rgb_arg, struct LDKNodeAlias alias_arg, struct LDKCVec_SocketAddressZ addresses_arg, struct LDKCVec_u8Z excess_address_data_arg, struct LDKCVec_u8Z excess_data_arg);
41745 * Creates a copy of the UnsignedNodeAnnouncement
41747 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
41750 * Generates a non-cryptographic 64-bit hash of the UnsignedNodeAnnouncement.
41752 uint64_t UnsignedNodeAnnouncement_hash(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR o);
41755 * Checks if two UnsignedNodeAnnouncements contain equal inner contents.
41756 * This ignores pointers and is_owned flags and looks at the values in fields.
41757 * Two objects with NULL inner values will be considered "equal" here.
41759 bool UnsignedNodeAnnouncement_eq(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR a, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR b);
41762 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
41764 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
41767 * The signature by the node key
41769 struct LDKECDSASignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
41772 * The signature by the node key
41774 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41777 * The actual content of the announcement
41779 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
41782 * The actual content of the announcement
41784 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
41787 * Constructs a new NodeAnnouncement given each field
41789 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
41792 * Creates a copy of the NodeAnnouncement
41794 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
41797 * Generates a non-cryptographic 64-bit hash of the NodeAnnouncement.
41799 uint64_t NodeAnnouncement_hash(const struct LDKNodeAnnouncement *NONNULL_PTR o);
41802 * Checks if two NodeAnnouncements contain equal inner contents.
41803 * This ignores pointers and is_owned flags and looks at the values in fields.
41804 * Two objects with NULL inner values will be considered "equal" here.
41806 bool NodeAnnouncement_eq(const struct LDKNodeAnnouncement *NONNULL_PTR a, const struct LDKNodeAnnouncement *NONNULL_PTR b);
41809 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
41811 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
41814 * The advertised channel features
41816 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
41819 * The advertised channel features
41821 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
41824 * The genesis hash of the blockchain where the channel is to be opened
41826 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
41829 * The genesis hash of the blockchain where the channel is to be opened
41831 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41834 * The short channel ID
41836 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
41839 * The short channel ID
41841 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
41844 * One of the two `node_id`s which are endpoints of this channel
41846 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
41849 * One of the two `node_id`s which are endpoints of this channel
41851 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
41854 * The other of the two `node_id`s which are endpoints of this channel
41856 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
41859 * The other of the two `node_id`s which are endpoints of this channel
41861 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
41864 * The funding key for the first node
41866 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
41869 * The funding key for the first node
41871 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
41874 * The funding key for the second node
41876 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
41879 * The funding key for the second node
41881 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
41884 * Excess data which was signed as a part of the message which we do not (yet) understand how
41887 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
41889 * Returns a copy of the field.
41891 struct LDKCVec_u8Z UnsignedChannelAnnouncement_get_excess_data(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
41894 * Excess data which was signed as a part of the message which we do not (yet) understand how
41897 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
41899 void UnsignedChannelAnnouncement_set_excess_data(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
41902 * Constructs a new UnsignedChannelAnnouncement given each field
41904 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);
41907 * Creates a copy of the UnsignedChannelAnnouncement
41909 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
41912 * Generates a non-cryptographic 64-bit hash of the UnsignedChannelAnnouncement.
41914 uint64_t UnsignedChannelAnnouncement_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR o);
41917 * Checks if two UnsignedChannelAnnouncements contain equal inner contents.
41918 * This ignores pointers and is_owned flags and looks at the values in fields.
41919 * Two objects with NULL inner values will be considered "equal" here.
41921 bool UnsignedChannelAnnouncement_eq(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR a, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR b);
41924 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
41926 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
41929 * Authentication of the announcement by the first public node
41931 struct LDKECDSASignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
41934 * Authentication of the announcement by the first public node
41936 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41939 * Authentication of the announcement by the second public node
41941 struct LDKECDSASignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
41944 * Authentication of the announcement by the second public node
41946 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41949 * Proof of funding UTXO ownership by the first public node
41951 struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
41954 * Proof of funding UTXO ownership by the first public node
41956 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41959 * Proof of funding UTXO ownership by the second public node
41961 struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
41964 * Proof of funding UTXO ownership by the second public node
41966 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41969 * The actual announcement
41971 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
41974 * The actual announcement
41976 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
41979 * Constructs a new ChannelAnnouncement given each field
41981 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);
41984 * Creates a copy of the ChannelAnnouncement
41986 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
41989 * Generates a non-cryptographic 64-bit hash of the ChannelAnnouncement.
41991 uint64_t ChannelAnnouncement_hash(const struct LDKChannelAnnouncement *NONNULL_PTR o);
41994 * Checks if two ChannelAnnouncements contain equal inner contents.
41995 * This ignores pointers and is_owned flags and looks at the values in fields.
41996 * Two objects with NULL inner values will be considered "equal" here.
41998 bool ChannelAnnouncement_eq(const struct LDKChannelAnnouncement *NONNULL_PTR a, const struct LDKChannelAnnouncement *NONNULL_PTR b);
42001 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
42003 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
42006 * The genesis hash of the blockchain where the channel is to be opened
42008 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
42011 * The genesis hash of the blockchain where the channel is to be opened
42013 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42016 * The short channel ID
42018 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
42021 * The short channel ID
42023 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
42026 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
42028 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
42031 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
42033 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
42038 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
42043 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
42046 * The number of blocks such that if:
42047 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
42048 * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
42049 * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
42050 * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
42051 * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
42052 * forwarding. Note that the HTLC sender is the one who originally sets this value when
42053 * constructing the route.
42055 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
42058 * The number of blocks such that if:
42059 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
42060 * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
42061 * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
42062 * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
42063 * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
42064 * forwarding. Note that the HTLC sender is the one who originally sets this value when
42065 * constructing the route.
42067 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
42070 * The minimum HTLC size incoming to sender, in milli-satoshi
42072 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
42075 * The minimum HTLC size incoming to sender, in milli-satoshi
42077 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
42080 * The maximum HTLC value incoming to sender, in milli-satoshi.
42082 * This used to be optional.
42084 uint64_t UnsignedChannelUpdate_get_htlc_maximum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
42087 * The maximum HTLC value incoming to sender, in milli-satoshi.
42089 * This used to be optional.
42091 void UnsignedChannelUpdate_set_htlc_maximum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
42094 * The base HTLC fee charged by sender, in milli-satoshi
42096 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
42099 * The base HTLC fee charged by sender, in milli-satoshi
42101 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
42104 * The amount to fee multiplier, in micro-satoshi
42106 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
42109 * The amount to fee multiplier, in micro-satoshi
42111 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
42114 * Excess data which was signed as a part of the message which we do not (yet) understand how
42117 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
42119 * Returns a copy of the field.
42121 struct LDKCVec_u8Z UnsignedChannelUpdate_get_excess_data(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
42124 * Excess data which was signed as a part of the message which we do not (yet) understand how
42127 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
42129 void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
42132 * Constructs a new UnsignedChannelUpdate given each field
42134 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);
42137 * Creates a copy of the UnsignedChannelUpdate
42139 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
42142 * Generates a non-cryptographic 64-bit hash of the UnsignedChannelUpdate.
42144 uint64_t UnsignedChannelUpdate_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR o);
42147 * Checks if two UnsignedChannelUpdates contain equal inner contents.
42148 * This ignores pointers and is_owned flags and looks at the values in fields.
42149 * Two objects with NULL inner values will be considered "equal" here.
42151 bool UnsignedChannelUpdate_eq(const struct LDKUnsignedChannelUpdate *NONNULL_PTR a, const struct LDKUnsignedChannelUpdate *NONNULL_PTR b);
42154 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
42156 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
42159 * A signature of the channel update
42161 struct LDKECDSASignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
42164 * A signature of the channel update
42166 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
42169 * The actual channel update
42171 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
42174 * The actual channel update
42176 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
42179 * Constructs a new ChannelUpdate given each field
42181 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
42184 * Creates a copy of the ChannelUpdate
42186 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
42189 * Generates a non-cryptographic 64-bit hash of the ChannelUpdate.
42191 uint64_t ChannelUpdate_hash(const struct LDKChannelUpdate *NONNULL_PTR o);
42194 * Checks if two ChannelUpdates contain equal inner contents.
42195 * This ignores pointers and is_owned flags and looks at the values in fields.
42196 * Two objects with NULL inner values will be considered "equal" here.
42198 bool ChannelUpdate_eq(const struct LDKChannelUpdate *NONNULL_PTR a, const struct LDKChannelUpdate *NONNULL_PTR b);
42201 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
42203 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
42206 * The genesis hash of the blockchain being queried
42208 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
42211 * The genesis hash of the blockchain being queried
42213 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42216 * The height of the first block for the channel UTXOs being queried
42218 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
42221 * The height of the first block for the channel UTXOs being queried
42223 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
42226 * The number of blocks to include in the query results
42228 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
42231 * The number of blocks to include in the query results
42233 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
42236 * Constructs a new QueryChannelRange given each field
42238 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
42241 * Creates a copy of the QueryChannelRange
42243 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
42246 * Generates a non-cryptographic 64-bit hash of the QueryChannelRange.
42248 uint64_t QueryChannelRange_hash(const struct LDKQueryChannelRange *NONNULL_PTR o);
42251 * Checks if two QueryChannelRanges contain equal inner contents.
42252 * This ignores pointers and is_owned flags and looks at the values in fields.
42253 * Two objects with NULL inner values will be considered "equal" here.
42255 bool QueryChannelRange_eq(const struct LDKQueryChannelRange *NONNULL_PTR a, const struct LDKQueryChannelRange *NONNULL_PTR b);
42258 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
42260 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
42263 * The genesis hash of the blockchain being queried
42265 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
42268 * The genesis hash of the blockchain being queried
42270 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42273 * The height of the first block in the range of the reply
42275 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
42278 * The height of the first block in the range of the reply
42280 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
42283 * The number of blocks included in the range of the reply
42285 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
42288 * The number of blocks included in the range of the reply
42290 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
42293 * True when this is the final reply for a query
42295 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
42298 * True when this is the final reply for a query
42300 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
42303 * The `short_channel_id`s in the channel range
42305 * Returns a copy of the field.
42307 struct LDKCVec_u64Z ReplyChannelRange_get_short_channel_ids(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
42310 * The `short_channel_id`s in the channel range
42312 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
42315 * Constructs a new ReplyChannelRange given each field
42317 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);
42320 * Creates a copy of the ReplyChannelRange
42322 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
42325 * Generates a non-cryptographic 64-bit hash of the ReplyChannelRange.
42327 uint64_t ReplyChannelRange_hash(const struct LDKReplyChannelRange *NONNULL_PTR o);
42330 * Checks if two ReplyChannelRanges contain equal inner contents.
42331 * This ignores pointers and is_owned flags and looks at the values in fields.
42332 * Two objects with NULL inner values will be considered "equal" here.
42334 bool ReplyChannelRange_eq(const struct LDKReplyChannelRange *NONNULL_PTR a, const struct LDKReplyChannelRange *NONNULL_PTR b);
42337 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
42339 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
42342 * The genesis hash of the blockchain being queried
42344 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
42347 * The genesis hash of the blockchain being queried
42349 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42352 * The short_channel_ids that are being queried
42354 * Returns a copy of the field.
42356 struct LDKCVec_u64Z QueryShortChannelIds_get_short_channel_ids(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr);
42359 * The short_channel_ids that are being queried
42361 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
42364 * Constructs a new QueryShortChannelIds given each field
42366 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
42369 * Creates a copy of the QueryShortChannelIds
42371 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
42374 * Generates a non-cryptographic 64-bit hash of the QueryShortChannelIds.
42376 uint64_t QueryShortChannelIds_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR o);
42379 * Checks if two QueryShortChannelIdss contain equal inner contents.
42380 * This ignores pointers and is_owned flags and looks at the values in fields.
42381 * Two objects with NULL inner values will be considered "equal" here.
42383 bool QueryShortChannelIds_eq(const struct LDKQueryShortChannelIds *NONNULL_PTR a, const struct LDKQueryShortChannelIds *NONNULL_PTR b);
42386 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
42388 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
42391 * The genesis hash of the blockchain that was queried
42393 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
42396 * The genesis hash of the blockchain that was queried
42398 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42401 * Indicates if the query recipient maintains up-to-date channel
42402 * information for the `chain_hash`
42404 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
42407 * Indicates if the query recipient maintains up-to-date channel
42408 * information for the `chain_hash`
42410 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
42413 * Constructs a new ReplyShortChannelIdsEnd given each field
42415 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
42418 * Creates a copy of the ReplyShortChannelIdsEnd
42420 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
42423 * Generates a non-cryptographic 64-bit hash of the ReplyShortChannelIdsEnd.
42425 uint64_t ReplyShortChannelIdsEnd_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR o);
42428 * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
42429 * This ignores pointers and is_owned flags and looks at the values in fields.
42430 * Two objects with NULL inner values will be considered "equal" here.
42432 bool ReplyShortChannelIdsEnd_eq(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR a, const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR b);
42435 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
42437 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
42440 * The genesis hash of the blockchain for channel and node information
42442 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
42445 * The genesis hash of the blockchain for channel and node information
42447 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42450 * The starting unix timestamp
42452 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
42455 * The starting unix timestamp
42457 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
42460 * The range of information in seconds
42462 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
42465 * The range of information in seconds
42467 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
42470 * Constructs a new GossipTimestampFilter given each field
42472 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
42475 * Creates a copy of the GossipTimestampFilter
42477 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
42480 * Generates a non-cryptographic 64-bit hash of the GossipTimestampFilter.
42482 uint64_t GossipTimestampFilter_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR o);
42485 * Checks if two GossipTimestampFilters contain equal inner contents.
42486 * This ignores pointers and is_owned flags and looks at the values in fields.
42487 * Two objects with NULL inner values will be considered "equal" here.
42489 bool GossipTimestampFilter_eq(const struct LDKGossipTimestampFilter *NONNULL_PTR a, const struct LDKGossipTimestampFilter *NONNULL_PTR b);
42492 * Frees any resources used by the ErrorAction
42494 void ErrorAction_free(struct LDKErrorAction this_ptr);
42497 * Creates a copy of the ErrorAction
42499 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
42502 * Utility method to constructs a new DisconnectPeer-variant ErrorAction
42504 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
42507 * Utility method to constructs a new DisconnectPeerWithWarning-variant ErrorAction
42509 struct LDKErrorAction ErrorAction_disconnect_peer_with_warning(struct LDKWarningMessage msg);
42512 * Utility method to constructs a new IgnoreError-variant ErrorAction
42514 struct LDKErrorAction ErrorAction_ignore_error(void);
42517 * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
42519 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
42522 * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
42524 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
42527 * Utility method to constructs a new SendErrorMessage-variant ErrorAction
42529 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
42532 * Utility method to constructs a new SendWarningMessage-variant ErrorAction
42534 struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
42537 * Generates a non-cryptographic 64-bit hash of the ErrorAction.
42539 uint64_t ErrorAction_hash(const struct LDKErrorAction *NONNULL_PTR o);
42542 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
42544 void LightningError_free(struct LDKLightningError this_obj);
42547 * A human-readable message describing the error
42549 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
42552 * A human-readable message describing the error
42554 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
42557 * The action which should be taken against the offending peer.
42559 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
42562 * The action which should be taken against the offending peer.
42564 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
42567 * Constructs a new LightningError given each field
42569 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
42572 * Creates a copy of the LightningError
42574 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
42577 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
42579 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
42582 * `update_add_htlc` messages which should be sent
42584 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
42587 * `update_add_htlc` messages which should be sent
42589 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
42592 * `update_fulfill_htlc` messages which should be sent
42594 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
42597 * `update_fulfill_htlc` messages which should be sent
42599 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
42602 * `update_fail_htlc` messages which should be sent
42604 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
42607 * `update_fail_htlc` messages which should be sent
42609 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
42612 * `update_fail_malformed_htlc` messages which should be sent
42614 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
42617 * `update_fail_malformed_htlc` messages which should be sent
42619 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
42622 * An `update_fee` message which should be sent
42624 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
42626 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
42629 * An `update_fee` message which should be sent
42631 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
42633 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
42636 * A `commitment_signed` message which should be sent
42638 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
42641 * A `commitment_signed` message which should be sent
42643 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
42646 * Constructs a new CommitmentUpdate given each field
42648 * Note that update_fee_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
42650 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);
42653 * Creates a copy of the CommitmentUpdate
42655 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
42658 * Generates a non-cryptographic 64-bit hash of the CommitmentUpdate.
42660 uint64_t CommitmentUpdate_hash(const struct LDKCommitmentUpdate *NONNULL_PTR o);
42663 * Checks if two CommitmentUpdates contain equal inner contents.
42664 * This ignores pointers and is_owned flags and looks at the values in fields.
42665 * Two objects with NULL inner values will be considered "equal" here.
42667 bool CommitmentUpdate_eq(const struct LDKCommitmentUpdate *NONNULL_PTR a, const struct LDKCommitmentUpdate *NONNULL_PTR b);
42670 * Calls the free function if one is set
42672 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
42675 * Calls the free function if one is set
42677 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
42680 * Calls the free function if one is set
42682 void OnionMessageHandler_free(struct LDKOnionMessageHandler this_ptr);
42685 * Frees any resources used by the FinalOnionHopData, if is_owned is set and inner is non-NULL.
42687 void FinalOnionHopData_free(struct LDKFinalOnionHopData this_obj);
42690 * When sending a multi-part payment, this secret is used to identify a payment across HTLCs.
42691 * Because it is generated by the recipient and included in the invoice, it also provides
42692 * proof to the recipient that the payment was sent by someone with the generated invoice.
42694 const uint8_t (*FinalOnionHopData_get_payment_secret(const struct LDKFinalOnionHopData *NONNULL_PTR this_ptr))[32];
42697 * When sending a multi-part payment, this secret is used to identify a payment across HTLCs.
42698 * Because it is generated by the recipient and included in the invoice, it also provides
42699 * proof to the recipient that the payment was sent by someone with the generated invoice.
42701 void FinalOnionHopData_set_payment_secret(struct LDKFinalOnionHopData *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42704 * The intended total amount that this payment is for.
42706 * Message serialization may panic if this value is more than 21 million Bitcoin.
42708 uint64_t FinalOnionHopData_get_total_msat(const struct LDKFinalOnionHopData *NONNULL_PTR this_ptr);
42711 * The intended total amount that this payment is for.
42713 * Message serialization may panic if this value is more than 21 million Bitcoin.
42715 void FinalOnionHopData_set_total_msat(struct LDKFinalOnionHopData *NONNULL_PTR this_ptr, uint64_t val);
42718 * Constructs a new FinalOnionHopData given each field
42720 MUST_USE_RES struct LDKFinalOnionHopData FinalOnionHopData_new(struct LDKThirtyTwoBytes payment_secret_arg, uint64_t total_msat_arg);
42723 * Creates a copy of the FinalOnionHopData
42725 struct LDKFinalOnionHopData FinalOnionHopData_clone(const struct LDKFinalOnionHopData *NONNULL_PTR orig);
42728 * Frees any resources used by the OnionPacket, if is_owned is set and inner is non-NULL.
42730 void OnionPacket_free(struct LDKOnionPacket this_obj);
42733 * BOLT 4 version number.
42735 uint8_t OnionPacket_get_version(const struct LDKOnionPacket *NONNULL_PTR this_ptr);
42738 * BOLT 4 version number.
42740 void OnionPacket_set_version(struct LDKOnionPacket *NONNULL_PTR this_ptr, uint8_t val);
42743 * In order to ensure we always return an error on onion decode in compliance with [BOLT
42744 * #4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md), we have to
42745 * deserialize `OnionPacket`s contained in [`UpdateAddHTLC`] messages even if the ephemeral
42746 * public key (here) is bogus, so we hold a [`Result`] instead of a [`PublicKey`] as we'd
42749 * Returns a copy of the field.
42751 struct LDKCResult_PublicKeySecp256k1ErrorZ OnionPacket_get_public_key(const struct LDKOnionPacket *NONNULL_PTR this_ptr);
42754 * In order to ensure we always return an error on onion decode in compliance with [BOLT
42755 * #4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md), we have to
42756 * deserialize `OnionPacket`s contained in [`UpdateAddHTLC`] messages even if the ephemeral
42757 * public key (here) is bogus, so we hold a [`Result`] instead of a [`PublicKey`] as we'd
42760 void OnionPacket_set_public_key(struct LDKOnionPacket *NONNULL_PTR this_ptr, struct LDKCResult_PublicKeySecp256k1ErrorZ val);
42763 * HMAC to verify the integrity of hop_data.
42765 const uint8_t (*OnionPacket_get_hmac(const struct LDKOnionPacket *NONNULL_PTR this_ptr))[32];
42768 * HMAC to verify the integrity of hop_data.
42770 void OnionPacket_set_hmac(struct LDKOnionPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42773 * Creates a copy of the OnionPacket
42775 struct LDKOnionPacket OnionPacket_clone(const struct LDKOnionPacket *NONNULL_PTR orig);
42778 * Generates a non-cryptographic 64-bit hash of the OnionPacket.
42780 uint64_t OnionPacket_hash(const struct LDKOnionPacket *NONNULL_PTR o);
42783 * Checks if two OnionPackets contain equal inner contents.
42784 * This ignores pointers and is_owned flags and looks at the values in fields.
42785 * Two objects with NULL inner values will be considered "equal" here.
42787 bool OnionPacket_eq(const struct LDKOnionPacket *NONNULL_PTR a, const struct LDKOnionPacket *NONNULL_PTR b);
42790 * Frees any resources used by the TrampolineOnionPacket, if is_owned is set and inner is non-NULL.
42792 void TrampolineOnionPacket_free(struct LDKTrampolineOnionPacket this_obj);
42795 * Bolt 04 version number
42797 uint8_t TrampolineOnionPacket_get_version(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr);
42800 * Bolt 04 version number
42802 void TrampolineOnionPacket_set_version(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, uint8_t val);
42805 * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
42807 struct LDKPublicKey TrampolineOnionPacket_get_public_key(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr);
42810 * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
42812 void TrampolineOnionPacket_set_public_key(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, struct LDKPublicKey val);
42815 * Encrypted payload for the next hop
42817 * Returns a copy of the field.
42819 struct LDKCVec_u8Z TrampolineOnionPacket_get_hop_data(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr);
42822 * Encrypted payload for the next hop
42824 void TrampolineOnionPacket_set_hop_data(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
42827 * HMAC to verify the integrity of hop_data
42829 const uint8_t (*TrampolineOnionPacket_get_hmac(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr))[32];
42832 * HMAC to verify the integrity of hop_data
42834 void TrampolineOnionPacket_set_hmac(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42837 * Constructs a new TrampolineOnionPacket given each field
42839 MUST_USE_RES struct LDKTrampolineOnionPacket TrampolineOnionPacket_new(uint8_t version_arg, struct LDKPublicKey public_key_arg, struct LDKCVec_u8Z hop_data_arg, struct LDKThirtyTwoBytes hmac_arg);
42842 * Creates a copy of the TrampolineOnionPacket
42844 struct LDKTrampolineOnionPacket TrampolineOnionPacket_clone(const struct LDKTrampolineOnionPacket *NONNULL_PTR orig);
42847 * Generates a non-cryptographic 64-bit hash of the TrampolineOnionPacket.
42849 uint64_t TrampolineOnionPacket_hash(const struct LDKTrampolineOnionPacket *NONNULL_PTR o);
42852 * Checks if two TrampolineOnionPackets contain equal inner contents.
42853 * This ignores pointers and is_owned flags and looks at the values in fields.
42854 * Two objects with NULL inner values will be considered "equal" here.
42856 bool TrampolineOnionPacket_eq(const struct LDKTrampolineOnionPacket *NONNULL_PTR a, const struct LDKTrampolineOnionPacket *NONNULL_PTR b);
42859 * Serialize the TrampolineOnionPacket object into a byte array which can be read by TrampolineOnionPacket_read
42861 struct LDKCVec_u8Z TrampolineOnionPacket_write(const struct LDKTrampolineOnionPacket *NONNULL_PTR obj);
42864 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
42866 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
42869 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
42871 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
42874 * Serialize the AcceptChannelV2 object into a byte array which can be read by AcceptChannelV2_read
42876 struct LDKCVec_u8Z AcceptChannelV2_write(const struct LDKAcceptChannelV2 *NONNULL_PTR obj);
42879 * Read a AcceptChannelV2 from a byte array, created by AcceptChannelV2_write
42881 struct LDKCResult_AcceptChannelV2DecodeErrorZ AcceptChannelV2_read(struct LDKu8slice ser);
42884 * Serialize the Stfu object into a byte array which can be read by Stfu_read
42886 struct LDKCVec_u8Z Stfu_write(const struct LDKStfu *NONNULL_PTR obj);
42889 * Read a Stfu from a byte array, created by Stfu_write
42891 struct LDKCResult_StfuDecodeErrorZ Stfu_read(struct LDKu8slice ser);
42894 * Serialize the Splice object into a byte array which can be read by Splice_read
42896 struct LDKCVec_u8Z Splice_write(const struct LDKSplice *NONNULL_PTR obj);
42899 * Read a Splice from a byte array, created by Splice_write
42901 struct LDKCResult_SpliceDecodeErrorZ Splice_read(struct LDKu8slice ser);
42904 * Serialize the SpliceAck object into a byte array which can be read by SpliceAck_read
42906 struct LDKCVec_u8Z SpliceAck_write(const struct LDKSpliceAck *NONNULL_PTR obj);
42909 * Read a SpliceAck from a byte array, created by SpliceAck_write
42911 struct LDKCResult_SpliceAckDecodeErrorZ SpliceAck_read(struct LDKu8slice ser);
42914 * Serialize the SpliceLocked object into a byte array which can be read by SpliceLocked_read
42916 struct LDKCVec_u8Z SpliceLocked_write(const struct LDKSpliceLocked *NONNULL_PTR obj);
42919 * Read a SpliceLocked from a byte array, created by SpliceLocked_write
42921 struct LDKCResult_SpliceLockedDecodeErrorZ SpliceLocked_read(struct LDKu8slice ser);
42924 * Serialize the TxAddInput object into a byte array which can be read by TxAddInput_read
42926 struct LDKCVec_u8Z TxAddInput_write(const struct LDKTxAddInput *NONNULL_PTR obj);
42929 * Read a TxAddInput from a byte array, created by TxAddInput_write
42931 struct LDKCResult_TxAddInputDecodeErrorZ TxAddInput_read(struct LDKu8slice ser);
42934 * Serialize the TxAddOutput object into a byte array which can be read by TxAddOutput_read
42936 struct LDKCVec_u8Z TxAddOutput_write(const struct LDKTxAddOutput *NONNULL_PTR obj);
42939 * Read a TxAddOutput from a byte array, created by TxAddOutput_write
42941 struct LDKCResult_TxAddOutputDecodeErrorZ TxAddOutput_read(struct LDKu8slice ser);
42944 * Serialize the TxRemoveInput object into a byte array which can be read by TxRemoveInput_read
42946 struct LDKCVec_u8Z TxRemoveInput_write(const struct LDKTxRemoveInput *NONNULL_PTR obj);
42949 * Read a TxRemoveInput from a byte array, created by TxRemoveInput_write
42951 struct LDKCResult_TxRemoveInputDecodeErrorZ TxRemoveInput_read(struct LDKu8slice ser);
42954 * Serialize the TxRemoveOutput object into a byte array which can be read by TxRemoveOutput_read
42956 struct LDKCVec_u8Z TxRemoveOutput_write(const struct LDKTxRemoveOutput *NONNULL_PTR obj);
42959 * Read a TxRemoveOutput from a byte array, created by TxRemoveOutput_write
42961 struct LDKCResult_TxRemoveOutputDecodeErrorZ TxRemoveOutput_read(struct LDKu8slice ser);
42964 * Serialize the TxComplete object into a byte array which can be read by TxComplete_read
42966 struct LDKCVec_u8Z TxComplete_write(const struct LDKTxComplete *NONNULL_PTR obj);
42969 * Read a TxComplete from a byte array, created by TxComplete_write
42971 struct LDKCResult_TxCompleteDecodeErrorZ TxComplete_read(struct LDKu8slice ser);
42974 * Serialize the TxSignatures object into a byte array which can be read by TxSignatures_read
42976 struct LDKCVec_u8Z TxSignatures_write(const struct LDKTxSignatures *NONNULL_PTR obj);
42979 * Read a TxSignatures from a byte array, created by TxSignatures_write
42981 struct LDKCResult_TxSignaturesDecodeErrorZ TxSignatures_read(struct LDKu8slice ser);
42984 * Serialize the TxInitRbf object into a byte array which can be read by TxInitRbf_read
42986 struct LDKCVec_u8Z TxInitRbf_write(const struct LDKTxInitRbf *NONNULL_PTR obj);
42989 * Read a TxInitRbf from a byte array, created by TxInitRbf_write
42991 struct LDKCResult_TxInitRbfDecodeErrorZ TxInitRbf_read(struct LDKu8slice ser);
42994 * Serialize the TxAckRbf object into a byte array which can be read by TxAckRbf_read
42996 struct LDKCVec_u8Z TxAckRbf_write(const struct LDKTxAckRbf *NONNULL_PTR obj);
42999 * Read a TxAckRbf from a byte array, created by TxAckRbf_write
43001 struct LDKCResult_TxAckRbfDecodeErrorZ TxAckRbf_read(struct LDKu8slice ser);
43004 * Serialize the TxAbort object into a byte array which can be read by TxAbort_read
43006 struct LDKCVec_u8Z TxAbort_write(const struct LDKTxAbort *NONNULL_PTR obj);
43009 * Read a TxAbort from a byte array, created by TxAbort_write
43011 struct LDKCResult_TxAbortDecodeErrorZ TxAbort_read(struct LDKu8slice ser);
43014 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
43016 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
43019 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
43021 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
43024 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
43026 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
43029 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
43031 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
43034 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
43036 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
43039 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
43041 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
43044 * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
43046 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
43049 * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
43051 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
43054 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
43056 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
43059 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
43061 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
43064 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
43066 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
43069 * Read a FundingCreated from a byte array, created by FundingCreated_write
43071 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
43074 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
43076 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
43079 * Read a FundingSigned from a byte array, created by FundingSigned_write
43081 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
43084 * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
43086 struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj);
43089 * Read a ChannelReady from a byte array, created by ChannelReady_write
43091 struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser);
43094 * Serialize the Init object into a byte array which can be read by Init_read
43096 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
43099 * Read a Init from a byte array, created by Init_write
43101 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
43104 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
43106 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
43109 * Read a OpenChannel from a byte array, created by OpenChannel_write
43111 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
43114 * Serialize the OpenChannelV2 object into a byte array which can be read by OpenChannelV2_read
43116 struct LDKCVec_u8Z OpenChannelV2_write(const struct LDKOpenChannelV2 *NONNULL_PTR obj);
43119 * Read a OpenChannelV2 from a byte array, created by OpenChannelV2_write
43121 struct LDKCResult_OpenChannelV2DecodeErrorZ OpenChannelV2_read(struct LDKu8slice ser);
43124 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
43126 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
43129 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
43131 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
43134 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
43136 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
43139 * Read a Shutdown from a byte array, created by Shutdown_write
43141 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
43144 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
43146 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
43149 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
43151 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
43154 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
43156 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
43159 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
43161 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
43164 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
43166 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
43169 * Read a UpdateFee from a byte array, created by UpdateFee_write
43171 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
43174 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
43176 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
43179 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
43181 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
43184 * Serialize the OnionPacket object into a byte array which can be read by OnionPacket_read
43186 struct LDKCVec_u8Z OnionPacket_write(const struct LDKOnionPacket *NONNULL_PTR obj);
43189 * Read a OnionPacket from a byte array, created by OnionPacket_write
43191 struct LDKCResult_OnionPacketDecodeErrorZ OnionPacket_read(struct LDKu8slice ser);
43194 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
43196 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
43199 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
43201 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
43204 * Read a OnionMessage from a byte array, created by OnionMessage_write
43206 struct LDKCResult_OnionMessageDecodeErrorZ OnionMessage_read(struct LDKu8slice ser);
43209 * Serialize the OnionMessage object into a byte array which can be read by OnionMessage_read
43211 struct LDKCVec_u8Z OnionMessage_write(const struct LDKOnionMessage *NONNULL_PTR obj);
43214 * Serialize the FinalOnionHopData object into a byte array which can be read by FinalOnionHopData_read
43216 struct LDKCVec_u8Z FinalOnionHopData_write(const struct LDKFinalOnionHopData *NONNULL_PTR obj);
43219 * Read a FinalOnionHopData from a byte array, created by FinalOnionHopData_write
43221 struct LDKCResult_FinalOnionHopDataDecodeErrorZ FinalOnionHopData_read(struct LDKu8slice ser);
43224 * Serialize the Ping object into a byte array which can be read by Ping_read
43226 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
43229 * Read a Ping from a byte array, created by Ping_write
43231 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
43234 * Serialize the Pong object into a byte array which can be read by Pong_read
43236 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
43239 * Read a Pong from a byte array, created by Pong_write
43241 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
43244 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
43246 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
43249 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
43251 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
43254 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
43256 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
43259 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
43261 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
43264 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
43266 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
43269 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
43271 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
43274 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
43276 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
43279 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
43281 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
43284 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
43286 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
43289 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
43291 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
43294 * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
43296 struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
43299 * Read a WarningMessage from a byte array, created by WarningMessage_write
43301 struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
43304 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
43306 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
43309 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
43311 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
43314 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
43316 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
43319 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
43321 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
43324 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
43326 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
43329 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
43331 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
43334 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
43336 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
43339 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
43341 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
43344 * Calculates the overflow safe ending block height for the query.
43346 * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`.
43348 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
43351 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
43353 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
43356 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
43358 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
43361 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
43363 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
43366 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
43368 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
43371 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
43373 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
43376 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
43378 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
43381 * Calls the free function if one is set
43383 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
43386 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
43388 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
43391 * Constructs a new IgnoringMessageHandler given each field
43393 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
43396 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
43397 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
43399 struct LDKEventsProvider IgnoringMessageHandler_as_EventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
43402 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
43403 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
43405 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
43408 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
43409 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
43411 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
43414 * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
43415 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
43417 struct LDKOnionMessageHandler IgnoringMessageHandler_as_OnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
43420 * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
43421 * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
43423 struct LDKOffersMessageHandler IgnoringMessageHandler_as_OffersMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
43426 * Constructs a new CustomOnionMessageHandler which calls the relevant methods on this_arg.
43427 * This copies the `inner` pointer in this_arg and thus the returned CustomOnionMessageHandler must be freed before this_arg is
43429 struct LDKCustomOnionMessageHandler IgnoringMessageHandler_as_CustomOnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
43432 * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
43433 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
43435 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
43438 * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
43439 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
43441 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
43444 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
43446 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
43449 * Constructs a new ErroringMessageHandler
43451 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
43454 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
43455 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
43457 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
43460 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
43461 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
43463 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
43466 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
43468 void MessageHandler_free(struct LDKMessageHandler this_obj);
43471 * A message handler which handles messages specific to channels. Usually this is just a
43472 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
43474 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
43476 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
43479 * A message handler which handles messages specific to channels. Usually this is just a
43480 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
43482 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
43484 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
43487 * A message handler which handles messages updating our knowledge of the network channel
43488 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
43490 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
43492 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
43495 * A message handler which handles messages updating our knowledge of the network channel
43496 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
43498 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
43500 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
43503 * A message handler which handles onion messages. This should generally be an
43504 * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
43506 * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
43508 const struct LDKOnionMessageHandler *MessageHandler_get_onion_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
43511 * A message handler which handles onion messages. This should generally be an
43512 * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
43514 * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
43516 void MessageHandler_set_onion_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKOnionMessageHandler val);
43519 * A message handler which handles custom messages. The only LDK-provided implementation is
43520 * [`IgnoringMessageHandler`].
43522 const struct LDKCustomMessageHandler *MessageHandler_get_custom_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
43525 * A message handler which handles custom messages. The only LDK-provided implementation is
43526 * [`IgnoringMessageHandler`].
43528 void MessageHandler_set_custom_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKCustomMessageHandler val);
43531 * Constructs a new MessageHandler given each field
43533 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);
43536 * Creates a copy of a SocketDescriptor
43538 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
43541 * Calls the free function if one is set
43543 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
43546 * Frees any resources used by the PeerDetails, if is_owned is set and inner is non-NULL.
43548 void PeerDetails_free(struct LDKPeerDetails this_obj);
43551 * The node id of the peer.
43553 * For outbound connections, this [`PublicKey`] will be the same as the `their_node_id` parameter
43554 * passed in to [`PeerManager::new_outbound_connection`].
43556 struct LDKPublicKey PeerDetails_get_counterparty_node_id(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
43559 * The node id of the peer.
43561 * For outbound connections, this [`PublicKey`] will be the same as the `their_node_id` parameter
43562 * passed in to [`PeerManager::new_outbound_connection`].
43564 void PeerDetails_set_counterparty_node_id(struct LDKPeerDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val);
43567 * The socket address the peer provided in the initial handshake.
43569 * Will only be `Some` if an address had been previously provided to
43570 * [`PeerManager::new_outbound_connection`] or [`PeerManager::new_inbound_connection`].
43572 * Returns a copy of the field.
43574 struct LDKCOption_SocketAddressZ PeerDetails_get_socket_address(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
43577 * The socket address the peer provided in the initial handshake.
43579 * Will only be `Some` if an address had been previously provided to
43580 * [`PeerManager::new_outbound_connection`] or [`PeerManager::new_inbound_connection`].
43582 void PeerDetails_set_socket_address(struct LDKPeerDetails *NONNULL_PTR this_ptr, struct LDKCOption_SocketAddressZ val);
43585 * The features the peer provided in the initial handshake.
43587 struct LDKInitFeatures PeerDetails_get_init_features(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
43590 * The features the peer provided in the initial handshake.
43592 void PeerDetails_set_init_features(struct LDKPeerDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
43595 * Indicates the direction of the peer connection.
43597 * Will be `true` for inbound connections, and `false` for outbound connections.
43599 bool PeerDetails_get_is_inbound_connection(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
43602 * Indicates the direction of the peer connection.
43604 * Will be `true` for inbound connections, and `false` for outbound connections.
43606 void PeerDetails_set_is_inbound_connection(struct LDKPeerDetails *NONNULL_PTR this_ptr, bool val);
43609 * Constructs a new PeerDetails given each field
43611 MUST_USE_RES struct LDKPeerDetails PeerDetails_new(struct LDKPublicKey counterparty_node_id_arg, struct LDKCOption_SocketAddressZ socket_address_arg, struct LDKInitFeatures init_features_arg, bool is_inbound_connection_arg);
43614 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
43616 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
43619 * Constructs a new PeerHandleError given each field
43621 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(void);
43624 * Creates a copy of the PeerHandleError
43626 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
43629 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
43631 void PeerManager_free(struct LDKPeerManager this_obj);
43634 * Constructs a new `PeerManager` with the given message handlers.
43636 * `ephemeral_random_data` is used to derive per-connection ephemeral keys and must be
43637 * cryptographically secure random bytes.
43639 * `current_time` is used as an always-increasing counter that survives across restarts and is
43640 * incremented irregularly internally. In general it is best to simply use the current UNIX
43641 * timestamp, however if it is not available a persistent counter that increases once per
43642 * minute should suffice.
43644 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);
43647 * Returns a list of [`PeerDetails`] for connected peers that have completed the initial
43650 MUST_USE_RES struct LDKCVec_PeerDetailsZ PeerManager_list_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
43653 * Returns the [`PeerDetails`] of a connected peer that has completed the initial handshake.
43655 * Will return `None` if the peer is unknown or it hasn't completed the initial handshake.
43657 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43659 MUST_USE_RES struct LDKPeerDetails PeerManager_peer_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id);
43662 * Indicates a new outbound connection has been established to a node with the given `node_id`
43663 * and an optional remote network address.
43665 * The remote network address adds the option to report a remote IP address back to a connecting
43666 * peer using the init message.
43667 * The user should pass the remote network address of the host they are connected to.
43669 * If an `Err` is returned here you must disconnect the connection immediately.
43671 * Returns a small number of bytes to send to the remote node (currently always 50).
43673 * Panics if descriptor is duplicative with some other descriptor which has not yet been
43674 * [`socket_disconnected`].
43676 * [`socket_disconnected`]: PeerManager::socket_disconnected
43678 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);
43681 * Indicates a new inbound connection has been established to a node with an optional remote
43684 * The remote network address adds the option to report a remote IP address back to a connecting
43685 * peer using the init message.
43686 * The user should pass the remote network address of the host they are connected to.
43688 * May refuse the connection by returning an Err, but will never write bytes to the remote end
43689 * (outbound connector always speaks first). If an `Err` is returned here you must disconnect
43690 * the connection immediately.
43692 * Panics if descriptor is duplicative with some other descriptor which has not yet been
43693 * [`socket_disconnected`].
43695 * [`socket_disconnected`]: PeerManager::socket_disconnected
43697 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);
43700 * Indicates that there is room to write data to the given socket descriptor.
43702 * May return an Err to indicate that the connection should be closed.
43704 * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
43705 * returning. Thus, be very careful with reentrancy issues! The invariants around calling
43706 * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
43707 * ready to call [`write_buffer_space_avail`] again if a write call generated here isn't
43710 * [`send_data`]: SocketDescriptor::send_data
43711 * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
43713 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
43716 * Indicates that data was read from the given socket descriptor.
43718 * May return an Err to indicate that the connection should be closed.
43720 * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
43721 * Thus, however, you should call [`process_events`] after any `read_event` to generate
43722 * [`send_data`] calls to handle responses.
43724 * If `Ok(true)` is returned, further read_events should not be triggered until a
43725 * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
43728 * In order to avoid processing too many messages at once per peer, `data` should be on the
43731 * [`send_data`]: SocketDescriptor::send_data
43732 * [`process_events`]: PeerManager::process_events
43734 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);
43737 * Checks for any events generated by our handlers and processes them. Includes sending most
43738 * response messages as well as messages generated by calls to handler functions directly (eg
43739 * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
43741 * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
43744 * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
43745 * or one of the other clients provided in our language bindings.
43747 * Note that if there are any other calls to this function waiting on lock(s) this may return
43748 * without doing any work. All available events that need handling will be handled before the
43749 * other calls return.
43751 * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
43752 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
43753 * [`send_data`]: SocketDescriptor::send_data
43755 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
43758 * Indicates that the given socket descriptor's connection is now closed.
43760 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
43763 * Disconnect a peer given its node id.
43765 * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
43766 * peer. Thus, be very careful about reentrancy issues.
43768 * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
43770 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
43773 * Disconnects all currently-connected peers. This is useful on platforms where there may be
43774 * an indication that TCP sockets have stalled even if we weren't around to time them out
43775 * using regular ping/pongs.
43777 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
43780 * Send pings to each peer and disconnect those which did not respond to the last round of
43783 * This may be called on any timescale you want, however, roughly once every ten seconds is
43784 * preferred. The call rate determines both how often we send a ping to our peers and how much
43785 * time they have to respond before we disconnect them.
43787 * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
43790 * [`send_data`]: SocketDescriptor::send_data
43792 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
43795 * Generates a signed node_announcement from the given arguments, sending it to all connected
43796 * peers. Note that peers will likely ignore this message unless we have at least one public
43797 * channel which has at least six confirmations on-chain.
43799 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
43800 * node to humans. They carry no in-protocol meaning.
43802 * `addresses` represent the set (possibly empty) of socket addresses on which this node
43803 * accepts incoming connections. These will be included in the node_announcement, publicly
43804 * tying these addresses together and to this node. If you wish to preserve user privacy,
43805 * addresses should likely contain only Tor Onion addresses.
43807 * Panics if `addresses` is absurdly large (more than 100).
43809 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
43811 void PeerManager_broadcast_node_announcement(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_SocketAddressZ addresses);
43814 * Gets the weight for an HTLC-Success transaction.
43816 uint64_t htlc_success_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
43819 * Gets the weight for an HTLC-Timeout transaction.
43821 uint64_t htlc_timeout_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
43824 * Creates a copy of the HTLCClaim
43826 enum LDKHTLCClaim HTLCClaim_clone(const enum LDKHTLCClaim *NONNULL_PTR orig);
43829 * Utility method to constructs a new OfferedTimeout-variant HTLCClaim
43831 enum LDKHTLCClaim HTLCClaim_offered_timeout(void);
43834 * Utility method to constructs a new OfferedPreimage-variant HTLCClaim
43836 enum LDKHTLCClaim HTLCClaim_offered_preimage(void);
43839 * Utility method to constructs a new AcceptedTimeout-variant HTLCClaim
43841 enum LDKHTLCClaim HTLCClaim_accepted_timeout(void);
43844 * Utility method to constructs a new AcceptedPreimage-variant HTLCClaim
43846 enum LDKHTLCClaim HTLCClaim_accepted_preimage(void);
43849 * Utility method to constructs a new Revocation-variant HTLCClaim
43851 enum LDKHTLCClaim HTLCClaim_revocation(void);
43854 * Checks if two HTLCClaims contain equal inner contents.
43855 * This ignores pointers and is_owned flags and looks at the values in fields.
43857 bool HTLCClaim_eq(const enum LDKHTLCClaim *NONNULL_PTR a, const enum LDKHTLCClaim *NONNULL_PTR b);
43860 * Check if a given input witness attempts to claim a HTLC.
43862 MUST_USE_RES struct LDKCOption_HTLCClaimZ HTLCClaim_from_witness(struct LDKWitness witness);
43865 * Build the commitment secret from the seed and the commitment number
43867 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
43870 * Build a closing transaction
43872 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);
43875 * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
43877 void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
43880 * Creates a copy of the CounterpartyCommitmentSecrets
43882 struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
43885 * Creates a new empty `CounterpartyCommitmentSecrets` structure.
43887 MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
43890 * Returns the minimum index of all stored secrets. Note that indexes start
43891 * at 1 << 48 and get decremented by one for each new secret.
43893 MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
43896 * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
43897 * was generated in accordance with BOLT 3 and is consistent with previous secrets.
43899 MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
43902 * Returns the secret at `idx`.
43903 * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
43905 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43907 MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
43910 * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
43912 struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
43915 * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
43917 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
43920 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
43921 * from the base secret and the per_commitment_point.
43923 struct LDKSecretKey derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
43926 * Derives a per-commitment-transaction revocation key from its constituent parts.
43928 * Only the cheating participant owns a valid witness to propagate a revoked
43929 * commitment transaction, thus per_commitment_secret always come from cheater
43930 * and revocation_base_secret always come from punisher, which is the broadcaster
43931 * of the transaction spending with this key knowledge.
43933 struct LDKSecretKey derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
43936 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
43938 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
43941 * The broadcaster's per-commitment public key which was used to derive the other keys.
43943 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
43946 * The broadcaster's per-commitment public key which was used to derive the other keys.
43948 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
43951 * The revocation key which is used to allow the broadcaster of the commitment
43952 * transaction to provide their counterparty the ability to punish them if they broadcast
43955 struct LDKRevocationKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
43958 * The revocation key which is used to allow the broadcaster of the commitment
43959 * transaction to provide their counterparty the ability to punish them if they broadcast
43962 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKRevocationKey val);
43965 * Broadcaster's HTLC Key
43967 struct LDKHtlcKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
43970 * Broadcaster's HTLC Key
43972 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKHtlcKey val);
43975 * Countersignatory's HTLC Key
43977 struct LDKHtlcKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
43980 * Countersignatory's HTLC Key
43982 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKHtlcKey val);
43985 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
43987 struct LDKDelayedPaymentKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
43990 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
43992 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKDelayedPaymentKey val);
43995 * Constructs a new TxCreationKeys given each field
43997 MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_new(struct LDKPublicKey per_commitment_point_arg, struct LDKRevocationKey revocation_key_arg, struct LDKHtlcKey broadcaster_htlc_key_arg, struct LDKHtlcKey countersignatory_htlc_key_arg, struct LDKDelayedPaymentKey broadcaster_delayed_payment_key_arg);
44000 * Checks if two TxCreationKeyss contain equal inner contents.
44001 * This ignores pointers and is_owned flags and looks at the values in fields.
44002 * Two objects with NULL inner values will be considered "equal" here.
44004 bool TxCreationKeys_eq(const struct LDKTxCreationKeys *NONNULL_PTR a, const struct LDKTxCreationKeys *NONNULL_PTR b);
44007 * Creates a copy of the TxCreationKeys
44009 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
44012 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
44014 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
44017 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
44019 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
44022 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
44024 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
44027 * The public key which is used to sign all commitment transactions, as it appears in the
44028 * on-chain channel lock-in 2-of-2 multisig output.
44030 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
44033 * The public key which is used to sign all commitment transactions, as it appears in the
44034 * on-chain channel lock-in 2-of-2 multisig output.
44036 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44039 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
44040 * revocation keys. This is combined with the per-commitment-secret generated by the
44041 * counterparty to create a secret which the counterparty can reveal to revoke previous
44044 struct LDKRevocationBasepoint ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
44047 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
44048 * revocation keys. This is combined with the per-commitment-secret generated by the
44049 * counterparty to create a secret which the counterparty can reveal to revoke previous
44052 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKRevocationBasepoint val);
44055 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
44056 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
44057 * static across every commitment transaction.
44059 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
44062 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
44063 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
44064 * static across every commitment transaction.
44066 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44069 * The base point which is used (with derive_public_key) to derive a per-commitment payment
44070 * public key which receives non-HTLC-encumbered funds which are only available for spending
44071 * after some delay (or can be claimed via the revocation path).
44073 struct LDKDelayedPaymentBasepoint ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
44076 * The base point which is used (with derive_public_key) to derive a per-commitment payment
44077 * public key which receives non-HTLC-encumbered funds which are only available for spending
44078 * after some delay (or can be claimed via the revocation path).
44080 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKDelayedPaymentBasepoint val);
44083 * The base point which is used (with derive_public_key) to derive a per-commitment public key
44084 * which is used to encumber HTLC-in-flight outputs.
44086 struct LDKHtlcBasepoint ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
44089 * The base point which is used (with derive_public_key) to derive a per-commitment public key
44090 * which is used to encumber HTLC-in-flight outputs.
44092 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKHtlcBasepoint val);
44095 * Constructs a new ChannelPublicKeys given each field
44097 MUST_USE_RES struct LDKChannelPublicKeys ChannelPublicKeys_new(struct LDKPublicKey funding_pubkey_arg, struct LDKRevocationBasepoint revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKDelayedPaymentBasepoint delayed_payment_basepoint_arg, struct LDKHtlcBasepoint htlc_basepoint_arg);
44100 * Creates a copy of the ChannelPublicKeys
44102 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
44105 * Generates a non-cryptographic 64-bit hash of the ChannelPublicKeys.
44107 uint64_t ChannelPublicKeys_hash(const struct LDKChannelPublicKeys *NONNULL_PTR o);
44110 * Checks if two ChannelPublicKeyss contain equal inner contents.
44111 * This ignores pointers and is_owned flags and looks at the values in fields.
44112 * Two objects with NULL inner values will be considered "equal" here.
44114 bool ChannelPublicKeys_eq(const struct LDKChannelPublicKeys *NONNULL_PTR a, const struct LDKChannelPublicKeys *NONNULL_PTR b);
44117 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
44119 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
44122 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
44124 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
44127 * Create per-state keys from channel base points and the per-commitment point.
44128 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
44130 MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_derive_new(struct LDKPublicKey per_commitment_point, const struct LDKDelayedPaymentBasepoint *NONNULL_PTR broadcaster_delayed_payment_base, const struct LDKHtlcBasepoint *NONNULL_PTR broadcaster_htlc_base, const struct LDKRevocationBasepoint *NONNULL_PTR countersignatory_revocation_base, const struct LDKHtlcBasepoint *NONNULL_PTR countersignatory_htlc_base);
44133 * Generate per-state keys from channel static keys.
44134 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
44136 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);
44139 * A script either spendable by the revocation
44140 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
44141 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
44143 struct LDKCVec_u8Z get_revokeable_redeemscript(const struct LDKRevocationKey *NONNULL_PTR revocation_key, uint16_t contest_delay, const struct LDKDelayedPaymentKey *NONNULL_PTR broadcaster_delayed_payment_key);
44146 * Returns the script for the counterparty's output on a holder's commitment transaction based on
44147 * the channel type.
44149 struct LDKCVec_u8Z get_counterparty_payment_script(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, struct LDKPublicKey payment_key);
44152 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
44154 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
44157 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
44158 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
44159 * need to compare this value to whether the commitment transaction in question is that of
44160 * the counterparty or our own.
44162 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
44165 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
44166 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
44167 * need to compare this value to whether the commitment transaction in question is that of
44168 * the counterparty or our own.
44170 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
44173 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
44174 * this divided by 1000.
44176 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
44179 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
44180 * this divided by 1000.
44182 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
44185 * The CLTV lock-time at which this HTLC expires.
44187 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
44190 * The CLTV lock-time at which this HTLC expires.
44192 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
44195 * The hash of the preimage which unlocks this HTLC.
44197 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
44200 * The hash of the preimage which unlocks this HTLC.
44202 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
44205 * The position within the commitment transactions' outputs. This may be None if the value is
44206 * below the dust limit (in which case no output appears in the commitment transaction and the
44207 * value is spent to additional transaction fees).
44209 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
44212 * The position within the commitment transactions' outputs. This may be None if the value is
44213 * below the dust limit (in which case no output appears in the commitment transaction and the
44214 * value is spent to additional transaction fees).
44216 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
44219 * Constructs a new HTLCOutputInCommitment given each field
44221 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);
44224 * Creates a copy of the HTLCOutputInCommitment
44226 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
44229 * Checks if two HTLCOutputInCommitments contain equal inner contents.
44230 * This ignores pointers and is_owned flags and looks at the values in fields.
44231 * Two objects with NULL inner values will be considered "equal" here.
44233 bool HTLCOutputInCommitment_eq(const struct LDKHTLCOutputInCommitment *NONNULL_PTR a, const struct LDKHTLCOutputInCommitment *NONNULL_PTR b);
44236 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
44238 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
44241 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
44243 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
44246 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
44247 * does not need to have its previous_output_index filled.
44249 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);
44252 * Gets the redeemscript for a funding output from the two funding public keys.
44253 * Note that the order of funding public keys does not matter.
44255 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
44258 * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
44259 * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
44260 * transaction which needs signing, and can be used to construct an HTLC transaction which is
44261 * broadcastable given a counterparty HTLC signature.
44263 * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
44264 * commitment transaction).
44266 struct LDKTransaction build_htlc_transaction(const uint8_t (*commitment_txid)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, const struct LDKDelayedPaymentKey *NONNULL_PTR broadcaster_delayed_payment_key, const struct LDKRevocationKey *NONNULL_PTR revocation_key);
44269 * Returns the witness required to satisfy and spend a HTLC input.
44271 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);
44274 * Gets the witnessScript for the to_remote output when anchors are enabled.
44276 struct LDKCVec_u8Z get_to_countersignatory_with_anchors_redeemscript(struct LDKPublicKey payment_point);
44279 * Gets the witnessScript for an anchor output from the funding public key.
44280 * The witness in the spending input must be:
44281 * <BIP 143 funding_signature>
44282 * After 16 blocks of confirmation, an alternative satisfying witness could be:
44284 * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
44286 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
44289 * Returns the witness required to satisfy and spend an anchor input.
44291 struct LDKWitness build_anchor_input_witness(struct LDKPublicKey funding_key, struct LDKECDSASignature funding_sig);
44294 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
44296 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
44299 * Holder public keys
44301 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
44304 * Holder public keys
44306 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
44309 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
44311 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
44314 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
44316 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
44319 * Whether the holder is the initiator of this channel.
44320 * This is an input to the commitment number obscure factor computation.
44322 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
44325 * Whether the holder is the initiator of this channel.
44326 * This is an input to the commitment number obscure factor computation.
44328 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
44331 * The late-bound counterparty channel transaction parameters.
44332 * These parameters are populated at the point in the protocol where the counterparty provides them.
44334 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44336 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
44339 * The late-bound counterparty channel transaction parameters.
44340 * These parameters are populated at the point in the protocol where the counterparty provides them.
44342 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
44344 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
44347 * The late-bound funding outpoint
44349 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44351 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
44354 * The late-bound funding outpoint
44356 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
44358 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
44361 * This channel's type, as negotiated during channel open. For old objects where this field
44362 * wasn't serialized, it will default to static_remote_key at deserialization.
44364 struct LDKChannelTypeFeatures ChannelTransactionParameters_get_channel_type_features(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
44367 * This channel's type, as negotiated during channel open. For old objects where this field
44368 * wasn't serialized, it will default to static_remote_key at deserialization.
44370 void ChannelTransactionParameters_set_channel_type_features(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
44373 * Constructs a new ChannelTransactionParameters given each field
44375 * Note that counterparty_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
44376 * Note that funding_outpoint_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
44378 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);
44381 * Creates a copy of the ChannelTransactionParameters
44383 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
44386 * Generates a non-cryptographic 64-bit hash of the ChannelTransactionParameters.
44388 uint64_t ChannelTransactionParameters_hash(const struct LDKChannelTransactionParameters *NONNULL_PTR o);
44391 * Checks if two ChannelTransactionParameterss contain equal inner contents.
44392 * This ignores pointers and is_owned flags and looks at the values in fields.
44393 * Two objects with NULL inner values will be considered "equal" here.
44395 bool ChannelTransactionParameters_eq(const struct LDKChannelTransactionParameters *NONNULL_PTR a, const struct LDKChannelTransactionParameters *NONNULL_PTR b);
44398 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
44400 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
44403 * Counter-party public keys
44405 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
44408 * Counter-party public keys
44410 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
44413 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
44415 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
44418 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
44420 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
44423 * Constructs a new CounterpartyChannelTransactionParameters given each field
44425 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
44428 * Creates a copy of the CounterpartyChannelTransactionParameters
44430 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
44433 * Generates a non-cryptographic 64-bit hash of the CounterpartyChannelTransactionParameters.
44435 uint64_t CounterpartyChannelTransactionParameters_hash(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR o);
44438 * Checks if two CounterpartyChannelTransactionParameterss contain equal inner contents.
44439 * This ignores pointers and is_owned flags and looks at the values in fields.
44440 * Two objects with NULL inner values will be considered "equal" here.
44442 bool CounterpartyChannelTransactionParameters_eq(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR a, const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR b);
44445 * Whether the late bound parameters are populated.
44447 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
44450 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
44451 * given that the holder is the broadcaster.
44453 * self.is_populated() must be true before calling this function.
44455 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
44458 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
44459 * given that the counterparty is the broadcaster.
44461 * self.is_populated() must be true before calling this function.
44463 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
44466 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
44468 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
44471 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
44473 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
44476 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
44478 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
44481 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
44483 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
44486 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
44488 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
44491 * Get the channel pubkeys for the broadcaster
44493 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
44496 * Get the channel pubkeys for the countersignatory
44498 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
44501 * Get the contest delay applicable to the transactions.
44502 * Note that the contest delay was selected by the countersignatory.
44504 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
44507 * Whether the channel is outbound from the broadcaster.
44509 * The boolean representing the side that initiated the channel is
44510 * an input to the commitment number obscure factor computation.
44512 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
44515 * The funding outpoint
44517 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
44520 * Whether to use anchors for this channel
44522 MUST_USE_RES struct LDKChannelTypeFeatures DirectedChannelTransactionParameters_channel_type_features(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
44525 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
44527 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
44530 * Our counterparty's signature for the transaction
44532 struct LDKECDSASignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
44535 * Our counterparty's signature for the transaction
44537 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
44540 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
44542 * Returns a copy of the field.
44544 struct LDKCVec_ECDSASignatureZ HolderCommitmentTransaction_get_counterparty_htlc_sigs(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
44547 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
44549 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
44552 * Creates a copy of the HolderCommitmentTransaction
44554 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
44557 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
44559 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
44562 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
44564 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
44567 * Create a new holder transaction with the given counterparty signatures.
44568 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
44570 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);
44573 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
44575 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
44578 * The commitment transaction
44580 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
44583 * The commitment transaction
44585 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
44588 * The txid for the commitment transaction.
44590 * This is provided as a performance optimization, instead of calling transaction.txid()
44593 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
44596 * The txid for the commitment transaction.
44598 * This is provided as a performance optimization, instead of calling transaction.txid()
44601 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
44604 * Constructs a new BuiltCommitmentTransaction given each field
44606 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
44609 * Creates a copy of the BuiltCommitmentTransaction
44611 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
44614 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
44616 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
44619 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
44621 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
44624 * Get the SIGHASH_ALL sighash value of the transaction.
44626 * This can be used to verify a signature.
44628 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);
44631 * Signs the counterparty's commitment transaction.
44633 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);
44636 * Signs the holder commitment transaction because we are about to broadcast it.
44638 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);
44641 * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
44643 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
44646 * Creates a copy of the ClosingTransaction
44648 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
44651 * Generates a non-cryptographic 64-bit hash of the ClosingTransaction.
44653 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
44656 * Checks if two ClosingTransactions contain equal inner contents.
44657 * This ignores pointers and is_owned flags and looks at the values in fields.
44658 * Two objects with NULL inner values will be considered "equal" here.
44660 bool ClosingTransaction_eq(const struct LDKClosingTransaction *NONNULL_PTR a, const struct LDKClosingTransaction *NONNULL_PTR b);
44663 * Construct an object of the class
44665 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);
44668 * Trust our pre-built transaction.
44670 * Applies a wrapper which allows access to the transaction.
44672 * This should only be used if you fully trust the builder of this object. It should not
44673 * be used by an external signer - instead use the verify function.
44675 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
44678 * Verify our pre-built transaction.
44680 * Applies a wrapper which allows access to the transaction.
44682 * An external validating signer must call this method before signing
44683 * or using the built transaction.
44685 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
44688 * The value to be sent to the holder, or zero if the output will be omitted
44690 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
44693 * The value to be sent to the counterparty, or zero if the output will be omitted
44695 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
44698 * The destination of the holder's output
44700 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
44703 * The destination of the counterparty's output
44705 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
44708 * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
44710 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
44713 * The pre-built Bitcoin commitment transaction
44715 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
44718 * Get the SIGHASH_ALL sighash value of the transaction.
44720 * This can be used to verify a signature.
44722 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);
44725 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
44726 * because we are about to broadcast a holder transaction.
44728 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);
44731 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
44733 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
44736 * Creates a copy of the CommitmentTransaction
44738 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
44741 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
44743 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
44746 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
44748 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
44751 * The backwards-counting commitment number
44753 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
44756 * The per commitment point used by the broadcaster.
44758 MUST_USE_RES struct LDKPublicKey CommitmentTransaction_per_commitment_point(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
44761 * The value to be sent to the broadcaster
44763 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
44766 * The value to be sent to the counterparty
44768 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
44771 * The feerate paid per 1000-weight-unit in this commitment transaction.
44773 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
44776 * Trust our pre-built transaction and derived transaction creation public keys.
44778 * Applies a wrapper which allows access to these fields.
44780 * This should only be used if you fully trust the builder of this object. It should not
44781 * be used by an external signer - instead use the verify function.
44783 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
44786 * Verify our pre-built transaction and derived transaction creation public keys.
44788 * Applies a wrapper which allows access to these fields.
44790 * An external validating signer must call this method before signing
44791 * or using the built transaction.
44793 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);
44796 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
44798 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
44801 * The transaction ID of the built Bitcoin transaction
44803 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
44806 * The pre-built Bitcoin commitment transaction
44808 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
44811 * The pre-calculated transaction creation public keys.
44813 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
44816 * Should anchors be used.
44818 MUST_USE_RES struct LDKChannelTypeFeatures TrustedCommitmentTransaction_channel_type_features(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
44821 * Get a signature for each HTLC which was included in the commitment transaction (ie for
44822 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
44824 * The returned Vec has one entry for each HTLC, and in the same order.
44826 * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
44828 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);
44831 * Returns the index of the revokeable output, i.e. the `to_local` output sending funds to
44832 * the broadcaster, in the built transaction, if any exists.
44834 * There are two cases where this may return `None`:
44835 * - The balance of the revokeable output is below the dust limit (only found on commitments
44836 * early in the channel's lifetime, i.e. before the channel reserve is met).
44837 * - This commitment was created before LDK 0.0.117. In this case, the
44838 * commitment transaction previously didn't contain enough information to locate the
44839 * revokeable output.
44841 MUST_USE_RES struct LDKCOption_usizeZ TrustedCommitmentTransaction_revokeable_output_index(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
44844 * Helper method to build an unsigned justice transaction spending the revokeable
44845 * `to_local` output to a destination script. Fee estimation accounts for the expected
44846 * revocation witness data that will be added when signed.
44848 * This method will error if the given fee rate results in a fee greater than the value
44849 * of the output being spent, or if there exists no revokeable `to_local` output on this
44850 * commitment transaction. See [`Self::revokeable_output_index`] for more details.
44852 * The built transaction will allow fee bumping with RBF, and this method takes
44853 * `feerate_per_kw` as an input such that multiple copies of a justice transaction at different
44854 * fee rates may be built.
44856 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);
44859 * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
44860 * shared secret first. This prevents on-chain observers from discovering how many commitment
44861 * transactions occurred in a channel before it was closed.
44863 * This function gets the shared secret from relevant channel public keys and can be used to
44864 * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
44866 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
44869 * Checks if two InitFeaturess contain equal inner contents.
44870 * This ignores pointers and is_owned flags and looks at the values in fields.
44871 * Two objects with NULL inner values will be considered "equal" here.
44873 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
44876 * Checks if two NodeFeaturess contain equal inner contents.
44877 * This ignores pointers and is_owned flags and looks at the values in fields.
44878 * Two objects with NULL inner values will be considered "equal" here.
44880 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
44883 * Checks if two ChannelFeaturess contain equal inner contents.
44884 * This ignores pointers and is_owned flags and looks at the values in fields.
44885 * Two objects with NULL inner values will be considered "equal" here.
44887 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
44890 * Checks if two Bolt11InvoiceFeaturess contain equal inner contents.
44891 * This ignores pointers and is_owned flags and looks at the values in fields.
44892 * Two objects with NULL inner values will be considered "equal" here.
44894 bool Bolt11InvoiceFeatures_eq(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR b);
44897 * Checks if two OfferFeaturess contain equal inner contents.
44898 * This ignores pointers and is_owned flags and looks at the values in fields.
44899 * Two objects with NULL inner values will be considered "equal" here.
44901 bool OfferFeatures_eq(const struct LDKOfferFeatures *NONNULL_PTR a, const struct LDKOfferFeatures *NONNULL_PTR b);
44904 * Checks if two InvoiceRequestFeaturess contain equal inner contents.
44905 * This ignores pointers and is_owned flags and looks at the values in fields.
44906 * Two objects with NULL inner values will be considered "equal" here.
44908 bool InvoiceRequestFeatures_eq(const struct LDKInvoiceRequestFeatures *NONNULL_PTR a, const struct LDKInvoiceRequestFeatures *NONNULL_PTR b);
44911 * Checks if two Bolt12InvoiceFeaturess contain equal inner contents.
44912 * This ignores pointers and is_owned flags and looks at the values in fields.
44913 * Two objects with NULL inner values will be considered "equal" here.
44915 bool Bolt12InvoiceFeatures_eq(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR b);
44918 * Checks if two BlindedHopFeaturess contain equal inner contents.
44919 * This ignores pointers and is_owned flags and looks at the values in fields.
44920 * Two objects with NULL inner values will be considered "equal" here.
44922 bool BlindedHopFeatures_eq(const struct LDKBlindedHopFeatures *NONNULL_PTR a, const struct LDKBlindedHopFeatures *NONNULL_PTR b);
44925 * Checks if two ChannelTypeFeaturess contain equal inner contents.
44926 * This ignores pointers and is_owned flags and looks at the values in fields.
44927 * Two objects with NULL inner values will be considered "equal" here.
44929 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
44932 * Creates a copy of the InitFeatures
44934 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
44937 * Creates a copy of the NodeFeatures
44939 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
44942 * Creates a copy of the ChannelFeatures
44944 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
44947 * Creates a copy of the Bolt11InvoiceFeatures
44949 struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_clone(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR orig);
44952 * Creates a copy of the OfferFeatures
44954 struct LDKOfferFeatures OfferFeatures_clone(const struct LDKOfferFeatures *NONNULL_PTR orig);
44957 * Creates a copy of the InvoiceRequestFeatures
44959 struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_clone(const struct LDKInvoiceRequestFeatures *NONNULL_PTR orig);
44962 * Creates a copy of the Bolt12InvoiceFeatures
44964 struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_clone(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR orig);
44967 * Creates a copy of the BlindedHopFeatures
44969 struct LDKBlindedHopFeatures BlindedHopFeatures_clone(const struct LDKBlindedHopFeatures *NONNULL_PTR orig);
44972 * Creates a copy of the ChannelTypeFeatures
44974 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
44977 * Generates a non-cryptographic 64-bit hash of the InitFeatures.
44979 uint64_t InitFeatures_hash(const struct LDKInitFeatures *NONNULL_PTR o);
44982 * Generates a non-cryptographic 64-bit hash of the NodeFeatures.
44984 uint64_t NodeFeatures_hash(const struct LDKNodeFeatures *NONNULL_PTR o);
44987 * Generates a non-cryptographic 64-bit hash of the ChannelFeatures.
44989 uint64_t ChannelFeatures_hash(const struct LDKChannelFeatures *NONNULL_PTR o);
44992 * Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceFeatures.
44994 uint64_t Bolt11InvoiceFeatures_hash(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR o);
44997 * Generates a non-cryptographic 64-bit hash of the OfferFeatures.
44999 uint64_t OfferFeatures_hash(const struct LDKOfferFeatures *NONNULL_PTR o);
45002 * Generates a non-cryptographic 64-bit hash of the InvoiceRequestFeatures.
45004 uint64_t InvoiceRequestFeatures_hash(const struct LDKInvoiceRequestFeatures *NONNULL_PTR o);
45007 * Generates a non-cryptographic 64-bit hash of the Bolt12InvoiceFeatures.
45009 uint64_t Bolt12InvoiceFeatures_hash(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR o);
45012 * Generates a non-cryptographic 64-bit hash of the BlindedHopFeatures.
45014 uint64_t BlindedHopFeatures_hash(const struct LDKBlindedHopFeatures *NONNULL_PTR o);
45017 * Generates a non-cryptographic 64-bit hash of the ChannelTypeFeatures.
45019 uint64_t ChannelTypeFeatures_hash(const struct LDKChannelTypeFeatures *NONNULL_PTR o);
45022 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
45024 void InitFeatures_free(struct LDKInitFeatures this_obj);
45027 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
45029 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
45032 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
45034 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
45037 * Frees any resources used by the Bolt11InvoiceFeatures, if is_owned is set and inner is non-NULL.
45039 void Bolt11InvoiceFeatures_free(struct LDKBolt11InvoiceFeatures this_obj);
45042 * Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
45044 void OfferFeatures_free(struct LDKOfferFeatures this_obj);
45047 * Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
45049 void InvoiceRequestFeatures_free(struct LDKInvoiceRequestFeatures this_obj);
45052 * Frees any resources used by the Bolt12InvoiceFeatures, if is_owned is set and inner is non-NULL.
45054 void Bolt12InvoiceFeatures_free(struct LDKBolt12InvoiceFeatures this_obj);
45057 * Frees any resources used by the BlindedHopFeatures, if is_owned is set and inner is non-NULL.
45059 void BlindedHopFeatures_free(struct LDKBlindedHopFeatures this_obj);
45062 * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
45064 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
45067 * Create a blank Features with no features set
45069 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
45072 * Returns true if this `Features` object contains required features unknown by `other`.
45074 MUST_USE_RES bool InitFeatures_requires_unknown_bits_from(const struct LDKInitFeatures *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR other);
45077 * Returns true if this `Features` object contains unknown feature flags which are set as
45080 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45083 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
45086 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45087 * be set instead (i.e., `bit - 1`).
45089 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45091 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45094 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
45097 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45098 * set instead (i.e., `bit + 1`).
45100 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45102 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45105 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
45106 * by [bLIP 2] or if it is a known `T` feature.
45108 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45109 * be set instead (i.e., `bit - 1`).
45111 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45113 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45116 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
45117 * by [bLIP 2] or if it is a known `T` feature.
45119 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45120 * set instead (i.e., `bit + 1`).
45122 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45124 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45127 * Create a blank Features with no features set
45129 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
45132 * Returns true if this `Features` object contains required features unknown by `other`.
45134 MUST_USE_RES bool NodeFeatures_requires_unknown_bits_from(const struct LDKNodeFeatures *NONNULL_PTR this_arg, const struct LDKNodeFeatures *NONNULL_PTR other);
45137 * Returns true if this `Features` object contains unknown feature flags which are set as
45140 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45143 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
45146 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45147 * be set instead (i.e., `bit - 1`).
45149 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45151 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45154 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
45157 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45158 * set instead (i.e., `bit + 1`).
45160 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45162 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45165 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
45166 * by [bLIP 2] or if it is a known `T` feature.
45168 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45169 * be set instead (i.e., `bit - 1`).
45171 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45173 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45176 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
45177 * by [bLIP 2] or if it is a known `T` feature.
45179 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45180 * set instead (i.e., `bit + 1`).
45182 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45184 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45187 * Create a blank Features with no features set
45189 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
45192 * Returns true if this `Features` object contains required features unknown by `other`.
45194 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits_from(const struct LDKChannelFeatures *NONNULL_PTR this_arg, const struct LDKChannelFeatures *NONNULL_PTR other);
45197 * Returns true if this `Features` object contains unknown feature flags which are set as
45200 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
45203 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
45206 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45207 * be set instead (i.e., `bit - 1`).
45209 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45211 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45214 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
45217 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45218 * set instead (i.e., `bit + 1`).
45220 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45222 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45225 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
45226 * by [bLIP 2] or if it is a known `T` feature.
45228 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45229 * be set instead (i.e., `bit - 1`).
45231 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45233 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45236 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
45237 * by [bLIP 2] or if it is a known `T` feature.
45239 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45240 * set instead (i.e., `bit + 1`).
45242 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45244 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45247 * Create a blank Features with no features set
45249 MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_empty(void);
45252 * Returns true if this `Features` object contains required features unknown by `other`.
45254 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR other);
45257 * Returns true if this `Features` object contains unknown feature flags which are set as
45260 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45263 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
45266 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45267 * be set instead (i.e., `bit - 1`).
45269 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45271 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45274 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
45277 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45278 * set instead (i.e., `bit + 1`).
45280 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45282 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45285 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
45286 * by [bLIP 2] or if it is a known `T` feature.
45288 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45289 * be set instead (i.e., `bit - 1`).
45291 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45293 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45296 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
45297 * by [bLIP 2] or if it is a known `T` feature.
45299 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45300 * set instead (i.e., `bit + 1`).
45302 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45304 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45307 * Create a blank Features with no features set
45309 MUST_USE_RES struct LDKOfferFeatures OfferFeatures_empty(void);
45312 * Returns true if this `Features` object contains required features unknown by `other`.
45314 MUST_USE_RES bool OfferFeatures_requires_unknown_bits_from(const struct LDKOfferFeatures *NONNULL_PTR this_arg, const struct LDKOfferFeatures *NONNULL_PTR other);
45317 * Returns true if this `Features` object contains unknown feature flags which are set as
45320 MUST_USE_RES bool OfferFeatures_requires_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg);
45323 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
45326 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45327 * be set instead (i.e., `bit - 1`).
45329 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45331 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45334 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
45337 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45338 * set instead (i.e., `bit + 1`).
45340 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45342 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45345 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
45346 * by [bLIP 2] or if it is a known `T` feature.
45348 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45349 * be set instead (i.e., `bit - 1`).
45351 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45353 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45356 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
45357 * by [bLIP 2] or if it is a known `T` feature.
45359 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45360 * set instead (i.e., `bit + 1`).
45362 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45364 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45367 * Create a blank Features with no features set
45369 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_empty(void);
45372 * Returns true if this `Features` object contains required features unknown by `other`.
45374 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits_from(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, const struct LDKInvoiceRequestFeatures *NONNULL_PTR other);
45377 * Returns true if this `Features` object contains unknown feature flags which are set as
45380 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg);
45383 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
45386 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45387 * be set instead (i.e., `bit - 1`).
45389 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45391 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45394 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
45397 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45398 * set instead (i.e., `bit + 1`).
45400 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45402 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45405 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
45406 * by [bLIP 2] or if it is a known `T` feature.
45408 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45409 * be set instead (i.e., `bit - 1`).
45411 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45413 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45416 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
45417 * by [bLIP 2] or if it is a known `T` feature.
45419 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45420 * set instead (i.e., `bit + 1`).
45422 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45424 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45427 * Create a blank Features with no features set
45429 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_empty(void);
45432 * Returns true if this `Features` object contains required features unknown by `other`.
45434 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR other);
45437 * Returns true if this `Features` object contains unknown feature flags which are set as
45440 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
45443 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
45446 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45447 * be set instead (i.e., `bit - 1`).
45449 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45451 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45454 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
45457 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45458 * set instead (i.e., `bit + 1`).
45460 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45462 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45465 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
45466 * by [bLIP 2] or if it is a known `T` feature.
45468 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45469 * be set instead (i.e., `bit - 1`).
45471 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45473 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45476 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
45477 * by [bLIP 2] or if it is a known `T` feature.
45479 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45480 * set instead (i.e., `bit + 1`).
45482 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45484 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45487 * Create a blank Features with no features set
45489 MUST_USE_RES struct LDKBlindedHopFeatures BlindedHopFeatures_empty(void);
45492 * Returns true if this `Features` object contains required features unknown by `other`.
45494 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits_from(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, const struct LDKBlindedHopFeatures *NONNULL_PTR other);
45497 * Returns true if this `Features` object contains unknown feature flags which are set as
45500 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg);
45503 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
45506 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45507 * be set instead (i.e., `bit - 1`).
45509 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45511 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45514 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
45517 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45518 * set instead (i.e., `bit + 1`).
45520 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45522 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45525 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
45526 * by [bLIP 2] or if it is a known `T` feature.
45528 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45529 * be set instead (i.e., `bit - 1`).
45531 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45533 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45536 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
45537 * by [bLIP 2] or if it is a known `T` feature.
45539 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45540 * set instead (i.e., `bit + 1`).
45542 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45544 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45547 * Create a blank Features with no features set
45549 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
45552 * Returns true if this `Features` object contains required features unknown by `other`.
45554 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits_from(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, const struct LDKChannelTypeFeatures *NONNULL_PTR other);
45557 * Returns true if this `Features` object contains unknown feature flags which are set as
45560 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45563 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
45566 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45567 * be set instead (i.e., `bit - 1`).
45569 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45571 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45574 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
45577 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45578 * set instead (i.e., `bit + 1`).
45580 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45582 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45585 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
45586 * by [bLIP 2] or if it is a known `T` feature.
45588 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45589 * be set instead (i.e., `bit - 1`).
45591 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45593 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45596 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
45597 * by [bLIP 2] or if it is a known `T` feature.
45599 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45600 * set instead (i.e., `bit + 1`).
45602 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45604 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45607 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
45609 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
45612 * Read a InitFeatures from a byte array, created by InitFeatures_write
45614 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
45617 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
45619 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
45622 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
45624 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
45627 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
45629 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
45632 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
45634 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
45637 * Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read
45639 struct LDKCVec_u8Z Bolt11InvoiceFeatures_write(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR obj);
45642 * Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write
45644 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ Bolt11InvoiceFeatures_read(struct LDKu8slice ser);
45647 * Serialize the Bolt12InvoiceFeatures object into a byte array which can be read by Bolt12InvoiceFeatures_read
45649 struct LDKCVec_u8Z Bolt12InvoiceFeatures_write(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR obj);
45652 * Read a Bolt12InvoiceFeatures from a byte array, created by Bolt12InvoiceFeatures_write
45654 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ Bolt12InvoiceFeatures_read(struct LDKu8slice ser);
45657 * Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read
45659 struct LDKCVec_u8Z BlindedHopFeatures_write(const struct LDKBlindedHopFeatures *NONNULL_PTR obj);
45662 * Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write
45664 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ BlindedHopFeatures_read(struct LDKu8slice ser);
45667 * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
45669 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
45672 * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
45674 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
45677 * Set this feature as optional.
45679 void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45682 * Set this feature as required.
45684 void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45687 * Checks if this feature is supported.
45689 MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45692 * Set this feature as optional.
45694 void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45697 * Set this feature as required.
45699 void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45702 * Checks if this feature is supported.
45704 MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45707 * Checks if this feature is required.
45709 MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45712 * Checks if this feature is required.
45714 MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45717 * Set this feature as optional.
45719 void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45722 * Set this feature as required.
45724 void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45727 * Checks if this feature is supported.
45729 MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45732 * Set this feature as optional.
45734 void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45737 * Set this feature as required.
45739 void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45742 * Checks if this feature is supported.
45744 MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45747 * Set this feature as optional.
45749 void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45752 * Set this feature as required.
45754 void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45757 * Checks if this feature is supported.
45759 MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45762 * Checks if this feature is required.
45764 MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45767 * Checks if this feature is required.
45769 MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45772 * Set this feature as optional.
45774 void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45777 * Set this feature as required.
45779 void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45782 * Checks if this feature is supported.
45784 MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45787 * Set this feature as optional.
45789 void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45792 * Set this feature as required.
45794 void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45797 * Checks if this feature is supported.
45799 MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45802 * Checks if this feature is required.
45804 MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45807 * Checks if this feature is required.
45809 MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45812 * Set this feature as optional.
45814 void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45817 * Set this feature as required.
45819 void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45822 * Checks if this feature is supported.
45824 MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45827 * Set this feature as optional.
45829 void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45832 * Set this feature as required.
45834 void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45837 * Checks if this feature is supported.
45839 MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45842 * Set this feature as optional.
45844 void Bolt11InvoiceFeatures_set_variable_length_onion_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45847 * Set this feature as required.
45849 void Bolt11InvoiceFeatures_set_variable_length_onion_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45852 * Checks if this feature is supported.
45854 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45857 * Checks if this feature is required.
45859 MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45862 * Checks if this feature is required.
45864 MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45867 * Checks if this feature is required.
45869 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45872 * Set this feature as optional.
45874 void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45877 * Set this feature as required.
45879 void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45882 * Checks if this feature is supported.
45884 MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45887 * Set this feature as optional.
45889 void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45892 * Set this feature as required.
45894 void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45897 * Checks if this feature is supported.
45899 MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45902 * Set this feature as optional.
45904 void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45907 * Set this feature as required.
45909 void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45912 * Checks if this feature is supported.
45914 MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45917 * Checks if this feature is required.
45919 MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45922 * Checks if this feature is required.
45924 MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45927 * Checks if this feature is required.
45929 MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45932 * Set this feature as optional.
45934 void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45937 * Set this feature as required.
45939 void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45942 * Checks if this feature is supported.
45944 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45947 * Set this feature as optional.
45949 void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45952 * Set this feature as required.
45954 void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45957 * Checks if this feature is supported.
45959 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45962 * Set this feature as optional.
45964 void Bolt11InvoiceFeatures_set_payment_secret_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45967 * Set this feature as required.
45969 void Bolt11InvoiceFeatures_set_payment_secret_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45972 * Checks if this feature is supported.
45974 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45977 * Checks if this feature is required.
45979 MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45982 * Checks if this feature is required.
45984 MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45987 * Checks if this feature is required.
45989 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45992 * Set this feature as optional.
45994 void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45997 * Set this feature as required.
45999 void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46002 * Checks if this feature is supported.
46004 MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46007 * Set this feature as optional.
46009 void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46012 * Set this feature as required.
46014 void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46017 * Checks if this feature is supported.
46019 MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46022 * Set this feature as optional.
46024 void Bolt11InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46027 * Set this feature as required.
46029 void Bolt11InvoiceFeatures_set_basic_mpp_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46032 * Checks if this feature is supported.
46034 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46037 * Set this feature as optional.
46039 void Bolt12InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
46042 * Set this feature as required.
46044 void Bolt12InvoiceFeatures_set_basic_mpp_required(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
46047 * Checks if this feature is supported.
46049 MUST_USE_RES bool Bolt12InvoiceFeatures_supports_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
46052 * Checks if this feature is required.
46054 MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46057 * Checks if this feature is required.
46059 MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46062 * Checks if this feature is required.
46064 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46067 * Checks if this feature is required.
46069 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
46072 * Set this feature as optional.
46074 void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46077 * Set this feature as required.
46079 void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46082 * Checks if this feature is supported.
46084 MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46087 * Set this feature as optional.
46089 void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46092 * Set this feature as required.
46094 void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46097 * Checks if this feature is supported.
46099 MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46102 * Checks if this feature is required.
46104 MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46107 * Checks if this feature is required.
46109 MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46112 * Set this feature as optional.
46114 void InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46117 * Set this feature as required.
46119 void InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46122 * Checks if this feature is supported.
46124 MUST_USE_RES bool InitFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46127 * Set this feature as optional.
46129 void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46132 * Set this feature as required.
46134 void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46137 * Checks if this feature is supported.
46139 MUST_USE_RES bool NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46142 * Set this feature as optional.
46144 void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46147 * Set this feature as required.
46149 void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46152 * Checks if this feature is supported.
46154 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46157 * Checks if this feature is required.
46159 MUST_USE_RES bool InitFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46162 * Checks if this feature is required.
46164 MUST_USE_RES bool NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46167 * Checks if this feature is required.
46169 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46172 * Set this feature as optional.
46174 void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46177 * Set this feature as required.
46179 void InitFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46182 * Checks if this feature is supported.
46184 MUST_USE_RES bool InitFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46187 * Set this feature as optional.
46189 void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46192 * Set this feature as required.
46194 void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46197 * Checks if this feature is supported.
46199 MUST_USE_RES bool NodeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46202 * Set this feature as optional.
46204 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46207 * Set this feature as required.
46209 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46212 * Checks if this feature is supported.
46214 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46217 * Checks if this feature is required.
46219 MUST_USE_RES bool InitFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46222 * Checks if this feature is required.
46224 MUST_USE_RES bool NodeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46227 * Checks if this feature is required.
46229 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46232 * Set this feature as optional.
46234 void InitFeatures_set_route_blinding_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46237 * Set this feature as required.
46239 void InitFeatures_set_route_blinding_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46242 * Checks if this feature is supported.
46244 MUST_USE_RES bool InitFeatures_supports_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46247 * Set this feature as optional.
46249 void NodeFeatures_set_route_blinding_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46252 * Set this feature as required.
46254 void NodeFeatures_set_route_blinding_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46257 * Checks if this feature is supported.
46259 MUST_USE_RES bool NodeFeatures_supports_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46262 * Checks if this feature is required.
46264 MUST_USE_RES bool InitFeatures_requires_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46267 * Checks if this feature is required.
46269 MUST_USE_RES bool NodeFeatures_requires_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46272 * Set this feature as optional.
46274 void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46277 * Set this feature as required.
46279 void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46282 * Checks if this feature is supported.
46284 MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46287 * Set this feature as optional.
46289 void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46292 * Set this feature as required.
46294 void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46297 * Checks if this feature is supported.
46299 MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46302 * Checks if this feature is required.
46304 MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46307 * Checks if this feature is required.
46309 MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46312 * Set this feature as optional.
46314 void InitFeatures_set_taproot_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46317 * Set this feature as required.
46319 void InitFeatures_set_taproot_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46322 * Checks if this feature is supported.
46324 MUST_USE_RES bool InitFeatures_supports_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46327 * Set this feature as optional.
46329 void NodeFeatures_set_taproot_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46332 * Set this feature as required.
46334 void NodeFeatures_set_taproot_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46337 * Checks if this feature is supported.
46339 MUST_USE_RES bool NodeFeatures_supports_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46342 * Set this feature as optional.
46344 void ChannelTypeFeatures_set_taproot_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46347 * Set this feature as required.
46349 void ChannelTypeFeatures_set_taproot_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46352 * Checks if this feature is supported.
46354 MUST_USE_RES bool ChannelTypeFeatures_supports_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46357 * Checks if this feature is required.
46359 MUST_USE_RES bool InitFeatures_requires_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46362 * Checks if this feature is required.
46364 MUST_USE_RES bool NodeFeatures_requires_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46367 * Checks if this feature is required.
46369 MUST_USE_RES bool ChannelTypeFeatures_requires_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46372 * Set this feature as optional.
46374 void InitFeatures_set_onion_messages_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46377 * Set this feature as required.
46379 void InitFeatures_set_onion_messages_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46382 * Checks if this feature is supported.
46384 MUST_USE_RES bool InitFeatures_supports_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46387 * Set this feature as optional.
46389 void NodeFeatures_set_onion_messages_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46392 * Set this feature as required.
46394 void NodeFeatures_set_onion_messages_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46397 * Checks if this feature is supported.
46399 MUST_USE_RES bool NodeFeatures_supports_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46402 * Checks if this feature is required.
46404 MUST_USE_RES bool InitFeatures_requires_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46407 * Checks if this feature is required.
46409 MUST_USE_RES bool NodeFeatures_requires_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46412 * Set this feature as optional.
46414 void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46417 * Set this feature as required.
46419 void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46422 * Checks if this feature is supported.
46424 MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46427 * Set this feature as optional.
46429 void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46432 * Set this feature as required.
46434 void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46437 * Checks if this feature is supported.
46439 MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46442 * Checks if this feature is required.
46444 MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46447 * Checks if this feature is required.
46449 MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46452 * Set this feature as optional.
46454 void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46457 * Set this feature as required.
46459 void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46462 * Checks if this feature is supported.
46464 MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46467 * Set this feature as optional.
46469 void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46472 * Set this feature as required.
46474 void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46477 * Checks if this feature is supported.
46479 MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46482 * Set this feature as optional.
46484 void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46487 * Set this feature as required.
46489 void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46492 * Checks if this feature is supported.
46494 MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46497 * Checks if this feature is required.
46499 MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46502 * Checks if this feature is required.
46504 MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46507 * Checks if this feature is required.
46509 MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46512 * Set this feature as optional.
46514 void Bolt11InvoiceFeatures_set_payment_metadata_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46517 * Set this feature as required.
46519 void Bolt11InvoiceFeatures_set_payment_metadata_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46522 * Checks if this feature is supported.
46524 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46527 * Checks if this feature is required.
46529 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46532 * Set this feature as optional.
46534 void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46537 * Set this feature as required.
46539 void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46542 * Checks if this feature is supported.
46544 MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46547 * Set this feature as optional.
46549 void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46552 * Set this feature as required.
46554 void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46557 * Checks if this feature is supported.
46559 MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46562 * Set this feature as optional.
46564 void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46567 * Set this feature as required.
46569 void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46572 * Checks if this feature is supported.
46574 MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46577 * Checks if this feature is required.
46579 MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46582 * Checks if this feature is required.
46584 MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46587 * Checks if this feature is required.
46589 MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46592 * Set this feature as optional.
46594 void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46597 * Set this feature as required.
46599 void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46602 * Checks if this feature is supported.
46604 MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46607 * Checks if this feature is required.
46609 MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46612 * Set this feature as optional.
46614 void InitFeatures_set_trampoline_routing_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46617 * Set this feature as required.
46619 void InitFeatures_set_trampoline_routing_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46622 * Checks if this feature is supported.
46624 MUST_USE_RES bool InitFeatures_supports_trampoline_routing(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46627 * Set this feature as optional.
46629 void NodeFeatures_set_trampoline_routing_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46632 * Set this feature as required.
46634 void NodeFeatures_set_trampoline_routing_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46637 * Checks if this feature is supported.
46639 MUST_USE_RES bool NodeFeatures_supports_trampoline_routing(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46642 * Set this feature as optional.
46644 void Bolt11InvoiceFeatures_set_trampoline_routing_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46647 * Set this feature as required.
46649 void Bolt11InvoiceFeatures_set_trampoline_routing_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46652 * Checks if this feature is supported.
46654 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_trampoline_routing(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46657 * Checks if this feature is required.
46659 MUST_USE_RES bool InitFeatures_requires_trampoline_routing(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46662 * Checks if this feature is required.
46664 MUST_USE_RES bool NodeFeatures_requires_trampoline_routing(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46667 * Checks if this feature is required.
46669 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_trampoline_routing(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46672 * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
46674 void ShutdownScript_free(struct LDKShutdownScript this_obj);
46677 * Creates a copy of the ShutdownScript
46679 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
46682 * Checks if two ShutdownScripts contain equal inner contents.
46683 * This ignores pointers and is_owned flags and looks at the values in fields.
46684 * Two objects with NULL inner values will be considered "equal" here.
46686 bool ShutdownScript_eq(const struct LDKShutdownScript *NONNULL_PTR a, const struct LDKShutdownScript *NONNULL_PTR b);
46689 * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
46691 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
46694 * The script that did not meet the requirements from [BOLT #2].
46696 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
46698 struct LDKCVec_u8Z InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
46701 * The script that did not meet the requirements from [BOLT #2].
46703 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
46705 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
46708 * Constructs a new InvalidShutdownScript given each field
46710 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
46713 * Creates a copy of the InvalidShutdownScript
46715 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
46718 * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
46720 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
46723 * Read a ShutdownScript from a byte array, created by ShutdownScript_write
46725 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
46728 * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
46730 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
46733 * Generates a P2WSH script pubkey from the given [`WScriptHash`].
46735 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
46738 * Generates a witness script pubkey from the given segwit version and program.
46740 * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
46741 * [`ShutdownScript::new_p2wsh`] instead.
46745 * This function may return an error if `program` is invalid for the segwit `version`.
46747 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessProgram witness_program);
46750 * Converts the shutdown script into the underlying [`ScriptBuf`].
46752 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
46755 * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
46757 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46759 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
46762 * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
46764 * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
46766 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
46769 * Frees any resources used by the ChannelId, if is_owned is set and inner is non-NULL.
46771 void ChannelId_free(struct LDKChannelId this_obj);
46773 const uint8_t (*ChannelId_get_a(const struct LDKChannelId *NONNULL_PTR this_ptr))[32];
46775 void ChannelId_set_a(struct LDKChannelId *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
46778 * Constructs a new ChannelId given each field
46780 MUST_USE_RES struct LDKChannelId ChannelId_new(struct LDKThirtyTwoBytes a_arg);
46783 * Creates a copy of the ChannelId
46785 struct LDKChannelId ChannelId_clone(const struct LDKChannelId *NONNULL_PTR orig);
46788 * Checks if two ChannelIds contain equal inner contents.
46789 * This ignores pointers and is_owned flags and looks at the values in fields.
46790 * Two objects with NULL inner values will be considered "equal" here.
46792 bool ChannelId_eq(const struct LDKChannelId *NONNULL_PTR a, const struct LDKChannelId *NONNULL_PTR b);
46795 * Generates a non-cryptographic 64-bit hash of the ChannelId.
46797 uint64_t ChannelId_hash(const struct LDKChannelId *NONNULL_PTR o);
46800 * Create _v1_ channel ID based on a funding TX ID and output index
46802 MUST_USE_RES struct LDKChannelId ChannelId_v1_from_funding_txid(const uint8_t (*txid)[32], uint16_t output_index);
46805 * Create _v1_ channel ID from a funding tx outpoint
46807 MUST_USE_RES struct LDKChannelId ChannelId_v1_from_funding_outpoint(struct LDKOutPoint outpoint);
46810 * Create a _temporary_ channel ID randomly, based on an entropy source.
46812 MUST_USE_RES struct LDKChannelId ChannelId_temporary_from_entropy_source(const struct LDKEntropySource *NONNULL_PTR entropy_source);
46815 * Generic constructor; create a new channel ID from the provided data.
46816 * Use a more specific `*_from_*` constructor when possible.
46818 MUST_USE_RES struct LDKChannelId ChannelId_from_bytes(struct LDKThirtyTwoBytes data);
46821 * Create a channel ID consisting of all-zeros data (e.g. when uninitialized or a placeholder).
46823 MUST_USE_RES struct LDKChannelId ChannelId_new_zero(void);
46826 * Check whether ID is consisting of all zeros (uninitialized)
46828 MUST_USE_RES bool ChannelId_is_zero(const struct LDKChannelId *NONNULL_PTR this_arg);
46831 * Create _v2_ channel ID by concatenating the holder revocation basepoint with the counterparty
46832 * revocation basepoint and hashing the result. The basepoints will be concatenated in increasing
46835 MUST_USE_RES struct LDKChannelId ChannelId_v2_from_revocation_basepoints(const struct LDKRevocationBasepoint *NONNULL_PTR ours, const struct LDKRevocationBasepoint *NONNULL_PTR theirs);
46838 * Create temporary _v2_ channel ID by concatenating a zeroed out basepoint with the holder
46839 * revocation basepoint and hashing the result.
46841 MUST_USE_RES struct LDKChannelId ChannelId_temporary_v2_from_revocation_basepoint(const struct LDKRevocationBasepoint *NONNULL_PTR our_revocation_basepoint);
46844 * Serialize the ChannelId object into a byte array which can be read by ChannelId_read
46846 struct LDKCVec_u8Z ChannelId_write(const struct LDKChannelId *NONNULL_PTR obj);
46849 * Read a ChannelId from a byte array, created by ChannelId_write
46851 struct LDKCResult_ChannelIdDecodeErrorZ ChannelId_read(struct LDKu8slice ser);
46854 * Frees any resources used by the Retry
46856 void Retry_free(struct LDKRetry this_ptr);
46859 * Creates a copy of the Retry
46861 struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig);
46864 * Utility method to constructs a new Attempts-variant Retry
46866 struct LDKRetry Retry_attempts(uint32_t a);
46869 * Utility method to constructs a new Timeout-variant Retry
46871 struct LDKRetry Retry_timeout(uint64_t a);
46874 * Checks if two Retrys contain equal inner contents.
46875 * This ignores pointers and is_owned flags and looks at the values in fields.
46877 bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b);
46880 * Generates a non-cryptographic 64-bit hash of the Retry.
46882 uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o);
46885 * Serialize the Retry object into a byte array which can be read by Retry_read
46887 struct LDKCVec_u8Z Retry_write(const struct LDKRetry *NONNULL_PTR obj);
46890 * Read a Retry from a byte array, created by Retry_write
46892 struct LDKCResult_RetryDecodeErrorZ Retry_read(struct LDKu8slice ser);
46895 * Creates a copy of the RetryableSendFailure
46897 enum LDKRetryableSendFailure RetryableSendFailure_clone(const enum LDKRetryableSendFailure *NONNULL_PTR orig);
46900 * Utility method to constructs a new PaymentExpired-variant RetryableSendFailure
46902 enum LDKRetryableSendFailure RetryableSendFailure_payment_expired(void);
46905 * Utility method to constructs a new RouteNotFound-variant RetryableSendFailure
46907 enum LDKRetryableSendFailure RetryableSendFailure_route_not_found(void);
46910 * Utility method to constructs a new DuplicatePayment-variant RetryableSendFailure
46912 enum LDKRetryableSendFailure RetryableSendFailure_duplicate_payment(void);
46915 * Checks if two RetryableSendFailures contain equal inner contents.
46916 * This ignores pointers and is_owned flags and looks at the values in fields.
46918 bool RetryableSendFailure_eq(const enum LDKRetryableSendFailure *NONNULL_PTR a, const enum LDKRetryableSendFailure *NONNULL_PTR b);
46921 * Frees any resources used by the PaymentSendFailure
46923 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
46926 * Creates a copy of the PaymentSendFailure
46928 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
46931 * Utility method to constructs a new ParameterError-variant PaymentSendFailure
46933 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
46936 * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
46938 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
46941 * Utility method to constructs a new AllFailedResendSafe-variant PaymentSendFailure
46943 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_resend_safe(struct LDKCVec_APIErrorZ a);
46946 * Utility method to constructs a new DuplicatePayment-variant PaymentSendFailure
46948 struct LDKPaymentSendFailure PaymentSendFailure_duplicate_payment(void);
46951 * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
46953 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
46956 * Checks if two PaymentSendFailures contain equal inner contents.
46957 * This ignores pointers and is_owned flags and looks at the values in fields.
46959 bool PaymentSendFailure_eq(const struct LDKPaymentSendFailure *NONNULL_PTR a, const struct LDKPaymentSendFailure *NONNULL_PTR b);
46962 * Frees any resources used by the ProbeSendFailure
46964 void ProbeSendFailure_free(struct LDKProbeSendFailure this_ptr);
46967 * Creates a copy of the ProbeSendFailure
46969 struct LDKProbeSendFailure ProbeSendFailure_clone(const struct LDKProbeSendFailure *NONNULL_PTR orig);
46972 * Utility method to constructs a new RouteNotFound-variant ProbeSendFailure
46974 struct LDKProbeSendFailure ProbeSendFailure_route_not_found(void);
46977 * Utility method to constructs a new SendingFailed-variant ProbeSendFailure
46979 struct LDKProbeSendFailure ProbeSendFailure_sending_failed(struct LDKPaymentSendFailure a);
46982 * Checks if two ProbeSendFailures contain equal inner contents.
46983 * This ignores pointers and is_owned flags and looks at the values in fields.
46985 bool ProbeSendFailure_eq(const struct LDKProbeSendFailure *NONNULL_PTR a, const struct LDKProbeSendFailure *NONNULL_PTR b);
46988 * Frees any resources used by the RecipientOnionFields, if is_owned is set and inner is non-NULL.
46990 void RecipientOnionFields_free(struct LDKRecipientOnionFields this_obj);
46993 * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
46994 * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
46995 * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
46998 * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
46999 * multi-path payments require a recipient-provided secret.
47001 * Some implementations may reject spontaneous payments with payment secrets, so you may only
47002 * want to provide a secret for a spontaneous payment if MPP is needed and you know your
47003 * recipient will not reject it.
47005 struct LDKCOption_ThirtyTwoBytesZ RecipientOnionFields_get_payment_secret(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
47008 * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
47009 * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
47010 * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
47013 * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
47014 * multi-path payments require a recipient-provided secret.
47016 * Some implementations may reject spontaneous payments with payment secrets, so you may only
47017 * want to provide a secret for a spontaneous payment if MPP is needed and you know your
47018 * recipient will not reject it.
47020 void RecipientOnionFields_set_payment_secret(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
47023 * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
47024 * arbitrary length. This gives recipients substantially more flexibility to receive
47027 * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
47028 * scheme to authenticate received payments against expected payments and invoices, this field
47029 * is not used in LDK for received payments, and can be used to store arbitrary data in
47030 * invoices which will be received with the payment.
47032 * Note that this field was added to the lightning specification more recently than
47033 * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
47034 * may not be supported as universally.
47036 * Returns a copy of the field.
47038 struct LDKCOption_CVec_u8ZZ RecipientOnionFields_get_payment_metadata(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
47041 * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
47042 * arbitrary length. This gives recipients substantially more flexibility to receive
47045 * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
47046 * scheme to authenticate received payments against expected payments and invoices, this field
47047 * is not used in LDK for received payments, and can be used to store arbitrary data in
47048 * invoices which will be received with the payment.
47050 * Note that this field was added to the lightning specification more recently than
47051 * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
47052 * may not be supported as universally.
47054 void RecipientOnionFields_set_payment_metadata(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
47057 * Creates a copy of the RecipientOnionFields
47059 struct LDKRecipientOnionFields RecipientOnionFields_clone(const struct LDKRecipientOnionFields *NONNULL_PTR orig);
47062 * Checks if two RecipientOnionFieldss contain equal inner contents.
47063 * This ignores pointers and is_owned flags and looks at the values in fields.
47064 * Two objects with NULL inner values will be considered "equal" here.
47066 bool RecipientOnionFields_eq(const struct LDKRecipientOnionFields *NONNULL_PTR a, const struct LDKRecipientOnionFields *NONNULL_PTR b);
47069 * Serialize the RecipientOnionFields object into a byte array which can be read by RecipientOnionFields_read
47071 struct LDKCVec_u8Z RecipientOnionFields_write(const struct LDKRecipientOnionFields *NONNULL_PTR obj);
47074 * Read a RecipientOnionFields from a byte array, created by RecipientOnionFields_write
47076 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ RecipientOnionFields_read(struct LDKu8slice ser);
47079 * Creates a [`RecipientOnionFields`] from only a [`PaymentSecret`]. This is the most common
47080 * set of onion fields for today's BOLT11 invoices - most nodes require a [`PaymentSecret`]
47081 * but do not require or provide any further data.
47083 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_secret_only(struct LDKThirtyTwoBytes payment_secret);
47086 * Creates a new [`RecipientOnionFields`] with no fields. This generally does not create
47087 * payable HTLCs except for single-path spontaneous payments, i.e. this should generally
47088 * only be used for calls to [`ChannelManager::send_spontaneous_payment`]. If you are sending
47089 * a spontaneous MPP this will not work as all MPP require payment secrets; you may
47090 * instead want to use [`RecipientOnionFields::secret_only`].
47092 * [`ChannelManager::send_spontaneous_payment`]: super::channelmanager::ChannelManager::send_spontaneous_payment
47093 * [`RecipientOnionFields::secret_only`]: RecipientOnionFields::secret_only
47095 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_spontaneous_empty(void);
47098 * Creates a new [`RecipientOnionFields`] from an existing one, adding custom TLVs. Each
47099 * TLV is provided as a `(u64, Vec<u8>)` for the type number and serialized value
47100 * respectively. TLV type numbers must be unique and within the range
47101 * reserved for custom types, i.e. >= 2^16, otherwise this method will return `Err(())`.
47103 * This method will also error for types in the experimental range which have been
47104 * standardized within the protocol, which only includes 5482373484 (keysend) for now.
47106 * See [`Self::custom_tlvs`] for more info.
47108 MUST_USE_RES struct LDKCResult_RecipientOnionFieldsNoneZ RecipientOnionFields_with_custom_tlvs(struct LDKRecipientOnionFields this_arg, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs);
47111 * Gets the custom TLVs that will be sent or have been received.
47113 * Custom TLVs allow sending extra application-specific data with a payment. They provide
47114 * additional flexibility on top of payment metadata, as while other implementations may
47115 * require `payment_metadata` to reflect metadata provided in an invoice, custom TLVs
47116 * do not have this restriction.
47118 * Note that if this field is non-empty, it will contain strictly increasing TLVs, each
47119 * represented by a `(u64, Vec<u8>)` for its type number and serialized value respectively.
47120 * This is validated when setting this field using [`Self::with_custom_tlvs`].
47122 MUST_USE_RES struct LDKCVec_C2Tuple_u64CVec_u8ZZZ RecipientOnionFields_custom_tlvs(const struct LDKRecipientOnionFields *NONNULL_PTR this_arg);
47125 * Calls the free function if one is set
47127 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
47130 * Creates a copy of a Type
47132 struct LDKType Type_clone(const struct LDKType *NONNULL_PTR orig);
47135 * Calls the free function if one is set
47137 void Type_free(struct LDKType this_ptr);
47140 * Frees any resources used by the OfferId, if is_owned is set and inner is non-NULL.
47142 void OfferId_free(struct LDKOfferId this_obj);
47144 const uint8_t (*OfferId_get_a(const struct LDKOfferId *NONNULL_PTR this_ptr))[32];
47146 void OfferId_set_a(struct LDKOfferId *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
47149 * Constructs a new OfferId given each field
47151 MUST_USE_RES struct LDKOfferId OfferId_new(struct LDKThirtyTwoBytes a_arg);
47154 * Creates a copy of the OfferId
47156 struct LDKOfferId OfferId_clone(const struct LDKOfferId *NONNULL_PTR orig);
47159 * Checks if two OfferIds contain equal inner contents.
47160 * This ignores pointers and is_owned flags and looks at the values in fields.
47161 * Two objects with NULL inner values will be considered "equal" here.
47163 bool OfferId_eq(const struct LDKOfferId *NONNULL_PTR a, const struct LDKOfferId *NONNULL_PTR b);
47166 * Serialize the OfferId object into a byte array which can be read by OfferId_read
47168 struct LDKCVec_u8Z OfferId_write(const struct LDKOfferId *NONNULL_PTR obj);
47171 * Read a OfferId from a byte array, created by OfferId_write
47173 struct LDKCResult_OfferIdDecodeErrorZ OfferId_read(struct LDKu8slice ser);
47176 * Frees any resources used by the OfferWithExplicitMetadataBuilder, if is_owned is set and inner is non-NULL.
47178 void OfferWithExplicitMetadataBuilder_free(struct LDKOfferWithExplicitMetadataBuilder this_obj);
47181 * Creates a copy of the OfferWithExplicitMetadataBuilder
47183 struct LDKOfferWithExplicitMetadataBuilder OfferWithExplicitMetadataBuilder_clone(const struct LDKOfferWithExplicitMetadataBuilder *NONNULL_PTR orig);
47186 * Frees any resources used by the OfferWithDerivedMetadataBuilder, if is_owned is set and inner is non-NULL.
47188 void OfferWithDerivedMetadataBuilder_free(struct LDKOfferWithDerivedMetadataBuilder this_obj);
47191 * Creates a copy of the OfferWithDerivedMetadataBuilder
47193 struct LDKOfferWithDerivedMetadataBuilder OfferWithDerivedMetadataBuilder_clone(const struct LDKOfferWithDerivedMetadataBuilder *NONNULL_PTR orig);
47196 * Creates a new builder for an offer using the [`Offer::signing_pubkey`] for signing invoices.
47197 * The associated secret key must be remembered while the offer is valid.
47199 * Use a different pubkey per offer to avoid correlating offers.
47203 * If constructing an [`Offer`] for use with a [`ChannelManager`], use
47204 * [`ChannelManager::create_offer_builder`] instead of [`OfferBuilder::new`].
47206 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
47207 * [`ChannelManager::create_offer_builder`]: crate::ln::channelmanager::ChannelManager::create_offer_builder
47209 MUST_USE_RES struct LDKOfferWithExplicitMetadataBuilder OfferWithExplicitMetadataBuilder_new(struct LDKPublicKey signing_pubkey);
47212 * Sets the [`Offer::metadata`] to the given bytes.
47214 * Successive calls to this method will override the previous setting.
47216 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ OfferWithExplicitMetadataBuilder_metadata(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKCVec_u8Z metadata);
47219 * Adds the chain hash of the given [`Network`] to [`Offer::chains`]. If not called,
47220 * the chain hash of [`Network::Bitcoin`] is assumed to be the only one supported.
47222 * See [`Offer::chains`] on how this relates to the payment currency.
47224 * Successive calls to this method will add another chain hash.
47226 MUST_USE_RES void OfferWithExplicitMetadataBuilder_chain(struct LDKOfferWithExplicitMetadataBuilder this_arg, enum LDKNetwork network);
47229 * Sets the [`Offer::amount`] as an [`Amount::Bitcoin`].
47231 * Successive calls to this method will override the previous setting.
47233 MUST_USE_RES void OfferWithExplicitMetadataBuilder_amount_msats(struct LDKOfferWithExplicitMetadataBuilder this_arg, uint64_t amount_msats);
47236 * Sets the [`Offer::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has
47237 * already passed is valid and can be checked for using [`Offer::is_expired`].
47239 * Successive calls to this method will override the previous setting.
47241 MUST_USE_RES void OfferWithExplicitMetadataBuilder_absolute_expiry(struct LDKOfferWithExplicitMetadataBuilder this_arg, uint64_t absolute_expiry);
47244 * Sets the [`Offer::description`].
47246 * Successive calls to this method will override the previous setting.
47248 MUST_USE_RES void OfferWithExplicitMetadataBuilder_description(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKStr description);
47251 * Sets the [`Offer::issuer`].
47253 * Successive calls to this method will override the previous setting.
47255 MUST_USE_RES void OfferWithExplicitMetadataBuilder_issuer(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKStr issuer);
47258 * Adds a blinded path to [`Offer::paths`]. Must include at least one path if only connected by
47259 * private channels or if [`Offer::signing_pubkey`] is not a public node id.
47261 * Successive calls to this method will add another blinded path. Caller is responsible for not
47262 * adding duplicate paths.
47264 MUST_USE_RES void OfferWithExplicitMetadataBuilder_path(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKBlindedPath path);
47267 * Sets the quantity of items for [`Offer::supported_quantity`]. If not called, defaults to
47268 * [`Quantity::One`].
47270 * Successive calls to this method will override the previous setting.
47272 MUST_USE_RES void OfferWithExplicitMetadataBuilder_supported_quantity(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKQuantity quantity);
47275 * Builds an [`Offer`] from the builder's settings.
47277 MUST_USE_RES struct LDKCResult_OfferBolt12SemanticErrorZ OfferWithExplicitMetadataBuilder_build(struct LDKOfferWithExplicitMetadataBuilder this_arg);
47280 * Similar to [`OfferBuilder::new`] except, if [`OfferBuilder::path`] is called, the signing
47281 * pubkey is derived from the given [`ExpandedKey`] and [`EntropySource`]. This provides
47282 * recipient privacy by using a different signing pubkey for each offer. Otherwise, the
47283 * provided `node_id` is used for the signing pubkey.
47285 * Also, sets the metadata when [`OfferBuilder::build`] is called such that it can be used by
47286 * [`InvoiceRequest::verify`] to determine if the request was produced for the offer given an
47289 * [`InvoiceRequest::verify`]: crate::offers::invoice_request::InvoiceRequest::verify
47290 * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey
47292 MUST_USE_RES struct LDKOfferWithDerivedMetadataBuilder OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(struct LDKPublicKey node_id, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKEntropySource entropy_source);
47295 * Adds the chain hash of the given [`Network`] to [`Offer::chains`]. If not called,
47296 * the chain hash of [`Network::Bitcoin`] is assumed to be the only one supported.
47298 * See [`Offer::chains`] on how this relates to the payment currency.
47300 * Successive calls to this method will add another chain hash.
47302 MUST_USE_RES void OfferWithDerivedMetadataBuilder_chain(struct LDKOfferWithDerivedMetadataBuilder this_arg, enum LDKNetwork network);
47305 * Sets the [`Offer::amount`] as an [`Amount::Bitcoin`].
47307 * Successive calls to this method will override the previous setting.
47309 MUST_USE_RES void OfferWithDerivedMetadataBuilder_amount_msats(struct LDKOfferWithDerivedMetadataBuilder this_arg, uint64_t amount_msats);
47312 * Sets the [`Offer::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has
47313 * already passed is valid and can be checked for using [`Offer::is_expired`].
47315 * Successive calls to this method will override the previous setting.
47317 MUST_USE_RES void OfferWithDerivedMetadataBuilder_absolute_expiry(struct LDKOfferWithDerivedMetadataBuilder this_arg, uint64_t absolute_expiry);
47320 * Sets the [`Offer::description`].
47322 * Successive calls to this method will override the previous setting.
47324 MUST_USE_RES void OfferWithDerivedMetadataBuilder_description(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKStr description);
47327 * Sets the [`Offer::issuer`].
47329 * Successive calls to this method will override the previous setting.
47331 MUST_USE_RES void OfferWithDerivedMetadataBuilder_issuer(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKStr issuer);
47334 * Adds a blinded path to [`Offer::paths`]. Must include at least one path if only connected by
47335 * private channels or if [`Offer::signing_pubkey`] is not a public node id.
47337 * Successive calls to this method will add another blinded path. Caller is responsible for not
47338 * adding duplicate paths.
47340 MUST_USE_RES void OfferWithDerivedMetadataBuilder_path(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKBlindedPath path);
47343 * Sets the quantity of items for [`Offer::supported_quantity`]. If not called, defaults to
47344 * [`Quantity::One`].
47346 * Successive calls to this method will override the previous setting.
47348 MUST_USE_RES void OfferWithDerivedMetadataBuilder_supported_quantity(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKQuantity quantity);
47351 * Builds an [`Offer`] from the builder's settings.
47353 MUST_USE_RES struct LDKCResult_OfferBolt12SemanticErrorZ OfferWithDerivedMetadataBuilder_build(struct LDKOfferWithDerivedMetadataBuilder this_arg);
47356 * Frees any resources used by the Offer, if is_owned is set and inner is non-NULL.
47358 void Offer_free(struct LDKOffer this_obj);
47361 * Creates a copy of the Offer
47363 struct LDKOffer Offer_clone(const struct LDKOffer *NONNULL_PTR orig);
47366 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
47367 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
47368 * for the selected chain.
47370 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ Offer_chains(const struct LDKOffer *NONNULL_PTR this_arg);
47373 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
47374 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
47376 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Offer_metadata(const struct LDKOffer *NONNULL_PTR this_arg);
47379 * The minimum amount required for a successful payment of a single item.
47381 MUST_USE_RES struct LDKCOption_AmountZ Offer_amount(const struct LDKOffer *NONNULL_PTR this_arg);
47384 * A complete description of the purpose of the payment. Intended to be displayed to the user
47385 * but with the caveat that it has not been verified in any way.
47387 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47389 MUST_USE_RES struct LDKPrintableString Offer_description(const struct LDKOffer *NONNULL_PTR this_arg);
47392 * Features pertaining to the offer.
47394 MUST_USE_RES struct LDKOfferFeatures Offer_offer_features(const struct LDKOffer *NONNULL_PTR this_arg);
47397 * Duration since the Unix epoch when an invoice should no longer be requested.
47399 * If `None`, the offer does not expire.
47401 MUST_USE_RES struct LDKCOption_u64Z Offer_absolute_expiry(const struct LDKOffer *NONNULL_PTR this_arg);
47404 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
47405 * displayed to the user but with the caveat that it has not been verified in any way.
47407 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47409 MUST_USE_RES struct LDKPrintableString Offer_issuer(const struct LDKOffer *NONNULL_PTR this_arg);
47412 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
47413 * recipient privacy by obfuscating its node id.
47415 MUST_USE_RES struct LDKCVec_BlindedPathZ Offer_paths(const struct LDKOffer *NONNULL_PTR this_arg);
47418 * The quantity of items supported.
47420 MUST_USE_RES struct LDKQuantity Offer_supported_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
47423 * The public key used by the recipient to sign invoices.
47425 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47427 MUST_USE_RES struct LDKPublicKey Offer_signing_pubkey(const struct LDKOffer *NONNULL_PTR this_arg);
47430 * Returns the id of the offer.
47432 MUST_USE_RES struct LDKOfferId Offer_id(const struct LDKOffer *NONNULL_PTR this_arg);
47435 * Returns whether the given chain is supported by the offer.
47437 MUST_USE_RES bool Offer_supports_chain(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes chain);
47440 * Whether the offer has expired.
47442 MUST_USE_RES bool Offer_is_expired(const struct LDKOffer *NONNULL_PTR this_arg);
47445 * Whether the offer has expired given the duration since the Unix epoch.
47447 MUST_USE_RES bool Offer_is_expired_no_std(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t duration_since_epoch);
47450 * Returns whether the given quantity is valid for the offer.
47452 MUST_USE_RES bool Offer_is_valid_quantity(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t quantity);
47455 * Returns whether a quantity is expected in an [`InvoiceRequest`] for the offer.
47457 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
47459 MUST_USE_RES bool Offer_expects_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
47462 * Similar to [`Offer::request_invoice`] except it:
47463 * - derives the [`InvoiceRequest::payer_id`] such that a different key can be used for each
47465 * - sets [`InvoiceRequest::payer_metadata`] when [`InvoiceRequestBuilder::build`] is called
47466 * such that it can be used by [`Bolt12Invoice::verify`] to determine if the invoice was
47467 * requested using a base [`ExpandedKey`] from which the payer id was derived, and
47468 * - includes the [`PaymentId`] encrypted in [`InvoiceRequest::payer_metadata`] so that it can
47469 * be used when sending the payment for the requested invoice.
47471 * Useful to protect the sender's privacy.
47473 * [`InvoiceRequest::payer_id`]: crate::offers::invoice_request::InvoiceRequest::payer_id
47474 * [`InvoiceRequest::payer_metadata`]: crate::offers::invoice_request::InvoiceRequest::payer_metadata
47475 * [`Bolt12Invoice::verify`]: crate::offers::invoice::Bolt12Invoice::verify
47476 * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey
47478 MUST_USE_RES struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ Offer_request_invoice_deriving_payer_id(const struct LDKOffer *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKEntropySource entropy_source, struct LDKThirtyTwoBytes payment_id);
47481 * Similar to [`Offer::request_invoice_deriving_payer_id`] except uses `payer_id` for the
47482 * [`InvoiceRequest::payer_id`] instead of deriving a different key for each request.
47484 * Useful for recurring payments using the same `payer_id` with different invoices.
47486 * [`InvoiceRequest::payer_id`]: crate::offers::invoice_request::InvoiceRequest::payer_id
47488 MUST_USE_RES struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ Offer_request_invoice_deriving_metadata(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKPublicKey payer_id, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKEntropySource entropy_source, struct LDKThirtyTwoBytes payment_id);
47491 * Creates an [`InvoiceRequestBuilder`] for the offer with the given `metadata` and `payer_id`,
47492 * which will be reflected in the `Bolt12Invoice` response.
47494 * The `metadata` is useful for including information about the derivation of `payer_id` such
47495 * that invoice response handling can be stateless. Also serves as payer-provided entropy while
47496 * hashing in the signature calculation.
47498 * This should not leak any information such as by using a simple BIP-32 derivation path.
47499 * Otherwise, payments may be correlated.
47501 * Errors if the offer contains unknown required features.
47503 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
47505 MUST_USE_RES struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ Offer_request_invoice(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKCVec_u8Z metadata, struct LDKPublicKey payer_id);
47508 * Generates a non-cryptographic 64-bit hash of the Offer.
47510 uint64_t Offer_hash(const struct LDKOffer *NONNULL_PTR o);
47513 * Serialize the Offer object into a byte array which can be read by Offer_read
47515 struct LDKCVec_u8Z Offer_write(const struct LDKOffer *NONNULL_PTR obj);
47518 * Frees any resources used by the Amount
47520 void Amount_free(struct LDKAmount this_ptr);
47523 * Creates a copy of the Amount
47525 struct LDKAmount Amount_clone(const struct LDKAmount *NONNULL_PTR orig);
47528 * Utility method to constructs a new Bitcoin-variant Amount
47530 struct LDKAmount Amount_bitcoin(uint64_t amount_msats);
47533 * Utility method to constructs a new Currency-variant Amount
47535 struct LDKAmount Amount_currency(struct LDKThreeBytes iso4217_code, uint64_t amount);
47538 * Frees any resources used by the Quantity
47540 void Quantity_free(struct LDKQuantity this_ptr);
47543 * Creates a copy of the Quantity
47545 struct LDKQuantity Quantity_clone(const struct LDKQuantity *NONNULL_PTR orig);
47548 * Utility method to constructs a new Bounded-variant Quantity
47550 struct LDKQuantity Quantity_bounded(uint64_t a);
47553 * Utility method to constructs a new Unbounded-variant Quantity
47555 struct LDKQuantity Quantity_unbounded(void);
47558 * Utility method to constructs a new One-variant Quantity
47560 struct LDKQuantity Quantity_one(void);
47563 * Read a Offer object from a string
47565 struct LDKCResult_OfferBolt12ParseErrorZ Offer_from_str(struct LDKStr s);
47568 * Frees any resources used by the InvoiceWithExplicitSigningPubkeyBuilder, if is_owned is set and inner is non-NULL.
47570 void InvoiceWithExplicitSigningPubkeyBuilder_free(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_obj);
47573 * Frees any resources used by the InvoiceWithDerivedSigningPubkeyBuilder, if is_owned is set and inner is non-NULL.
47575 void InvoiceWithDerivedSigningPubkeyBuilder_free(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_obj);
47578 * Builds an unsigned [`Bolt12Invoice`] after checking for valid semantics. It can be signed by
47579 * [`UnsignedBolt12Invoice::sign`].
47581 MUST_USE_RES struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ InvoiceWithExplicitSigningPubkeyBuilder_build(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg);
47584 * Sets the [`Bolt12Invoice::relative_expiry`] as seconds since [`Bolt12Invoice::created_at`].
47585 * Any expiry that has already passed is valid and can be checked for using
47586 * [`Bolt12Invoice::is_expired`].
47588 * Successive calls to this method will override the previous setting.
47590 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, uint32_t relative_expiry_secs);
47593 * Adds a P2WSH address to [`Bolt12Invoice::fallbacks`].
47595 * Successive calls to this method will add another address. Caller is responsible for not
47596 * adding duplicate addresses and only calling if capable of receiving to P2WSH addresses.
47598 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, const uint8_t (*script_hash)[32]);
47601 * Adds a P2WPKH address to [`Bolt12Invoice::fallbacks`].
47603 * Successive calls to this method will add another address. Caller is responsible for not
47604 * adding duplicate addresses and only calling if capable of receiving to P2WPKH addresses.
47606 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wpkh(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, const uint8_t (*pubkey_hash)[20]);
47609 * Adds a P2TR address to [`Bolt12Invoice::fallbacks`].
47611 * Successive calls to this method will add another address. Caller is responsible for not
47612 * adding duplicate addresses and only calling if capable of receiving to P2TR addresses.
47614 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, struct LDKTweakedPublicKey output_key);
47617 * Sets [`Bolt12Invoice::invoice_features`] to indicate MPP may be used. Otherwise, MPP is
47620 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg);
47623 * Builds a signed [`Bolt12Invoice`] after checking for valid semantics.
47625 MUST_USE_RES struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg);
47628 * Sets the [`Bolt12Invoice::relative_expiry`] as seconds since [`Bolt12Invoice::created_at`].
47629 * Any expiry that has already passed is valid and can be checked for using
47630 * [`Bolt12Invoice::is_expired`].
47632 * Successive calls to this method will override the previous setting.
47634 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, uint32_t relative_expiry_secs);
47637 * Adds a P2WSH address to [`Bolt12Invoice::fallbacks`].
47639 * Successive calls to this method will add another address. Caller is responsible for not
47640 * adding duplicate addresses and only calling if capable of receiving to P2WSH addresses.
47642 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wsh(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, const uint8_t (*script_hash)[32]);
47645 * Adds a P2WPKH address to [`Bolt12Invoice::fallbacks`].
47647 * Successive calls to this method will add another address. Caller is responsible for not
47648 * adding duplicate addresses and only calling if capable of receiving to P2WPKH addresses.
47650 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wpkh(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, const uint8_t (*pubkey_hash)[20]);
47653 * Adds a P2TR address to [`Bolt12Invoice::fallbacks`].
47655 * Successive calls to this method will add another address. Caller is responsible for not
47656 * adding duplicate addresses and only calling if capable of receiving to P2TR addresses.
47658 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, struct LDKTweakedPublicKey output_key);
47661 * Sets [`Bolt12Invoice::invoice_features`] to indicate MPP may be used. Otherwise, MPP is
47664 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg);
47667 * Frees any resources used by the UnsignedBolt12Invoice, if is_owned is set and inner is non-NULL.
47669 void UnsignedBolt12Invoice_free(struct LDKUnsignedBolt12Invoice this_obj);
47672 * Creates a copy of the UnsignedBolt12Invoice
47674 struct LDKUnsignedBolt12Invoice UnsignedBolt12Invoice_clone(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR orig);
47677 * Calls the free function if one is set
47679 void SignBolt12InvoiceFn_free(struct LDKSignBolt12InvoiceFn this_ptr);
47682 * Returns the [`TaggedHash`] of the invoice to sign.
47684 MUST_USE_RES struct LDKTaggedHash UnsignedBolt12Invoice_tagged_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47687 * Frees any resources used by the Bolt12Invoice, if is_owned is set and inner is non-NULL.
47689 void Bolt12Invoice_free(struct LDKBolt12Invoice this_obj);
47692 * Creates a copy of the Bolt12Invoice
47694 struct LDKBolt12Invoice Bolt12Invoice_clone(const struct LDKBolt12Invoice *NONNULL_PTR orig);
47697 * The chains that may be used when paying a requested invoice.
47699 * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
47701 * [`Offer::chains`]: crate::offers::offer::Offer::chains
47703 MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ UnsignedBolt12Invoice_offer_chains(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47706 * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
47707 * invoice originated from an offer.
47709 * From [`InvoiceRequest::chain`] or [`Refund::chain`].
47711 * [`offer_chains`]: Self::offer_chains
47712 * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
47714 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_chain(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47717 * Opaque bytes set by the originating [`Offer`].
47719 * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
47720 * if the [`Offer`] did not set it.
47722 * [`Offer`]: crate::offers::offer::Offer
47723 * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
47725 MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedBolt12Invoice_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47728 * The minimum amount required for a successful payment of a single item.
47730 * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
47731 * the [`Offer`] did not set it.
47733 * [`Offer`]: crate::offers::offer::Offer
47734 * [`Offer::amount`]: crate::offers::offer::Offer::amount
47736 MUST_USE_RES struct LDKCOption_AmountZ UnsignedBolt12Invoice_amount(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47739 * Features pertaining to the originating [`Offer`].
47741 * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
47744 * [`Offer`]: crate::offers::offer::Offer
47745 * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
47747 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47749 MUST_USE_RES struct LDKOfferFeatures UnsignedBolt12Invoice_offer_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47752 * A complete description of the purpose of the originating offer or refund.
47754 * From [`Offer::description`] or [`Refund::description`].
47756 * [`Offer::description`]: crate::offers::offer::Offer::description
47758 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47760 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_description(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47763 * Duration since the Unix epoch when an invoice should no longer be requested.
47765 * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
47767 * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
47769 MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_absolute_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47772 * The issuer of the offer or refund.
47774 * From [`Offer::issuer`] or [`Refund::issuer`].
47776 * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
47778 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47780 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_issuer(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47783 * Paths to the recipient originating from publicly reachable nodes.
47785 * From [`Offer::paths`] or [`Refund::paths`].
47787 * [`Offer::paths`]: crate::offers::offer::Offer::paths
47789 MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedBolt12Invoice_message_paths(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47792 * The quantity of items supported.
47794 * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
47797 * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
47799 MUST_USE_RES struct LDKCOption_QuantityZ UnsignedBolt12Invoice_supported_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47802 * An unpredictable series of bytes from the payer.
47804 * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
47806 MUST_USE_RES struct LDKu8slice UnsignedBolt12Invoice_payer_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47809 * Features pertaining to requesting an invoice.
47811 * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
47813 MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedBolt12Invoice_invoice_request_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47816 * The quantity of items requested or refunded for.
47818 * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
47820 MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47823 * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
47824 * refund in case there are no [`message_paths`].
47826 * [`message_paths`]: Self::message_paths
47828 MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_payer_id(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47831 * A payer-provided note reflected back in the invoice.
47833 * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
47835 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47837 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_payer_note(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47840 * Duration since the Unix epoch when the invoice was created.
47842 MUST_USE_RES uint64_t UnsignedBolt12Invoice_created_at(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47845 * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
47846 * should no longer be paid.
47848 MUST_USE_RES uint64_t UnsignedBolt12Invoice_relative_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47851 * Whether the invoice has expired.
47853 MUST_USE_RES bool UnsignedBolt12Invoice_is_expired(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47856 * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
47858 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_payment_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47861 * The minimum amount required for a successful payment of the invoice.
47863 MUST_USE_RES uint64_t UnsignedBolt12Invoice_amount_msats(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47866 * Features pertaining to paying an invoice.
47868 MUST_USE_RES struct LDKBolt12InvoiceFeatures UnsignedBolt12Invoice_invoice_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47871 * The public key corresponding to the key used to sign the invoice.
47873 MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_signing_pubkey(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47876 * The chains that may be used when paying a requested invoice.
47878 * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
47880 * [`Offer::chains`]: crate::offers::offer::Offer::chains
47882 MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ Bolt12Invoice_offer_chains(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47885 * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
47886 * invoice originated from an offer.
47888 * From [`InvoiceRequest::chain`] or [`Refund::chain`].
47890 * [`offer_chains`]: Self::offer_chains
47891 * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
47893 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_chain(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47896 * Opaque bytes set by the originating [`Offer`].
47898 * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
47899 * if the [`Offer`] did not set it.
47901 * [`Offer`]: crate::offers::offer::Offer
47902 * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
47904 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt12Invoice_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47907 * The minimum amount required for a successful payment of a single item.
47909 * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
47910 * the [`Offer`] did not set it.
47912 * [`Offer`]: crate::offers::offer::Offer
47913 * [`Offer::amount`]: crate::offers::offer::Offer::amount
47915 MUST_USE_RES struct LDKCOption_AmountZ Bolt12Invoice_amount(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47918 * Features pertaining to the originating [`Offer`].
47920 * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
47923 * [`Offer`]: crate::offers::offer::Offer
47924 * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
47926 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47928 MUST_USE_RES struct LDKOfferFeatures Bolt12Invoice_offer_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47931 * A complete description of the purpose of the originating offer or refund.
47933 * From [`Offer::description`] or [`Refund::description`].
47935 * [`Offer::description`]: crate::offers::offer::Offer::description
47937 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47939 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_description(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47942 * Duration since the Unix epoch when an invoice should no longer be requested.
47944 * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
47946 * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
47948 MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_absolute_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47951 * The issuer of the offer or refund.
47953 * From [`Offer::issuer`] or [`Refund::issuer`].
47955 * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
47957 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47959 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_issuer(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47962 * Paths to the recipient originating from publicly reachable nodes.
47964 * From [`Offer::paths`] or [`Refund::paths`].
47966 * [`Offer::paths`]: crate::offers::offer::Offer::paths
47968 MUST_USE_RES struct LDKCVec_BlindedPathZ Bolt12Invoice_message_paths(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47971 * The quantity of items supported.
47973 * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
47976 * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
47978 MUST_USE_RES struct LDKCOption_QuantityZ Bolt12Invoice_supported_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47981 * An unpredictable series of bytes from the payer.
47983 * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
47985 MUST_USE_RES struct LDKu8slice Bolt12Invoice_payer_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47988 * Features pertaining to requesting an invoice.
47990 * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
47992 MUST_USE_RES struct LDKInvoiceRequestFeatures Bolt12Invoice_invoice_request_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47995 * The quantity of items requested or refunded for.
47997 * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
47999 MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48002 * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
48003 * refund in case there are no [`message_paths`].
48005 * [`message_paths`]: Self::message_paths
48007 MUST_USE_RES struct LDKPublicKey Bolt12Invoice_payer_id(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48010 * A payer-provided note reflected back in the invoice.
48012 * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
48014 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48016 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_payer_note(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48019 * Duration since the Unix epoch when the invoice was created.
48021 MUST_USE_RES uint64_t Bolt12Invoice_created_at(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48024 * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
48025 * should no longer be paid.
48027 MUST_USE_RES uint64_t Bolt12Invoice_relative_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48030 * Whether the invoice has expired.
48032 MUST_USE_RES bool Bolt12Invoice_is_expired(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48035 * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
48037 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_payment_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48040 * The minimum amount required for a successful payment of the invoice.
48042 MUST_USE_RES uint64_t Bolt12Invoice_amount_msats(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48045 * Features pertaining to paying an invoice.
48047 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12Invoice_invoice_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48050 * The public key corresponding to the key used to sign the invoice.
48052 MUST_USE_RES struct LDKPublicKey Bolt12Invoice_signing_pubkey(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48055 * Signature of the invoice verified using [`Bolt12Invoice::signing_pubkey`].
48057 MUST_USE_RES struct LDKSchnorrSignature Bolt12Invoice_signature(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48060 * Hash that was used for signing the invoice.
48062 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_signable_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
48065 * Verifies that the invoice was for a request or refund created using the given key. Returns
48066 * the associated [`PaymentId`] to use when sending the payment.
48068 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ Bolt12Invoice_verify(const struct LDKBolt12Invoice *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
48071 * Generates a non-cryptographic 64-bit hash of the Bolt12Invoice.
48073 uint64_t Bolt12Invoice_hash(const struct LDKBolt12Invoice *NONNULL_PTR o);
48076 * Serialize the UnsignedBolt12Invoice object into a byte array which can be read by UnsignedBolt12Invoice_read
48078 struct LDKCVec_u8Z UnsignedBolt12Invoice_write(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR obj);
48081 * Serialize the Bolt12Invoice object into a byte array which can be read by Bolt12Invoice_read
48083 struct LDKCVec_u8Z Bolt12Invoice_write(const struct LDKBolt12Invoice *NONNULL_PTR obj);
48086 * Frees any resources used by the BlindedPayInfo, if is_owned is set and inner is non-NULL.
48088 void BlindedPayInfo_free(struct LDKBlindedPayInfo this_obj);
48091 * Base fee charged (in millisatoshi) for the entire blinded path.
48093 uint32_t BlindedPayInfo_get_fee_base_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
48096 * Base fee charged (in millisatoshi) for the entire blinded path.
48098 void BlindedPayInfo_set_fee_base_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
48101 * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
48102 * (i.e., 10,000 is 1%).
48104 uint32_t BlindedPayInfo_get_fee_proportional_millionths(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
48107 * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
48108 * (i.e., 10,000 is 1%).
48110 void BlindedPayInfo_set_fee_proportional_millionths(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
48113 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
48116 uint16_t BlindedPayInfo_get_cltv_expiry_delta(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
48119 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
48122 void BlindedPayInfo_set_cltv_expiry_delta(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint16_t val);
48125 * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
48126 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
48127 * seen by the recipient.
48129 uint64_t BlindedPayInfo_get_htlc_minimum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
48132 * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
48133 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
48134 * seen by the recipient.
48136 void BlindedPayInfo_set_htlc_minimum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
48139 * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
48140 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
48141 * seen by the recipient.
48143 uint64_t BlindedPayInfo_get_htlc_maximum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
48146 * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
48147 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
48148 * seen by the recipient.
48150 void BlindedPayInfo_set_htlc_maximum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
48153 * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
48156 struct LDKBlindedHopFeatures BlindedPayInfo_get_features(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
48159 * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
48162 void BlindedPayInfo_set_features(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
48165 * Constructs a new BlindedPayInfo given each field
48167 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);
48170 * Creates a copy of the BlindedPayInfo
48172 struct LDKBlindedPayInfo BlindedPayInfo_clone(const struct LDKBlindedPayInfo *NONNULL_PTR orig);
48175 * Generates a non-cryptographic 64-bit hash of the BlindedPayInfo.
48177 uint64_t BlindedPayInfo_hash(const struct LDKBlindedPayInfo *NONNULL_PTR o);
48180 * Checks if two BlindedPayInfos contain equal inner contents.
48181 * This ignores pointers and is_owned flags and looks at the values in fields.
48182 * Two objects with NULL inner values will be considered "equal" here.
48184 bool BlindedPayInfo_eq(const struct LDKBlindedPayInfo *NONNULL_PTR a, const struct LDKBlindedPayInfo *NONNULL_PTR b);
48187 * Serialize the BlindedPayInfo object into a byte array which can be read by BlindedPayInfo_read
48189 struct LDKCVec_u8Z BlindedPayInfo_write(const struct LDKBlindedPayInfo *NONNULL_PTR obj);
48192 * Read a BlindedPayInfo from a byte array, created by BlindedPayInfo_write
48194 struct LDKCResult_BlindedPayInfoDecodeErrorZ BlindedPayInfo_read(struct LDKu8slice ser);
48197 * Frees any resources used by the InvoiceError, if is_owned is set and inner is non-NULL.
48199 void InvoiceError_free(struct LDKInvoiceError this_obj);
48202 * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
48204 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
48205 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
48207 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48209 struct LDKErroneousField InvoiceError_get_erroneous_field(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
48212 * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
48214 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
48215 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
48217 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
48219 void InvoiceError_set_erroneous_field(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKErroneousField val);
48222 * An explanation of the error.
48224 struct LDKUntrustedString InvoiceError_get_message(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
48227 * An explanation of the error.
48229 void InvoiceError_set_message(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKUntrustedString val);
48232 * Constructs a new InvoiceError given each field
48234 * Note that erroneous_field_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
48236 MUST_USE_RES struct LDKInvoiceError InvoiceError_new(struct LDKErroneousField erroneous_field_arg, struct LDKUntrustedString message_arg);
48239 * Creates a copy of the InvoiceError
48241 struct LDKInvoiceError InvoiceError_clone(const struct LDKInvoiceError *NONNULL_PTR orig);
48244 * Frees any resources used by the ErroneousField, if is_owned is set and inner is non-NULL.
48246 void ErroneousField_free(struct LDKErroneousField this_obj);
48249 * The type number of the TLV field containing the error.
48251 uint64_t ErroneousField_get_tlv_fieldnum(const struct LDKErroneousField *NONNULL_PTR this_ptr);
48254 * The type number of the TLV field containing the error.
48256 void ErroneousField_set_tlv_fieldnum(struct LDKErroneousField *NONNULL_PTR this_ptr, uint64_t val);
48259 * A value to use for the TLV field to avoid the error.
48261 * Returns a copy of the field.
48263 struct LDKCOption_CVec_u8ZZ ErroneousField_get_suggested_value(const struct LDKErroneousField *NONNULL_PTR this_ptr);
48266 * A value to use for the TLV field to avoid the error.
48268 void ErroneousField_set_suggested_value(struct LDKErroneousField *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
48271 * Constructs a new ErroneousField given each field
48273 MUST_USE_RES struct LDKErroneousField ErroneousField_new(uint64_t tlv_fieldnum_arg, struct LDKCOption_CVec_u8ZZ suggested_value_arg);
48276 * Creates a copy of the ErroneousField
48278 struct LDKErroneousField ErroneousField_clone(const struct LDKErroneousField *NONNULL_PTR orig);
48281 * Creates an [`InvoiceError`] with the given message.
48283 MUST_USE_RES struct LDKInvoiceError InvoiceError_from_string(struct LDKStr s);
48286 * Serialize the InvoiceError object into a byte array which can be read by InvoiceError_read
48288 struct LDKCVec_u8Z InvoiceError_write(const struct LDKInvoiceError *NONNULL_PTR obj);
48291 * Read a InvoiceError from a byte array, created by InvoiceError_write
48293 struct LDKCResult_InvoiceErrorDecodeErrorZ InvoiceError_read(struct LDKu8slice ser);
48296 * Frees any resources used by the InvoiceRequestWithExplicitPayerIdBuilder, if is_owned is set and inner is non-NULL.
48298 void InvoiceRequestWithExplicitPayerIdBuilder_free(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_obj);
48301 * Frees any resources used by the InvoiceRequestWithDerivedPayerIdBuilder, if is_owned is set and inner is non-NULL.
48303 void InvoiceRequestWithDerivedPayerIdBuilder_free(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_obj);
48306 * Builds an unsigned [`InvoiceRequest`] after checking for valid semantics. It can be signed
48307 * by [`UnsignedInvoiceRequest::sign`].
48309 MUST_USE_RES struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_build(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg);
48312 * Sets the [`InvoiceRequest::chain`] of the given [`Network`] for paying an invoice. If not
48313 * called, [`Network::Bitcoin`] is assumed. Errors if the chain for `network` is not supported
48316 * Successive calls to this method will override the previous setting.
48318 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_chain(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, enum LDKNetwork network);
48321 * Sets the [`InvoiceRequest::amount_msats`] for paying an invoice. Errors if `amount_msats` is
48322 * not at least the expected invoice amount (i.e., [`Offer::amount`] times [`quantity`]).
48324 * Successive calls to this method will override the previous setting.
48326 * [`quantity`]: Self::quantity
48328 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, uint64_t amount_msats);
48331 * Sets [`InvoiceRequest::quantity`] of items. If not set, `1` is assumed. Errors if `quantity`
48332 * does not conform to [`Offer::is_valid_quantity`].
48334 * Successive calls to this method will override the previous setting.
48336 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_quantity(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, uint64_t quantity);
48339 * Sets the [`InvoiceRequest::payer_note`].
48341 * Successive calls to this method will override the previous setting.
48343 MUST_USE_RES void InvoiceRequestWithExplicitPayerIdBuilder_payer_note(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, struct LDKStr payer_note);
48346 * Builds a signed [`InvoiceRequest`] after checking for valid semantics.
48348 MUST_USE_RES struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg);
48351 * Sets the [`InvoiceRequest::chain`] of the given [`Network`] for paying an invoice. If not
48352 * called, [`Network::Bitcoin`] is assumed. Errors if the chain for `network` is not supported
48355 * Successive calls to this method will override the previous setting.
48357 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_chain(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, enum LDKNetwork network);
48360 * Sets the [`InvoiceRequest::amount_msats`] for paying an invoice. Errors if `amount_msats` is
48361 * not at least the expected invoice amount (i.e., [`Offer::amount`] times [`quantity`]).
48363 * Successive calls to this method will override the previous setting.
48365 * [`quantity`]: Self::quantity
48367 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_amount_msats(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, uint64_t amount_msats);
48370 * Sets [`InvoiceRequest::quantity`] of items. If not set, `1` is assumed. Errors if `quantity`
48371 * does not conform to [`Offer::is_valid_quantity`].
48373 * Successive calls to this method will override the previous setting.
48375 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_quantity(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, uint64_t quantity);
48378 * Sets the [`InvoiceRequest::payer_note`].
48380 * Successive calls to this method will override the previous setting.
48382 MUST_USE_RES void InvoiceRequestWithDerivedPayerIdBuilder_payer_note(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, struct LDKStr payer_note);
48385 * Frees any resources used by the UnsignedInvoiceRequest, if is_owned is set and inner is non-NULL.
48387 void UnsignedInvoiceRequest_free(struct LDKUnsignedInvoiceRequest this_obj);
48390 * Creates a copy of the UnsignedInvoiceRequest
48392 struct LDKUnsignedInvoiceRequest UnsignedInvoiceRequest_clone(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR orig);
48395 * Calls the free function if one is set
48397 void SignInvoiceRequestFn_free(struct LDKSignInvoiceRequestFn this_ptr);
48400 * Returns the [`TaggedHash`] of the invoice to sign.
48402 MUST_USE_RES struct LDKTaggedHash UnsignedInvoiceRequest_tagged_hash(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48405 * Frees any resources used by the InvoiceRequest, if is_owned is set and inner is non-NULL.
48407 void InvoiceRequest_free(struct LDKInvoiceRequest this_obj);
48410 * Creates a copy of the InvoiceRequest
48412 struct LDKInvoiceRequest InvoiceRequest_clone(const struct LDKInvoiceRequest *NONNULL_PTR orig);
48415 * Frees any resources used by the VerifiedInvoiceRequest, if is_owned is set and inner is non-NULL.
48417 void VerifiedInvoiceRequest_free(struct LDKVerifiedInvoiceRequest this_obj);
48420 * The identifier of the [`Offer`] for which the [`InvoiceRequest`] was made.
48422 struct LDKOfferId VerifiedInvoiceRequest_get_offer_id(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr);
48425 * The identifier of the [`Offer`] for which the [`InvoiceRequest`] was made.
48427 void VerifiedInvoiceRequest_set_offer_id(struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr, struct LDKOfferId val);
48430 * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
48432 * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
48433 * [`respond_with`].
48435 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
48436 * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
48437 * [`respond_with`]: Self::respond_with
48439 struct LDKCOption_SecretKeyZ VerifiedInvoiceRequest_get_keys(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr);
48442 * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
48444 * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
48445 * [`respond_with`].
48447 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
48448 * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
48449 * [`respond_with`]: Self::respond_with
48451 void VerifiedInvoiceRequest_set_keys(struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr, struct LDKCOption_SecretKeyZ val);
48454 * Creates a copy of the VerifiedInvoiceRequest
48456 struct LDKVerifiedInvoiceRequest VerifiedInvoiceRequest_clone(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR orig);
48459 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
48460 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
48461 * for the selected chain.
48463 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ UnsignedInvoiceRequest_chains(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48466 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
48467 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
48469 MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedInvoiceRequest_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48472 * The minimum amount required for a successful payment of a single item.
48474 MUST_USE_RES struct LDKCOption_AmountZ UnsignedInvoiceRequest_amount(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48477 * A complete description of the purpose of the payment. Intended to be displayed to the user
48478 * but with the caveat that it has not been verified in any way.
48480 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48482 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_description(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48485 * Features pertaining to the offer.
48487 MUST_USE_RES struct LDKOfferFeatures UnsignedInvoiceRequest_offer_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48490 * Duration since the Unix epoch when an invoice should no longer be requested.
48492 * If `None`, the offer does not expire.
48494 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_absolute_expiry(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48497 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
48498 * displayed to the user but with the caveat that it has not been verified in any way.
48500 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48502 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_issuer(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48505 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
48506 * recipient privacy by obfuscating its node id.
48508 MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedInvoiceRequest_paths(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48511 * The quantity of items supported.
48513 MUST_USE_RES struct LDKQuantity UnsignedInvoiceRequest_supported_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48516 * The public key used by the recipient to sign invoices.
48518 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48520 MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_signing_pubkey(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48523 * An unpredictable series of bytes, typically containing information about the derivation of
48526 * [`payer_id`]: Self::payer_id
48528 MUST_USE_RES struct LDKu8slice UnsignedInvoiceRequest_payer_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48531 * A chain from [`Offer::chains`] that the offer is valid for.
48533 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedInvoiceRequest_chain(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48536 * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
48537 * must be greater than or equal to [`Offer::amount`], converted if necessary.
48539 * [`chain`]: Self::chain
48541 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_amount_msats(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48544 * Features pertaining to requesting an invoice.
48546 MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedInvoiceRequest_invoice_request_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48549 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
48551 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48554 * A possibly transient pubkey used to sign the invoice request.
48556 MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_payer_id(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48559 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
48562 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48564 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_payer_note(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48567 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
48568 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
48569 * for the selected chain.
48571 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ InvoiceRequest_chains(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48574 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
48575 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
48577 MUST_USE_RES struct LDKCOption_CVec_u8ZZ InvoiceRequest_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48580 * The minimum amount required for a successful payment of a single item.
48582 MUST_USE_RES struct LDKCOption_AmountZ InvoiceRequest_amount(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48585 * A complete description of the purpose of the payment. Intended to be displayed to the user
48586 * but with the caveat that it has not been verified in any way.
48588 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48590 MUST_USE_RES struct LDKPrintableString InvoiceRequest_description(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48593 * Features pertaining to the offer.
48595 MUST_USE_RES struct LDKOfferFeatures InvoiceRequest_offer_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48598 * Duration since the Unix epoch when an invoice should no longer be requested.
48600 * If `None`, the offer does not expire.
48602 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_absolute_expiry(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48605 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
48606 * displayed to the user but with the caveat that it has not been verified in any way.
48608 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48610 MUST_USE_RES struct LDKPrintableString InvoiceRequest_issuer(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48613 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
48614 * recipient privacy by obfuscating its node id.
48616 MUST_USE_RES struct LDKCVec_BlindedPathZ InvoiceRequest_paths(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48619 * The quantity of items supported.
48621 MUST_USE_RES struct LDKQuantity InvoiceRequest_supported_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48624 * The public key used by the recipient to sign invoices.
48626 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48628 MUST_USE_RES struct LDKPublicKey InvoiceRequest_signing_pubkey(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48631 * An unpredictable series of bytes, typically containing information about the derivation of
48634 * [`payer_id`]: Self::payer_id
48636 MUST_USE_RES struct LDKu8slice InvoiceRequest_payer_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48639 * A chain from [`Offer::chains`] that the offer is valid for.
48641 MUST_USE_RES struct LDKThirtyTwoBytes InvoiceRequest_chain(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48644 * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
48645 * must be greater than or equal to [`Offer::amount`], converted if necessary.
48647 * [`chain`]: Self::chain
48649 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_amount_msats(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48652 * Features pertaining to requesting an invoice.
48654 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequest_invoice_request_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48657 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
48659 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48662 * A possibly transient pubkey used to sign the invoice request.
48664 MUST_USE_RES struct LDKPublicKey InvoiceRequest_payer_id(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48667 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
48670 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48672 MUST_USE_RES struct LDKPrintableString InvoiceRequest_payer_note(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48675 * Creates an [`InvoiceBuilder`] for the request with the given required fields and using the
48676 * [`Duration`] since [`std::time::SystemTime::UNIX_EPOCH`] as the creation time.
48678 * See [`InvoiceRequest::respond_with_no_std`] for further details where the aforementioned
48679 * creation time is used for the `created_at` parameter.
48681 * [`Duration`]: core::time::Duration
48683 MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ InvoiceRequest_respond_with(const struct LDKInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash);
48686 * Creates an [`InvoiceBuilder`] for the request with the given required fields.
48688 * Unless [`InvoiceBuilder::relative_expiry`] is set, the invoice will expire two hours after
48689 * `created_at`, which is used to set [`Bolt12Invoice::created_at`]. Useful for `no-std` builds
48690 * where [`std::time::SystemTime`] is not available.
48692 * The caller is expected to remember the preimage of `payment_hash` in order to claim a payment
48695 * The `payment_paths` parameter is useful for maintaining the payment recipient's privacy. It
48696 * must contain one or more elements ordered from most-preferred to least-preferred, if there's
48697 * a preference. Note, however, that any privacy is lost if a public node id was used for
48698 * [`Offer::signing_pubkey`].
48700 * Errors if the request contains unknown required features.
48704 * If the originating [`Offer`] was created using [`OfferBuilder::deriving_signing_pubkey`],
48705 * then use [`InvoiceRequest::verify`] and [`VerifiedInvoiceRequest`] methods instead.
48707 * [`Bolt12Invoice::created_at`]: crate::offers::invoice::Bolt12Invoice::created_at
48708 * [`OfferBuilder::deriving_signing_pubkey`]: crate::offers::offer::OfferBuilder::deriving_signing_pubkey
48710 MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ InvoiceRequest_respond_with_no_std(const struct LDKInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at);
48713 * Verifies that the request was for an offer created using the given key. Returns the verified
48714 * request which contains the derived keys needed to sign a [`Bolt12Invoice`] for the request
48715 * if they could be extracted from the metadata.
48717 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
48719 MUST_USE_RES struct LDKCResult_VerifiedInvoiceRequestNoneZ InvoiceRequest_verify(struct LDKInvoiceRequest this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
48722 * Signature of the invoice request using [`payer_id`].
48724 * [`payer_id`]: Self::payer_id
48726 MUST_USE_RES struct LDKSchnorrSignature InvoiceRequest_signature(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48729 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
48730 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
48731 * for the selected chain.
48733 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ VerifiedInvoiceRequest_chains(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48736 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
48737 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
48739 MUST_USE_RES struct LDKCOption_CVec_u8ZZ VerifiedInvoiceRequest_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48742 * The minimum amount required for a successful payment of a single item.
48744 MUST_USE_RES struct LDKCOption_AmountZ VerifiedInvoiceRequest_amount(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48747 * A complete description of the purpose of the payment. Intended to be displayed to the user
48748 * but with the caveat that it has not been verified in any way.
48750 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48752 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_description(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48755 * Features pertaining to the offer.
48757 MUST_USE_RES struct LDKOfferFeatures VerifiedInvoiceRequest_offer_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48760 * Duration since the Unix epoch when an invoice should no longer be requested.
48762 * If `None`, the offer does not expire.
48764 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_absolute_expiry(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48767 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
48768 * displayed to the user but with the caveat that it has not been verified in any way.
48770 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48772 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_issuer(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48775 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
48776 * recipient privacy by obfuscating its node id.
48778 MUST_USE_RES struct LDKCVec_BlindedPathZ VerifiedInvoiceRequest_paths(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48781 * The quantity of items supported.
48783 MUST_USE_RES struct LDKQuantity VerifiedInvoiceRequest_supported_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48786 * The public key used by the recipient to sign invoices.
48788 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48790 MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_signing_pubkey(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48793 * An unpredictable series of bytes, typically containing information about the derivation of
48796 * [`payer_id`]: Self::payer_id
48798 MUST_USE_RES struct LDKu8slice VerifiedInvoiceRequest_payer_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48801 * A chain from [`Offer::chains`] that the offer is valid for.
48803 MUST_USE_RES struct LDKThirtyTwoBytes VerifiedInvoiceRequest_chain(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48806 * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
48807 * must be greater than or equal to [`Offer::amount`], converted if necessary.
48809 * [`chain`]: Self::chain
48811 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_amount_msats(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48814 * Features pertaining to requesting an invoice.
48816 MUST_USE_RES struct LDKInvoiceRequestFeatures VerifiedInvoiceRequest_invoice_request_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48819 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
48821 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48824 * A possibly transient pubkey used to sign the invoice request.
48826 MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_payer_id(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48829 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
48832 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48834 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_payer_note(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48837 * Creates an [`InvoiceBuilder`] for the request with the given required fields and using the
48838 * [`Duration`] since [`std::time::SystemTime::UNIX_EPOCH`] as the creation time.
48840 * See [`InvoiceRequest::respond_with_no_std`] for further details where the aforementioned
48841 * creation time is used for the `created_at` parameter.
48843 * [`Duration`]: core::time::Duration
48845 MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_with(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash);
48848 * Creates an [`InvoiceBuilder`] for the request with the given required fields.
48850 * Unless [`InvoiceBuilder::relative_expiry`] is set, the invoice will expire two hours after
48851 * `created_at`, which is used to set [`Bolt12Invoice::created_at`]. Useful for `no-std` builds
48852 * where [`std::time::SystemTime`] is not available.
48854 * The caller is expected to remember the preimage of `payment_hash` in order to claim a payment
48857 * The `payment_paths` parameter is useful for maintaining the payment recipient's privacy. It
48858 * must contain one or more elements ordered from most-preferred to least-preferred, if there's
48859 * a preference. Note, however, that any privacy is lost if a public node id was used for
48860 * [`Offer::signing_pubkey`].
48862 * Errors if the request contains unknown required features.
48866 * If the originating [`Offer`] was created using [`OfferBuilder::deriving_signing_pubkey`],
48867 * then use [`InvoiceRequest::verify`] and [`VerifiedInvoiceRequest`] methods instead.
48869 * [`Bolt12Invoice::created_at`]: crate::offers::invoice::Bolt12Invoice::created_at
48870 * [`OfferBuilder::deriving_signing_pubkey`]: crate::offers::offer::OfferBuilder::deriving_signing_pubkey
48872 MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_with_no_std(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at);
48875 * Creates an [`InvoiceBuilder`] for the request using the given required fields and that uses
48876 * derived signing keys from the originating [`Offer`] to sign the [`Bolt12Invoice`]. Must use
48877 * the same [`ExpandedKey`] as the one used to create the offer.
48879 * See [`InvoiceRequest::respond_with`] for further details.
48881 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
48883 MUST_USE_RES struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_using_derived_keys(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash);
48886 * Creates an [`InvoiceBuilder`] for the request using the given required fields and that uses
48887 * derived signing keys from the originating [`Offer`] to sign the [`Bolt12Invoice`]. Must use
48888 * the same [`ExpandedKey`] as the one used to create the offer.
48890 * See [`InvoiceRequest::respond_with_no_std`] for further details.
48892 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
48894 MUST_USE_RES struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_using_derived_keys_no_std(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at);
48897 * Serialize the UnsignedInvoiceRequest object into a byte array which can be read by UnsignedInvoiceRequest_read
48899 struct LDKCVec_u8Z UnsignedInvoiceRequest_write(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR obj);
48902 * Serialize the InvoiceRequest object into a byte array which can be read by InvoiceRequest_read
48904 struct LDKCVec_u8Z InvoiceRequest_write(const struct LDKInvoiceRequest *NONNULL_PTR obj);
48907 * Frees any resources used by the InvoiceRequestFields, if is_owned is set and inner is non-NULL.
48909 void InvoiceRequestFields_free(struct LDKInvoiceRequestFields this_obj);
48912 * A possibly transient pubkey used to sign the invoice request.
48914 struct LDKPublicKey InvoiceRequestFields_get_payer_id(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr);
48917 * A possibly transient pubkey used to sign the invoice request.
48919 void InvoiceRequestFields_set_payer_id(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
48922 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
48924 struct LDKCOption_u64Z InvoiceRequestFields_get_quantity(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr);
48927 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
48929 void InvoiceRequestFields_set_quantity(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
48932 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
48933 * response. Truncated to [`PAYER_NOTE_LIMIT`] characters.
48935 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48937 struct LDKUntrustedString InvoiceRequestFields_get_payer_note_truncated(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr);
48940 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
48941 * response. Truncated to [`PAYER_NOTE_LIMIT`] characters.
48943 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
48945 void InvoiceRequestFields_set_payer_note_truncated(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKUntrustedString val);
48948 * Constructs a new InvoiceRequestFields given each field
48950 * Note that payer_note_truncated_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
48952 MUST_USE_RES struct LDKInvoiceRequestFields InvoiceRequestFields_new(struct LDKPublicKey payer_id_arg, struct LDKCOption_u64Z quantity_arg, struct LDKUntrustedString payer_note_truncated_arg);
48955 * Creates a copy of the InvoiceRequestFields
48957 struct LDKInvoiceRequestFields InvoiceRequestFields_clone(const struct LDKInvoiceRequestFields *NONNULL_PTR orig);
48960 * Checks if two InvoiceRequestFieldss contain equal inner contents.
48961 * This ignores pointers and is_owned flags and looks at the values in fields.
48962 * Two objects with NULL inner values will be considered "equal" here.
48964 bool InvoiceRequestFields_eq(const struct LDKInvoiceRequestFields *NONNULL_PTR a, const struct LDKInvoiceRequestFields *NONNULL_PTR b);
48967 * Serialize the InvoiceRequestFields object into a byte array which can be read by InvoiceRequestFields_read
48969 struct LDKCVec_u8Z InvoiceRequestFields_write(const struct LDKInvoiceRequestFields *NONNULL_PTR obj);
48972 * Read a InvoiceRequestFields from a byte array, created by InvoiceRequestFields_write
48974 struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ InvoiceRequestFields_read(struct LDKu8slice ser);
48977 * Frees any resources used by the TaggedHash, if is_owned is set and inner is non-NULL.
48979 void TaggedHash_free(struct LDKTaggedHash this_obj);
48982 * Creates a copy of the TaggedHash
48984 struct LDKTaggedHash TaggedHash_clone(const struct LDKTaggedHash *NONNULL_PTR orig);
48987 * Returns the digest to sign.
48989 MUST_USE_RES const uint8_t (*TaggedHash_as_digest(const struct LDKTaggedHash *NONNULL_PTR this_arg))[32];
48992 * Returns the tag used in the tagged hash.
48994 MUST_USE_RES struct LDKStr TaggedHash_tag(const struct LDKTaggedHash *NONNULL_PTR this_arg);
48997 * Returns the merkle root used in the tagged hash.
48999 MUST_USE_RES struct LDKThirtyTwoBytes TaggedHash_merkle_root(const struct LDKTaggedHash *NONNULL_PTR this_arg);
49002 * Frees any resources used by the SignError
49004 void SignError_free(struct LDKSignError this_ptr);
49007 * Creates a copy of the SignError
49009 struct LDKSignError SignError_clone(const struct LDKSignError *NONNULL_PTR orig);
49012 * Utility method to constructs a new Signing-variant SignError
49014 struct LDKSignError SignError_signing(void);
49017 * Utility method to constructs a new Verification-variant SignError
49019 struct LDKSignError SignError_verification(enum LDKSecp256k1Error a);
49022 * Frees any resources used by the Bolt12ParseError, if is_owned is set and inner is non-NULL.
49024 void Bolt12ParseError_free(struct LDKBolt12ParseError this_obj);
49027 * Creates a copy of the Bolt12ParseError
49029 struct LDKBolt12ParseError Bolt12ParseError_clone(const struct LDKBolt12ParseError *NONNULL_PTR orig);
49032 * Creates a copy of the Bolt12SemanticError
49034 enum LDKBolt12SemanticError Bolt12SemanticError_clone(const enum LDKBolt12SemanticError *NONNULL_PTR orig);
49037 * Utility method to constructs a new AlreadyExpired-variant Bolt12SemanticError
49039 enum LDKBolt12SemanticError Bolt12SemanticError_already_expired(void);
49042 * Utility method to constructs a new UnsupportedChain-variant Bolt12SemanticError
49044 enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_chain(void);
49047 * Utility method to constructs a new UnexpectedChain-variant Bolt12SemanticError
49049 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_chain(void);
49052 * Utility method to constructs a new MissingAmount-variant Bolt12SemanticError
49054 enum LDKBolt12SemanticError Bolt12SemanticError_missing_amount(void);
49057 * Utility method to constructs a new InvalidAmount-variant Bolt12SemanticError
49059 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_amount(void);
49062 * Utility method to constructs a new InsufficientAmount-variant Bolt12SemanticError
49064 enum LDKBolt12SemanticError Bolt12SemanticError_insufficient_amount(void);
49067 * Utility method to constructs a new UnexpectedAmount-variant Bolt12SemanticError
49069 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_amount(void);
49072 * Utility method to constructs a new UnsupportedCurrency-variant Bolt12SemanticError
49074 enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_currency(void);
49077 * Utility method to constructs a new UnknownRequiredFeatures-variant Bolt12SemanticError
49079 enum LDKBolt12SemanticError Bolt12SemanticError_unknown_required_features(void);
49082 * Utility method to constructs a new UnexpectedFeatures-variant Bolt12SemanticError
49084 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_features(void);
49087 * Utility method to constructs a new MissingDescription-variant Bolt12SemanticError
49089 enum LDKBolt12SemanticError Bolt12SemanticError_missing_description(void);
49092 * Utility method to constructs a new MissingSigningPubkey-variant Bolt12SemanticError
49094 enum LDKBolt12SemanticError Bolt12SemanticError_missing_signing_pubkey(void);
49097 * Utility method to constructs a new InvalidSigningPubkey-variant Bolt12SemanticError
49099 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_signing_pubkey(void);
49102 * Utility method to constructs a new UnexpectedSigningPubkey-variant Bolt12SemanticError
49104 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_signing_pubkey(void);
49107 * Utility method to constructs a new MissingQuantity-variant Bolt12SemanticError
49109 enum LDKBolt12SemanticError Bolt12SemanticError_missing_quantity(void);
49112 * Utility method to constructs a new InvalidQuantity-variant Bolt12SemanticError
49114 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_quantity(void);
49117 * Utility method to constructs a new UnexpectedQuantity-variant Bolt12SemanticError
49119 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_quantity(void);
49122 * Utility method to constructs a new InvalidMetadata-variant Bolt12SemanticError
49124 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_metadata(void);
49127 * Utility method to constructs a new UnexpectedMetadata-variant Bolt12SemanticError
49129 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_metadata(void);
49132 * Utility method to constructs a new MissingPayerMetadata-variant Bolt12SemanticError
49134 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_metadata(void);
49137 * Utility method to constructs a new MissingPayerId-variant Bolt12SemanticError
49139 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_id(void);
49142 * Utility method to constructs a new DuplicatePaymentId-variant Bolt12SemanticError
49144 enum LDKBolt12SemanticError Bolt12SemanticError_duplicate_payment_id(void);
49147 * Utility method to constructs a new MissingPaths-variant Bolt12SemanticError
49149 enum LDKBolt12SemanticError Bolt12SemanticError_missing_paths(void);
49152 * Utility method to constructs a new UnexpectedPaths-variant Bolt12SemanticError
49154 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_paths(void);
49157 * Utility method to constructs a new InvalidPayInfo-variant Bolt12SemanticError
49159 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_pay_info(void);
49162 * Utility method to constructs a new MissingCreationTime-variant Bolt12SemanticError
49164 enum LDKBolt12SemanticError Bolt12SemanticError_missing_creation_time(void);
49167 * Utility method to constructs a new MissingPaymentHash-variant Bolt12SemanticError
49169 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payment_hash(void);
49172 * Utility method to constructs a new MissingSignature-variant Bolt12SemanticError
49174 enum LDKBolt12SemanticError Bolt12SemanticError_missing_signature(void);
49177 * Frees any resources used by the RefundMaybeWithDerivedMetadataBuilder, if is_owned is set and inner is non-NULL.
49179 void RefundMaybeWithDerivedMetadataBuilder_free(struct LDKRefundMaybeWithDerivedMetadataBuilder this_obj);
49182 * Creates a copy of the RefundMaybeWithDerivedMetadataBuilder
49184 struct LDKRefundMaybeWithDerivedMetadataBuilder RefundMaybeWithDerivedMetadataBuilder_clone(const struct LDKRefundMaybeWithDerivedMetadataBuilder *NONNULL_PTR orig);
49187 * Creates a new builder for a refund using the [`Refund::payer_id`] for the public node id to
49188 * send to if no [`Refund::paths`] are set. Otherwise, it may be a transient pubkey.
49190 * Additionally, sets the required (empty) [`Refund::description`], [`Refund::payer_metadata`],
49191 * and [`Refund::amount_msats`].
49195 * If constructing a [`Refund`] for use with a [`ChannelManager`], use
49196 * [`ChannelManager::create_refund_builder`] instead of [`RefundBuilder::new`].
49198 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
49199 * [`ChannelManager::create_refund_builder`]: crate::ln::channelmanager::ChannelManager::create_refund_builder
49201 MUST_USE_RES struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_new(struct LDKCVec_u8Z metadata, struct LDKPublicKey payer_id, uint64_t amount_msats);
49204 * Similar to [`RefundBuilder::new`] except, if [`RefundBuilder::path`] is called, the payer id
49205 * is derived from the given [`ExpandedKey`] and nonce. This provides sender privacy by using a
49206 * different payer id for each refund, assuming a different nonce is used. Otherwise, the
49207 * provided `node_id` is used for the payer id.
49209 * Also, sets the metadata when [`RefundBuilder::build`] is called such that it can be used to
49210 * verify that an [`InvoiceRequest`] was produced for the refund given an [`ExpandedKey`].
49212 * The `payment_id` is encrypted in the metadata and should be unique. This ensures that only
49213 * one invoice will be paid for the refund and that payments can be uniquely identified.
49215 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
49216 * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey
49218 MUST_USE_RES struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(struct LDKPublicKey node_id, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKEntropySource entropy_source, uint64_t amount_msats, struct LDKThirtyTwoBytes payment_id);
49221 * Sets the [`Refund::description`].
49223 * Successive calls to this method will override the previous setting.
49225 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_description(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr description);
49228 * Sets the [`Refund::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has
49229 * already passed is valid and can be checked for using [`Refund::is_expired`].
49231 * Successive calls to this method will override the previous setting.
49233 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, uint64_t absolute_expiry);
49236 * Sets the [`Refund::issuer`].
49238 * Successive calls to this method will override the previous setting.
49240 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_issuer(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr issuer);
49243 * Adds a blinded path to [`Refund::paths`]. Must include at least one path if only connected
49244 * by private channels or if [`Refund::payer_id`] is not a public node id.
49246 * Successive calls to this method will add another blinded path. Caller is responsible for not
49247 * adding duplicate paths.
49249 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_path(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKBlindedPath path);
49252 * Sets the [`Refund::chain`] of the given [`Network`] for paying an invoice. If not
49253 * called, [`Network::Bitcoin`] is assumed.
49255 * Successive calls to this method will override the previous setting.
49257 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_chain(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, enum LDKNetwork network);
49260 * Sets [`Refund::quantity`] of items. This is purely for informational purposes. It is useful
49261 * when the refund pertains to a [`Bolt12Invoice`] that paid for more than one item from an
49262 * [`Offer`] as specified by [`InvoiceRequest::quantity`].
49264 * Successive calls to this method will override the previous setting.
49266 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
49267 * [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
49268 * [`Offer`]: crate::offers::offer::Offer
49270 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_quantity(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, uint64_t quantity);
49273 * Sets the [`Refund::payer_note`].
49275 * Successive calls to this method will override the previous setting.
49277 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_payer_note(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr payer_note);
49280 * Builds a [`Refund`] after checking for valid semantics.
49282 MUST_USE_RES struct LDKCResult_RefundBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_build(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg);
49285 * Frees any resources used by the Refund, if is_owned is set and inner is non-NULL.
49287 void Refund_free(struct LDKRefund this_obj);
49290 * Creates a copy of the Refund
49292 struct LDKRefund Refund_clone(const struct LDKRefund *NONNULL_PTR orig);
49295 * A complete description of the purpose of the refund. Intended to be displayed to the user
49296 * but with the caveat that it has not been verified in any way.
49298 MUST_USE_RES struct LDKPrintableString Refund_description(const struct LDKRefund *NONNULL_PTR this_arg);
49301 * Duration since the Unix epoch when an invoice should no longer be sent.
49303 * If `None`, the refund does not expire.
49305 MUST_USE_RES struct LDKCOption_u64Z Refund_absolute_expiry(const struct LDKRefund *NONNULL_PTR this_arg);
49308 * Whether the refund has expired.
49310 MUST_USE_RES bool Refund_is_expired(const struct LDKRefund *NONNULL_PTR this_arg);
49313 * Whether the refund has expired given the duration since the Unix epoch.
49315 MUST_USE_RES bool Refund_is_expired_no_std(const struct LDKRefund *NONNULL_PTR this_arg, uint64_t duration_since_epoch);
49318 * The issuer of the refund, possibly beginning with `user@domain` or `domain`. Intended to be
49319 * displayed to the user but with the caveat that it has not been verified in any way.
49321 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49323 MUST_USE_RES struct LDKPrintableString Refund_issuer(const struct LDKRefund *NONNULL_PTR this_arg);
49326 * Paths to the sender originating from publicly reachable nodes. Blinded paths provide sender
49327 * privacy by obfuscating its node id.
49329 MUST_USE_RES struct LDKCVec_BlindedPathZ Refund_paths(const struct LDKRefund *NONNULL_PTR this_arg);
49332 * An unpredictable series of bytes, typically containing information about the derivation of
49335 * [`payer_id`]: Self::payer_id
49337 MUST_USE_RES struct LDKu8slice Refund_payer_metadata(const struct LDKRefund *NONNULL_PTR this_arg);
49340 * A chain that the refund is valid for.
49342 MUST_USE_RES struct LDKThirtyTwoBytes Refund_chain(const struct LDKRefund *NONNULL_PTR this_arg);
49345 * The amount to refund in msats (i.e., the minimum lightning-payable unit for [`chain`]).
49347 * [`chain`]: Self::chain
49349 MUST_USE_RES uint64_t Refund_amount_msats(const struct LDKRefund *NONNULL_PTR this_arg);
49352 * Features pertaining to requesting an invoice.
49354 MUST_USE_RES struct LDKInvoiceRequestFeatures Refund_features(const struct LDKRefund *NONNULL_PTR this_arg);
49357 * The quantity of an item that refund is for.
49359 MUST_USE_RES struct LDKCOption_u64Z Refund_quantity(const struct LDKRefund *NONNULL_PTR this_arg);
49362 * A public node id to send to in the case where there are no [`paths`]. Otherwise, a possibly
49363 * transient pubkey.
49365 * [`paths`]: Self::paths
49367 MUST_USE_RES struct LDKPublicKey Refund_payer_id(const struct LDKRefund *NONNULL_PTR this_arg);
49370 * Payer provided note to include in the invoice.
49372 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49374 MUST_USE_RES struct LDKPrintableString Refund_payer_note(const struct LDKRefund *NONNULL_PTR this_arg);
49377 * Generates a non-cryptographic 64-bit hash of the Refund.
49379 uint64_t Refund_hash(const struct LDKRefund *NONNULL_PTR o);
49382 * Serialize the Refund object into a byte array which can be read by Refund_read
49384 struct LDKCVec_u8Z Refund_write(const struct LDKRefund *NONNULL_PTR obj);
49387 * Read a Refund object from a string
49389 struct LDKCResult_RefundBolt12ParseErrorZ Refund_from_str(struct LDKStr s);
49392 * Creates a copy of the UtxoLookupError
49394 enum LDKUtxoLookupError UtxoLookupError_clone(const enum LDKUtxoLookupError *NONNULL_PTR orig);
49397 * Utility method to constructs a new UnknownChain-variant UtxoLookupError
49399 enum LDKUtxoLookupError UtxoLookupError_unknown_chain(void);
49402 * Utility method to constructs a new UnknownTx-variant UtxoLookupError
49404 enum LDKUtxoLookupError UtxoLookupError_unknown_tx(void);
49407 * Frees any resources used by the UtxoResult
49409 void UtxoResult_free(struct LDKUtxoResult this_ptr);
49412 * Creates a copy of the UtxoResult
49414 struct LDKUtxoResult UtxoResult_clone(const struct LDKUtxoResult *NONNULL_PTR orig);
49417 * Utility method to constructs a new Sync-variant UtxoResult
49419 struct LDKUtxoResult UtxoResult_sync(struct LDKCResult_TxOutUtxoLookupErrorZ a);
49422 * Utility method to constructs a new Async-variant UtxoResult
49424 struct LDKUtxoResult UtxoResult_async(struct LDKUtxoFuture a);
49427 * Calls the free function if one is set
49429 void UtxoLookup_free(struct LDKUtxoLookup this_ptr);
49432 * Frees any resources used by the UtxoFuture, if is_owned is set and inner is non-NULL.
49434 void UtxoFuture_free(struct LDKUtxoFuture this_obj);
49437 * Creates a copy of the UtxoFuture
49439 struct LDKUtxoFuture UtxoFuture_clone(const struct LDKUtxoFuture *NONNULL_PTR orig);
49442 * Builds a new future for later resolution.
49444 MUST_USE_RES struct LDKUtxoFuture UtxoFuture_new(void);
49447 * Resolves this future against the given `graph` and with the given `result`.
49449 * This is identical to calling [`UtxoFuture::resolve`] with a dummy `gossip`, disabling
49450 * forwarding the validated gossip message onwards to peers.
49452 * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
49453 * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
49456 * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
49457 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
49459 void UtxoFuture_resolve_without_forwarding(const struct LDKUtxoFuture *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR graph, struct LDKCResult_TxOutUtxoLookupErrorZ result);
49462 * Resolves this future against the given `graph` and with the given `result`.
49464 * The given `gossip` is used to broadcast any validated messages onwards to all peers which
49465 * have available buffer space.
49467 * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
49468 * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
49471 * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
49472 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
49474 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);
49477 * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
49479 void NodeId_free(struct LDKNodeId this_obj);
49482 * Creates a copy of the NodeId
49484 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
49487 * Create a new NodeId from a public key
49489 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
49492 * Create a new NodeId from a slice of bytes
49494 MUST_USE_RES struct LDKCResult_NodeIdDecodeErrorZ NodeId_from_slice(struct LDKu8slice bytes);
49497 * Get the public key slice from this NodeId
49499 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
49502 * Get the public key as an array from this NodeId
49504 MUST_USE_RES const uint8_t (*NodeId_as_array(const struct LDKNodeId *NONNULL_PTR this_arg))[33];
49507 * Get the public key from this NodeId
49509 MUST_USE_RES struct LDKCResult_PublicKeySecp256k1ErrorZ NodeId_as_pubkey(const struct LDKNodeId *NONNULL_PTR this_arg);
49512 * Generates a non-cryptographic 64-bit hash of the NodeId.
49514 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
49517 * Serialize the NodeId object into a byte array which can be read by NodeId_read
49519 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
49522 * Read a NodeId from a byte array, created by NodeId_write
49524 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
49527 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
49529 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
49532 * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
49534 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
49537 * Frees any resources used by the NetworkUpdate
49539 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
49542 * Creates a copy of the NetworkUpdate
49544 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
49547 * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
49549 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
49552 * Utility method to constructs a new ChannelFailure-variant NetworkUpdate
49554 struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent);
49557 * Utility method to constructs a new NodeFailure-variant NetworkUpdate
49559 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
49562 * Checks if two NetworkUpdates contain equal inner contents.
49563 * This ignores pointers and is_owned flags and looks at the values in fields.
49565 bool NetworkUpdate_eq(const struct LDKNetworkUpdate *NONNULL_PTR a, const struct LDKNetworkUpdate *NONNULL_PTR b);
49568 * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
49570 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
49573 * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
49575 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
49578 * Frees any resources used by the P2PGossipSync, if is_owned is set and inner is non-NULL.
49580 void P2PGossipSync_free(struct LDKP2PGossipSync this_obj);
49583 * Creates a new tracker of the actual state of the network of channels and nodes,
49584 * assuming an existing [`NetworkGraph`].
49585 * UTXO lookup is used to make sure announced channels exist on-chain, channel data is
49586 * correct, and the announcement is signed with channel owners' keys.
49588 MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_UtxoLookupZ utxo_lookup, struct LDKLogger logger);
49591 * Adds a provider used to check new announcements. Does not affect
49592 * existing announcements unless they are updated.
49593 * Add, update or remove the provider would replace the current one.
49595 void P2PGossipSync_add_utxo_lookup(const struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_UtxoLookupZ utxo_lookup);
49598 * Handles any network updates originating from [`Event`]s.
49599 * Note that this will skip applying any [`NetworkUpdate::ChannelUpdateMessage`] to avoid
49600 * leaking possibly identifying information of the sender to the public network.
49602 * [`Event`]: crate::events::Event
49604 void NetworkGraph_handle_network_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNetworkUpdate *NONNULL_PTR network_update);
49607 * Gets the chain hash for this network graph.
49609 MUST_USE_RES struct LDKThirtyTwoBytes NetworkGraph_get_chain_hash(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
49612 * Verifies the signature of a [`NodeAnnouncement`].
49614 * Returns an error if it is invalid.
49616 struct LDKCResult_NoneLightningErrorZ verify_node_announcement(const struct LDKNodeAnnouncement *NONNULL_PTR msg);
49619 * Verifies all signatures included in a [`ChannelAnnouncement`].
49621 * Returns an error if one of the signatures is invalid.
49623 struct LDKCResult_NoneLightningErrorZ verify_channel_announcement(const struct LDKChannelAnnouncement *NONNULL_PTR msg);
49626 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
49627 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
49629 struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
49632 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
49633 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
49635 struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
49638 * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
49640 void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
49643 * When the last update to the channel direction was issued.
49644 * Value is opaque, as set in the announcement.
49646 uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
49649 * When the last update to the channel direction was issued.
49650 * Value is opaque, as set in the announcement.
49652 void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
49655 * Whether the channel can be currently used for payments (in this one direction).
49657 bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
49660 * Whether the channel can be currently used for payments (in this one direction).
49662 void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
49665 * The difference in CLTV values that you must have when routing through this channel.
49667 uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
49670 * The difference in CLTV values that you must have when routing through this channel.
49672 void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
49675 * The minimum value, which must be relayed to the next hop via the channel
49677 uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
49680 * The minimum value, which must be relayed to the next hop via the channel
49682 void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
49685 * The maximum value which may be relayed to the next hop via the channel.
49687 uint64_t ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
49690 * The maximum value which may be relayed to the next hop via the channel.
49692 void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
49695 * Fees charged when the channel is used for routing
49697 struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
49700 * Fees charged when the channel is used for routing
49702 void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
49705 * Most recent update for the channel received from the network
49706 * Mostly redundant with the data we store in fields explicitly.
49707 * Everything else is useful only for sending out for initial routing sync.
49708 * Not stored if contains excess data to prevent DoS.
49710 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49712 struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
49715 * Most recent update for the channel received from the network
49716 * Mostly redundant with the data we store in fields explicitly.
49717 * Everything else is useful only for sending out for initial routing sync.
49718 * Not stored if contains excess data to prevent DoS.
49720 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
49722 void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
49725 * Constructs a new ChannelUpdateInfo given each field
49727 * Note that last_update_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
49729 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);
49732 * Creates a copy of the ChannelUpdateInfo
49734 struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
49737 * Checks if two ChannelUpdateInfos contain equal inner contents.
49738 * This ignores pointers and is_owned flags and looks at the values in fields.
49739 * Two objects with NULL inner values will be considered "equal" here.
49741 bool ChannelUpdateInfo_eq(const struct LDKChannelUpdateInfo *NONNULL_PTR a, const struct LDKChannelUpdateInfo *NONNULL_PTR b);
49744 * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
49746 struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
49749 * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
49751 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
49754 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
49756 void ChannelInfo_free(struct LDKChannelInfo this_obj);
49759 * Protocol features of a channel communicated during its announcement
49761 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
49764 * Protocol features of a channel communicated during its announcement
49766 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
49769 * Source node of the first direction of a channel
49771 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
49774 * Source node of the first direction of a channel
49776 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
49779 * Details about the first direction of a channel
49781 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49783 struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
49786 * Details about the first direction of a channel
49788 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
49790 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
49793 * Source node of the second direction of a channel
49795 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
49798 * Source node of the second direction of a channel
49800 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
49803 * Details about the second direction of a channel
49805 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49807 struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
49810 * Details about the second direction of a channel
49812 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
49814 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
49817 * The channel capacity as seen on-chain, if chain lookup is available.
49819 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
49822 * The channel capacity as seen on-chain, if chain lookup is available.
49824 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
49827 * An initial announcement of the channel
49828 * Mostly redundant with the data we store in fields explicitly.
49829 * Everything else is useful only for sending out for initial routing sync.
49830 * Not stored if contains excess data to prevent DoS.
49832 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49834 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
49837 * An initial announcement of the channel
49838 * Mostly redundant with the data we store in fields explicitly.
49839 * Everything else is useful only for sending out for initial routing sync.
49840 * Not stored if contains excess data to prevent DoS.
49842 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
49844 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
49847 * Creates a copy of the ChannelInfo
49849 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
49852 * Checks if two ChannelInfos contain equal inner contents.
49853 * This ignores pointers and is_owned flags and looks at the values in fields.
49854 * Two objects with NULL inner values will be considered "equal" here.
49856 bool ChannelInfo_eq(const struct LDKChannelInfo *NONNULL_PTR a, const struct LDKChannelInfo *NONNULL_PTR b);
49859 * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
49861 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49863 MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
49866 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
49868 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
49871 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
49873 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
49876 * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
49878 void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
49881 * Creates a copy of the DirectedChannelInfo
49883 struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
49886 * Returns information for the channel.
49888 MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
49891 * Returns the [`EffectiveCapacity`] of the channel in the direction.
49893 * This is either the total capacity from the funding transaction, if known, or the
49894 * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
49897 MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
49900 * Returns the `node_id` of the source hop.
49902 * Refers to the `node_id` forwarding the payment to the next hop.
49904 MUST_USE_RES struct LDKNodeId DirectedChannelInfo_source(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
49907 * Returns the `node_id` of the target hop.
49909 * Refers to the `node_id` receiving the payment from the previous hop.
49911 MUST_USE_RES struct LDKNodeId DirectedChannelInfo_target(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
49914 * Frees any resources used by the EffectiveCapacity
49916 void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
49919 * Creates a copy of the EffectiveCapacity
49921 struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
49924 * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
49926 struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
49929 * Utility method to constructs a new AdvertisedMaxHTLC-variant EffectiveCapacity
49931 struct LDKEffectiveCapacity EffectiveCapacity_advertised_max_htlc(uint64_t amount_msat);
49934 * Utility method to constructs a new Total-variant EffectiveCapacity
49936 struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, uint64_t htlc_maximum_msat);
49939 * Utility method to constructs a new Infinite-variant EffectiveCapacity
49941 struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
49944 * Utility method to constructs a new HintMaxHTLC-variant EffectiveCapacity
49946 struct LDKEffectiveCapacity EffectiveCapacity_hint_max_htlc(uint64_t amount_msat);
49949 * Utility method to constructs a new Unknown-variant EffectiveCapacity
49951 struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
49954 * Returns the effective capacity denominated in millisatoshi.
49956 MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
49959 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
49961 void RoutingFees_free(struct LDKRoutingFees this_obj);
49964 * Flat routing fee in millisatoshis.
49966 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
49969 * Flat routing fee in millisatoshis.
49971 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
49974 * Liquidity-based routing fee in millionths of a routed amount.
49975 * In other words, 10000 is 1%.
49977 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
49980 * Liquidity-based routing fee in millionths of a routed amount.
49981 * In other words, 10000 is 1%.
49983 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
49986 * Constructs a new RoutingFees given each field
49988 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
49991 * Checks if two RoutingFeess contain equal inner contents.
49992 * This ignores pointers and is_owned flags and looks at the values in fields.
49993 * Two objects with NULL inner values will be considered "equal" here.
49995 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
49998 * Creates a copy of the RoutingFees
50000 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
50003 * Generates a non-cryptographic 64-bit hash of the RoutingFees.
50005 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
50008 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
50010 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
50013 * Read a RoutingFees from a byte array, created by RoutingFees_write
50015 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
50018 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
50020 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
50023 * Protocol features the node announced support for
50025 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
50028 * Protocol features the node announced support for
50030 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
50033 * When the last known update to the node state was issued.
50034 * Value is opaque, as set in the announcement.
50036 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
50039 * When the last known update to the node state was issued.
50040 * Value is opaque, as set in the announcement.
50042 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
50045 * Color assigned to the node
50047 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
50050 * Color assigned to the node
50052 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
50055 * Moniker assigned to the node.
50056 * May be invalid or malicious (eg control chars),
50057 * should not be exposed to the user.
50059 struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
50062 * Moniker assigned to the node.
50063 * May be invalid or malicious (eg control chars),
50064 * should not be exposed to the user.
50066 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
50069 * An initial announcement of the node
50070 * Mostly redundant with the data we store in fields explicitly.
50071 * Everything else is useful only for sending out for initial routing sync.
50072 * Not stored if contains excess data to prevent DoS.
50074 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50076 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
50079 * An initial announcement of the node
50080 * Mostly redundant with the data we store in fields explicitly.
50081 * Everything else is useful only for sending out for initial routing sync.
50082 * Not stored if contains excess data to prevent DoS.
50084 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
50086 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
50089 * Constructs a new NodeAnnouncementInfo given each field
50091 * Note that announcement_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
50093 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);
50096 * Creates a copy of the NodeAnnouncementInfo
50098 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
50101 * Checks if two NodeAnnouncementInfos contain equal inner contents.
50102 * This ignores pointers and is_owned flags and looks at the values in fields.
50103 * Two objects with NULL inner values will be considered "equal" here.
50105 bool NodeAnnouncementInfo_eq(const struct LDKNodeAnnouncementInfo *NONNULL_PTR a, const struct LDKNodeAnnouncementInfo *NONNULL_PTR b);
50108 * Internet-level addresses via which one can connect to the node
50110 MUST_USE_RES struct LDKCVec_SocketAddressZ NodeAnnouncementInfo_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg);
50113 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
50115 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
50118 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
50120 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
50123 * Frees any resources used by the NodeAlias, if is_owned is set and inner is non-NULL.
50125 void NodeAlias_free(struct LDKNodeAlias this_obj);
50127 const uint8_t (*NodeAlias_get_a(const struct LDKNodeAlias *NONNULL_PTR this_ptr))[32];
50129 void NodeAlias_set_a(struct LDKNodeAlias *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
50132 * Constructs a new NodeAlias given each field
50134 MUST_USE_RES struct LDKNodeAlias NodeAlias_new(struct LDKThirtyTwoBytes a_arg);
50137 * Creates a copy of the NodeAlias
50139 struct LDKNodeAlias NodeAlias_clone(const struct LDKNodeAlias *NONNULL_PTR orig);
50142 * Generates a non-cryptographic 64-bit hash of the NodeAlias.
50144 uint64_t NodeAlias_hash(const struct LDKNodeAlias *NONNULL_PTR o);
50147 * Checks if two NodeAliass contain equal inner contents.
50148 * This ignores pointers and is_owned flags and looks at the values in fields.
50149 * Two objects with NULL inner values will be considered "equal" here.
50151 bool NodeAlias_eq(const struct LDKNodeAlias *NONNULL_PTR a, const struct LDKNodeAlias *NONNULL_PTR b);
50154 * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
50156 struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj);
50159 * Read a NodeAlias from a byte array, created by NodeAlias_write
50161 struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser);
50164 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
50166 void NodeInfo_free(struct LDKNodeInfo this_obj);
50169 * All valid channels a node has announced
50171 * Returns a copy of the field.
50173 struct LDKCVec_u64Z NodeInfo_get_channels(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
50176 * All valid channels a node has announced
50178 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
50181 * More information about a node from node_announcement.
50182 * Optional because we store a Node entry after learning about it from
50183 * a channel announcement, but before receiving a node announcement.
50185 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50187 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
50190 * More information about a node from node_announcement.
50191 * Optional because we store a Node entry after learning about it from
50192 * a channel announcement, but before receiving a node announcement.
50194 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
50196 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
50199 * Constructs a new NodeInfo given each field
50201 * Note that announcement_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
50203 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
50206 * Creates a copy of the NodeInfo
50208 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
50211 * Checks if two NodeInfos contain equal inner contents.
50212 * This ignores pointers and is_owned flags and looks at the values in fields.
50213 * Two objects with NULL inner values will be considered "equal" here.
50215 bool NodeInfo_eq(const struct LDKNodeInfo *NONNULL_PTR a, const struct LDKNodeInfo *NONNULL_PTR b);
50218 * Returns whether the node has only announced Tor addresses.
50220 MUST_USE_RES bool NodeInfo_is_tor_only(const struct LDKNodeInfo *NONNULL_PTR this_arg);
50223 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
50225 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
50228 * Read a NodeInfo from a byte array, created by NodeInfo_write
50230 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
50233 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
50235 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
50238 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
50240 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg);
50243 * Creates a new, empty, network graph.
50245 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(enum LDKNetwork network, struct LDKLogger logger);
50248 * Returns a read-only view of the network graph.
50250 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
50253 * The unix timestamp provided by the most recent rapid gossip sync.
50254 * It will be set by the rapid sync process after every sync completion.
50256 MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
50259 * Update the unix timestamp provided by the most recent rapid gossip sync.
50260 * This should be done automatically by the rapid sync process after every sync completion.
50262 void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp);
50265 * For an already known node (from channel announcements), update its stored properties from a
50266 * given node announcement.
50268 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
50269 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
50270 * routing messages from a source using a protocol other than the lightning P2P protocol.
50272 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
50275 * For an already known node (from channel announcements), update its stored properties from a
50276 * given node announcement without verifying the associated signatures. Because we aren't
50277 * given the associated signatures here we cannot relay the node announcement to any of our
50280 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);
50283 * Store or update channel info from a channel announcement.
50285 * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
50286 * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
50287 * routing messages from a source using a protocol other than the lightning P2P protocol.
50289 * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
50290 * the corresponding UTXO exists on chain and is correctly-formatted.
50292 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);
50295 * Store or update channel info from a channel announcement.
50297 * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
50298 * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
50299 * routing messages from a source using a protocol other than the lightning P2P protocol.
50301 * This will skip verification of if the channel is actually on-chain.
50303 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);
50306 * Store or update channel info from a channel announcement without verifying the associated
50307 * signatures. Because we aren't given the associated signatures here we cannot relay the
50308 * channel announcement to any of our peers.
50310 * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
50311 * the corresponding UTXO exists on chain and is correctly-formatted.
50313 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);
50316 * Update channel from partial announcement data received via rapid gossip sync
50318 * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the
50319 * rapid gossip sync server)
50321 * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields.
50323 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);
50326 * Marks a channel in the graph as failed permanently.
50328 * The channel and any node for which this was their last channel are removed from the graph.
50330 void NetworkGraph_channel_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
50333 * Marks a node in the graph as permanently failed, effectively removing it and its channels
50334 * from local storage.
50336 void NetworkGraph_node_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
50339 * Removes information about channels that we haven't heard any updates about in some time.
50340 * This can be used regularly to prune the network graph of channels that likely no longer
50343 * While there is no formal requirement that nodes regularly re-broadcast their channel
50344 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
50345 * pruning occur for updates which are at least two weeks old, which we implement here.
50347 * Note that for users of the `lightning-background-processor` crate this method may be
50348 * automatically called regularly for you.
50350 * This method will also cause us to stop tracking removed nodes and channels if they have been
50351 * in the map for a while so that these can be resynced from gossip in the future.
50353 * This method is only available with the `std` feature. See
50354 * [`NetworkGraph::remove_stale_channels_and_tracking_with_time`] for `no-std` use.
50356 void NetworkGraph_remove_stale_channels_and_tracking(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
50359 * Removes information about channels that we haven't heard any updates about in some time.
50360 * This can be used regularly to prune the network graph of channels that likely no longer
50363 * While there is no formal requirement that nodes regularly re-broadcast their channel
50364 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
50365 * pruning occur for updates which are at least two weeks old, which we implement here.
50367 * This method will also cause us to stop tracking removed nodes and channels if they have been
50368 * in the map for a while so that these can be resynced from gossip in the future.
50370 * This function takes the current unix time as an argument. For users with the `std` feature
50371 * enabled, [`NetworkGraph::remove_stale_channels_and_tracking`] may be preferable.
50373 void NetworkGraph_remove_stale_channels_and_tracking_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
50376 * For an already known (from announcement) channel, update info about one of the directions
50379 * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
50380 * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
50381 * routing messages from a source using a protocol other than the lightning P2P protocol.
50383 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
50384 * materially in the future will be rejected.
50386 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
50389 * For an already known (from announcement) channel, update info about one of the directions
50390 * of the channel without verifying the associated signatures. Because we aren't given the
50391 * associated signatures here we cannot relay the channel update to any of our peers.
50393 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
50394 * materially in the future will be rejected.
50396 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
50399 * For an already known (from announcement) channel, verify the given [`ChannelUpdate`].
50401 * This checks whether the update currently is applicable by [`Self::update_channel`].
50403 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
50404 * materially in the future will be rejected.
50406 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_verify_channel_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
50409 * Returns information on a channel with the given id.
50411 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50413 MUST_USE_RES struct LDKChannelInfo ReadOnlyNetworkGraph_channel(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
50416 * Returns the list of channels in the graph
50418 MUST_USE_RES struct LDKCVec_u64Z ReadOnlyNetworkGraph_list_channels(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
50421 * Returns information on a node with the given id.
50423 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50425 MUST_USE_RES struct LDKNodeInfo ReadOnlyNetworkGraph_node(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
50428 * Returns the list of nodes in the graph
50430 MUST_USE_RES struct LDKCVec_NodeIdZ ReadOnlyNetworkGraph_list_nodes(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
50433 * Get network addresses by node id.
50434 * Returns None if the requested node is completely unknown,
50435 * or if node announcement for the node was never received.
50437 MUST_USE_RES struct LDKCOption_CVec_SocketAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
50440 * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
50442 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
50445 * Creates a new router.
50447 MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, struct LDKEntropySource entropy_source, struct LDKLockableScore scorer, struct LDKProbabilisticScoringFeeParameters score_params);
50450 * Constructs a new Router which calls the relevant methods on this_arg.
50451 * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
50453 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
50456 * Constructs a new MessageRouter which calls the relevant methods on this_arg.
50457 * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is
50459 struct LDKMessageRouter DefaultRouter_as_MessageRouter(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
50462 * Calls the free function if one is set
50464 void Router_free(struct LDKRouter this_ptr);
50467 * Frees any resources used by the ScorerAccountingForInFlightHtlcs, if is_owned is set and inner is non-NULL.
50469 void ScorerAccountingForInFlightHtlcs_free(struct LDKScorerAccountingForInFlightHtlcs this_obj);
50472 * Initialize a new `ScorerAccountingForInFlightHtlcs`.
50474 MUST_USE_RES struct LDKScorerAccountingForInFlightHtlcs ScorerAccountingForInFlightHtlcs_new(struct LDKScoreLookUp scorer, const struct LDKInFlightHtlcs *NONNULL_PTR inflight_htlcs);
50477 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
50478 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
50480 struct LDKScoreLookUp ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(const struct LDKScorerAccountingForInFlightHtlcs *NONNULL_PTR this_arg);
50483 * Frees any resources used by the InFlightHtlcs, if is_owned is set and inner is non-NULL.
50485 void InFlightHtlcs_free(struct LDKInFlightHtlcs this_obj);
50488 * Creates a copy of the InFlightHtlcs
50490 struct LDKInFlightHtlcs InFlightHtlcs_clone(const struct LDKInFlightHtlcs *NONNULL_PTR orig);
50493 * Constructs an empty `InFlightHtlcs`.
50495 MUST_USE_RES struct LDKInFlightHtlcs InFlightHtlcs_new(void);
50498 * Takes in a path with payer's node id and adds the path's details to `InFlightHtlcs`.
50500 void InFlightHtlcs_process_path(struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKPath *NONNULL_PTR path, struct LDKPublicKey payer_node_id);
50503 * Adds a known HTLC given the public key of the HTLC source, target, and short channel
50506 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);
50509 * Returns liquidity in msat given the public key of the HTLC source, target, and short channel
50512 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);
50515 * Serialize the InFlightHtlcs object into a byte array which can be read by InFlightHtlcs_read
50517 struct LDKCVec_u8Z InFlightHtlcs_write(const struct LDKInFlightHtlcs *NONNULL_PTR obj);
50520 * Read a InFlightHtlcs from a byte array, created by InFlightHtlcs_write
50522 struct LDKCResult_InFlightHtlcsDecodeErrorZ InFlightHtlcs_read(struct LDKu8slice ser);
50525 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
50527 void RouteHop_free(struct LDKRouteHop this_obj);
50530 * The node_id of the node at this hop.
50532 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
50535 * The node_id of the node at this hop.
50537 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
50540 * The node_announcement features of the node at this hop. For the last hop, these may be
50541 * amended to match the features present in the invoice this node generated.
50543 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
50546 * The node_announcement features of the node at this hop. For the last hop, these may be
50547 * amended to match the features present in the invoice this node generated.
50549 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
50552 * The channel that should be used from the previous hop to reach this node.
50554 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
50557 * The channel that should be used from the previous hop to reach this node.
50559 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
50562 * The channel_announcement features of the channel that should be used from the previous hop
50563 * to reach this node.
50565 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
50568 * The channel_announcement features of the channel that should be used from the previous hop
50569 * to reach this node.
50571 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
50574 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
50575 * If this is the last hop in [`Path::hops`]:
50576 * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
50577 * * otherwise, this is the full value of this [`Path`]'s part of the payment
50579 * [`BlindedPath`]: crate::blinded_path::BlindedPath
50581 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
50584 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
50585 * If this is the last hop in [`Path::hops`]:
50586 * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
50587 * * otherwise, this is the full value of this [`Path`]'s part of the payment
50589 * [`BlindedPath`]: crate::blinded_path::BlindedPath
50591 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
50594 * The CLTV delta added for this hop.
50595 * If this is the last hop in [`Path::hops`]:
50596 * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
50597 * * otherwise, this is the CLTV delta expected at the destination
50599 * [`BlindedPath`]: crate::blinded_path::BlindedPath
50601 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
50604 * The CLTV delta added for this hop.
50605 * If this is the last hop in [`Path::hops`]:
50606 * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
50607 * * otherwise, this is the CLTV delta expected at the destination
50609 * [`BlindedPath`]: crate::blinded_path::BlindedPath
50611 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
50614 * Indicates whether this hop is possibly announced in the public network graph.
50616 * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
50617 * either know for sure it's announced in the public graph, or if any public channels exist
50618 * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
50619 * the channel to be unannounced.
50621 * Will be `true` for objects serialized with LDK version 0.0.116 and before.
50623 bool RouteHop_get_maybe_announced_channel(const struct LDKRouteHop *NONNULL_PTR this_ptr);
50626 * Indicates whether this hop is possibly announced in the public network graph.
50628 * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
50629 * either know for sure it's announced in the public graph, or if any public channels exist
50630 * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
50631 * the channel to be unannounced.
50633 * Will be `true` for objects serialized with LDK version 0.0.116 and before.
50635 void RouteHop_set_maybe_announced_channel(struct LDKRouteHop *NONNULL_PTR this_ptr, bool val);
50638 * Constructs a new RouteHop given each field
50640 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);
50643 * Creates a copy of the RouteHop
50645 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
50648 * Generates a non-cryptographic 64-bit hash of the RouteHop.
50650 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
50653 * Checks if two RouteHops contain equal inner contents.
50654 * This ignores pointers and is_owned flags and looks at the values in fields.
50655 * Two objects with NULL inner values will be considered "equal" here.
50657 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
50660 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
50662 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
50665 * Read a RouteHop from a byte array, created by RouteHop_write
50667 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
50670 * Frees any resources used by the BlindedTail, if is_owned is set and inner is non-NULL.
50672 void BlindedTail_free(struct LDKBlindedTail this_obj);
50675 * The hops of the [`BlindedPath`] provided by the recipient.
50677 * [`BlindedPath`]: crate::blinded_path::BlindedPath
50679 struct LDKCVec_BlindedHopZ BlindedTail_get_hops(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
50682 * The hops of the [`BlindedPath`] provided by the recipient.
50684 * [`BlindedPath`]: crate::blinded_path::BlindedPath
50686 void BlindedTail_set_hops(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
50689 * The blinding point of the [`BlindedPath`] provided by the recipient.
50691 * [`BlindedPath`]: crate::blinded_path::BlindedPath
50693 struct LDKPublicKey BlindedTail_get_blinding_point(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
50696 * The blinding point of the [`BlindedPath`] provided by the recipient.
50698 * [`BlindedPath`]: crate::blinded_path::BlindedPath
50700 void BlindedTail_set_blinding_point(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKPublicKey val);
50703 * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
50704 * inferring the destination. May be 0.
50706 uint32_t BlindedTail_get_excess_final_cltv_expiry_delta(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
50709 * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
50710 * inferring the destination. May be 0.
50712 void BlindedTail_set_excess_final_cltv_expiry_delta(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint32_t val);
50715 * The total amount paid on this [`Path`], excluding the fees.
50717 uint64_t BlindedTail_get_final_value_msat(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
50720 * The total amount paid on this [`Path`], excluding the fees.
50722 void BlindedTail_set_final_value_msat(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint64_t val);
50725 * Constructs a new BlindedTail given each field
50727 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);
50730 * Creates a copy of the BlindedTail
50732 struct LDKBlindedTail BlindedTail_clone(const struct LDKBlindedTail *NONNULL_PTR orig);
50735 * Generates a non-cryptographic 64-bit hash of the BlindedTail.
50737 uint64_t BlindedTail_hash(const struct LDKBlindedTail *NONNULL_PTR o);
50740 * Checks if two BlindedTails contain equal inner contents.
50741 * This ignores pointers and is_owned flags and looks at the values in fields.
50742 * Two objects with NULL inner values will be considered "equal" here.
50744 bool BlindedTail_eq(const struct LDKBlindedTail *NONNULL_PTR a, const struct LDKBlindedTail *NONNULL_PTR b);
50747 * Serialize the BlindedTail object into a byte array which can be read by BlindedTail_read
50749 struct LDKCVec_u8Z BlindedTail_write(const struct LDKBlindedTail *NONNULL_PTR obj);
50752 * Read a BlindedTail from a byte array, created by BlindedTail_write
50754 struct LDKCResult_BlindedTailDecodeErrorZ BlindedTail_read(struct LDKu8slice ser);
50757 * Frees any resources used by the Path, if is_owned is set and inner is non-NULL.
50759 void Path_free(struct LDKPath this_obj);
50762 * The list of unblinded hops in this [`Path`]. Must be at least length one.
50764 struct LDKCVec_RouteHopZ Path_get_hops(const struct LDKPath *NONNULL_PTR this_ptr);
50767 * The list of unblinded hops in this [`Path`]. Must be at least length one.
50769 void Path_set_hops(struct LDKPath *NONNULL_PTR this_ptr, struct LDKCVec_RouteHopZ val);
50772 * The blinded path at which this path terminates, if we're sending to one, and its metadata.
50774 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50776 struct LDKBlindedTail Path_get_blinded_tail(const struct LDKPath *NONNULL_PTR this_ptr);
50779 * The blinded path at which this path terminates, if we're sending to one, and its metadata.
50781 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
50783 void Path_set_blinded_tail(struct LDKPath *NONNULL_PTR this_ptr, struct LDKBlindedTail val);
50786 * Constructs a new Path given each field
50788 * Note that blinded_tail_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
50790 MUST_USE_RES struct LDKPath Path_new(struct LDKCVec_RouteHopZ hops_arg, struct LDKBlindedTail blinded_tail_arg);
50793 * Creates a copy of the Path
50795 struct LDKPath Path_clone(const struct LDKPath *NONNULL_PTR orig);
50798 * Generates a non-cryptographic 64-bit hash of the Path.
50800 uint64_t Path_hash(const struct LDKPath *NONNULL_PTR o);
50803 * Checks if two Paths contain equal inner contents.
50804 * This ignores pointers and is_owned flags and looks at the values in fields.
50805 * Two objects with NULL inner values will be considered "equal" here.
50807 bool Path_eq(const struct LDKPath *NONNULL_PTR a, const struct LDKPath *NONNULL_PTR b);
50810 * Gets the fees for a given path, excluding any excess paid to the recipient.
50812 MUST_USE_RES uint64_t Path_fee_msat(const struct LDKPath *NONNULL_PTR this_arg);
50815 * Gets the total amount paid on this [`Path`], excluding the fees.
50817 MUST_USE_RES uint64_t Path_final_value_msat(const struct LDKPath *NONNULL_PTR this_arg);
50820 * Gets the final hop's CLTV expiry delta.
50822 MUST_USE_RES struct LDKCOption_u32Z Path_final_cltv_expiry_delta(const struct LDKPath *NONNULL_PTR this_arg);
50825 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
50827 void Route_free(struct LDKRoute this_obj);
50830 * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
50831 * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
50834 struct LDKCVec_PathZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
50837 * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
50838 * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
50841 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_PathZ val);
50844 * The `route_params` parameter passed to [`find_route`].
50846 * This is used by `ChannelManager` to track information which may be required for retries.
50848 * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
50850 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50852 struct LDKRouteParameters Route_get_route_params(const struct LDKRoute *NONNULL_PTR this_ptr);
50855 * The `route_params` parameter passed to [`find_route`].
50857 * This is used by `ChannelManager` to track information which may be required for retries.
50859 * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
50861 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
50863 void Route_set_route_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKRouteParameters val);
50866 * Constructs a new Route given each field
50868 * Note that route_params_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
50870 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_PathZ paths_arg, struct LDKRouteParameters route_params_arg);
50873 * Creates a copy of the Route
50875 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
50878 * Generates a non-cryptographic 64-bit hash of the Route.
50880 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
50883 * Checks if two Routes contain equal inner contents.
50884 * This ignores pointers and is_owned flags and looks at the values in fields.
50885 * Two objects with NULL inner values will be considered "equal" here.
50887 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
50890 * Returns the total amount of fees paid on this [`Route`].
50892 * For objects serialized with LDK 0.0.117 and after, this includes any extra payment made to
50893 * the recipient, which can happen in excess of the amount passed to [`find_route`] via
50894 * [`RouteParameters::final_value_msat`], if we had to reach the [`htlc_minimum_msat`] limits.
50896 * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
50898 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
50901 * Returns the total amount paid on this [`Route`], excluding the fees.
50903 * Might be more than requested as part of the given [`RouteParameters::final_value_msat`] if
50904 * we had to reach the [`htlc_minimum_msat`] limits.
50906 * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
50908 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
50911 * Serialize the Route object into a byte array which can be read by Route_read
50913 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
50916 * Read a Route from a byte array, created by Route_write
50918 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
50921 * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
50923 void RouteParameters_free(struct LDKRouteParameters this_obj);
50926 * The parameters of the failed payment path.
50928 struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
50931 * The parameters of the failed payment path.
50933 void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
50936 * The amount in msats sent on the failed payment path.
50938 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
50941 * The amount in msats sent on the failed payment path.
50943 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
50946 * The maximum total fees, in millisatoshi, that may accrue during route finding.
50948 * This limit also applies to the total fees that may arise while retrying failed payment
50951 * Note that values below a few sats may result in some paths being spuriously ignored.
50953 struct LDKCOption_u64Z RouteParameters_get_max_total_routing_fee_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
50956 * The maximum total fees, in millisatoshi, that may accrue during route finding.
50958 * This limit also applies to the total fees that may arise while retrying failed payment
50961 * Note that values below a few sats may result in some paths being spuriously ignored.
50963 void RouteParameters_set_max_total_routing_fee_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
50966 * Constructs a new RouteParameters given each field
50968 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);
50971 * Creates a copy of the RouteParameters
50973 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
50976 * Generates a non-cryptographic 64-bit hash of the RouteParameters.
50978 uint64_t RouteParameters_hash(const struct LDKRouteParameters *NONNULL_PTR o);
50981 * Checks if two RouteParameterss contain equal inner contents.
50982 * This ignores pointers and is_owned flags and looks at the values in fields.
50983 * Two objects with NULL inner values will be considered "equal" here.
50985 bool RouteParameters_eq(const struct LDKRouteParameters *NONNULL_PTR a, const struct LDKRouteParameters *NONNULL_PTR b);
50988 * Constructs [`RouteParameters`] from the given [`PaymentParameters`] and a payment amount.
50990 * [`Self::max_total_routing_fee_msat`] defaults to 1% of the payment amount + 50 sats
50992 MUST_USE_RES struct LDKRouteParameters RouteParameters_from_payment_params_and_value(struct LDKPaymentParameters payment_params, uint64_t final_value_msat);
50995 * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
50997 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
51000 * Read a RouteParameters from a byte array, created by RouteParameters_write
51002 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
51005 * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
51007 void PaymentParameters_free(struct LDKPaymentParameters this_obj);
51010 * Information about the payee, such as their features and route hints for their channels.
51012 struct LDKPayee PaymentParameters_get_payee(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
51015 * Information about the payee, such as their features and route hints for their channels.
51017 void PaymentParameters_set_payee(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPayee val);
51020 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
51022 struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
51025 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
51027 void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
51030 * The maximum total CLTV delta we accept for the route.
51031 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
51033 uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
51036 * The maximum total CLTV delta we accept for the route.
51037 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
51039 void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
51042 * The maximum number of paths that may be used by (MPP) payments.
51043 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
51045 uint8_t PaymentParameters_get_max_path_count(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
51048 * The maximum number of paths that may be used by (MPP) payments.
51049 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
51051 void PaymentParameters_set_max_path_count(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
51054 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
51055 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
51056 * a lower value prefers to send larger MPP parts, potentially saturating channels and
51057 * increasing failure probability for those paths.
51059 * Note that this restriction will be relaxed during pathfinding after paths which meet this
51060 * restriction have been found. While paths which meet this criteria will be searched for, it
51061 * is ultimately up to the scorer to select them over other paths.
51063 * A value of 0 will allow payments up to and including a channel's total announced usable
51064 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
51068 uint8_t PaymentParameters_get_max_channel_saturation_power_of_half(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
51071 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
51072 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
51073 * a lower value prefers to send larger MPP parts, potentially saturating channels and
51074 * increasing failure probability for those paths.
51076 * Note that this restriction will be relaxed during pathfinding after paths which meet this
51077 * restriction have been found. While paths which meet this criteria will be searched for, it
51078 * is ultimately up to the scorer to select them over other paths.
51080 * A value of 0 will allow payments up to and including a channel's total announced usable
51081 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
51085 void PaymentParameters_set_max_channel_saturation_power_of_half(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
51088 * A list of SCIDs which this payment was previously attempted over and which caused the
51089 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
51092 * Returns a copy of the field.
51094 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_channels(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
51097 * A list of SCIDs which this payment was previously attempted over and which caused the
51098 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
51101 void PaymentParameters_set_previously_failed_channels(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
51104 * A list of indices corresponding to blinded paths in [`Payee::Blinded::route_hints`] which this
51105 * payment was previously attempted over and which caused the payment to fail. Future attempts
51106 * for the same payment shouldn't be relayed through any of these blinded paths.
51108 * Returns a copy of the field.
51110 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_blinded_path_idxs(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
51113 * A list of indices corresponding to blinded paths in [`Payee::Blinded::route_hints`] which this
51114 * payment was previously attempted over and which caused the payment to fail. Future attempts
51115 * for the same payment shouldn't be relayed through any of these blinded paths.
51117 void PaymentParameters_set_previously_failed_blinded_path_idxs(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
51120 * Constructs a new PaymentParameters given each field
51122 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_new(struct LDKPayee payee_arg, struct LDKCOption_u64Z expiry_time_arg, uint32_t max_total_cltv_expiry_delta_arg, uint8_t max_path_count_arg, uint8_t max_channel_saturation_power_of_half_arg, struct LDKCVec_u64Z previously_failed_channels_arg, struct LDKCVec_u64Z previously_failed_blinded_path_idxs_arg);
51125 * Creates a copy of the PaymentParameters
51127 struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
51130 * Generates a non-cryptographic 64-bit hash of the PaymentParameters.
51132 uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
51135 * Checks if two PaymentParameterss contain equal inner contents.
51136 * This ignores pointers and is_owned flags and looks at the values in fields.
51137 * Two objects with NULL inner values will be considered "equal" here.
51139 bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
51142 * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
51144 struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
51147 * Read a PaymentParameters from a byte array, created by PaymentParameters_write
51149 struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser, uint32_t arg);
51152 * Creates a payee with the node id of the given `pubkey`.
51154 * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
51157 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta);
51160 * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
51162 * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
51165 * Note that MPP keysend is not widely supported yet. The `allow_mpp` lets you choose
51166 * whether your router will be allowed to find a multi-part route for this payment. If you
51167 * set `allow_mpp` to true, you should ensure a payment secret is set on send, likely via
51168 * [`RecipientOnionFields::secret_only`].
51170 * [`RecipientOnionFields::secret_only`]: crate::ln::channelmanager::RecipientOnionFields::secret_only
51172 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta, bool allow_mpp);
51175 * Creates parameters for paying to a blinded payee from the provided invoice. Sets
51176 * [`Payee::Blinded::route_hints`], [`Payee::Blinded::features`], and
51177 * [`PaymentParameters::expiry_time`].
51179 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_bolt12_invoice(const struct LDKBolt12Invoice *NONNULL_PTR invoice);
51182 * Creates parameters for paying to a blinded payee from the provided blinded route hints.
51184 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ blinded_route_hints);
51187 * Frees any resources used by the Payee
51189 void Payee_free(struct LDKPayee this_ptr);
51192 * Creates a copy of the Payee
51194 struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig);
51197 * Utility method to constructs a new Blinded-variant Payee
51199 struct LDKPayee Payee_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints, struct LDKBolt12InvoiceFeatures features);
51202 * Utility method to constructs a new Clear-variant Payee
51204 struct LDKPayee Payee_clear(struct LDKPublicKey node_id, struct LDKCVec_RouteHintZ route_hints, struct LDKBolt11InvoiceFeatures features, uint32_t final_cltv_expiry_delta);
51207 * Generates a non-cryptographic 64-bit hash of the Payee.
51209 uint64_t Payee_hash(const struct LDKPayee *NONNULL_PTR o);
51212 * Checks if two Payees contain equal inner contents.
51213 * This ignores pointers and is_owned flags and looks at the values in fields.
51215 bool Payee_eq(const struct LDKPayee *NONNULL_PTR a, const struct LDKPayee *NONNULL_PTR b);
51218 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
51220 void RouteHint_free(struct LDKRouteHint this_obj);
51222 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
51224 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
51227 * Constructs a new RouteHint given each field
51229 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
51232 * Creates a copy of the RouteHint
51234 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
51237 * Generates a non-cryptographic 64-bit hash of the RouteHint.
51239 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
51242 * Checks if two RouteHints contain equal inner contents.
51243 * This ignores pointers and is_owned flags and looks at the values in fields.
51244 * Two objects with NULL inner values will be considered "equal" here.
51246 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
51249 * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
51251 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
51254 * Read a RouteHint from a byte array, created by RouteHint_write
51256 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
51259 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
51261 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
51264 * The node_id of the non-target end of the route
51266 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
51269 * The node_id of the non-target end of the route
51271 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
51274 * The short_channel_id of this channel
51276 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
51279 * The short_channel_id of this channel
51281 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
51284 * The fees which must be paid to use this channel
51286 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
51289 * The fees which must be paid to use this channel
51291 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
51294 * The difference in CLTV values between this node and the next node.
51296 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
51299 * The difference in CLTV values between this node and the next node.
51301 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
51304 * The minimum value, in msat, which must be relayed to the next hop.
51306 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
51309 * The minimum value, in msat, which must be relayed to the next hop.
51311 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
51314 * The maximum value in msat available for routing with a single HTLC.
51316 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
51319 * The maximum value in msat available for routing with a single HTLC.
51321 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
51324 * Constructs a new RouteHintHop given each field
51326 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);
51329 * Creates a copy of the RouteHintHop
51331 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
51334 * Generates a non-cryptographic 64-bit hash of the RouteHintHop.
51336 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
51339 * Checks if two RouteHintHops contain equal inner contents.
51340 * This ignores pointers and is_owned flags and looks at the values in fields.
51341 * Two objects with NULL inner values will be considered "equal" here.
51343 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
51346 * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
51348 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
51351 * Read a RouteHintHop from a byte array, created by RouteHintHop_write
51353 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
51356 * Frees any resources used by the FirstHopCandidate, if is_owned is set and inner is non-NULL.
51358 void FirstHopCandidate_free(struct LDKFirstHopCandidate this_obj);
51361 * Creates a copy of the FirstHopCandidate
51363 struct LDKFirstHopCandidate FirstHopCandidate_clone(const struct LDKFirstHopCandidate *NONNULL_PTR orig);
51366 * Frees any resources used by the PublicHopCandidate, if is_owned is set and inner is non-NULL.
51368 void PublicHopCandidate_free(struct LDKPublicHopCandidate this_obj);
51371 * The short channel ID of the channel, i.e. the identifier by which we refer to this
51374 uint64_t PublicHopCandidate_get_short_channel_id(const struct LDKPublicHopCandidate *NONNULL_PTR this_ptr);
51377 * The short channel ID of the channel, i.e. the identifier by which we refer to this
51380 void PublicHopCandidate_set_short_channel_id(struct LDKPublicHopCandidate *NONNULL_PTR this_ptr, uint64_t val);
51383 * Creates a copy of the PublicHopCandidate
51385 struct LDKPublicHopCandidate PublicHopCandidate_clone(const struct LDKPublicHopCandidate *NONNULL_PTR orig);
51388 * Frees any resources used by the PrivateHopCandidate, if is_owned is set and inner is non-NULL.
51390 void PrivateHopCandidate_free(struct LDKPrivateHopCandidate this_obj);
51393 * Creates a copy of the PrivateHopCandidate
51395 struct LDKPrivateHopCandidate PrivateHopCandidate_clone(const struct LDKPrivateHopCandidate *NONNULL_PTR orig);
51398 * Frees any resources used by the BlindedPathCandidate, if is_owned is set and inner is non-NULL.
51400 void BlindedPathCandidate_free(struct LDKBlindedPathCandidate this_obj);
51403 * Creates a copy of the BlindedPathCandidate
51405 struct LDKBlindedPathCandidate BlindedPathCandidate_clone(const struct LDKBlindedPathCandidate *NONNULL_PTR orig);
51408 * Frees any resources used by the OneHopBlindedPathCandidate, if is_owned is set and inner is non-NULL.
51410 void OneHopBlindedPathCandidate_free(struct LDKOneHopBlindedPathCandidate this_obj);
51413 * Creates a copy of the OneHopBlindedPathCandidate
51415 struct LDKOneHopBlindedPathCandidate OneHopBlindedPathCandidate_clone(const struct LDKOneHopBlindedPathCandidate *NONNULL_PTR orig);
51418 * Frees any resources used by the CandidateRouteHop
51420 void CandidateRouteHop_free(struct LDKCandidateRouteHop this_ptr);
51423 * Creates a copy of the CandidateRouteHop
51425 struct LDKCandidateRouteHop CandidateRouteHop_clone(const struct LDKCandidateRouteHop *NONNULL_PTR orig);
51428 * Utility method to constructs a new FirstHop-variant CandidateRouteHop
51430 struct LDKCandidateRouteHop CandidateRouteHop_first_hop(struct LDKFirstHopCandidate a);
51433 * Utility method to constructs a new PublicHop-variant CandidateRouteHop
51435 struct LDKCandidateRouteHop CandidateRouteHop_public_hop(struct LDKPublicHopCandidate a);
51438 * Utility method to constructs a new PrivateHop-variant CandidateRouteHop
51440 struct LDKCandidateRouteHop CandidateRouteHop_private_hop(struct LDKPrivateHopCandidate a);
51443 * Utility method to constructs a new Blinded-variant CandidateRouteHop
51445 struct LDKCandidateRouteHop CandidateRouteHop_blinded(struct LDKBlindedPathCandidate a);
51448 * Utility method to constructs a new OneHopBlinded-variant CandidateRouteHop
51450 struct LDKCandidateRouteHop CandidateRouteHop_one_hop_blinded(struct LDKOneHopBlindedPathCandidate a);
51453 * Returns the globally unique short channel ID for this hop, if one is known.
51455 * This only returns `Some` if the channel is public (either our own, or one we've learned
51456 * from the public network graph), and thus the short channel ID we have for this channel is
51457 * globally unique and identifies this channel in a global namespace.
51459 MUST_USE_RES struct LDKCOption_u64Z CandidateRouteHop_globally_unique_short_channel_id(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
51462 * Returns the required difference in HTLC CLTV expiry between the [`Self::source`] and the
51463 * next-hop for an HTLC taking this hop.
51465 * This is the time that the node(s) in this hop have to claim the HTLC on-chain if the
51466 * next-hop goes on chain with a payment preimage.
51468 MUST_USE_RES uint32_t CandidateRouteHop_cltv_expiry_delta(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
51471 * Returns the minimum amount that can be sent over this hop, in millisatoshis.
51473 MUST_USE_RES uint64_t CandidateRouteHop_htlc_minimum_msat(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
51476 * Returns the fees that must be paid to route an HTLC over this channel.
51478 MUST_USE_RES struct LDKRoutingFees CandidateRouteHop_fees(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
51481 * Returns the source node id of current hop.
51483 * Source node id refers to the node forwarding the HTLC through this hop.
51485 * For [`Self::FirstHop`] we return payer's node id.
51487 MUST_USE_RES struct LDKNodeId CandidateRouteHop_source(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
51490 * Returns the target node id of this hop, if known.
51492 * Target node id refers to the node receiving the HTLC after this hop.
51494 * For [`Self::Blinded`] we return `None` because the ultimate destination after the blinded
51497 * For [`Self::OneHopBlinded`] we return `None` because the target is the same as the source,
51498 * and such a return value would be somewhat nonsensical.
51500 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
51502 MUST_USE_RES struct LDKNodeId CandidateRouteHop_target(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
51505 * Finds a route from us (payer) to the given target node (payee).
51507 * If the payee provided features in their invoice, they should be provided via the `payee` field
51508 * in the given [`RouteParameters::payment_params`].
51509 * Without this, MPP will only be used if the payee's features are available in the network graph.
51511 * Private routing paths between a public node and the target may be included in the `payee` field
51512 * of [`RouteParameters::payment_params`].
51514 * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
51515 * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels
51516 * from `network_graph` will be ignored, and only those in `first_hops` will be used.
51518 * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
51519 * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
51520 * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
51524 * Panics if first_hops contains channels without `short_channel_id`s;
51525 * [`ChannelManager::list_usable_channels`] will never include such channels.
51527 * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
51528 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
51529 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
51531 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
51533 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]);
51536 * Construct a route from us (payer) to the target node (payee) via the given hops (which should
51537 * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
51539 * Re-uses logic from `find_route`, so the restrictions described there also apply here.
51541 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]);
51544 * Calls the free function if one is set
51546 void ScoreLookUp_free(struct LDKScoreLookUp this_ptr);
51549 * Calls the free function if one is set
51551 void ScoreUpdate_free(struct LDKScoreUpdate this_ptr);
51554 * Calls the free function if one is set
51556 void Score_free(struct LDKScore this_ptr);
51559 * Calls the free function if one is set
51561 void LockableScore_free(struct LDKLockableScore this_ptr);
51564 * Calls the free function if one is set
51566 void WriteableScore_free(struct LDKWriteableScore this_ptr);
51569 * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
51571 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
51574 * Constructs a new LockableScore which calls the relevant methods on this_arg.
51575 * This copies the `inner` pointer in this_arg and thus the returned LockableScore must be freed before this_arg is
51577 struct LDKLockableScore MultiThreadedLockableScore_as_LockableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
51580 * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
51582 struct LDKCVec_u8Z MultiThreadedLockableScore_write(const struct LDKMultiThreadedLockableScore *NONNULL_PTR obj);
51585 * Constructs a new WriteableScore which calls the relevant methods on this_arg.
51586 * This copies the `inner` pointer in this_arg and thus the returned WriteableScore must be freed before this_arg is
51588 struct LDKWriteableScore MultiThreadedLockableScore_as_WriteableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
51591 * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
51593 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
51596 * Frees any resources used by the MultiThreadedScoreLockRead, if is_owned is set and inner is non-NULL.
51598 void MultiThreadedScoreLockRead_free(struct LDKMultiThreadedScoreLockRead this_obj);
51601 * Frees any resources used by the MultiThreadedScoreLockWrite, if is_owned is set and inner is non-NULL.
51603 void MultiThreadedScoreLockWrite_free(struct LDKMultiThreadedScoreLockWrite this_obj);
51606 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
51607 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
51609 struct LDKScoreLookUp MultiThreadedScoreLockRead_as_ScoreLookUp(const struct LDKMultiThreadedScoreLockRead *NONNULL_PTR this_arg);
51612 * Serialize the MultiThreadedScoreLockWrite object into a byte array which can be read by MultiThreadedScoreLockWrite_read
51614 struct LDKCVec_u8Z MultiThreadedScoreLockWrite_write(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR obj);
51617 * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
51618 * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
51620 struct LDKScoreUpdate MultiThreadedScoreLockWrite_as_ScoreUpdate(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR this_arg);
51623 * Frees any resources used by the ChannelUsage, if is_owned is set and inner is non-NULL.
51625 void ChannelUsage_free(struct LDKChannelUsage this_obj);
51628 * The amount to send through the channel, denominated in millisatoshis.
51630 uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
51633 * The amount to send through the channel, denominated in millisatoshis.
51635 void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
51638 * Total amount, denominated in millisatoshis, already allocated to send through the channel
51639 * as part of a multi-path payment.
51641 uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
51644 * Total amount, denominated in millisatoshis, already allocated to send through the channel
51645 * as part of a multi-path payment.
51647 void ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
51650 * The effective capacity of the channel.
51652 struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
51655 * The effective capacity of the channel.
51657 void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val);
51660 * Constructs a new ChannelUsage given each field
51662 MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg);
51665 * Creates a copy of the ChannelUsage
51667 struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig);
51670 * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
51672 void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
51675 * Creates a copy of the FixedPenaltyScorer
51677 struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
51680 * Creates a new scorer using `penalty_msat`.
51682 MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
51685 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
51686 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
51688 struct LDKScoreLookUp FixedPenaltyScorer_as_ScoreLookUp(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
51691 * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
51692 * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
51694 struct LDKScoreUpdate FixedPenaltyScorer_as_ScoreUpdate(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
51697 * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
51699 struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
51702 * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
51704 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
51707 * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
51709 void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
51712 * Frees any resources used by the ProbabilisticScoringFeeParameters, if is_owned is set and inner is non-NULL.
51714 void ProbabilisticScoringFeeParameters_free(struct LDKProbabilisticScoringFeeParameters this_obj);
51717 * A fixed penalty in msats to apply to each channel.
51719 * Default value: 500 msat
51721 uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51724 * A fixed penalty in msats to apply to each channel.
51726 * Default value: 500 msat
51728 void ProbabilisticScoringFeeParameters_set_base_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
51731 * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
51732 * applied to each channel, in excess of the [`base_penalty_msat`].
51734 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
51735 * fees plus penalty) for large payments. The penalty is computed as the product of this
51736 * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
51737 * amount plus the amount of any other HTLCs flowing we sent over the same channel).
51739 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
51741 * Default value: 8,192 msat
51743 * [`base_penalty_msat`]: Self::base_penalty_msat
51745 uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51748 * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
51749 * applied to each channel, in excess of the [`base_penalty_msat`].
51751 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
51752 * fees plus penalty) for large payments. The penalty is computed as the product of this
51753 * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
51754 * amount plus the amount of any other HTLCs flowing we sent over the same channel).
51756 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
51758 * Default value: 8,192 msat
51760 * [`base_penalty_msat`]: Self::base_penalty_msat
51762 void ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
51765 * A multiplier used in conjunction with the negative `log10` of the channel's success
51766 * probability for a payment, as determined by our latest estimates of the channel's
51767 * liquidity, to determine the liquidity penalty.
51769 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
51770 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
51771 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
51772 * lower bounding the success probability to `0.01`) when the amount falls within the
51773 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
51774 * result in a `u64::max_value` penalty, however.
51776 * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
51778 * Default value: 30,000 msat
51780 * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
51782 uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51785 * A multiplier used in conjunction with the negative `log10` of the channel's success
51786 * probability for a payment, as determined by our latest estimates of the channel's
51787 * liquidity, to determine the liquidity penalty.
51789 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
51790 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
51791 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
51792 * lower bounding the success probability to `0.01`) when the amount falls within the
51793 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
51794 * result in a `u64::max_value` penalty, however.
51796 * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
51798 * Default value: 30,000 msat
51800 * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
51802 void ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
51805 * A multiplier used in conjunction with the total amount flowing over a channel and the
51806 * negative `log10` of the channel's success probability for the payment, as determined by our
51807 * latest estimates of the channel's liquidity, to determine the amount penalty.
51809 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
51810 * fees plus penalty) for large payments. The penalty is computed as the product of this
51811 * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
51812 * `log10` of the success probability.
51814 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
51816 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
51817 * the amount will result in a penalty of the multiplier. And, as the success probability
51818 * decreases, the negative `log10` weighting will increase dramatically. For higher success
51819 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
51822 * Default value: 192 msat
51824 uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51827 * A multiplier used in conjunction with the total amount flowing over a channel and the
51828 * negative `log10` of the channel's success probability for the payment, as determined by our
51829 * latest estimates of the channel's liquidity, to determine the amount penalty.
51831 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
51832 * fees plus penalty) for large payments. The penalty is computed as the product of this
51833 * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
51834 * `log10` of the success probability.
51836 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
51838 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
51839 * the amount will result in a penalty of the multiplier. And, as the success probability
51840 * decreases, the negative `log10` weighting will increase dramatically. For higher success
51841 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
51844 * Default value: 192 msat
51846 void ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
51849 * A multiplier used in conjunction with the negative `log10` of the channel's success
51850 * probability for the payment, as determined based on the history of our estimates of the
51851 * channel's available liquidity, to determine a penalty.
51853 * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
51854 * only our latest estimate for the current liquidity available in the channel, it estimates
51855 * success probability based on the estimated liquidity available in the channel through
51856 * history. Specifically, every time we update our liquidity bounds on a given channel, we
51857 * track which of several buckets those bounds fall into, exponentially decaying the
51858 * probability of each bucket as new samples are added.
51860 * Default value: 10,000 msat
51862 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
51864 uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51867 * A multiplier used in conjunction with the negative `log10` of the channel's success
51868 * probability for the payment, as determined based on the history of our estimates of the
51869 * channel's available liquidity, to determine a penalty.
51871 * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
51872 * only our latest estimate for the current liquidity available in the channel, it estimates
51873 * success probability based on the estimated liquidity available in the channel through
51874 * history. Specifically, every time we update our liquidity bounds on a given channel, we
51875 * track which of several buckets those bounds fall into, exponentially decaying the
51876 * probability of each bucket as new samples are added.
51878 * Default value: 10,000 msat
51880 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
51882 void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
51885 * A multiplier used in conjunction with the total amount flowing over a channel and the
51886 * negative `log10` of the channel's success probability for the payment, as determined based
51887 * on the history of our estimates of the channel's available liquidity, to determine a
51890 * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
51891 * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
51892 * of the amount flowing over this channel, weighted by the negative `log10` of the success
51895 * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
51896 * of using only our latest estimate for the current liquidity available in the channel, it
51897 * estimates success probability based on the estimated liquidity available in the channel
51898 * through history. Specifically, every time we update our liquidity bounds on a given
51899 * channel, we track which of several buckets those bounds fall into, exponentially decaying
51900 * the probability of each bucket as new samples are added.
51902 * Default value: 64 msat
51904 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
51906 uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51909 * A multiplier used in conjunction with the total amount flowing over a channel and the
51910 * negative `log10` of the channel's success probability for the payment, as determined based
51911 * on the history of our estimates of the channel's available liquidity, to determine a
51914 * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
51915 * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
51916 * of the amount flowing over this channel, weighted by the negative `log10` of the success
51919 * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
51920 * of using only our latest estimate for the current liquidity available in the channel, it
51921 * estimates success probability based on the estimated liquidity available in the channel
51922 * through history. Specifically, every time we update our liquidity bounds on a given
51923 * channel, we track which of several buckets those bounds fall into, exponentially decaying
51924 * the probability of each bucket as new samples are added.
51926 * Default value: 64 msat
51928 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
51930 void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
51933 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
51934 * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
51935 * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
51936 * as this makes balance discovery attacks harder to execute, thereby creating an incentive
51937 * to restrict `htlc_maximum_msat` and improve privacy.
51939 * Default value: 250 msat
51941 uint64_t ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51944 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
51945 * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
51946 * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
51947 * as this makes balance discovery attacks harder to execute, thereby creating an incentive
51948 * to restrict `htlc_maximum_msat` and improve privacy.
51950 * Default value: 250 msat
51952 void ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
51955 * This penalty is applied when the total amount flowing over a channel exceeds our current
51956 * estimate of the channel's available liquidity. The total amount is the amount of the
51957 * current HTLC plus any HTLCs which we've sent over the same channel.
51959 * Note that in this case all other penalties, including the
51960 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
51961 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
51962 * applicable, are still included in the overall penalty.
51964 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
51965 * `u64::max_value()` will guarantee that.
51967 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
51969 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
51970 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
51971 * [`base_penalty_msat`]: Self::base_penalty_msat
51972 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
51974 uint64_t ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51977 * This penalty is applied when the total amount flowing over a channel exceeds our current
51978 * estimate of the channel's available liquidity. The total amount is the amount of the
51979 * current HTLC plus any HTLCs which we've sent over the same channel.
51981 * Note that in this case all other penalties, including the
51982 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
51983 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
51984 * applicable, are still included in the overall penalty.
51986 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
51987 * `u64::max_value()` will guarantee that.
51989 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
51991 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
51992 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
51993 * [`base_penalty_msat`]: Self::base_penalty_msat
51994 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
51996 void ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
51999 * In order to calculate most of the scores above, we must first convert a lower and upper
52000 * bound on the available liquidity in a channel into the probability that we think a payment
52001 * will succeed. That probability is derived from a Probability Density Function for where we
52002 * think the liquidity in a channel likely lies, given such bounds.
52004 * If this flag is set, that PDF is simply a constant - we assume that the actual available
52005 * liquidity in a channel is just as likely to be at any point between our lower and upper
52008 * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
52009 * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
52010 * matches experimental results - most routing nodes do not aggressively rebalance their
52011 * channels and flows in the network are often unbalanced, leaving liquidity usually
52014 * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
52015 * of floating-point multiplications in the hottest routing code, which may lead to routing
52016 * performance degradation on some machines.
52018 * Default value: false
52020 bool ProbabilisticScoringFeeParameters_get_linear_success_probability(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
52023 * In order to calculate most of the scores above, we must first convert a lower and upper
52024 * bound on the available liquidity in a channel into the probability that we think a payment
52025 * will succeed. That probability is derived from a Probability Density Function for where we
52026 * think the liquidity in a channel likely lies, given such bounds.
52028 * If this flag is set, that PDF is simply a constant - we assume that the actual available
52029 * liquidity in a channel is just as likely to be at any point between our lower and upper
52032 * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
52033 * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
52034 * matches experimental results - most routing nodes do not aggressively rebalance their
52035 * channels and flows in the network are often unbalanced, leaving liquidity usually
52038 * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
52039 * of floating-point multiplications in the hottest routing code, which may lead to routing
52040 * performance degradation on some machines.
52042 * Default value: false
52044 void ProbabilisticScoringFeeParameters_set_linear_success_probability(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, bool val);
52047 * Creates a copy of the ProbabilisticScoringFeeParameters
52049 struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_clone(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR orig);
52052 * Creates a "default" ProbabilisticScoringFeeParameters. See struct and individual field documentaiton for details on which values are used.
52054 MUST_USE_RES struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_default(void);
52057 * Marks the node with the given `node_id` as banned,
52058 * i.e it will be avoided during path finding.
52060 void ProbabilisticScoringFeeParameters_add_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
52063 * Marks all nodes in the given list as banned, i.e.,
52064 * they will be avoided during path finding.
52066 void ProbabilisticScoringFeeParameters_add_banned_from_list(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, struct LDKCVec_NodeIdZ node_ids);
52069 * Removes the node with the given `node_id` from the list of nodes to avoid.
52071 void ProbabilisticScoringFeeParameters_remove_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
52074 * Sets a manual penalty for the given node.
52076 void ProbabilisticScoringFeeParameters_set_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id, uint64_t penalty);
52079 * Removes the node with the given `node_id` from the list of manual penalties.
52081 void ProbabilisticScoringFeeParameters_remove_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
52084 * Clears the list of manual penalties that are applied during path finding.
52086 void ProbabilisticScoringFeeParameters_clear_manual_penalties(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg);
52089 * Frees any resources used by the ProbabilisticScoringDecayParameters, if is_owned is set and inner is non-NULL.
52091 void ProbabilisticScoringDecayParameters_free(struct LDKProbabilisticScoringDecayParameters this_obj);
52094 * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
52095 * tracking can simply live on with increasingly stale data. Instead, when a channel has not
52096 * seen a liquidity estimate update for this amount of time, the historical datapoints are
52098 * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
52100 * Note that after 16 or more half lives all historical data will be completely gone.
52102 * Default value: 14 days
52104 * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorer::historical_estimated_channel_liquidity_probabilities
52106 uint64_t ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
52109 * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
52110 * tracking can simply live on with increasingly stale data. Instead, when a channel has not
52111 * seen a liquidity estimate update for this amount of time, the historical datapoints are
52113 * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
52115 * Note that after 16 or more half lives all historical data will be completely gone.
52117 * Default value: 14 days
52119 * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorer::historical_estimated_channel_liquidity_probabilities
52121 void ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
52124 * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
52125 * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
52126 * the available liquidity is halved and the upper-bound moves half-way to the channel's total
52129 * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
52130 * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
52131 * struct documentation for more info on the way the liquidity bounds are used.
52133 * For example, if the channel's capacity is 1 million sats, and the current upper and lower
52134 * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
52135 * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
52137 * Default value: 6 hours
52141 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
52142 * liquidity knowledge will never decay except when the bounds cross.
52144 uint64_t ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
52147 * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
52148 * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
52149 * the available liquidity is halved and the upper-bound moves half-way to the channel's total
52152 * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
52153 * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
52154 * struct documentation for more info on the way the liquidity bounds are used.
52156 * For example, if the channel's capacity is 1 million sats, and the current upper and lower
52157 * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
52158 * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
52160 * Default value: 6 hours
52164 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
52165 * liquidity knowledge will never decay except when the bounds cross.
52167 void ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
52170 * Constructs a new ProbabilisticScoringDecayParameters given each field
52172 MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_new(uint64_t historical_no_updates_half_life_arg, uint64_t liquidity_offset_half_life_arg);
52175 * Creates a copy of the ProbabilisticScoringDecayParameters
52177 struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_clone(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR orig);
52180 * Creates a "default" ProbabilisticScoringDecayParameters. See struct and individual field documentaiton for details on which values are used.
52182 MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_default(void);
52185 * Creates a new scorer using the given scoring parameters for sending payments from a node
52186 * through a network graph.
52188 MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringDecayParameters decay_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
52191 * Dump the contents of this scorer into the configured logger.
52193 * Note that this writes roughly one line per channel for which we have a liquidity estimate,
52194 * which may be a substantial amount of log output.
52196 void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
52199 * Query the estimated minimum and maximum liquidity available for sending a payment over the
52200 * channel with `scid` towards the given `target` node.
52202 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);
52205 * Query the historical estimated minimum and maximum liquidity available for sending a
52206 * payment over the channel with `scid` towards the given `target` node.
52208 * Returns two sets of 32 buckets. The first set describes the lower-bound liquidity history,
52209 * the second set describes the upper-bound liquidity history. Each bucket describes the
52210 * relative frequency at which we've seen a liquidity bound in the bucket's range relative to
52211 * the channel's total capacity, on an arbitrary scale. Because the values are slowly decayed,
52212 * more recent data points are weighted more heavily than older datapoints.
52214 * Note that the range of each bucket varies by its location to provide more granular results
52215 * at the edges of a channel's capacity, where it is more likely to sit.
52217 * When scoring, the estimated probability that an upper-/lower-bound lies in a given bucket
52218 * is calculated by dividing that bucket's value with the total value of all buckets.
52220 * For example, using a lower bucket count for illustrative purposes, a value of
52221 * `[0, 0, 0, ..., 0, 32]` indicates that we believe the probability of a bound being very
52222 * close to the channel's capacity to be 100%, and have never (recently) seen it in any other
52223 * bucket. A value of `[31, 0, 0, ..., 0, 0, 32]` indicates we've seen the bound being both
52224 * in the top and bottom bucket, and roughly with similar (recent) frequency.
52226 * Because the datapoints are decayed slowly over time, values will eventually return to
52227 * `Some(([0; 32], [0; 32]))` or `None` if no data remains for a channel.
52229 * In order to fetch a single success probability from the buckets provided here, as used in
52230 * the scoring model, see [`Self::historical_estimated_payment_success_probability`].
52232 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);
52235 * Query the probability of payment success sending the given `amount_msat` over the channel
52236 * with `scid` towards the given `target` node, based on the historical estimated liquidity
52239 * These are the same bounds as returned by
52240 * [`Self::historical_estimated_channel_liquidity_probabilities`] (but not those returned by
52241 * [`Self::estimated_channel_liquidity_range`]).
52243 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);
52246 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
52247 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
52249 struct LDKScoreLookUp ProbabilisticScorer_as_ScoreLookUp(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
52252 * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
52253 * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
52255 struct LDKScoreUpdate ProbabilisticScorer_as_ScoreUpdate(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
52258 * Constructs a new Score which calls the relevant methods on this_arg.
52259 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
52261 struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
52264 * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
52266 struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
52269 * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
52271 struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringDecayParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
52274 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
52276 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
52279 * The outpoint which is spendable.
52281 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
52284 * The outpoint which is spendable.
52286 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
52289 * Per commitment point to derive the delayed payment key by key holder.
52291 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
52294 * Per commitment point to derive the delayed payment key by key holder.
52296 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
52299 * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
52300 * the witness_script.
52302 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
52305 * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
52306 * the witness_script.
52308 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
52311 * The output which is referenced by the given outpoint.
52313 struct LDKTxOut DelayedPaymentOutputDescriptor_get_output(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
52316 * The output which is referenced by the given outpoint.
52318 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
52321 * The revocation point specific to the commitment transaction which was broadcast. Used to
52322 * derive the witnessScript for this output.
52324 struct LDKRevocationKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
52327 * The revocation point specific to the commitment transaction which was broadcast. Used to
52328 * derive the witnessScript for this output.
52330 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKRevocationKey val);
52333 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
52334 * This may be useful in re-deriving keys used in the channel to spend the output.
52336 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
52339 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
52340 * This may be useful in re-deriving keys used in the channel to spend the output.
52342 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
52345 * The value of the channel which this output originated from, possibly indirectly.
52347 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
52350 * The value of the channel which this output originated from, possibly indirectly.
52352 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
52355 * The channel public keys and other parameters needed to generate a spending transaction or
52356 * to provide to a re-derived signer through [`ChannelSigner::provide_channel_parameters`].
52358 * Added as optional, but always `Some` if the descriptor was produced in v0.0.123 or later.
52360 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
52362 struct LDKChannelTransactionParameters DelayedPaymentOutputDescriptor_get_channel_transaction_parameters(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
52365 * The channel public keys and other parameters needed to generate a spending transaction or
52366 * to provide to a re-derived signer through [`ChannelSigner::provide_channel_parameters`].
52368 * Added as optional, but always `Some` if the descriptor was produced in v0.0.123 or later.
52370 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
52372 void DelayedPaymentOutputDescriptor_set_channel_transaction_parameters(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
52375 * Constructs a new DelayedPaymentOutputDescriptor given each field
52377 * Note that channel_transaction_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
52379 MUST_USE_RES struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKPublicKey per_commitment_point_arg, uint16_t to_self_delay_arg, struct LDKTxOut output_arg, struct LDKRevocationKey revocation_pubkey_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg, struct LDKChannelTransactionParameters channel_transaction_parameters_arg);
52382 * Creates a copy of the DelayedPaymentOutputDescriptor
52384 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
52387 * Generates a non-cryptographic 64-bit hash of the DelayedPaymentOutputDescriptor.
52389 uint64_t DelayedPaymentOutputDescriptor_hash(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR o);
52392 * Checks if two DelayedPaymentOutputDescriptors contain equal inner contents.
52393 * This ignores pointers and is_owned flags and looks at the values in fields.
52394 * Two objects with NULL inner values will be considered "equal" here.
52396 bool DelayedPaymentOutputDescriptor_eq(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR b);
52399 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
52401 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
52404 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
52406 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
52409 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
52411 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
52414 * The outpoint which is spendable.
52416 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
52419 * The outpoint which is spendable.
52421 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
52424 * The output which is referenced by the given outpoint.
52426 struct LDKTxOut StaticPaymentOutputDescriptor_get_output(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
52429 * The output which is referenced by the given outpoint.
52431 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
52434 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
52435 * This may be useful in re-deriving keys used in the channel to spend the output.
52437 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
52440 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
52441 * This may be useful in re-deriving keys used in the channel to spend the output.
52443 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
52446 * The value of the channel which this transactions spends.
52448 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
52451 * The value of the channel which this transactions spends.
52453 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
52456 * The necessary channel parameters that need to be provided to the re-derived signer through
52457 * [`ChannelSigner::provide_channel_parameters`].
52459 * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
52461 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
52463 struct LDKChannelTransactionParameters StaticPaymentOutputDescriptor_get_channel_transaction_parameters(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
52466 * The necessary channel parameters that need to be provided to the re-derived signer through
52467 * [`ChannelSigner::provide_channel_parameters`].
52469 * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
52471 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
52473 void StaticPaymentOutputDescriptor_set_channel_transaction_parameters(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
52476 * Constructs a new StaticPaymentOutputDescriptor given each field
52478 * Note that channel_transaction_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
52480 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);
52483 * Creates a copy of the StaticPaymentOutputDescriptor
52485 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
52488 * Generates a non-cryptographic 64-bit hash of the StaticPaymentOutputDescriptor.
52490 uint64_t StaticPaymentOutputDescriptor_hash(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR o);
52493 * Checks if two StaticPaymentOutputDescriptors contain equal inner contents.
52494 * This ignores pointers and is_owned flags and looks at the values in fields.
52495 * Two objects with NULL inner values will be considered "equal" here.
52497 bool StaticPaymentOutputDescriptor_eq(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR b);
52500 * Returns the `witness_script` of the spendable output.
52502 * Note that this will only return `Some` for [`StaticPaymentOutputDescriptor`]s that
52503 * originated from an anchor outputs channel, as they take the form of a P2WSH script.
52505 MUST_USE_RES struct LDKCOption_CVec_u8ZZ StaticPaymentOutputDescriptor_witness_script(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
52508 * The maximum length a well-formed witness spending one of these should have.
52509 * Note: If you have the grind_signatures feature enabled, this will be at least 1 byte
52512 MUST_USE_RES uint64_t StaticPaymentOutputDescriptor_max_witness_length(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
52515 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
52517 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
52520 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
52522 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
52525 * Frees any resources used by the SpendableOutputDescriptor
52527 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
52530 * Creates a copy of the SpendableOutputDescriptor
52532 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
52535 * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
52537 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output, struct LDKThirtyTwoBytes channel_keys_id);
52540 * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
52542 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
52545 * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
52547 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
52550 * Generates a non-cryptographic 64-bit hash of the SpendableOutputDescriptor.
52552 uint64_t SpendableOutputDescriptor_hash(const struct LDKSpendableOutputDescriptor *NONNULL_PTR o);
52555 * Checks if two SpendableOutputDescriptors contain equal inner contents.
52556 * This ignores pointers and is_owned flags and looks at the values in fields.
52558 bool SpendableOutputDescriptor_eq(const struct LDKSpendableOutputDescriptor *NONNULL_PTR a, const struct LDKSpendableOutputDescriptor *NONNULL_PTR b);
52561 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
52563 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
52566 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
52568 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
52571 * Creates an unsigned [`PartiallySignedTransaction`] which spends the given descriptors to
52572 * the given outputs, plus an output to the given change destination (if sufficient
52573 * change value remains). The PSBT will have a feerate, at least, of the given value.
52575 * The `locktime` argument is used to set the transaction's locktime. If `None`, the
52576 * transaction will have a locktime of 0. It it recommended to set this to the current block
52577 * height to avoid fee sniping, unless you have some specific reason to use a different
52580 * Returns the PSBT and expected max transaction weight.
52582 * Returns `Err(())` if the output value is greater than the input value minus required fee,
52583 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
52584 * does not match the one we can spend.
52586 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
52588 MUST_USE_RES struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ SpendableOutputDescriptor_create_spendable_outputs_psbt(struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_u32Z locktime);
52591 * Frees any resources used by the ChannelDerivationParameters, if is_owned is set and inner is non-NULL.
52593 void ChannelDerivationParameters_free(struct LDKChannelDerivationParameters this_obj);
52596 * The value in satoshis of the channel we're attempting to spend the anchor output of.
52598 uint64_t ChannelDerivationParameters_get_value_satoshis(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
52601 * The value in satoshis of the channel we're attempting to spend the anchor output of.
52603 void ChannelDerivationParameters_set_value_satoshis(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, uint64_t val);
52606 * The unique identifier to re-derive the signer for the associated channel.
52608 const uint8_t (*ChannelDerivationParameters_get_keys_id(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr))[32];
52611 * The unique identifier to re-derive the signer for the associated channel.
52613 void ChannelDerivationParameters_set_keys_id(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
52616 * The necessary channel parameters that need to be provided to the re-derived signer through
52617 * [`ChannelSigner::provide_channel_parameters`].
52619 struct LDKChannelTransactionParameters ChannelDerivationParameters_get_transaction_parameters(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
52622 * The necessary channel parameters that need to be provided to the re-derived signer through
52623 * [`ChannelSigner::provide_channel_parameters`].
52625 void ChannelDerivationParameters_set_transaction_parameters(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
52628 * Constructs a new ChannelDerivationParameters given each field
52630 MUST_USE_RES struct LDKChannelDerivationParameters ChannelDerivationParameters_new(uint64_t value_satoshis_arg, struct LDKThirtyTwoBytes keys_id_arg, struct LDKChannelTransactionParameters transaction_parameters_arg);
52633 * Creates a copy of the ChannelDerivationParameters
52635 struct LDKChannelDerivationParameters ChannelDerivationParameters_clone(const struct LDKChannelDerivationParameters *NONNULL_PTR orig);
52638 * Checks if two ChannelDerivationParameterss contain equal inner contents.
52639 * This ignores pointers and is_owned flags and looks at the values in fields.
52640 * Two objects with NULL inner values will be considered "equal" here.
52642 bool ChannelDerivationParameters_eq(const struct LDKChannelDerivationParameters *NONNULL_PTR a, const struct LDKChannelDerivationParameters *NONNULL_PTR b);
52645 * Serialize the ChannelDerivationParameters object into a byte array which can be read by ChannelDerivationParameters_read
52647 struct LDKCVec_u8Z ChannelDerivationParameters_write(const struct LDKChannelDerivationParameters *NONNULL_PTR obj);
52650 * Read a ChannelDerivationParameters from a byte array, created by ChannelDerivationParameters_write
52652 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ ChannelDerivationParameters_read(struct LDKu8slice ser);
52655 * Frees any resources used by the HTLCDescriptor, if is_owned is set and inner is non-NULL.
52657 void HTLCDescriptor_free(struct LDKHTLCDescriptor this_obj);
52660 * The parameters required to derive the signer for the HTLC input.
52662 struct LDKChannelDerivationParameters HTLCDescriptor_get_channel_derivation_parameters(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
52665 * The parameters required to derive the signer for the HTLC input.
52667 void HTLCDescriptor_set_channel_derivation_parameters(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
52670 * The txid of the commitment transaction in which the HTLC output lives.
52672 const uint8_t (*HTLCDescriptor_get_commitment_txid(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr))[32];
52675 * The txid of the commitment transaction in which the HTLC output lives.
52677 void HTLCDescriptor_set_commitment_txid(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
52680 * The number of the commitment transaction in which the HTLC output lives.
52682 uint64_t HTLCDescriptor_get_per_commitment_number(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
52685 * The number of the commitment transaction in which the HTLC output lives.
52687 void HTLCDescriptor_set_per_commitment_number(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint64_t val);
52690 * The key tweak corresponding to the number of the commitment transaction in which the HTLC
52691 * output lives. This tweak is applied to all the basepoints for both parties in the channel to
52692 * arrive at unique keys per commitment.
52694 * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
52696 struct LDKPublicKey HTLCDescriptor_get_per_commitment_point(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
52699 * The key tweak corresponding to the number of the commitment transaction in which the HTLC
52700 * output lives. This tweak is applied to all the basepoints for both parties in the channel to
52701 * arrive at unique keys per commitment.
52703 * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
52705 void HTLCDescriptor_set_per_commitment_point(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
52708 * The feerate to use on the HTLC claiming transaction. This is always `0` for HTLCs
52709 * originating from a channel supporting anchor outputs, otherwise it is the channel's
52710 * negotiated feerate at the time the commitment transaction was built.
52712 uint32_t HTLCDescriptor_get_feerate_per_kw(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
52715 * The feerate to use on the HTLC claiming transaction. This is always `0` for HTLCs
52716 * originating from a channel supporting anchor outputs, otherwise it is the channel's
52717 * negotiated feerate at the time the commitment transaction was built.
52719 void HTLCDescriptor_set_feerate_per_kw(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint32_t val);
52722 * The details of the HTLC as it appears in the commitment transaction.
52724 struct LDKHTLCOutputInCommitment HTLCDescriptor_get_htlc(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
52727 * The details of the HTLC as it appears in the commitment transaction.
52729 void HTLCDescriptor_set_htlc(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKHTLCOutputInCommitment val);
52732 * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
52735 struct LDKCOption_ThirtyTwoBytesZ HTLCDescriptor_get_preimage(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
52738 * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
52741 void HTLCDescriptor_set_preimage(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
52744 * The counterparty's signature required to spend the HTLC output.
52746 struct LDKECDSASignature HTLCDescriptor_get_counterparty_sig(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
52749 * The counterparty's signature required to spend the HTLC output.
52751 void HTLCDescriptor_set_counterparty_sig(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
52754 * Constructs a new HTLCDescriptor given each field
52756 MUST_USE_RES struct LDKHTLCDescriptor HTLCDescriptor_new(struct LDKChannelDerivationParameters channel_derivation_parameters_arg, struct LDKThirtyTwoBytes commitment_txid_arg, uint64_t per_commitment_number_arg, struct LDKPublicKey per_commitment_point_arg, uint32_t feerate_per_kw_arg, struct LDKHTLCOutputInCommitment htlc_arg, struct LDKCOption_ThirtyTwoBytesZ preimage_arg, struct LDKECDSASignature counterparty_sig_arg);
52759 * Creates a copy of the HTLCDescriptor
52761 struct LDKHTLCDescriptor HTLCDescriptor_clone(const struct LDKHTLCDescriptor *NONNULL_PTR orig);
52764 * Checks if two HTLCDescriptors contain equal inner contents.
52765 * This ignores pointers and is_owned flags and looks at the values in fields.
52766 * Two objects with NULL inner values will be considered "equal" here.
52768 bool HTLCDescriptor_eq(const struct LDKHTLCDescriptor *NONNULL_PTR a, const struct LDKHTLCDescriptor *NONNULL_PTR b);
52771 * Serialize the HTLCDescriptor object into a byte array which can be read by HTLCDescriptor_read
52773 struct LDKCVec_u8Z HTLCDescriptor_write(const struct LDKHTLCDescriptor *NONNULL_PTR obj);
52776 * Read a HTLCDescriptor from a byte array, created by HTLCDescriptor_write
52778 struct LDKCResult_HTLCDescriptorDecodeErrorZ HTLCDescriptor_read(struct LDKu8slice ser);
52781 * Returns the outpoint of the HTLC output in the commitment transaction. This is the outpoint
52782 * being spent by the HTLC input in the HTLC transaction.
52784 MUST_USE_RES struct LDKOutPoint HTLCDescriptor_outpoint(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
52787 * Returns the UTXO to be spent by the HTLC input, which can be obtained via
52788 * [`Self::unsigned_tx_input`].
52790 MUST_USE_RES struct LDKTxOut HTLCDescriptor_previous_utxo(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
52793 * Returns the unsigned transaction input spending the HTLC output in the commitment
52796 MUST_USE_RES struct LDKTxIn HTLCDescriptor_unsigned_tx_input(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
52799 * Returns the delayed output created as a result of spending the HTLC output in the commitment
52802 MUST_USE_RES struct LDKTxOut HTLCDescriptor_tx_output(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
52805 * Returns the witness script of the HTLC output in the commitment transaction.
52807 MUST_USE_RES struct LDKCVec_u8Z HTLCDescriptor_witness_script(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
52810 * Returns the fully signed witness required to spend the HTLC output in the commitment
52813 MUST_USE_RES struct LDKWitness HTLCDescriptor_tx_input_witness(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature, struct LDKu8slice witness_script);
52816 * Derives the channel signer required to sign the HTLC input.
52818 MUST_USE_RES struct LDKWriteableEcdsaChannelSigner HTLCDescriptor_derive_channel_signer(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
52821 * Calls the free function if one is set
52823 void ChannelSigner_free(struct LDKChannelSigner this_ptr);
52826 * Creates a copy of the Recipient
52828 enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
52831 * Utility method to constructs a new Node-variant Recipient
52833 enum LDKRecipient Recipient_node(void);
52836 * Utility method to constructs a new PhantomNode-variant Recipient
52838 enum LDKRecipient Recipient_phantom_node(void);
52841 * Calls the free function if one is set
52843 void EntropySource_free(struct LDKEntropySource this_ptr);
52846 * Calls the free function if one is set
52848 void NodeSigner_free(struct LDKNodeSigner this_ptr);
52851 * Calls the free function if one is set
52853 void OutputSpender_free(struct LDKOutputSpender this_ptr);
52856 * Calls the free function if one is set
52858 void SignerProvider_free(struct LDKSignerProvider this_ptr);
52861 * Calls the free function if one is set
52863 void ChangeDestinationSource_free(struct LDKChangeDestinationSource this_ptr);
52866 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
52868 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
52871 * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
52872 * holder's anchor output in a commitment transaction, if one is present.
52874 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
52877 * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
52878 * holder's anchor output in a commitment transaction, if one is present.
52880 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
52883 * Holder secret key for blinded revocation pubkey.
52885 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
52888 * Holder secret key for blinded revocation pubkey.
52890 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
52893 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
52895 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
52898 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
52900 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
52903 * Holder secret key used in an HTLC transaction.
52905 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
52908 * Holder secret key used in an HTLC transaction.
52910 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
52913 * Holder HTLC secret key used in commitment transaction HTLC outputs.
52915 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
52918 * Holder HTLC secret key used in commitment transaction HTLC outputs.
52920 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
52925 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
52930 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
52933 * Creates a copy of the InMemorySigner
52935 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
52938 * Creates a new [`InMemorySigner`].
52940 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);
52943 * Returns the counterparty's pubkeys.
52945 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
52946 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
52948 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
52950 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52953 * Returns the `contest_delay` value specified by our counterparty and applied on holder-broadcastable
52954 * transactions, i.e., the amount of time that we have to wait to recover our funds if we
52955 * broadcast a transaction.
52957 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
52958 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
52960 MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52963 * Returns the `contest_delay` value specified by us and applied on transactions broadcastable
52964 * by our counterparty, i.e., the amount of time that they have to wait to recover their funds
52965 * if they broadcast a transaction.
52967 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
52968 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
52970 MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52973 * Returns whether the holder is the initiator.
52975 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
52976 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
52978 MUST_USE_RES struct LDKCOption_boolZ InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52983 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
52984 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
52986 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
52988 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52991 * Returns a [`ChannelTransactionParameters`] for this channel, to be used when verifying or
52992 * building transactions.
52994 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
52995 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
52997 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
52999 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
53002 * Returns the channel type features of the channel parameters. Should be helpful for
53003 * determining a channel's category, i. e. legacy/anchors/taproot/etc.
53005 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
53006 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
53008 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
53010 MUST_USE_RES struct LDKChannelTypeFeatures InMemorySigner_channel_type_features(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
53013 * Sign the single input of `spend_tx` at index `input_idx`, which spends the output described
53014 * by `descriptor`, returning the witness stack for the input.
53016 * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
53017 * is not spending the outpoint described by [`descriptor.outpoint`],
53018 * or if an output descriptor `script_pubkey` does not match the one we can spend.
53020 * [`descriptor.outpoint`]: StaticPaymentOutputDescriptor::outpoint
53022 MUST_USE_RES struct LDKCResult_WitnessNoneZ InMemorySigner_sign_counterparty_payment_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR descriptor);
53025 * Sign the single input of `spend_tx` at index `input_idx` which spends the output
53026 * described by `descriptor`, returning the witness stack for the input.
53028 * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
53029 * is not spending the outpoint described by [`descriptor.outpoint`], does not have a
53030 * sequence set to [`descriptor.to_self_delay`], or if an output descriptor
53031 * `script_pubkey` does not match the one we can spend.
53033 * [`descriptor.outpoint`]: DelayedPaymentOutputDescriptor::outpoint
53034 * [`descriptor.to_self_delay`]: DelayedPaymentOutputDescriptor::to_self_delay
53036 MUST_USE_RES struct LDKCResult_WitnessNoneZ InMemorySigner_sign_dynamic_p2wsh_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR descriptor);
53039 * Constructs a new EntropySource which calls the relevant methods on this_arg.
53040 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
53042 struct LDKEntropySource InMemorySigner_as_EntropySource(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
53045 * Constructs a new ChannelSigner which calls the relevant methods on this_arg.
53046 * This copies the `inner` pointer in this_arg and thus the returned ChannelSigner must be freed before this_arg is
53048 struct LDKChannelSigner InMemorySigner_as_ChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
53051 * Constructs a new EcdsaChannelSigner which calls the relevant methods on this_arg.
53052 * This copies the `inner` pointer in this_arg and thus the returned EcdsaChannelSigner must be freed before this_arg is
53054 struct LDKEcdsaChannelSigner InMemorySigner_as_EcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
53057 * Constructs a new WriteableEcdsaChannelSigner which calls the relevant methods on this_arg.
53058 * This copies the `inner` pointer in this_arg and thus the returned WriteableEcdsaChannelSigner must be freed before this_arg is
53060 struct LDKWriteableEcdsaChannelSigner InMemorySigner_as_WriteableEcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
53063 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
53065 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
53068 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
53070 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKEntropySource arg);
53073 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
53075 void KeysManager_free(struct LDKKeysManager this_obj);
53078 * Constructs a [`KeysManager`] from a 32-byte seed. If the seed is in some way biased (e.g.,
53079 * your CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
53080 * `starting_time` isn't strictly required to actually be a time, but it must absolutely,
53081 * without a doubt, be unique to this instance. ie if you start multiple times with the same
53082 * `seed`, `starting_time` must be unique to each run. Thus, the easiest way to achieve this
53083 * is to simply use the current time (with very high precision).
53085 * The `seed` MUST be backed up safely prior to use so that the keys can be re-created, however,
53086 * obviously, `starting_time` should be unique every time you reload the library - it is only
53087 * used to generate new ephemeral key data (which will be stored by the individual channel if
53090 * Note that the seed is required to recover certain on-chain funds independent of
53091 * [`ChannelMonitor`] data, though a current copy of [`ChannelMonitor`] data is also required
53092 * for any channel, and some on-chain during-closing funds.
53094 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
53096 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
53099 * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
53101 MUST_USE_RES struct LDKSecretKey KeysManager_get_node_secret_key(const struct LDKKeysManager *NONNULL_PTR this_arg);
53104 * Derive an old [`WriteableEcdsaChannelSigner`] containing per-channel secrets based on a key derivation parameters.
53106 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]);
53109 * Signs the given [`PartiallySignedTransaction`] which spends the given [`SpendableOutputDescriptor`]s.
53110 * The resulting inputs will be finalized and the PSBT will be ready for broadcast if there
53111 * are no other inputs that need signing.
53113 * Returns `Err(())` if the PSBT is missing a descriptor or if we fail to sign.
53115 * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used
53116 * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`].
53118 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);
53121 * Constructs a new EntropySource which calls the relevant methods on this_arg.
53122 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
53124 struct LDKEntropySource KeysManager_as_EntropySource(const struct LDKKeysManager *NONNULL_PTR this_arg);
53127 * Constructs a new NodeSigner which calls the relevant methods on this_arg.
53128 * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
53130 struct LDKNodeSigner KeysManager_as_NodeSigner(const struct LDKKeysManager *NONNULL_PTR this_arg);
53133 * Constructs a new OutputSpender which calls the relevant methods on this_arg.
53134 * This copies the `inner` pointer in this_arg and thus the returned OutputSpender must be freed before this_arg is
53136 struct LDKOutputSpender KeysManager_as_OutputSpender(const struct LDKKeysManager *NONNULL_PTR this_arg);
53139 * Constructs a new SignerProvider which calls the relevant methods on this_arg.
53140 * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
53142 struct LDKSignerProvider KeysManager_as_SignerProvider(const struct LDKKeysManager *NONNULL_PTR this_arg);
53145 * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
53147 void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
53150 * Constructs a new EntropySource which calls the relevant methods on this_arg.
53151 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
53153 struct LDKEntropySource PhantomKeysManager_as_EntropySource(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
53156 * Constructs a new NodeSigner which calls the relevant methods on this_arg.
53157 * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
53159 struct LDKNodeSigner PhantomKeysManager_as_NodeSigner(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
53162 * Constructs a new OutputSpender which calls the relevant methods on this_arg.
53163 * This copies the `inner` pointer in this_arg and thus the returned OutputSpender must be freed before this_arg is
53165 struct LDKOutputSpender PhantomKeysManager_as_OutputSpender(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
53168 * Constructs a new SignerProvider which calls the relevant methods on this_arg.
53169 * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
53171 struct LDKSignerProvider PhantomKeysManager_as_SignerProvider(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
53174 * Constructs a [`PhantomKeysManager`] given a 32-byte seed and an additional `cross_node_seed`
53175 * that is shared across all nodes that intend to participate in [phantom node payments]
53178 * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
53179 * `starting_time_nanos`.
53181 * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
53182 * same across restarts, or else inbound payments may fail.
53184 * [phantom node payments]: PhantomKeysManager
53186 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]);
53189 * See [`KeysManager::derive_channel_keys`] for documentation on this method.
53191 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]);
53194 * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
53196 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
53199 * Gets the \"node_id\" secret key of the phantom node used to sign invoices, decode the
53200 * last-hop onion data, etc.
53202 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_phantom_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
53205 * Frees any resources used by the RandomBytes, if is_owned is set and inner is non-NULL.
53207 void RandomBytes_free(struct LDKRandomBytes this_obj);
53210 * Creates a new instance using the given seed.
53212 MUST_USE_RES struct LDKRandomBytes RandomBytes_new(struct LDKThirtyTwoBytes seed);
53215 * Constructs a new EntropySource which calls the relevant methods on this_arg.
53216 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
53218 struct LDKEntropySource RandomBytes_as_EntropySource(const struct LDKRandomBytes *NONNULL_PTR this_arg);
53221 * Calls the free function if one is set
53223 void EcdsaChannelSigner_free(struct LDKEcdsaChannelSigner this_ptr);
53226 * Creates a copy of a WriteableEcdsaChannelSigner
53228 struct LDKWriteableEcdsaChannelSigner WriteableEcdsaChannelSigner_clone(const struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR orig);
53231 * Calls the free function if one is set
53233 void WriteableEcdsaChannelSigner_free(struct LDKWriteableEcdsaChannelSigner this_ptr);
53236 * Frees any resources used by the OnionMessenger, if is_owned is set and inner is non-NULL.
53238 void OnionMessenger_free(struct LDKOnionMessenger this_obj);
53241 * Calls the free function if one is set
53243 void MessageRouter_free(struct LDKMessageRouter this_ptr);
53246 * Frees any resources used by the DefaultMessageRouter, if is_owned is set and inner is non-NULL.
53248 void DefaultMessageRouter_free(struct LDKDefaultMessageRouter this_obj);
53251 * Creates a [`DefaultMessageRouter`] using the given [`NetworkGraph`].
53253 MUST_USE_RES struct LDKDefaultMessageRouter DefaultMessageRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKEntropySource entropy_source);
53256 * Constructs a new MessageRouter which calls the relevant methods on this_arg.
53257 * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is
53259 struct LDKMessageRouter DefaultMessageRouter_as_MessageRouter(const struct LDKDefaultMessageRouter *NONNULL_PTR this_arg);
53262 * Frees any resources used by the OnionMessagePath, if is_owned is set and inner is non-NULL.
53264 void OnionMessagePath_free(struct LDKOnionMessagePath this_obj);
53267 * Nodes on the path between the sender and the destination.
53269 * Returns a copy of the field.
53271 struct LDKCVec_PublicKeyZ OnionMessagePath_get_intermediate_nodes(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
53274 * Nodes on the path between the sender and the destination.
53276 void OnionMessagePath_set_intermediate_nodes(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKCVec_PublicKeyZ val);
53279 * The recipient of the message.
53281 struct LDKDestination OnionMessagePath_get_destination(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
53284 * The recipient of the message.
53286 void OnionMessagePath_set_destination(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKDestination val);
53289 * Addresses that may be used to connect to [`OnionMessagePath::first_node`].
53291 * Only needs to be set if a connection to the node is required. [`OnionMessenger`] may use
53292 * this to initiate such a connection.
53294 * Returns a copy of the field.
53296 struct LDKCOption_CVec_SocketAddressZZ OnionMessagePath_get_first_node_addresses(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
53299 * Addresses that may be used to connect to [`OnionMessagePath::first_node`].
53301 * Only needs to be set if a connection to the node is required. [`OnionMessenger`] may use
53302 * this to initiate such a connection.
53304 void OnionMessagePath_set_first_node_addresses(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKCOption_CVec_SocketAddressZZ val);
53307 * Constructs a new OnionMessagePath given each field
53309 MUST_USE_RES struct LDKOnionMessagePath OnionMessagePath_new(struct LDKCVec_PublicKeyZ intermediate_nodes_arg, struct LDKDestination destination_arg, struct LDKCOption_CVec_SocketAddressZZ first_node_addresses_arg);
53312 * Creates a copy of the OnionMessagePath
53314 struct LDKOnionMessagePath OnionMessagePath_clone(const struct LDKOnionMessagePath *NONNULL_PTR orig);
53317 * Returns the first node in the path.
53319 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
53321 MUST_USE_RES struct LDKPublicKey OnionMessagePath_first_node(const struct LDKOnionMessagePath *NONNULL_PTR this_arg);
53324 * Frees any resources used by the Destination
53326 void Destination_free(struct LDKDestination this_ptr);
53329 * Creates a copy of the Destination
53331 struct LDKDestination Destination_clone(const struct LDKDestination *NONNULL_PTR orig);
53334 * Utility method to constructs a new Node-variant Destination
53336 struct LDKDestination Destination_node(struct LDKPublicKey a);
53339 * Utility method to constructs a new BlindedPath-variant Destination
53341 struct LDKDestination Destination_blinded_path(struct LDKBlindedPath a);
53344 * Generates a non-cryptographic 64-bit hash of the Destination.
53346 uint64_t Destination_hash(const struct LDKDestination *NONNULL_PTR o);
53349 * Checks if two Destinations contain equal inner contents.
53350 * This ignores pointers and is_owned flags and looks at the values in fields.
53352 bool Destination_eq(const struct LDKDestination *NONNULL_PTR a, const struct LDKDestination *NONNULL_PTR b);
53355 * Attempts to resolve the [`IntroductionNode::DirectedShortChannelId`] of a
53356 * [`Destination::BlindedPath`] to a [`IntroductionNode::NodeId`], if applicable, using the
53357 * provided [`ReadOnlyNetworkGraph`].
53359 void Destination_resolve(struct LDKDestination *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph);
53362 * Frees any resources used by the SendSuccess
53364 void SendSuccess_free(struct LDKSendSuccess this_ptr);
53367 * Creates a copy of the SendSuccess
53369 struct LDKSendSuccess SendSuccess_clone(const struct LDKSendSuccess *NONNULL_PTR orig);
53372 * Utility method to constructs a new Buffered-variant SendSuccess
53374 struct LDKSendSuccess SendSuccess_buffered(void);
53377 * Utility method to constructs a new BufferedAwaitingConnection-variant SendSuccess
53379 struct LDKSendSuccess SendSuccess_buffered_awaiting_connection(struct LDKPublicKey a);
53382 * Generates a non-cryptographic 64-bit hash of the SendSuccess.
53384 uint64_t SendSuccess_hash(const struct LDKSendSuccess *NONNULL_PTR o);
53387 * Checks if two SendSuccesss contain equal inner contents.
53388 * This ignores pointers and is_owned flags and looks at the values in fields.
53390 bool SendSuccess_eq(const struct LDKSendSuccess *NONNULL_PTR a, const struct LDKSendSuccess *NONNULL_PTR b);
53393 * Frees any resources used by the SendError
53395 void SendError_free(struct LDKSendError this_ptr);
53398 * Creates a copy of the SendError
53400 struct LDKSendError SendError_clone(const struct LDKSendError *NONNULL_PTR orig);
53403 * Utility method to constructs a new Secp256k1-variant SendError
53405 struct LDKSendError SendError_secp256k1(enum LDKSecp256k1Error a);
53408 * Utility method to constructs a new TooBigPacket-variant SendError
53410 struct LDKSendError SendError_too_big_packet(void);
53413 * Utility method to constructs a new TooFewBlindedHops-variant SendError
53415 struct LDKSendError SendError_too_few_blinded_hops(void);
53418 * Utility method to constructs a new InvalidFirstHop-variant SendError
53420 struct LDKSendError SendError_invalid_first_hop(struct LDKPublicKey a);
53423 * Utility method to constructs a new PathNotFound-variant SendError
53425 struct LDKSendError SendError_path_not_found(void);
53428 * Utility method to constructs a new InvalidMessage-variant SendError
53430 struct LDKSendError SendError_invalid_message(void);
53433 * Utility method to constructs a new BufferFull-variant SendError
53435 struct LDKSendError SendError_buffer_full(void);
53438 * Utility method to constructs a new GetNodeIdFailed-variant SendError
53440 struct LDKSendError SendError_get_node_id_failed(void);
53443 * Utility method to constructs a new UnresolvedIntroductionNode-variant SendError
53445 struct LDKSendError SendError_unresolved_introduction_node(void);
53448 * Utility method to constructs a new BlindedPathAdvanceFailed-variant SendError
53450 struct LDKSendError SendError_blinded_path_advance_failed(void);
53453 * Generates a non-cryptographic 64-bit hash of the SendError.
53455 uint64_t SendError_hash(const struct LDKSendError *NONNULL_PTR o);
53458 * Checks if two SendErrors contain equal inner contents.
53459 * This ignores pointers and is_owned flags and looks at the values in fields.
53461 bool SendError_eq(const struct LDKSendError *NONNULL_PTR a, const struct LDKSendError *NONNULL_PTR b);
53464 * Calls the free function if one is set
53466 void CustomOnionMessageHandler_free(struct LDKCustomOnionMessageHandler this_ptr);
53469 * Frees any resources used by the PeeledOnion
53471 void PeeledOnion_free(struct LDKPeeledOnion this_ptr);
53474 * Creates a copy of the PeeledOnion
53476 struct LDKPeeledOnion PeeledOnion_clone(const struct LDKPeeledOnion *NONNULL_PTR orig);
53479 * Utility method to constructs a new Forward-variant PeeledOnion
53481 struct LDKPeeledOnion PeeledOnion_forward(struct LDKNextMessageHop a, struct LDKOnionMessage b);
53484 * Utility method to constructs a new Receive-variant PeeledOnion
53486 struct LDKPeeledOnion PeeledOnion_receive(struct LDKParsedOnionMessageContents a, struct LDKThirtyTwoBytes b, struct LDKBlindedPath c);
53489 * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of
53490 * `path`, first calling [`Destination::resolve`] on `path.destination` with the given
53491 * [`ReadOnlyNetworkGraph`].
53493 * Returns the node id of the peer to send the message to, the message itself, and any addresses
53494 * needed to connect to the first node.
53496 * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
53498 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ create_onion_message_resolving_destination(const struct LDKEntropySource *NONNULL_PTR entropy_source, const struct LDKNodeSigner *NONNULL_PTR node_signer, const struct LDKNodeIdLookUp *NONNULL_PTR node_id_lookup, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph, struct LDKOnionMessagePath path, struct LDKOnionMessageContents contents, struct LDKBlindedPath reply_path);
53501 * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of
53504 * Returns the node id of the peer to send the message to, the message itself, and any addresses
53505 * needed to connect to the first node.
53507 * Returns [`SendError::UnresolvedIntroductionNode`] if:
53508 * - `destination` contains a blinded path with an [`IntroductionNode::DirectedShortChannelId`],
53509 * - unless it can be resolved by [`NodeIdLookUp::next_node_id`].
53510 * Use [`create_onion_message_resolving_destination`] instead to resolve the introduction node
53511 * first with a [`ReadOnlyNetworkGraph`].
53513 * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
53515 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ create_onion_message(const struct LDKEntropySource *NONNULL_PTR entropy_source, const struct LDKNodeSigner *NONNULL_PTR node_signer, const struct LDKNodeIdLookUp *NONNULL_PTR node_id_lookup, struct LDKOnionMessagePath path, struct LDKOnionMessageContents contents, struct LDKBlindedPath reply_path);
53518 * Decode one layer of an incoming [`OnionMessage`].
53520 * Returns either the next layer of the onion for forwarding or the decrypted content for the
53523 struct LDKCResult_PeeledOnionNoneZ peel_onion_message(const struct LDKOnionMessage *NONNULL_PTR msg, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKCustomOnionMessageHandler custom_handler);
53526 * Constructs a new `OnionMessenger` to send, forward, and delegate received onion messages to
53527 * their respective handlers.
53529 MUST_USE_RES struct LDKOnionMessenger OnionMessenger_new(struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKNodeIdLookUp node_id_lookup, struct LDKMessageRouter message_router, struct LDKOffersMessageHandler offers_handler, struct LDKCustomOnionMessageHandler custom_handler);
53532 * Sends an [`OnionMessage`] with the given `contents` to `destination`.
53534 * See [`OnionMessenger`] for example usage.
53536 * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
53538 MUST_USE_RES struct LDKCResult_SendSuccessSendErrorZ OnionMessenger_send_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKOnionMessageContents contents, struct LDKDestination destination, struct LDKBlindedPath reply_path);
53541 * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
53542 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
53544 struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
53547 * Calls the free function if one is set
53549 void OffersMessageHandler_free(struct LDKOffersMessageHandler this_ptr);
53552 * Frees any resources used by the OffersMessage
53554 void OffersMessage_free(struct LDKOffersMessage this_ptr);
53557 * Creates a copy of the OffersMessage
53559 struct LDKOffersMessage OffersMessage_clone(const struct LDKOffersMessage *NONNULL_PTR orig);
53562 * Utility method to constructs a new InvoiceRequest-variant OffersMessage
53564 struct LDKOffersMessage OffersMessage_invoice_request(struct LDKInvoiceRequest a);
53567 * Utility method to constructs a new Invoice-variant OffersMessage
53569 struct LDKOffersMessage OffersMessage_invoice(struct LDKBolt12Invoice a);
53572 * Utility method to constructs a new InvoiceError-variant OffersMessage
53574 struct LDKOffersMessage OffersMessage_invoice_error(struct LDKInvoiceError a);
53577 * Returns whether `tlv_type` corresponds to a TLV record for Offers.
53579 MUST_USE_RES bool OffersMessage_is_known_type(uint64_t tlv_type);
53582 * Constructs a new OnionMessageContents which calls the relevant methods on this_arg.
53583 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is
53585 struct LDKOnionMessageContents OffersMessage_as_OnionMessageContents(const struct LDKOffersMessage *NONNULL_PTR this_arg);
53588 * Serialize the OffersMessage object into a byte array which can be read by OffersMessage_read
53590 struct LDKCVec_u8Z OffersMessage_write(const struct LDKOffersMessage *NONNULL_PTR obj);
53593 * Read a OffersMessage from a byte array, created by OffersMessage_write
53595 struct LDKCResult_OffersMessageDecodeErrorZ OffersMessage_read(struct LDKu8slice ser, uint64_t arg_a, const struct LDKLogger *NONNULL_PTR arg_b);
53598 * Frees any resources used by the Packet, if is_owned is set and inner is non-NULL.
53600 void Packet_free(struct LDKPacket this_obj);
53603 * Bolt 04 version number
53605 uint8_t Packet_get_version(const struct LDKPacket *NONNULL_PTR this_ptr);
53608 * Bolt 04 version number
53610 void Packet_set_version(struct LDKPacket *NONNULL_PTR this_ptr, uint8_t val);
53613 * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
53615 struct LDKPublicKey Packet_get_public_key(const struct LDKPacket *NONNULL_PTR this_ptr);
53618 * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
53620 void Packet_set_public_key(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKPublicKey val);
53623 * Encrypted payload for the next hop
53625 * Returns a copy of the field.
53627 struct LDKCVec_u8Z Packet_get_hop_data(const struct LDKPacket *NONNULL_PTR this_ptr);
53630 * Encrypted payload for the next hop
53632 void Packet_set_hop_data(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
53635 * HMAC to verify the integrity of hop_data
53637 const uint8_t (*Packet_get_hmac(const struct LDKPacket *NONNULL_PTR this_ptr))[32];
53640 * HMAC to verify the integrity of hop_data
53642 void Packet_set_hmac(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
53645 * Constructs a new Packet given each field
53647 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);
53650 * Creates a copy of the Packet
53652 struct LDKPacket Packet_clone(const struct LDKPacket *NONNULL_PTR orig);
53655 * Generates a non-cryptographic 64-bit hash of the Packet.
53657 uint64_t Packet_hash(const struct LDKPacket *NONNULL_PTR o);
53660 * Checks if two Packets contain equal inner contents.
53661 * This ignores pointers and is_owned flags and looks at the values in fields.
53662 * Two objects with NULL inner values will be considered "equal" here.
53664 bool Packet_eq(const struct LDKPacket *NONNULL_PTR a, const struct LDKPacket *NONNULL_PTR b);
53667 * Serialize the Packet object into a byte array which can be read by Packet_read
53669 struct LDKCVec_u8Z Packet_write(const struct LDKPacket *NONNULL_PTR obj);
53672 * Frees any resources used by the ParsedOnionMessageContents
53674 void ParsedOnionMessageContents_free(struct LDKParsedOnionMessageContents this_ptr);
53677 * Creates a copy of the ParsedOnionMessageContents
53679 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_clone(const struct LDKParsedOnionMessageContents *NONNULL_PTR orig);
53682 * Utility method to constructs a new Offers-variant ParsedOnionMessageContents
53684 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_offers(struct LDKOffersMessage a);
53687 * Utility method to constructs a new Custom-variant ParsedOnionMessageContents
53689 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_custom(struct LDKOnionMessageContents a);
53692 * Constructs a new OnionMessageContents which calls the relevant methods on this_arg.
53693 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is
53695 struct LDKOnionMessageContents ParsedOnionMessageContents_as_OnionMessageContents(const struct LDKParsedOnionMessageContents *NONNULL_PTR this_arg);
53698 * Serialize the ParsedOnionMessageContents object into a byte array which can be read by ParsedOnionMessageContents_read
53700 struct LDKCVec_u8Z ParsedOnionMessageContents_write(const struct LDKParsedOnionMessageContents *NONNULL_PTR obj);
53703 * Creates a copy of a OnionMessageContents
53705 struct LDKOnionMessageContents OnionMessageContents_clone(const struct LDKOnionMessageContents *NONNULL_PTR orig);
53708 * Calls the free function if one is set
53710 void OnionMessageContents_free(struct LDKOnionMessageContents this_ptr);
53713 * Frees any resources used by the NextMessageHop
53715 void NextMessageHop_free(struct LDKNextMessageHop this_ptr);
53718 * Creates a copy of the NextMessageHop
53720 struct LDKNextMessageHop NextMessageHop_clone(const struct LDKNextMessageHop *NONNULL_PTR orig);
53723 * Utility method to constructs a new NodeId-variant NextMessageHop
53725 struct LDKNextMessageHop NextMessageHop_node_id(struct LDKPublicKey a);
53728 * Utility method to constructs a new ShortChannelId-variant NextMessageHop
53730 struct LDKNextMessageHop NextMessageHop_short_channel_id(uint64_t a);
53733 * Generates a non-cryptographic 64-bit hash of the NextMessageHop.
53735 uint64_t NextMessageHop_hash(const struct LDKNextMessageHop *NONNULL_PTR o);
53738 * Checks if two NextMessageHops contain equal inner contents.
53739 * This ignores pointers and is_owned flags and looks at the values in fields.
53741 bool NextMessageHop_eq(const struct LDKNextMessageHop *NONNULL_PTR a, const struct LDKNextMessageHop *NONNULL_PTR b);
53744 * Frees any resources used by the BlindedPath, if is_owned is set and inner is non-NULL.
53746 void BlindedPath_free(struct LDKBlindedPath this_obj);
53749 * To send to a blinded path, the sender first finds a route to the unblinded
53750 * `introduction_node`, which can unblind its [`encrypted_payload`] to find out the onion
53751 * message or payment's next hop and forward it along.
53753 * [`encrypted_payload`]: BlindedHop::encrypted_payload
53755 struct LDKIntroductionNode BlindedPath_get_introduction_node(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
53758 * To send to a blinded path, the sender first finds a route to the unblinded
53759 * `introduction_node`, which can unblind its [`encrypted_payload`] to find out the onion
53760 * message or payment's next hop and forward it along.
53762 * [`encrypted_payload`]: BlindedHop::encrypted_payload
53764 void BlindedPath_set_introduction_node(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKIntroductionNode val);
53767 * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion
53768 * message or payment.
53770 * [`encrypted_payload`]: BlindedHop::encrypted_payload
53772 struct LDKPublicKey BlindedPath_get_blinding_point(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
53775 * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion
53776 * message or payment.
53778 * [`encrypted_payload`]: BlindedHop::encrypted_payload
53780 void BlindedPath_set_blinding_point(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKPublicKey val);
53783 * The hops composing the blinded path.
53785 struct LDKCVec_BlindedHopZ BlindedPath_get_blinded_hops(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
53788 * The hops composing the blinded path.
53790 void BlindedPath_set_blinded_hops(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
53793 * Constructs a new BlindedPath given each field
53795 MUST_USE_RES struct LDKBlindedPath BlindedPath_new(struct LDKIntroductionNode introduction_node_arg, struct LDKPublicKey blinding_point_arg, struct LDKCVec_BlindedHopZ blinded_hops_arg);
53798 * Creates a copy of the BlindedPath
53800 struct LDKBlindedPath BlindedPath_clone(const struct LDKBlindedPath *NONNULL_PTR orig);
53803 * Generates a non-cryptographic 64-bit hash of the BlindedPath.
53805 uint64_t BlindedPath_hash(const struct LDKBlindedPath *NONNULL_PTR o);
53808 * Checks if two BlindedPaths contain equal inner contents.
53809 * This ignores pointers and is_owned flags and looks at the values in fields.
53810 * Two objects with NULL inner values will be considered "equal" here.
53812 bool BlindedPath_eq(const struct LDKBlindedPath *NONNULL_PTR a, const struct LDKBlindedPath *NONNULL_PTR b);
53815 * Frees any resources used by the IntroductionNode
53817 void IntroductionNode_free(struct LDKIntroductionNode this_ptr);
53820 * Creates a copy of the IntroductionNode
53822 struct LDKIntroductionNode IntroductionNode_clone(const struct LDKIntroductionNode *NONNULL_PTR orig);
53825 * Utility method to constructs a new NodeId-variant IntroductionNode
53827 struct LDKIntroductionNode IntroductionNode_node_id(struct LDKPublicKey a);
53830 * Utility method to constructs a new DirectedShortChannelId-variant IntroductionNode
53832 struct LDKIntroductionNode IntroductionNode_directed_short_channel_id(enum LDKDirection a, uint64_t b);
53835 * Generates a non-cryptographic 64-bit hash of the IntroductionNode.
53837 uint64_t IntroductionNode_hash(const struct LDKIntroductionNode *NONNULL_PTR o);
53840 * Checks if two IntroductionNodes contain equal inner contents.
53841 * This ignores pointers and is_owned flags and looks at the values in fields.
53843 bool IntroductionNode_eq(const struct LDKIntroductionNode *NONNULL_PTR a, const struct LDKIntroductionNode *NONNULL_PTR b);
53846 * Creates a copy of the Direction
53848 enum LDKDirection Direction_clone(const enum LDKDirection *NONNULL_PTR orig);
53851 * Utility method to constructs a new NodeOne-variant Direction
53853 enum LDKDirection Direction_node_one(void);
53856 * Utility method to constructs a new NodeTwo-variant Direction
53858 enum LDKDirection Direction_node_two(void);
53861 * Generates a non-cryptographic 64-bit hash of the Direction.
53863 uint64_t Direction_hash(const enum LDKDirection *NONNULL_PTR o);
53866 * Checks if two Directions contain equal inner contents.
53867 * This ignores pointers and is_owned flags and looks at the values in fields.
53869 bool Direction_eq(const enum LDKDirection *NONNULL_PTR a, const enum LDKDirection *NONNULL_PTR b);
53872 * Calls the free function if one is set
53874 void NodeIdLookUp_free(struct LDKNodeIdLookUp this_ptr);
53877 * Frees any resources used by the EmptyNodeIdLookUp, if is_owned is set and inner is non-NULL.
53879 void EmptyNodeIdLookUp_free(struct LDKEmptyNodeIdLookUp this_obj);
53882 * Constructs a new EmptyNodeIdLookUp given each field
53884 MUST_USE_RES struct LDKEmptyNodeIdLookUp EmptyNodeIdLookUp_new(void);
53887 * Constructs a new NodeIdLookUp which calls the relevant methods on this_arg.
53888 * This copies the `inner` pointer in this_arg and thus the returned NodeIdLookUp must be freed before this_arg is
53890 struct LDKNodeIdLookUp EmptyNodeIdLookUp_as_NodeIdLookUp(const struct LDKEmptyNodeIdLookUp *NONNULL_PTR this_arg);
53893 * Frees any resources used by the BlindedHop, if is_owned is set and inner is non-NULL.
53895 void BlindedHop_free(struct LDKBlindedHop this_obj);
53898 * The blinded node id of this hop in a [`BlindedPath`].
53900 struct LDKPublicKey BlindedHop_get_blinded_node_id(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
53903 * The blinded node id of this hop in a [`BlindedPath`].
53905 void BlindedHop_set_blinded_node_id(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
53908 * The encrypted payload intended for this hop in a [`BlindedPath`].
53910 * Returns a copy of the field.
53912 struct LDKCVec_u8Z BlindedHop_get_encrypted_payload(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
53915 * The encrypted payload intended for this hop in a [`BlindedPath`].
53917 void BlindedHop_set_encrypted_payload(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
53920 * Constructs a new BlindedHop given each field
53922 MUST_USE_RES struct LDKBlindedHop BlindedHop_new(struct LDKPublicKey blinded_node_id_arg, struct LDKCVec_u8Z encrypted_payload_arg);
53925 * Creates a copy of the BlindedHop
53927 struct LDKBlindedHop BlindedHop_clone(const struct LDKBlindedHop *NONNULL_PTR orig);
53930 * Generates a non-cryptographic 64-bit hash of the BlindedHop.
53932 uint64_t BlindedHop_hash(const struct LDKBlindedHop *NONNULL_PTR o);
53935 * Checks if two BlindedHops contain equal inner contents.
53936 * This ignores pointers and is_owned flags and looks at the values in fields.
53937 * Two objects with NULL inner values will be considered "equal" here.
53939 bool BlindedHop_eq(const struct LDKBlindedHop *NONNULL_PTR a, const struct LDKBlindedHop *NONNULL_PTR b);
53942 * Create a one-hop blinded path for a message.
53944 MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_one_hop_for_message(struct LDKPublicKey recipient_node_id, struct LDKEntropySource entropy_source);
53947 * Create a blinded path for an onion message, to be forwarded along `node_pks`. The last node
53948 * pubkey in `node_pks` will be the destination node.
53950 * Errors if no hops are provided or if `node_pk`(s) are invalid.
53952 MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_new_for_message(struct LDKCVec_PublicKeyZ node_pks, struct LDKEntropySource entropy_source);
53955 * Create a one-hop blinded path for a payment.
53957 MUST_USE_RES struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_one_hop_for_payment(struct LDKPublicKey payee_node_id, struct LDKReceiveTlvs payee_tlvs, uint16_t min_final_cltv_expiry_delta, struct LDKEntropySource entropy_source);
53960 * Create a blinded path for a payment, to be forwarded along `intermediate_nodes`.
53963 * * a provided node id is invalid
53964 * * [`BlindedPayInfo`] calculation results in an integer overflow
53965 * * any unknown features are required in the provided [`ForwardTlvs`]
53967 * [`ForwardTlvs`]: crate::blinded_path::payment::ForwardTlvs
53969 MUST_USE_RES struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_new_for_payment(struct LDKCVec_ForwardNodeZ intermediate_nodes, struct LDKPublicKey payee_node_id, struct LDKReceiveTlvs payee_tlvs, uint64_t htlc_maximum_msat, uint16_t min_final_cltv_expiry_delta, struct LDKEntropySource entropy_source);
53972 * Returns the introduction [`NodeId`] of the blinded path, if it is publicly reachable (i.e.,
53973 * it is found in the network graph).
53975 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
53977 MUST_USE_RES struct LDKNodeId BlindedPath_public_introduction_node_id(const struct LDKBlindedPath *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph);
53980 * Serialize the BlindedPath object into a byte array which can be read by BlindedPath_read
53982 struct LDKCVec_u8Z BlindedPath_write(const struct LDKBlindedPath *NONNULL_PTR obj);
53985 * Read a BlindedPath from a byte array, created by BlindedPath_write
53987 struct LDKCResult_BlindedPathDecodeErrorZ BlindedPath_read(struct LDKu8slice ser);
53990 * Serialize the BlindedHop object into a byte array which can be read by BlindedHop_read
53992 struct LDKCVec_u8Z BlindedHop_write(const struct LDKBlindedHop *NONNULL_PTR obj);
53995 * Read a BlindedHop from a byte array, created by BlindedHop_write
53997 struct LDKCResult_BlindedHopDecodeErrorZ BlindedHop_read(struct LDKu8slice ser);
54000 * Frees any resources used by the ForwardNode, if is_owned is set and inner is non-NULL.
54002 void ForwardNode_free(struct LDKForwardNode this_obj);
54005 * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
54006 * used for [`BlindedPayInfo`] construction.
54008 struct LDKForwardTlvs ForwardNode_get_tlvs(const struct LDKForwardNode *NONNULL_PTR this_ptr);
54011 * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
54012 * used for [`BlindedPayInfo`] construction.
54014 void ForwardNode_set_tlvs(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKForwardTlvs val);
54017 * This node's pubkey.
54019 struct LDKPublicKey ForwardNode_get_node_id(const struct LDKForwardNode *NONNULL_PTR this_ptr);
54022 * This node's pubkey.
54024 void ForwardNode_set_node_id(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKPublicKey val);
54027 * The maximum value, in msat, that may be accepted by this node.
54029 uint64_t ForwardNode_get_htlc_maximum_msat(const struct LDKForwardNode *NONNULL_PTR this_ptr);
54032 * The maximum value, in msat, that may be accepted by this node.
54034 void ForwardNode_set_htlc_maximum_msat(struct LDKForwardNode *NONNULL_PTR this_ptr, uint64_t val);
54037 * Constructs a new ForwardNode given each field
54039 MUST_USE_RES struct LDKForwardNode ForwardNode_new(struct LDKForwardTlvs tlvs_arg, struct LDKPublicKey node_id_arg, uint64_t htlc_maximum_msat_arg);
54042 * Creates a copy of the ForwardNode
54044 struct LDKForwardNode ForwardNode_clone(const struct LDKForwardNode *NONNULL_PTR orig);
54047 * Frees any resources used by the ForwardTlvs, if is_owned is set and inner is non-NULL.
54049 void ForwardTlvs_free(struct LDKForwardTlvs this_obj);
54052 * The short channel id this payment should be forwarded out over.
54054 uint64_t ForwardTlvs_get_short_channel_id(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
54057 * The short channel id this payment should be forwarded out over.
54059 void ForwardTlvs_set_short_channel_id(struct LDKForwardTlvs *NONNULL_PTR this_ptr, uint64_t val);
54062 * Payment parameters for relaying over [`Self::short_channel_id`].
54064 struct LDKPaymentRelay ForwardTlvs_get_payment_relay(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
54067 * Payment parameters for relaying over [`Self::short_channel_id`].
54069 void ForwardTlvs_set_payment_relay(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentRelay val);
54072 * Payment constraints for relaying over [`Self::short_channel_id`].
54074 struct LDKPaymentConstraints ForwardTlvs_get_payment_constraints(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
54077 * Payment constraints for relaying over [`Self::short_channel_id`].
54079 void ForwardTlvs_set_payment_constraints(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
54082 * Supported and required features when relaying a payment onion containing this object's
54083 * corresponding [`BlindedHop::encrypted_payload`].
54085 * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
54087 struct LDKBlindedHopFeatures ForwardTlvs_get_features(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
54090 * Supported and required features when relaying a payment onion containing this object's
54091 * corresponding [`BlindedHop::encrypted_payload`].
54093 * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
54095 void ForwardTlvs_set_features(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
54098 * Constructs a new ForwardTlvs given each field
54100 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);
54103 * Creates a copy of the ForwardTlvs
54105 struct LDKForwardTlvs ForwardTlvs_clone(const struct LDKForwardTlvs *NONNULL_PTR orig);
54108 * Frees any resources used by the ReceiveTlvs, if is_owned is set and inner is non-NULL.
54110 void ReceiveTlvs_free(struct LDKReceiveTlvs this_obj);
54113 * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
54115 const uint8_t (*ReceiveTlvs_get_payment_secret(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr))[32];
54118 * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
54120 void ReceiveTlvs_set_payment_secret(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
54123 * Constraints for the receiver of this payment.
54125 struct LDKPaymentConstraints ReceiveTlvs_get_payment_constraints(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr);
54128 * Constraints for the receiver of this payment.
54130 void ReceiveTlvs_set_payment_constraints(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
54133 * Context for the receiver of this payment.
54135 struct LDKPaymentContext ReceiveTlvs_get_payment_context(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr);
54138 * Context for the receiver of this payment.
54140 void ReceiveTlvs_set_payment_context(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentContext val);
54143 * Constructs a new ReceiveTlvs given each field
54145 MUST_USE_RES struct LDKReceiveTlvs ReceiveTlvs_new(struct LDKThirtyTwoBytes payment_secret_arg, struct LDKPaymentConstraints payment_constraints_arg, struct LDKPaymentContext payment_context_arg);
54148 * Creates a copy of the ReceiveTlvs
54150 struct LDKReceiveTlvs ReceiveTlvs_clone(const struct LDKReceiveTlvs *NONNULL_PTR orig);
54153 * Frees any resources used by the PaymentRelay, if is_owned is set and inner is non-NULL.
54155 void PaymentRelay_free(struct LDKPaymentRelay this_obj);
54158 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
54160 uint16_t PaymentRelay_get_cltv_expiry_delta(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
54163 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
54165 void PaymentRelay_set_cltv_expiry_delta(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint16_t val);
54168 * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
54169 * this [`BlindedHop`], (i.e., 10,000 is 1%).
54171 uint32_t PaymentRelay_get_fee_proportional_millionths(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
54174 * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
54175 * this [`BlindedHop`], (i.e., 10,000 is 1%).
54177 void PaymentRelay_set_fee_proportional_millionths(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
54180 * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
54182 uint32_t PaymentRelay_get_fee_base_msat(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
54185 * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
54187 void PaymentRelay_set_fee_base_msat(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
54190 * Constructs a new PaymentRelay given each field
54192 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);
54195 * Creates a copy of the PaymentRelay
54197 struct LDKPaymentRelay PaymentRelay_clone(const struct LDKPaymentRelay *NONNULL_PTR orig);
54200 * Frees any resources used by the PaymentConstraints, if is_owned is set and inner is non-NULL.
54202 void PaymentConstraints_free(struct LDKPaymentConstraints this_obj);
54205 * The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
54207 uint32_t PaymentConstraints_get_max_cltv_expiry(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
54210 * The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
54212 void PaymentConstraints_set_max_cltv_expiry(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint32_t val);
54215 * The minimum value, in msat, that may be accepted by the node corresponding to this
54218 uint64_t PaymentConstraints_get_htlc_minimum_msat(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
54221 * The minimum value, in msat, that may be accepted by the node corresponding to this
54224 void PaymentConstraints_set_htlc_minimum_msat(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint64_t val);
54227 * Constructs a new PaymentConstraints given each field
54229 MUST_USE_RES struct LDKPaymentConstraints PaymentConstraints_new(uint32_t max_cltv_expiry_arg, uint64_t htlc_minimum_msat_arg);
54232 * Creates a copy of the PaymentConstraints
54234 struct LDKPaymentConstraints PaymentConstraints_clone(const struct LDKPaymentConstraints *NONNULL_PTR orig);
54237 * Frees any resources used by the PaymentContext
54239 void PaymentContext_free(struct LDKPaymentContext this_ptr);
54242 * Creates a copy of the PaymentContext
54244 struct LDKPaymentContext PaymentContext_clone(const struct LDKPaymentContext *NONNULL_PTR orig);
54247 * Utility method to constructs a new Unknown-variant PaymentContext
54249 struct LDKPaymentContext PaymentContext_unknown(struct LDKUnknownPaymentContext a);
54252 * Utility method to constructs a new Bolt12Offer-variant PaymentContext
54254 struct LDKPaymentContext PaymentContext_bolt12_offer(struct LDKBolt12OfferContext a);
54257 * Utility method to constructs a new Bolt12Refund-variant PaymentContext
54259 struct LDKPaymentContext PaymentContext_bolt12_refund(struct LDKBolt12RefundContext a);
54262 * Checks if two PaymentContexts contain equal inner contents.
54263 * This ignores pointers and is_owned flags and looks at the values in fields.
54265 bool PaymentContext_eq(const struct LDKPaymentContext *NONNULL_PTR a, const struct LDKPaymentContext *NONNULL_PTR b);
54268 * Frees any resources used by the UnknownPaymentContext, if is_owned is set and inner is non-NULL.
54270 void UnknownPaymentContext_free(struct LDKUnknownPaymentContext this_obj);
54273 * Creates a copy of the UnknownPaymentContext
54275 struct LDKUnknownPaymentContext UnknownPaymentContext_clone(const struct LDKUnknownPaymentContext *NONNULL_PTR orig);
54278 * Checks if two UnknownPaymentContexts contain equal inner contents.
54279 * This ignores pointers and is_owned flags and looks at the values in fields.
54280 * Two objects with NULL inner values will be considered "equal" here.
54282 bool UnknownPaymentContext_eq(const struct LDKUnknownPaymentContext *NONNULL_PTR a, const struct LDKUnknownPaymentContext *NONNULL_PTR b);
54285 * Frees any resources used by the Bolt12OfferContext, if is_owned is set and inner is non-NULL.
54287 void Bolt12OfferContext_free(struct LDKBolt12OfferContext this_obj);
54290 * The identifier of the [`Offer`].
54292 * [`Offer`]: crate::offers::offer::Offer
54294 struct LDKOfferId Bolt12OfferContext_get_offer_id(const struct LDKBolt12OfferContext *NONNULL_PTR this_ptr);
54297 * The identifier of the [`Offer`].
54299 * [`Offer`]: crate::offers::offer::Offer
54301 void Bolt12OfferContext_set_offer_id(struct LDKBolt12OfferContext *NONNULL_PTR this_ptr, struct LDKOfferId val);
54304 * Fields from an [`InvoiceRequest`] sent for a [`Bolt12Invoice`].
54306 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
54307 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
54309 struct LDKInvoiceRequestFields Bolt12OfferContext_get_invoice_request(const struct LDKBolt12OfferContext *NONNULL_PTR this_ptr);
54312 * Fields from an [`InvoiceRequest`] sent for a [`Bolt12Invoice`].
54314 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
54315 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
54317 void Bolt12OfferContext_set_invoice_request(struct LDKBolt12OfferContext *NONNULL_PTR this_ptr, struct LDKInvoiceRequestFields val);
54320 * Constructs a new Bolt12OfferContext given each field
54322 MUST_USE_RES struct LDKBolt12OfferContext Bolt12OfferContext_new(struct LDKOfferId offer_id_arg, struct LDKInvoiceRequestFields invoice_request_arg);
54325 * Creates a copy of the Bolt12OfferContext
54327 struct LDKBolt12OfferContext Bolt12OfferContext_clone(const struct LDKBolt12OfferContext *NONNULL_PTR orig);
54330 * Checks if two Bolt12OfferContexts contain equal inner contents.
54331 * This ignores pointers and is_owned flags and looks at the values in fields.
54332 * Two objects with NULL inner values will be considered "equal" here.
54334 bool Bolt12OfferContext_eq(const struct LDKBolt12OfferContext *NONNULL_PTR a, const struct LDKBolt12OfferContext *NONNULL_PTR b);
54337 * Frees any resources used by the Bolt12RefundContext, if is_owned is set and inner is non-NULL.
54339 void Bolt12RefundContext_free(struct LDKBolt12RefundContext this_obj);
54342 * Constructs a new Bolt12RefundContext given each field
54344 MUST_USE_RES struct LDKBolt12RefundContext Bolt12RefundContext_new(void);
54347 * Creates a copy of the Bolt12RefundContext
54349 struct LDKBolt12RefundContext Bolt12RefundContext_clone(const struct LDKBolt12RefundContext *NONNULL_PTR orig);
54352 * Checks if two Bolt12RefundContexts contain equal inner contents.
54353 * This ignores pointers and is_owned flags and looks at the values in fields.
54354 * Two objects with NULL inner values will be considered "equal" here.
54356 bool Bolt12RefundContext_eq(const struct LDKBolt12RefundContext *NONNULL_PTR a, const struct LDKBolt12RefundContext *NONNULL_PTR b);
54359 * Serialize the ForwardTlvs object into a byte array which can be read by ForwardTlvs_read
54361 struct LDKCVec_u8Z ForwardTlvs_write(const struct LDKForwardTlvs *NONNULL_PTR obj);
54364 * Serialize the ReceiveTlvs object into a byte array which can be read by ReceiveTlvs_read
54366 struct LDKCVec_u8Z ReceiveTlvs_write(const struct LDKReceiveTlvs *NONNULL_PTR obj);
54369 * Serialize the PaymentRelay object into a byte array which can be read by PaymentRelay_read
54371 struct LDKCVec_u8Z PaymentRelay_write(const struct LDKPaymentRelay *NONNULL_PTR obj);
54374 * Read a PaymentRelay from a byte array, created by PaymentRelay_write
54376 struct LDKCResult_PaymentRelayDecodeErrorZ PaymentRelay_read(struct LDKu8slice ser);
54379 * Serialize the PaymentConstraints object into a byte array which can be read by PaymentConstraints_read
54381 struct LDKCVec_u8Z PaymentConstraints_write(const struct LDKPaymentConstraints *NONNULL_PTR obj);
54384 * Read a PaymentConstraints from a byte array, created by PaymentConstraints_write
54386 struct LDKCResult_PaymentConstraintsDecodeErrorZ PaymentConstraints_read(struct LDKu8slice ser);
54389 * Serialize the PaymentContext object into a byte array which can be read by PaymentContext_read
54391 struct LDKCVec_u8Z PaymentContext_write(const struct LDKPaymentContext *NONNULL_PTR obj);
54394 * Read a PaymentContext from a byte array, created by PaymentContext_write
54396 struct LDKCResult_PaymentContextDecodeErrorZ PaymentContext_read(struct LDKu8slice ser);
54399 * Serialize the UnknownPaymentContext object into a byte array which can be read by UnknownPaymentContext_read
54401 struct LDKCVec_u8Z UnknownPaymentContext_write(const struct LDKUnknownPaymentContext *NONNULL_PTR obj);
54404 * Read a UnknownPaymentContext from a byte array, created by UnknownPaymentContext_write
54406 struct LDKCResult_UnknownPaymentContextDecodeErrorZ UnknownPaymentContext_read(struct LDKu8slice ser);
54409 * Serialize the Bolt12OfferContext object into a byte array which can be read by Bolt12OfferContext_read
54411 struct LDKCVec_u8Z Bolt12OfferContext_write(const struct LDKBolt12OfferContext *NONNULL_PTR obj);
54414 * Read a Bolt12OfferContext from a byte array, created by Bolt12OfferContext_write
54416 struct LDKCResult_Bolt12OfferContextDecodeErrorZ Bolt12OfferContext_read(struct LDKu8slice ser);
54419 * Serialize the Bolt12RefundContext object into a byte array which can be read by Bolt12RefundContext_read
54421 struct LDKCVec_u8Z Bolt12RefundContext_write(const struct LDKBolt12RefundContext *NONNULL_PTR obj);
54424 * Read a Bolt12RefundContext from a byte array, created by Bolt12RefundContext_write
54426 struct LDKCResult_Bolt12RefundContextDecodeErrorZ Bolt12RefundContext_read(struct LDKu8slice ser);
54429 * Frees any resources used by the PaymentPurpose
54431 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
54434 * Creates a copy of the PaymentPurpose
54436 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
54439 * Utility method to constructs a new Bolt11InvoicePayment-variant PaymentPurpose
54441 struct LDKPaymentPurpose PaymentPurpose_bolt11_invoice_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret);
54444 * Utility method to constructs a new Bolt12OfferPayment-variant PaymentPurpose
54446 struct LDKPaymentPurpose PaymentPurpose_bolt12_offer_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret, struct LDKBolt12OfferContext payment_context);
54449 * Utility method to constructs a new Bolt12RefundPayment-variant PaymentPurpose
54451 struct LDKPaymentPurpose PaymentPurpose_bolt12_refund_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret, struct LDKBolt12RefundContext payment_context);
54454 * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
54456 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
54459 * Checks if two PaymentPurposes contain equal inner contents.
54460 * This ignores pointers and is_owned flags and looks at the values in fields.
54462 bool PaymentPurpose_eq(const struct LDKPaymentPurpose *NONNULL_PTR a, const struct LDKPaymentPurpose *NONNULL_PTR b);
54465 * Returns the preimage for this payment, if it is known.
54467 MUST_USE_RES struct LDKCOption_ThirtyTwoBytesZ PaymentPurpose_preimage(const struct LDKPaymentPurpose *NONNULL_PTR this_arg);
54470 * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
54472 struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj);
54475 * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
54477 struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser);
54480 * Frees any resources used by the ClaimedHTLC, if is_owned is set and inner is non-NULL.
54482 void ClaimedHTLC_free(struct LDKClaimedHTLC this_obj);
54485 * The `channel_id` of the channel over which the HTLC was received.
54487 struct LDKChannelId ClaimedHTLC_get_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
54490 * The `channel_id` of the channel over which the HTLC was received.
54492 void ClaimedHTLC_set_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
54495 * The `user_channel_id` of the channel over which the HTLC was received. This is the value
54496 * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
54497 * [`ChannelManager::accept_inbound_channel`] for inbound channels if
54498 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
54499 * `user_channel_id` will be randomized for an inbound channel.
54501 * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
54502 * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
54503 * was not actually claimed until after upgrading.)
54505 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
54506 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
54507 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
54509 struct LDKU128 ClaimedHTLC_get_user_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
54512 * The `user_channel_id` of the channel over which the HTLC was received. This is the value
54513 * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
54514 * [`ChannelManager::accept_inbound_channel`] for inbound channels if
54515 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
54516 * `user_channel_id` will be randomized for an inbound channel.
54518 * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
54519 * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
54520 * was not actually claimed until after upgrading.)
54522 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
54523 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
54524 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
54526 void ClaimedHTLC_set_user_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKU128 val);
54529 * The block height at which this HTLC expires.
54531 uint32_t ClaimedHTLC_get_cltv_expiry(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
54534 * The block height at which this HTLC expires.
54536 void ClaimedHTLC_set_cltv_expiry(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint32_t val);
54539 * The amount (in msats) of this part of an MPP.
54541 uint64_t ClaimedHTLC_get_value_msat(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
54544 * The amount (in msats) of this part of an MPP.
54546 void ClaimedHTLC_set_value_msat(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint64_t val);
54549 * The extra fee our counterparty skimmed off the top of this HTLC, if any.
54551 * This value will always be 0 for [`ClaimedHTLC`]s serialized with LDK versions prior to
54554 uint64_t ClaimedHTLC_get_counterparty_skimmed_fee_msat(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
54557 * The extra fee our counterparty skimmed off the top of this HTLC, if any.
54559 * This value will always be 0 for [`ClaimedHTLC`]s serialized with LDK versions prior to
54562 void ClaimedHTLC_set_counterparty_skimmed_fee_msat(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint64_t val);
54565 * Constructs a new ClaimedHTLC given each field
54567 MUST_USE_RES struct LDKClaimedHTLC ClaimedHTLC_new(struct LDKChannelId channel_id_arg, struct LDKU128 user_channel_id_arg, uint32_t cltv_expiry_arg, uint64_t value_msat_arg, uint64_t counterparty_skimmed_fee_msat_arg);
54570 * Creates a copy of the ClaimedHTLC
54572 struct LDKClaimedHTLC ClaimedHTLC_clone(const struct LDKClaimedHTLC *NONNULL_PTR orig);
54575 * Checks if two ClaimedHTLCs contain equal inner contents.
54576 * This ignores pointers and is_owned flags and looks at the values in fields.
54577 * Two objects with NULL inner values will be considered "equal" here.
54579 bool ClaimedHTLC_eq(const struct LDKClaimedHTLC *NONNULL_PTR a, const struct LDKClaimedHTLC *NONNULL_PTR b);
54582 * Serialize the ClaimedHTLC object into a byte array which can be read by ClaimedHTLC_read
54584 struct LDKCVec_u8Z ClaimedHTLC_write(const struct LDKClaimedHTLC *NONNULL_PTR obj);
54587 * Read a ClaimedHTLC from a byte array, created by ClaimedHTLC_write
54589 struct LDKCResult_ClaimedHTLCDecodeErrorZ ClaimedHTLC_read(struct LDKu8slice ser);
54592 * Frees any resources used by the PathFailure
54594 void PathFailure_free(struct LDKPathFailure this_ptr);
54597 * Creates a copy of the PathFailure
54599 struct LDKPathFailure PathFailure_clone(const struct LDKPathFailure *NONNULL_PTR orig);
54602 * Utility method to constructs a new InitialSend-variant PathFailure
54604 struct LDKPathFailure PathFailure_initial_send(struct LDKAPIError err);
54607 * Utility method to constructs a new OnPath-variant PathFailure
54609 struct LDKPathFailure PathFailure_on_path(struct LDKCOption_NetworkUpdateZ network_update);
54612 * Checks if two PathFailures contain equal inner contents.
54613 * This ignores pointers and is_owned flags and looks at the values in fields.
54615 bool PathFailure_eq(const struct LDKPathFailure *NONNULL_PTR a, const struct LDKPathFailure *NONNULL_PTR b);
54618 * Serialize the PathFailure object into a byte array which can be read by PathFailure_read
54620 struct LDKCVec_u8Z PathFailure_write(const struct LDKPathFailure *NONNULL_PTR obj);
54623 * Read a PathFailure from a byte array, created by PathFailure_write
54625 struct LDKCResult_COption_PathFailureZDecodeErrorZ PathFailure_read(struct LDKu8slice ser);
54628 * Frees any resources used by the ClosureReason
54630 void ClosureReason_free(struct LDKClosureReason this_ptr);
54633 * Creates a copy of the ClosureReason
54635 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
54638 * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
54640 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKUntrustedString peer_msg);
54643 * Utility method to constructs a new HolderForceClosed-variant ClosureReason
54645 struct LDKClosureReason ClosureReason_holder_force_closed(void);
54648 * Utility method to constructs a new LegacyCooperativeClosure-variant ClosureReason
54650 struct LDKClosureReason ClosureReason_legacy_cooperative_closure(void);
54653 * Utility method to constructs a new CounterpartyInitiatedCooperativeClosure-variant ClosureReason
54655 struct LDKClosureReason ClosureReason_counterparty_initiated_cooperative_closure(void);
54658 * Utility method to constructs a new LocallyInitiatedCooperativeClosure-variant ClosureReason
54660 struct LDKClosureReason ClosureReason_locally_initiated_cooperative_closure(void);
54663 * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
54665 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
54668 * Utility method to constructs a new FundingTimedOut-variant ClosureReason
54670 struct LDKClosureReason ClosureReason_funding_timed_out(void);
54673 * Utility method to constructs a new ProcessingError-variant ClosureReason
54675 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
54678 * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
54680 struct LDKClosureReason ClosureReason_disconnected_peer(void);
54683 * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
54685 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
54688 * Utility method to constructs a new CounterpartyCoopClosedUnfundedChannel-variant ClosureReason
54690 struct LDKClosureReason ClosureReason_counterparty_coop_closed_unfunded_channel(void);
54693 * Utility method to constructs a new FundingBatchClosure-variant ClosureReason
54695 struct LDKClosureReason ClosureReason_funding_batch_closure(void);
54698 * Utility method to constructs a new HTLCsTimedOut-variant ClosureReason
54700 struct LDKClosureReason ClosureReason_htlcs_timed_out(void);
54703 * Checks if two ClosureReasons contain equal inner contents.
54704 * This ignores pointers and is_owned flags and looks at the values in fields.
54706 bool ClosureReason_eq(const struct LDKClosureReason *NONNULL_PTR a, const struct LDKClosureReason *NONNULL_PTR b);
54709 * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
54711 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
54714 * Read a ClosureReason from a byte array, created by ClosureReason_write
54716 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
54719 * Frees any resources used by the HTLCDestination
54721 void HTLCDestination_free(struct LDKHTLCDestination this_ptr);
54724 * Creates a copy of the HTLCDestination
54726 struct LDKHTLCDestination HTLCDestination_clone(const struct LDKHTLCDestination *NONNULL_PTR orig);
54729 * Utility method to constructs a new NextHopChannel-variant HTLCDestination
54731 struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKChannelId channel_id);
54734 * Utility method to constructs a new UnknownNextHop-variant HTLCDestination
54736 struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid);
54739 * Utility method to constructs a new InvalidForward-variant HTLCDestination
54741 struct LDKHTLCDestination HTLCDestination_invalid_forward(uint64_t requested_forward_scid);
54744 * Utility method to constructs a new InvalidOnion-variant HTLCDestination
54746 struct LDKHTLCDestination HTLCDestination_invalid_onion(void);
54749 * Utility method to constructs a new FailedPayment-variant HTLCDestination
54751 struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash);
54754 * Checks if two HTLCDestinations contain equal inner contents.
54755 * This ignores pointers and is_owned flags and looks at the values in fields.
54757 bool HTLCDestination_eq(const struct LDKHTLCDestination *NONNULL_PTR a, const struct LDKHTLCDestination *NONNULL_PTR b);
54760 * Serialize the HTLCDestination object into a byte array which can be read by HTLCDestination_read
54762 struct LDKCVec_u8Z HTLCDestination_write(const struct LDKHTLCDestination *NONNULL_PTR obj);
54765 * Read a HTLCDestination from a byte array, created by HTLCDestination_write
54767 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(struct LDKu8slice ser);
54770 * Creates a copy of the PaymentFailureReason
54772 enum LDKPaymentFailureReason PaymentFailureReason_clone(const enum LDKPaymentFailureReason *NONNULL_PTR orig);
54775 * Utility method to constructs a new RecipientRejected-variant PaymentFailureReason
54777 enum LDKPaymentFailureReason PaymentFailureReason_recipient_rejected(void);
54780 * Utility method to constructs a new UserAbandoned-variant PaymentFailureReason
54782 enum LDKPaymentFailureReason PaymentFailureReason_user_abandoned(void);
54785 * Utility method to constructs a new RetriesExhausted-variant PaymentFailureReason
54787 enum LDKPaymentFailureReason PaymentFailureReason_retries_exhausted(void);
54790 * Utility method to constructs a new PaymentExpired-variant PaymentFailureReason
54792 enum LDKPaymentFailureReason PaymentFailureReason_payment_expired(void);
54795 * Utility method to constructs a new RouteNotFound-variant PaymentFailureReason
54797 enum LDKPaymentFailureReason PaymentFailureReason_route_not_found(void);
54800 * Utility method to constructs a new UnexpectedError-variant PaymentFailureReason
54802 enum LDKPaymentFailureReason PaymentFailureReason_unexpected_error(void);
54805 * Checks if two PaymentFailureReasons contain equal inner contents.
54806 * This ignores pointers and is_owned flags and looks at the values in fields.
54808 bool PaymentFailureReason_eq(const enum LDKPaymentFailureReason *NONNULL_PTR a, const enum LDKPaymentFailureReason *NONNULL_PTR b);
54811 * Serialize the PaymentFailureReason object into a byte array which can be read by PaymentFailureReason_read
54813 struct LDKCVec_u8Z PaymentFailureReason_write(const enum LDKPaymentFailureReason *NONNULL_PTR obj);
54816 * Read a PaymentFailureReason from a byte array, created by PaymentFailureReason_write
54818 struct LDKCResult_PaymentFailureReasonDecodeErrorZ PaymentFailureReason_read(struct LDKu8slice ser);
54821 * Frees any resources used by the Event
54823 void Event_free(struct LDKEvent this_ptr);
54826 * Creates a copy of the Event
54828 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
54831 * Utility method to constructs a new FundingGenerationReady-variant Event
54833 struct LDKEvent Event_funding_generation_ready(struct LDKChannelId temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, struct LDKU128 user_channel_id);
54836 * Utility method to constructs a new PaymentClaimable-variant Event
54838 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 LDKChannelId via_channel_id, struct LDKCOption_U128Z via_user_channel_id, struct LDKCOption_u32Z claim_deadline);
54841 * Utility method to constructs a new PaymentClaimed-variant Event
54843 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);
54846 * Utility method to constructs a new ConnectionNeeded-variant Event
54848 struct LDKEvent Event_connection_needed(struct LDKPublicKey node_id, struct LDKCVec_SocketAddressZ addresses);
54851 * Utility method to constructs a new InvoiceRequestFailed-variant Event
54853 struct LDKEvent Event_invoice_request_failed(struct LDKThirtyTwoBytes payment_id);
54856 * Utility method to constructs a new PaymentSent-variant Event
54858 struct LDKEvent Event_payment_sent(struct LDKCOption_ThirtyTwoBytesZ payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
54861 * Utility method to constructs a new PaymentFailed-variant Event
54863 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_PaymentFailureReasonZ reason);
54866 * Utility method to constructs a new PaymentPathSuccessful-variant Event
54868 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash, struct LDKPath path);
54871 * Utility method to constructs a new PaymentPathFailed-variant Event
54873 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);
54876 * Utility method to constructs a new ProbeSuccessful-variant Event
54878 struct LDKEvent Event_probe_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path);
54881 * Utility method to constructs a new ProbeFailed-variant Event
54883 struct LDKEvent Event_probe_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path, struct LDKCOption_u64Z short_channel_id);
54886 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
54888 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
54891 * Utility method to constructs a new HTLCIntercepted-variant Event
54893 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);
54896 * Utility method to constructs a new SpendableOutputs-variant Event
54898 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs, struct LDKChannelId channel_id);
54901 * Utility method to constructs a new PaymentForwarded-variant Event
54903 struct LDKEvent Event_payment_forwarded(struct LDKChannelId prev_channel_id, struct LDKChannelId next_channel_id, struct LDKCOption_U128Z prev_user_channel_id, struct LDKCOption_U128Z next_user_channel_id, struct LDKCOption_u64Z total_fee_earned_msat, struct LDKCOption_u64Z skimmed_fee_msat, bool claim_from_onchain_tx, struct LDKCOption_u64Z outbound_amount_forwarded_msat);
54906 * Utility method to constructs a new ChannelPending-variant Event
54908 struct LDKEvent Event_channel_pending(struct LDKChannelId channel_id, struct LDKU128 user_channel_id, struct LDKChannelId former_temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKOutPoint funding_txo, struct LDKChannelTypeFeatures channel_type);
54911 * Utility method to constructs a new ChannelReady-variant Event
54913 struct LDKEvent Event_channel_ready(struct LDKChannelId channel_id, struct LDKU128 user_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKChannelTypeFeatures channel_type);
54916 * Utility method to constructs a new ChannelClosed-variant Event
54918 struct LDKEvent Event_channel_closed(struct LDKChannelId channel_id, struct LDKU128 user_channel_id, struct LDKClosureReason reason, struct LDKPublicKey counterparty_node_id, struct LDKCOption_u64Z channel_capacity_sats, struct LDKOutPoint channel_funding_txo);
54921 * Utility method to constructs a new DiscardFunding-variant Event
54923 struct LDKEvent Event_discard_funding(struct LDKChannelId channel_id, struct LDKTransaction transaction);
54926 * Utility method to constructs a new OpenChannelRequest-variant Event
54928 struct LDKEvent Event_open_channel_request(struct LDKChannelId temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t funding_satoshis, uint64_t push_msat, struct LDKChannelTypeFeatures channel_type);
54931 * Utility method to constructs a new HTLCHandlingFailed-variant Event
54933 struct LDKEvent Event_htlchandling_failed(struct LDKChannelId prev_channel_id, struct LDKHTLCDestination failed_next_destination);
54936 * Utility method to constructs a new BumpTransaction-variant Event
54938 struct LDKEvent Event_bump_transaction(struct LDKBumpTransactionEvent a);
54941 * Checks if two Events contain equal inner contents.
54942 * This ignores pointers and is_owned flags and looks at the values in fields.
54944 bool Event_eq(const struct LDKEvent *NONNULL_PTR a, const struct LDKEvent *NONNULL_PTR b);
54947 * Serialize the Event object into a byte array which can be read by Event_read
54949 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
54952 * Read a Event from a byte array, created by Event_write
54954 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
54957 * Frees any resources used by the MessageSendEvent
54959 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
54962 * Creates a copy of the MessageSendEvent
54964 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
54967 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
54969 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
54972 * Utility method to constructs a new SendAcceptChannelV2-variant MessageSendEvent
54974 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel_v2(struct LDKPublicKey node_id, struct LDKAcceptChannelV2 msg);
54977 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
54979 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
54982 * Utility method to constructs a new SendOpenChannelV2-variant MessageSendEvent
54984 struct LDKMessageSendEvent MessageSendEvent_send_open_channel_v2(struct LDKPublicKey node_id, struct LDKOpenChannelV2 msg);
54987 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
54989 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
54992 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
54994 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
54997 * Utility method to constructs a new SendStfu-variant MessageSendEvent
54999 struct LDKMessageSendEvent MessageSendEvent_send_stfu(struct LDKPublicKey node_id, struct LDKStfu msg);
55002 * Utility method to constructs a new SendSplice-variant MessageSendEvent
55004 struct LDKMessageSendEvent MessageSendEvent_send_splice(struct LDKPublicKey node_id, struct LDKSplice msg);
55007 * Utility method to constructs a new SendSpliceAck-variant MessageSendEvent
55009 struct LDKMessageSendEvent MessageSendEvent_send_splice_ack(struct LDKPublicKey node_id, struct LDKSpliceAck msg);
55012 * Utility method to constructs a new SendSpliceLocked-variant MessageSendEvent
55014 struct LDKMessageSendEvent MessageSendEvent_send_splice_locked(struct LDKPublicKey node_id, struct LDKSpliceLocked msg);
55017 * Utility method to constructs a new SendTxAddInput-variant MessageSendEvent
55019 struct LDKMessageSendEvent MessageSendEvent_send_tx_add_input(struct LDKPublicKey node_id, struct LDKTxAddInput msg);
55022 * Utility method to constructs a new SendTxAddOutput-variant MessageSendEvent
55024 struct LDKMessageSendEvent MessageSendEvent_send_tx_add_output(struct LDKPublicKey node_id, struct LDKTxAddOutput msg);
55027 * Utility method to constructs a new SendTxRemoveInput-variant MessageSendEvent
55029 struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_input(struct LDKPublicKey node_id, struct LDKTxRemoveInput msg);
55032 * Utility method to constructs a new SendTxRemoveOutput-variant MessageSendEvent
55034 struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_output(struct LDKPublicKey node_id, struct LDKTxRemoveOutput msg);
55037 * Utility method to constructs a new SendTxComplete-variant MessageSendEvent
55039 struct LDKMessageSendEvent MessageSendEvent_send_tx_complete(struct LDKPublicKey node_id, struct LDKTxComplete msg);
55042 * Utility method to constructs a new SendTxSignatures-variant MessageSendEvent
55044 struct LDKMessageSendEvent MessageSendEvent_send_tx_signatures(struct LDKPublicKey node_id, struct LDKTxSignatures msg);
55047 * Utility method to constructs a new SendTxInitRbf-variant MessageSendEvent
55049 struct LDKMessageSendEvent MessageSendEvent_send_tx_init_rbf(struct LDKPublicKey node_id, struct LDKTxInitRbf msg);
55052 * Utility method to constructs a new SendTxAckRbf-variant MessageSendEvent
55054 struct LDKMessageSendEvent MessageSendEvent_send_tx_ack_rbf(struct LDKPublicKey node_id, struct LDKTxAckRbf msg);
55057 * Utility method to constructs a new SendTxAbort-variant MessageSendEvent
55059 struct LDKMessageSendEvent MessageSendEvent_send_tx_abort(struct LDKPublicKey node_id, struct LDKTxAbort msg);
55062 * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
55064 struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg);
55067 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
55069 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
55072 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
55074 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
55077 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
55079 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
55082 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
55084 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
55087 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
55089 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
55092 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
55094 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
55097 * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
55099 struct LDKMessageSendEvent MessageSendEvent_send_channel_announcement(struct LDKPublicKey node_id, struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
55102 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
55104 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
55107 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
55109 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
55112 * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
55114 struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
55117 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
55119 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
55122 * Utility method to constructs a new HandleError-variant MessageSendEvent
55124 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
55127 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
55129 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
55132 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
55134 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
55137 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
55139 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
55142 * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
55144 struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
55147 * Calls the free function if one is set
55149 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
55152 * Calls the free function if one is set
55154 void EventsProvider_free(struct LDKEventsProvider this_ptr);
55157 * Calls the free function if one is set
55159 void EventHandler_free(struct LDKEventHandler this_ptr);
55162 * Frees any resources used by the AnchorDescriptor, if is_owned is set and inner is non-NULL.
55164 void AnchorDescriptor_free(struct LDKAnchorDescriptor this_obj);
55167 * The parameters required to derive the signer for the anchor input.
55169 struct LDKChannelDerivationParameters AnchorDescriptor_get_channel_derivation_parameters(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
55172 * The parameters required to derive the signer for the anchor input.
55174 void AnchorDescriptor_set_channel_derivation_parameters(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
55177 * The transaction input's outpoint corresponding to the commitment transaction's anchor
55180 struct LDKOutPoint AnchorDescriptor_get_outpoint(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
55183 * The transaction input's outpoint corresponding to the commitment transaction's anchor
55186 void AnchorDescriptor_set_outpoint(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
55189 * Constructs a new AnchorDescriptor given each field
55191 MUST_USE_RES struct LDKAnchorDescriptor AnchorDescriptor_new(struct LDKChannelDerivationParameters channel_derivation_parameters_arg, struct LDKOutPoint outpoint_arg);
55194 * Creates a copy of the AnchorDescriptor
55196 struct LDKAnchorDescriptor AnchorDescriptor_clone(const struct LDKAnchorDescriptor *NONNULL_PTR orig);
55199 * Checks if two AnchorDescriptors contain equal inner contents.
55200 * This ignores pointers and is_owned flags and looks at the values in fields.
55201 * Two objects with NULL inner values will be considered "equal" here.
55203 bool AnchorDescriptor_eq(const struct LDKAnchorDescriptor *NONNULL_PTR a, const struct LDKAnchorDescriptor *NONNULL_PTR b);
55206 * Returns the UTXO to be spent by the anchor input, which can be obtained via
55207 * [`Self::unsigned_tx_input`].
55209 MUST_USE_RES struct LDKTxOut AnchorDescriptor_previous_utxo(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
55212 * Returns the unsigned transaction input spending the anchor output in the commitment
55215 MUST_USE_RES struct LDKTxIn AnchorDescriptor_unsigned_tx_input(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
55218 * Returns the witness script of the anchor output in the commitment transaction.
55220 MUST_USE_RES struct LDKCVec_u8Z AnchorDescriptor_witness_script(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
55223 * Returns the fully signed witness required to spend the anchor output in the commitment
55226 MUST_USE_RES struct LDKWitness AnchorDescriptor_tx_input_witness(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature);
55229 * Derives the channel signer required to sign the anchor input.
55231 MUST_USE_RES struct LDKWriteableEcdsaChannelSigner AnchorDescriptor_derive_channel_signer(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
55234 * Frees any resources used by the BumpTransactionEvent
55236 void BumpTransactionEvent_free(struct LDKBumpTransactionEvent this_ptr);
55239 * Creates a copy of the BumpTransactionEvent
55241 struct LDKBumpTransactionEvent BumpTransactionEvent_clone(const struct LDKBumpTransactionEvent *NONNULL_PTR orig);
55244 * Utility method to constructs a new ChannelClose-variant BumpTransactionEvent
55246 struct LDKBumpTransactionEvent BumpTransactionEvent_channel_close(struct LDKChannelId channel_id, struct LDKPublicKey counterparty_node_id, 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);
55249 * Utility method to constructs a new HTLCResolution-variant BumpTransactionEvent
55251 struct LDKBumpTransactionEvent BumpTransactionEvent_htlcresolution(struct LDKChannelId channel_id, struct LDKPublicKey counterparty_node_id, struct LDKThirtyTwoBytes claim_id, uint32_t target_feerate_sat_per_1000_weight, struct LDKCVec_HTLCDescriptorZ htlc_descriptors, uint32_t tx_lock_time);
55254 * Checks if two BumpTransactionEvents contain equal inner contents.
55255 * This ignores pointers and is_owned flags and looks at the values in fields.
55257 bool BumpTransactionEvent_eq(const struct LDKBumpTransactionEvent *NONNULL_PTR a, const struct LDKBumpTransactionEvent *NONNULL_PTR b);
55260 * Frees any resources used by the Input, if is_owned is set and inner is non-NULL.
55262 void Input_free(struct LDKInput this_obj);
55265 * The unique identifier of the input.
55267 struct LDKOutPoint Input_get_outpoint(const struct LDKInput *NONNULL_PTR this_ptr);
55270 * The unique identifier of the input.
55272 void Input_set_outpoint(struct LDKInput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
55275 * The UTXO being spent by the input.
55277 struct LDKTxOut Input_get_previous_utxo(const struct LDKInput *NONNULL_PTR this_ptr);
55280 * The UTXO being spent by the input.
55282 void Input_set_previous_utxo(struct LDKInput *NONNULL_PTR this_ptr, struct LDKTxOut val);
55285 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
55286 * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
55289 uint64_t Input_get_satisfaction_weight(const struct LDKInput *NONNULL_PTR this_ptr);
55292 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
55293 * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
55296 void Input_set_satisfaction_weight(struct LDKInput *NONNULL_PTR this_ptr, uint64_t val);
55299 * Constructs a new Input given each field
55301 MUST_USE_RES struct LDKInput Input_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut previous_utxo_arg, uint64_t satisfaction_weight_arg);
55304 * Creates a copy of the Input
55306 struct LDKInput Input_clone(const struct LDKInput *NONNULL_PTR orig);
55309 * Generates a non-cryptographic 64-bit hash of the Input.
55311 uint64_t Input_hash(const struct LDKInput *NONNULL_PTR o);
55314 * Checks if two Inputs contain equal inner contents.
55315 * This ignores pointers and is_owned flags and looks at the values in fields.
55316 * Two objects with NULL inner values will be considered "equal" here.
55318 bool Input_eq(const struct LDKInput *NONNULL_PTR a, const struct LDKInput *NONNULL_PTR b);
55321 * Frees any resources used by the Utxo, if is_owned is set and inner is non-NULL.
55323 void Utxo_free(struct LDKUtxo this_obj);
55326 * The unique identifier of the output.
55328 struct LDKOutPoint Utxo_get_outpoint(const struct LDKUtxo *NONNULL_PTR this_ptr);
55331 * The unique identifier of the output.
55333 void Utxo_set_outpoint(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKOutPoint val);
55336 * The output to spend.
55338 struct LDKTxOut Utxo_get_output(const struct LDKUtxo *NONNULL_PTR this_ptr);
55341 * The output to spend.
55343 void Utxo_set_output(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKTxOut val);
55346 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
55347 * with their lengths included, required to satisfy the output's script. The weight consumed by
55348 * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
55350 uint64_t Utxo_get_satisfaction_weight(const struct LDKUtxo *NONNULL_PTR this_ptr);
55353 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
55354 * with their lengths included, required to satisfy the output's script. The weight consumed by
55355 * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
55357 void Utxo_set_satisfaction_weight(struct LDKUtxo *NONNULL_PTR this_ptr, uint64_t val);
55360 * Constructs a new Utxo given each field
55362 MUST_USE_RES struct LDKUtxo Utxo_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, uint64_t satisfaction_weight_arg);
55365 * Creates a copy of the Utxo
55367 struct LDKUtxo Utxo_clone(const struct LDKUtxo *NONNULL_PTR orig);
55370 * Generates a non-cryptographic 64-bit hash of the Utxo.
55372 uint64_t Utxo_hash(const struct LDKUtxo *NONNULL_PTR o);
55375 * Checks if two Utxos contain equal inner contents.
55376 * This ignores pointers and is_owned flags and looks at the values in fields.
55377 * Two objects with NULL inner values will be considered "equal" here.
55379 bool Utxo_eq(const struct LDKUtxo *NONNULL_PTR a, const struct LDKUtxo *NONNULL_PTR b);
55382 * Returns a `Utxo` with the `satisfaction_weight` estimate for a legacy P2PKH output.
55384 MUST_USE_RES struct LDKUtxo Utxo_new_p2pkh(struct LDKOutPoint outpoint, uint64_t value, const uint8_t (*pubkey_hash)[20]);
55387 * Frees any resources used by the CoinSelection, if is_owned is set and inner is non-NULL.
55389 void CoinSelection_free(struct LDKCoinSelection this_obj);
55392 * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
55393 * requiring additional fees.
55395 struct LDKCVec_UtxoZ CoinSelection_get_confirmed_utxos(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
55398 * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
55399 * requiring additional fees.
55401 void CoinSelection_set_confirmed_utxos(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCVec_UtxoZ val);
55404 * An additional output tracking whether any change remained after coin selection. This output
55405 * should always have a value above dust for its given `script_pubkey`. It should not be
55406 * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
55407 * not met. This implies no other party should be able to spend it except us.
55409 struct LDKCOption_TxOutZ CoinSelection_get_change_output(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
55412 * An additional output tracking whether any change remained after coin selection. This output
55413 * should always have a value above dust for its given `script_pubkey`. It should not be
55414 * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
55415 * not met. This implies no other party should be able to spend it except us.
55417 void CoinSelection_set_change_output(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCOption_TxOutZ val);
55420 * Constructs a new CoinSelection given each field
55422 MUST_USE_RES struct LDKCoinSelection CoinSelection_new(struct LDKCVec_UtxoZ confirmed_utxos_arg, struct LDKCOption_TxOutZ change_output_arg);
55425 * Creates a copy of the CoinSelection
55427 struct LDKCoinSelection CoinSelection_clone(const struct LDKCoinSelection *NONNULL_PTR orig);
55430 * Calls the free function if one is set
55432 void CoinSelectionSource_free(struct LDKCoinSelectionSource this_ptr);
55435 * Calls the free function if one is set
55437 void WalletSource_free(struct LDKWalletSource this_ptr);
55440 * Frees any resources used by the Wallet, if is_owned is set and inner is non-NULL.
55442 void Wallet_free(struct LDKWallet this_obj);
55445 * Returns a new instance backed by the given [`WalletSource`] that serves as an implementation
55446 * of [`CoinSelectionSource`].
55448 MUST_USE_RES struct LDKWallet Wallet_new(struct LDKWalletSource source, struct LDKLogger logger);
55451 * Constructs a new CoinSelectionSource which calls the relevant methods on this_arg.
55452 * This copies the `inner` pointer in this_arg and thus the returned CoinSelectionSource must be freed before this_arg is
55454 struct LDKCoinSelectionSource Wallet_as_CoinSelectionSource(const struct LDKWallet *NONNULL_PTR this_arg);
55457 * Frees any resources used by the BumpTransactionEventHandler, if is_owned is set and inner is non-NULL.
55459 void BumpTransactionEventHandler_free(struct LDKBumpTransactionEventHandler this_obj);
55462 * Returns a new instance capable of handling [`Event::BumpTransaction`] events.
55464 * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
55466 MUST_USE_RES struct LDKBumpTransactionEventHandler BumpTransactionEventHandler_new(struct LDKBroadcasterInterface broadcaster, struct LDKCoinSelectionSource utxo_source, struct LDKSignerProvider signer_provider, struct LDKLogger logger);
55469 * Handles all variants of [`BumpTransactionEvent`].
55471 void BumpTransactionEventHandler_handle_event(const struct LDKBumpTransactionEventHandler *NONNULL_PTR this_arg, const struct LDKBumpTransactionEvent *NONNULL_PTR event);
55474 * Frees any resources used by the FilesystemStore, if is_owned is set and inner is non-NULL.
55476 void FilesystemStore_free(struct LDKFilesystemStore this_obj);
55479 * Constructs a new [`FilesystemStore`].
55481 MUST_USE_RES struct LDKFilesystemStore FilesystemStore_new(struct LDKStr data_dir);
55484 * Returns the data directory.
55486 MUST_USE_RES struct LDKStr FilesystemStore_get_data_dir(const struct LDKFilesystemStore *NONNULL_PTR this_arg);
55489 * Constructs a new KVStore which calls the relevant methods on this_arg.
55490 * This copies the `inner` pointer in this_arg and thus the returned KVStore must be freed before this_arg is
55492 struct LDKKVStore FilesystemStore_as_KVStore(const struct LDKFilesystemStore *NONNULL_PTR this_arg);
55495 * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
55497 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
55500 * Frees any resources used by the GossipSync
55502 void GossipSync_free(struct LDKGossipSync this_ptr);
55505 * Utility method to constructs a new P2P-variant GossipSync
55507 struct LDKGossipSync GossipSync_p2_p(const struct LDKP2PGossipSync *NONNULL_PTR a);
55510 * Utility method to constructs a new Rapid-variant GossipSync
55512 struct LDKGossipSync GossipSync_rapid(const struct LDKRapidGossipSync *NONNULL_PTR a);
55515 * Utility method to constructs a new None-variant GossipSync
55517 struct LDKGossipSync GossipSync_none(void);
55520 * Start a background thread that takes care of responsibilities enumerated in the [top-level
55523 * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
55524 * [`Persister::persist_manager`] returns an error. In case of an error, the error is retrieved by calling
55525 * either [`join`] or [`stop`].
55527 * # Data Persistence
55529 * [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
55530 * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
55531 * [`ChannelManager`]. See the `lightning-persister` crate for LDK's
55532 * provided implementation.
55534 * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if
55535 * [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
55536 * See the `lightning-persister` crate for LDK's provided implementation.
55538 * Typically, users should either implement [`Persister::persist_manager`] to never return an
55539 * error or call [`join`] and handle any error that may arise. For the latter case,
55540 * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
55544 * `event_handler` is responsible for handling events that users should be notified of (e.g.,
55545 * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
55546 * functionality implemented by other handlers.
55547 * * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures.
55549 * # Rapid Gossip Sync
55551 * If rapid gossip sync is meant to run at startup, pass [`RapidGossipSync`] via `gossip_sync`
55552 * to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
55553 * until the [`RapidGossipSync`] instance completes its first sync.
55555 * [top-level documentation]: BackgroundProcessor
55556 * [`join`]: Self::join
55557 * [`stop`]: Self::stop
55558 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
55559 * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
55560 * [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager
55561 * [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph
55562 * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
55563 * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
55565 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);
55568 * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
55569 * [`ChannelManager`].
55573 * This function panics if the background thread has panicked such as while persisting or
55576 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
55578 MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
55581 * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
55582 * [`ChannelManager`].
55586 * This function panics if the background thread has panicked such as while persisting or
55589 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
55591 MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
55594 * Frees any resources used by the Bolt11ParseError
55596 void Bolt11ParseError_free(struct LDKBolt11ParseError this_ptr);
55599 * Creates a copy of the Bolt11ParseError
55601 struct LDKBolt11ParseError Bolt11ParseError_clone(const struct LDKBolt11ParseError *NONNULL_PTR orig);
55604 * Utility method to constructs a new Bech32Error-variant Bolt11ParseError
55606 struct LDKBolt11ParseError Bolt11ParseError_bech32_error(struct LDKBech32Error a);
55609 * Utility method to constructs a new ParseAmountError-variant Bolt11ParseError
55611 struct LDKBolt11ParseError Bolt11ParseError_parse_amount_error(struct LDKError a);
55614 * Utility method to constructs a new MalformedSignature-variant Bolt11ParseError
55616 struct LDKBolt11ParseError Bolt11ParseError_malformed_signature(enum LDKSecp256k1Error a);
55619 * Utility method to constructs a new BadPrefix-variant Bolt11ParseError
55621 struct LDKBolt11ParseError Bolt11ParseError_bad_prefix(void);
55624 * Utility method to constructs a new UnknownCurrency-variant Bolt11ParseError
55626 struct LDKBolt11ParseError Bolt11ParseError_unknown_currency(void);
55629 * Utility method to constructs a new UnknownSiPrefix-variant Bolt11ParseError
55631 struct LDKBolt11ParseError Bolt11ParseError_unknown_si_prefix(void);
55634 * Utility method to constructs a new MalformedHRP-variant Bolt11ParseError
55636 struct LDKBolt11ParseError Bolt11ParseError_malformed_hrp(void);
55639 * Utility method to constructs a new TooShortDataPart-variant Bolt11ParseError
55641 struct LDKBolt11ParseError Bolt11ParseError_too_short_data_part(void);
55644 * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant Bolt11ParseError
55646 struct LDKBolt11ParseError Bolt11ParseError_unexpected_end_of_tagged_fields(void);
55649 * Utility method to constructs a new DescriptionDecodeError-variant Bolt11ParseError
55651 struct LDKBolt11ParseError Bolt11ParseError_description_decode_error(struct LDKError a);
55654 * Utility method to constructs a new PaddingError-variant Bolt11ParseError
55656 struct LDKBolt11ParseError Bolt11ParseError_padding_error(void);
55659 * Utility method to constructs a new IntegerOverflowError-variant Bolt11ParseError
55661 struct LDKBolt11ParseError Bolt11ParseError_integer_overflow_error(void);
55664 * Utility method to constructs a new InvalidSegWitProgramLength-variant Bolt11ParseError
55666 struct LDKBolt11ParseError Bolt11ParseError_invalid_seg_wit_program_length(void);
55669 * Utility method to constructs a new InvalidPubKeyHashLength-variant Bolt11ParseError
55671 struct LDKBolt11ParseError Bolt11ParseError_invalid_pub_key_hash_length(void);
55674 * Utility method to constructs a new InvalidScriptHashLength-variant Bolt11ParseError
55676 struct LDKBolt11ParseError Bolt11ParseError_invalid_script_hash_length(void);
55679 * Utility method to constructs a new InvalidRecoveryId-variant Bolt11ParseError
55681 struct LDKBolt11ParseError Bolt11ParseError_invalid_recovery_id(void);
55684 * Utility method to constructs a new InvalidSliceLength-variant Bolt11ParseError
55686 struct LDKBolt11ParseError Bolt11ParseError_invalid_slice_length(struct LDKStr a);
55689 * Utility method to constructs a new Skip-variant Bolt11ParseError
55691 struct LDKBolt11ParseError Bolt11ParseError_skip(void);
55694 * Checks if two Bolt11ParseErrors contain equal inner contents.
55695 * This ignores pointers and is_owned flags and looks at the values in fields.
55697 bool Bolt11ParseError_eq(const struct LDKBolt11ParseError *NONNULL_PTR a, const struct LDKBolt11ParseError *NONNULL_PTR b);
55700 * Frees any resources used by the ParseOrSemanticError
55702 void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr);
55705 * Creates a copy of the ParseOrSemanticError
55707 struct LDKParseOrSemanticError ParseOrSemanticError_clone(const struct LDKParseOrSemanticError *NONNULL_PTR orig);
55710 * Utility method to constructs a new ParseError-variant ParseOrSemanticError
55712 struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKBolt11ParseError a);
55715 * Utility method to constructs a new SemanticError-variant ParseOrSemanticError
55717 struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKBolt11SemanticError a);
55720 * Checks if two ParseOrSemanticErrors contain equal inner contents.
55721 * This ignores pointers and is_owned flags and looks at the values in fields.
55723 bool ParseOrSemanticError_eq(const struct LDKParseOrSemanticError *NONNULL_PTR a, const struct LDKParseOrSemanticError *NONNULL_PTR b);
55726 * Frees any resources used by the Bolt11Invoice, if is_owned is set and inner is non-NULL.
55728 void Bolt11Invoice_free(struct LDKBolt11Invoice this_obj);
55731 * Checks if two Bolt11Invoices contain equal inner contents.
55732 * This ignores pointers and is_owned flags and looks at the values in fields.
55733 * Two objects with NULL inner values will be considered "equal" here.
55735 bool Bolt11Invoice_eq(const struct LDKBolt11Invoice *NONNULL_PTR a, const struct LDKBolt11Invoice *NONNULL_PTR b);
55738 * Creates a copy of the Bolt11Invoice
55740 struct LDKBolt11Invoice Bolt11Invoice_clone(const struct LDKBolt11Invoice *NONNULL_PTR orig);
55743 * Generates a non-cryptographic 64-bit hash of the Bolt11Invoice.
55745 uint64_t Bolt11Invoice_hash(const struct LDKBolt11Invoice *NONNULL_PTR o);
55748 * Frees any resources used by the SignedRawBolt11Invoice, if is_owned is set and inner is non-NULL.
55750 void SignedRawBolt11Invoice_free(struct LDKSignedRawBolt11Invoice this_obj);
55753 * Checks if two SignedRawBolt11Invoices contain equal inner contents.
55754 * This ignores pointers and is_owned flags and looks at the values in fields.
55755 * Two objects with NULL inner values will be considered "equal" here.
55757 bool SignedRawBolt11Invoice_eq(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR a, const struct LDKSignedRawBolt11Invoice *NONNULL_PTR b);
55760 * Creates a copy of the SignedRawBolt11Invoice
55762 struct LDKSignedRawBolt11Invoice SignedRawBolt11Invoice_clone(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR orig);
55765 * Generates a non-cryptographic 64-bit hash of the SignedRawBolt11Invoice.
55767 uint64_t SignedRawBolt11Invoice_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o);
55770 * Frees any resources used by the RawBolt11Invoice, if is_owned is set and inner is non-NULL.
55772 void RawBolt11Invoice_free(struct LDKRawBolt11Invoice this_obj);
55777 struct LDKRawDataPart RawBolt11Invoice_get_data(const struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr);
55782 void RawBolt11Invoice_set_data(struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
55785 * Checks if two RawBolt11Invoices contain equal inner contents.
55786 * This ignores pointers and is_owned flags and looks at the values in fields.
55787 * Two objects with NULL inner values will be considered "equal" here.
55789 bool RawBolt11Invoice_eq(const struct LDKRawBolt11Invoice *NONNULL_PTR a, const struct LDKRawBolt11Invoice *NONNULL_PTR b);
55792 * Creates a copy of the RawBolt11Invoice
55794 struct LDKRawBolt11Invoice RawBolt11Invoice_clone(const struct LDKRawBolt11Invoice *NONNULL_PTR orig);
55797 * Generates a non-cryptographic 64-bit hash of the RawBolt11Invoice.
55799 uint64_t RawBolt11Invoice_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR o);
55802 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
55804 void RawDataPart_free(struct LDKRawDataPart this_obj);
55807 * generation time of the invoice
55809 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
55812 * generation time of the invoice
55814 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
55817 * Checks if two RawDataParts contain equal inner contents.
55818 * This ignores pointers and is_owned flags and looks at the values in fields.
55819 * Two objects with NULL inner values will be considered "equal" here.
55821 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
55824 * Creates a copy of the RawDataPart
55826 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
55829 * Generates a non-cryptographic 64-bit hash of the RawDataPart.
55831 uint64_t RawDataPart_hash(const struct LDKRawDataPart *NONNULL_PTR o);
55834 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
55836 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
55839 * Checks if two PositiveTimestamps contain equal inner contents.
55840 * This ignores pointers and is_owned flags and looks at the values in fields.
55841 * Two objects with NULL inner values will be considered "equal" here.
55843 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
55846 * Creates a copy of the PositiveTimestamp
55848 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
55851 * Generates a non-cryptographic 64-bit hash of the PositiveTimestamp.
55853 uint64_t PositiveTimestamp_hash(const struct LDKPositiveTimestamp *NONNULL_PTR o);
55856 * Creates a copy of the SiPrefix
55858 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
55861 * Utility method to constructs a new Milli-variant SiPrefix
55863 enum LDKSiPrefix SiPrefix_milli(void);
55866 * Utility method to constructs a new Micro-variant SiPrefix
55868 enum LDKSiPrefix SiPrefix_micro(void);
55871 * Utility method to constructs a new Nano-variant SiPrefix
55873 enum LDKSiPrefix SiPrefix_nano(void);
55876 * Utility method to constructs a new Pico-variant SiPrefix
55878 enum LDKSiPrefix SiPrefix_pico(void);
55881 * Checks if two SiPrefixs contain equal inner contents.
55882 * This ignores pointers and is_owned flags and looks at the values in fields.
55884 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
55887 * Generates a non-cryptographic 64-bit hash of the SiPrefix.
55889 uint64_t SiPrefix_hash(const enum LDKSiPrefix *NONNULL_PTR o);
55892 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
55893 * This is effectively 10^12 * the prefix multiplier
55895 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
55898 * Creates a copy of the Currency
55900 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
55903 * Utility method to constructs a new Bitcoin-variant Currency
55905 enum LDKCurrency Currency_bitcoin(void);
55908 * Utility method to constructs a new BitcoinTestnet-variant Currency
55910 enum LDKCurrency Currency_bitcoin_testnet(void);
55913 * Utility method to constructs a new Regtest-variant Currency
55915 enum LDKCurrency Currency_regtest(void);
55918 * Utility method to constructs a new Simnet-variant Currency
55920 enum LDKCurrency Currency_simnet(void);
55923 * Utility method to constructs a new Signet-variant Currency
55925 enum LDKCurrency Currency_signet(void);
55928 * Generates a non-cryptographic 64-bit hash of the Currency.
55930 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
55933 * Checks if two Currencys contain equal inner contents.
55934 * This ignores pointers and is_owned flags and looks at the values in fields.
55936 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
55939 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
55941 void Sha256_free(struct LDKSha256 this_obj);
55944 * Creates a copy of the Sha256
55946 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
55949 * Generates a non-cryptographic 64-bit hash of the Sha256.
55951 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
55954 * Checks if two Sha256s contain equal inner contents.
55955 * This ignores pointers and is_owned flags and looks at the values in fields.
55956 * Two objects with NULL inner values will be considered "equal" here.
55958 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
55961 * Constructs a new [`Sha256`] from the given bytes, which are assumed to be the output of a
55962 * single sha256 hash.
55964 MUST_USE_RES struct LDKSha256 Sha256_from_bytes(const uint8_t (*bytes)[32]);
55967 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
55969 void Description_free(struct LDKDescription this_obj);
55972 * Creates a copy of the Description
55974 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
55977 * Generates a non-cryptographic 64-bit hash of the Description.
55979 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
55982 * Checks if two Descriptions contain equal inner contents.
55983 * This ignores pointers and is_owned flags and looks at the values in fields.
55984 * Two objects with NULL inner values will be considered "equal" here.
55986 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
55989 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
55991 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
55993 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
55995 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
55998 * Constructs a new PayeePubKey given each field
56000 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
56003 * Creates a copy of the PayeePubKey
56005 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
56008 * Generates a non-cryptographic 64-bit hash of the PayeePubKey.
56010 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
56013 * Checks if two PayeePubKeys contain equal inner contents.
56014 * This ignores pointers and is_owned flags and looks at the values in fields.
56015 * Two objects with NULL inner values will be considered "equal" here.
56017 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
56020 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
56022 void ExpiryTime_free(struct LDKExpiryTime this_obj);
56025 * Creates a copy of the ExpiryTime
56027 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
56030 * Generates a non-cryptographic 64-bit hash of the ExpiryTime.
56032 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
56035 * Checks if two ExpiryTimes contain equal inner contents.
56036 * This ignores pointers and is_owned flags and looks at the values in fields.
56037 * Two objects with NULL inner values will be considered "equal" here.
56039 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
56042 * Frees any resources used by the MinFinalCltvExpiryDelta, if is_owned is set and inner is non-NULL.
56044 void MinFinalCltvExpiryDelta_free(struct LDKMinFinalCltvExpiryDelta this_obj);
56046 uint64_t MinFinalCltvExpiryDelta_get_a(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr);
56048 void MinFinalCltvExpiryDelta_set_a(struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr, uint64_t val);
56051 * Constructs a new MinFinalCltvExpiryDelta given each field
56053 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_new(uint64_t a_arg);
56056 * Creates a copy of the MinFinalCltvExpiryDelta
56058 struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_clone(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR orig);
56061 * Generates a non-cryptographic 64-bit hash of the MinFinalCltvExpiryDelta.
56063 uint64_t MinFinalCltvExpiryDelta_hash(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR o);
56066 * Checks if two MinFinalCltvExpiryDeltas contain equal inner contents.
56067 * This ignores pointers and is_owned flags and looks at the values in fields.
56068 * Two objects with NULL inner values will be considered "equal" here.
56070 bool MinFinalCltvExpiryDelta_eq(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR a, const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR b);
56073 * Frees any resources used by the Fallback
56075 void Fallback_free(struct LDKFallback this_ptr);
56078 * Creates a copy of the Fallback
56080 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
56083 * Utility method to constructs a new SegWitProgram-variant Fallback
56085 struct LDKFallback Fallback_seg_wit_program(struct LDKWitnessVersion version, struct LDKCVec_u8Z program);
56088 * Utility method to constructs a new PubKeyHash-variant Fallback
56090 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
56093 * Utility method to constructs a new ScriptHash-variant Fallback
56095 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
56098 * Generates a non-cryptographic 64-bit hash of the Fallback.
56100 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
56103 * Checks if two Fallbacks contain equal inner contents.
56104 * This ignores pointers and is_owned flags and looks at the values in fields.
56106 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
56109 * Frees any resources used by the Bolt11InvoiceSignature, if is_owned is set and inner is non-NULL.
56111 void Bolt11InvoiceSignature_free(struct LDKBolt11InvoiceSignature this_obj);
56114 * Creates a copy of the Bolt11InvoiceSignature
56116 struct LDKBolt11InvoiceSignature Bolt11InvoiceSignature_clone(const struct LDKBolt11InvoiceSignature *NONNULL_PTR orig);
56119 * Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceSignature.
56121 uint64_t Bolt11InvoiceSignature_hash(const struct LDKBolt11InvoiceSignature *NONNULL_PTR o);
56124 * Checks if two Bolt11InvoiceSignatures contain equal inner contents.
56125 * This ignores pointers and is_owned flags and looks at the values in fields.
56126 * Two objects with NULL inner values will be considered "equal" here.
56128 bool Bolt11InvoiceSignature_eq(const struct LDKBolt11InvoiceSignature *NONNULL_PTR a, const struct LDKBolt11InvoiceSignature *NONNULL_PTR b);
56131 * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
56133 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
56136 * Creates a copy of the PrivateRoute
56138 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
56141 * Generates a non-cryptographic 64-bit hash of the PrivateRoute.
56143 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
56146 * Checks if two PrivateRoutes contain equal inner contents.
56147 * This ignores pointers and is_owned flags and looks at the values in fields.
56148 * Two objects with NULL inner values will be considered "equal" here.
56150 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
56153 * Disassembles the `SignedRawBolt11Invoice` into its three parts:
56155 * 2. hash of the raw invoice
56158 MUST_USE_RES struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ SignedRawBolt11Invoice_into_parts(struct LDKSignedRawBolt11Invoice this_arg);
56161 * The [`RawBolt11Invoice`] which was signed.
56163 MUST_USE_RES struct LDKRawBolt11Invoice SignedRawBolt11Invoice_raw_invoice(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
56166 * The hash of the [`RawBolt11Invoice`] that was signed.
56168 MUST_USE_RES const uint8_t (*SignedRawBolt11Invoice_signable_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg))[32];
56171 * Signature for the invoice.
56173 MUST_USE_RES struct LDKBolt11InvoiceSignature SignedRawBolt11Invoice_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
56176 * Recovers the public key used for signing the invoice from the recoverable signature.
56178 MUST_USE_RES struct LDKCResult_PayeePubKeySecp256k1ErrorZ SignedRawBolt11Invoice_recover_payee_pub_key(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
56181 * Checks if the signature is valid for the included payee public key or if none exists if it's
56182 * valid for the recovered signature (which should always be true?).
56184 MUST_USE_RES bool SignedRawBolt11Invoice_check_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
56187 * Calculate the hash of the encoded `RawBolt11Invoice` which should be signed.
56189 MUST_USE_RES struct LDKThirtyTwoBytes RawBolt11Invoice_signable_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
56193 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
56195 MUST_USE_RES struct LDKSha256 RawBolt11Invoice_payment_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
56199 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
56201 MUST_USE_RES struct LDKDescription RawBolt11Invoice_description(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
56205 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
56207 MUST_USE_RES struct LDKPayeePubKey RawBolt11Invoice_payee_pub_key(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
56211 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
56213 MUST_USE_RES struct LDKSha256 RawBolt11Invoice_description_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
56217 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
56219 MUST_USE_RES struct LDKExpiryTime RawBolt11Invoice_expiry_time(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
56223 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
56225 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta RawBolt11Invoice_min_final_cltv_expiry_delta(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
56227 MUST_USE_RES struct LDKCOption_ThirtyTwoBytesZ RawBolt11Invoice_payment_secret(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
56229 MUST_USE_RES struct LDKCOption_CVec_u8ZZ RawBolt11Invoice_payment_metadata(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
56233 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
56235 MUST_USE_RES struct LDKBolt11InvoiceFeatures RawBolt11Invoice_features(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
56237 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawBolt11Invoice_private_routes(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
56240 * Returns `None` if no amount is set or on overflow.
56242 MUST_USE_RES struct LDKCOption_u64Z RawBolt11Invoice_amount_pico_btc(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
56244 MUST_USE_RES enum LDKCurrency RawBolt11Invoice_currency(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
56247 * Creates a `PositiveTimestamp` from a Unix timestamp in the range `0..=MAX_TIMESTAMP`.
56249 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
56251 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
56254 * Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
56255 * the range `0..=MAX_TIMESTAMP`.
56257 * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
56259 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
56261 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
56264 * Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
56265 * `0..=MAX_TIMESTAMP`.
56267 * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
56269 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
56271 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_duration_since_epoch(uint64_t duration);
56274 * Returns the Unix timestamp representing the stored time
56276 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
56279 * Returns the duration of the stored time since the Unix epoch
56281 MUST_USE_RES uint64_t PositiveTimestamp_as_duration_since_epoch(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
56284 * Returns the [`SystemTime`] representing the stored time
56286 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
56289 * The hash of the [`RawBolt11Invoice`] that was signed.
56291 MUST_USE_RES struct LDKThirtyTwoBytes Bolt11Invoice_signable_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
56294 * Transform the `Bolt11Invoice` into its unchecked version.
56296 MUST_USE_RES struct LDKSignedRawBolt11Invoice Bolt11Invoice_into_signed_raw(struct LDKBolt11Invoice this_arg);
56299 * Check that the invoice is signed correctly and that key recovery works
56301 MUST_USE_RES struct LDKCResult_NoneBolt11SemanticErrorZ Bolt11Invoice_check_signature(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
56304 * Constructs a `Bolt11Invoice` from a [`SignedRawBolt11Invoice`] by checking all its invariants.
56306 * use lightning_invoice::*;
56308 * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
56309 * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
56310 * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
56311 * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
56312 * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
56313 * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
56314 * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
56315 * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
56316 * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
56317 * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
56318 * j5r6drg6k6zcqj0fcwg\";
56320 * let signed = invoice.parse::<SignedRawBolt11Invoice>().unwrap();
56322 * assert!(Bolt11Invoice::from_signed(signed).is_ok());
56325 MUST_USE_RES struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ Bolt11Invoice_from_signed(struct LDKSignedRawBolt11Invoice signed_invoice);
56328 * Returns the `Bolt11Invoice`'s timestamp (should equal its creation time)
56330 MUST_USE_RES uint64_t Bolt11Invoice_timestamp(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
56333 * Returns the `Bolt11Invoice`'s timestamp as a duration since the Unix epoch
56335 MUST_USE_RES uint64_t Bolt11Invoice_duration_since_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
56338 * Returns the hash to which we will receive the preimage on completion of the payment
56340 MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32];
56343 * Get the payee's public key if one was included in the invoice
56345 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
56347 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
56350 * Get the payment secret if one was included in the invoice
56352 MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_secret(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32];
56355 * Get the payment metadata blob if one was included in the invoice
56357 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt11Invoice_payment_metadata(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
56360 * Get the invoice features if they were included in the invoice
56362 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
56364 MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11Invoice_features(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
56367 * Recover the payee's public key (only to be used if none was included in the invoice)
56369 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_recover_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
56372 * Recover the payee's public key if one was included in the invoice, otherwise return the
56373 * recovered public key from the signature
56375 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_get_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
56378 * Returns the Duration since the Unix epoch at which the invoice expires.
56379 * Returning None if overflow occurred.
56381 MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_expires_at(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
56384 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
56386 MUST_USE_RES uint64_t Bolt11Invoice_expiry_time(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
56389 * Returns whether the invoice has expired.
56391 MUST_USE_RES bool Bolt11Invoice_is_expired(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
56394 * Returns the Duration remaining until the invoice expires.
56396 MUST_USE_RES uint64_t Bolt11Invoice_duration_until_expiry(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
56399 * Returns the Duration remaining until the invoice expires given the current time.
56400 * `time` is the timestamp as a duration since the Unix epoch.
56402 MUST_USE_RES uint64_t Bolt11Invoice_expiration_remaining_from_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t time);
56405 * Returns whether the expiry time would pass at the given point in time.
56406 * `at_time` is the timestamp as a duration since the Unix epoch.
56408 MUST_USE_RES bool Bolt11Invoice_would_expire(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t at_time);
56411 * Returns the invoice's `min_final_cltv_expiry_delta` time, if present, otherwise
56412 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA`].
56414 MUST_USE_RES uint64_t Bolt11Invoice_min_final_cltv_expiry_delta(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
56417 * Returns a list of all fallback addresses as [`Address`]es
56419 MUST_USE_RES struct LDKCVec_StrZ Bolt11Invoice_fallback_addresses(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
56422 * Returns a list of all routes included in the invoice
56424 MUST_USE_RES struct LDKCVec_PrivateRouteZ Bolt11Invoice_private_routes(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
56427 * Returns a list of all routes included in the invoice as the underlying hints
56429 MUST_USE_RES struct LDKCVec_RouteHintZ Bolt11Invoice_route_hints(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
56432 * Returns the currency for which the invoice was issued
56434 MUST_USE_RES enum LDKCurrency Bolt11Invoice_currency(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
56437 * Returns the amount if specified in the invoice as millisatoshis.
56439 MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_amount_milli_satoshis(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
56442 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
56443 * returns [`CreationError::DescriptionTooLong`] otherwise
56445 * Please note that single characters may use more than one byte due to UTF8 encoding.
56447 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
56450 * Returns the underlying description [`UntrustedString`]
56452 MUST_USE_RES struct LDKUntrustedString Description_into_inner(struct LDKDescription this_arg);
56455 * Get the string representation of a Description object
56457 struct LDKStr Description_to_str(const struct LDKDescription *NONNULL_PTR o);
56460 * Construct an `ExpiryTime` from seconds.
56462 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds);
56465 * Construct an `ExpiryTime` from a [`Duration`], dropping the sub-second part.
56467 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_duration(uint64_t duration);
56470 * Returns the expiry time in seconds
56472 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
56475 * Returns a reference to the underlying [`Duration`] (=expiry time)
56477 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
56480 * Creates a new (partial) route from a list of hops
56482 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
56485 * Returns the underlying list of hops
56487 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
56490 * Creates a copy of the CreationError
56492 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
56495 * Utility method to constructs a new DescriptionTooLong-variant CreationError
56497 enum LDKCreationError CreationError_description_too_long(void);
56500 * Utility method to constructs a new RouteTooLong-variant CreationError
56502 enum LDKCreationError CreationError_route_too_long(void);
56505 * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
56507 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
56510 * Utility method to constructs a new InvalidAmount-variant CreationError
56512 enum LDKCreationError CreationError_invalid_amount(void);
56515 * Utility method to constructs a new MissingRouteHints-variant CreationError
56517 enum LDKCreationError CreationError_missing_route_hints(void);
56520 * Utility method to constructs a new MinFinalCltvExpiryDeltaTooShort-variant CreationError
56522 enum LDKCreationError CreationError_min_final_cltv_expiry_delta_too_short(void);
56525 * Checks if two CreationErrors contain equal inner contents.
56526 * This ignores pointers and is_owned flags and looks at the values in fields.
56528 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
56531 * Get the string representation of a CreationError object
56533 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
56536 * Creates a copy of the Bolt11SemanticError
56538 enum LDKBolt11SemanticError Bolt11SemanticError_clone(const enum LDKBolt11SemanticError *NONNULL_PTR orig);
56541 * Utility method to constructs a new NoPaymentHash-variant Bolt11SemanticError
56543 enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_hash(void);
56546 * Utility method to constructs a new MultiplePaymentHashes-variant Bolt11SemanticError
56548 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_hashes(void);
56551 * Utility method to constructs a new NoDescription-variant Bolt11SemanticError
56553 enum LDKBolt11SemanticError Bolt11SemanticError_no_description(void);
56556 * Utility method to constructs a new MultipleDescriptions-variant Bolt11SemanticError
56558 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_descriptions(void);
56561 * Utility method to constructs a new NoPaymentSecret-variant Bolt11SemanticError
56563 enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_secret(void);
56566 * Utility method to constructs a new MultiplePaymentSecrets-variant Bolt11SemanticError
56568 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_secrets(void);
56571 * Utility method to constructs a new InvalidFeatures-variant Bolt11SemanticError
56573 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_features(void);
56576 * Utility method to constructs a new InvalidRecoveryId-variant Bolt11SemanticError
56578 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_recovery_id(void);
56581 * Utility method to constructs a new InvalidSignature-variant Bolt11SemanticError
56583 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_signature(void);
56586 * Utility method to constructs a new ImpreciseAmount-variant Bolt11SemanticError
56588 enum LDKBolt11SemanticError Bolt11SemanticError_imprecise_amount(void);
56591 * Checks if two Bolt11SemanticErrors contain equal inner contents.
56592 * This ignores pointers and is_owned flags and looks at the values in fields.
56594 bool Bolt11SemanticError_eq(const enum LDKBolt11SemanticError *NONNULL_PTR a, const enum LDKBolt11SemanticError *NONNULL_PTR b);
56597 * Get the string representation of a Bolt11SemanticError object
56599 struct LDKStr Bolt11SemanticError_to_str(const enum LDKBolt11SemanticError *NONNULL_PTR o);
56602 * Frees any resources used by the SignOrCreationError
56604 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
56607 * Creates a copy of the SignOrCreationError
56609 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
56612 * Utility method to constructs a new SignError-variant SignOrCreationError
56614 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
56617 * Utility method to constructs a new CreationError-variant SignOrCreationError
56619 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
56622 * Checks if two SignOrCreationErrors contain equal inner contents.
56623 * This ignores pointers and is_owned flags and looks at the values in fields.
56625 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
56628 * Get the string representation of a SignOrCreationError object
56630 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
56633 * Builds the necessary parameters to pay or pre-flight probe the given zero-amount
56634 * [`Bolt11Invoice`] using [`ChannelManager::send_payment`] or
56635 * [`ChannelManager::send_preflight_probes`].
56637 * Prior to paying, you must ensure that the [`Bolt11Invoice::payment_hash`] is unique and the
56638 * same [`PaymentHash`] has never been paid before.
56640 * Will always succeed unless the invoice has an amount specified, in which case
56641 * [`payment_parameters_from_invoice`] should be used.
56643 * [`ChannelManager::send_payment`]: lightning::ln::channelmanager::ChannelManager::send_payment
56644 * [`ChannelManager::send_preflight_probes`]: lightning::ln::channelmanager::ChannelManager::send_preflight_probes
56646 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_zero_amount_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msat);
56649 * Builds the necessary parameters to pay or pre-flight probe the given [`Bolt11Invoice`] using
56650 * [`ChannelManager::send_payment`] or [`ChannelManager::send_preflight_probes`].
56652 * Prior to paying, you must ensure that the [`Bolt11Invoice::payment_hash`] is unique and the
56653 * same [`PaymentHash`] has never been paid before.
56655 * Will always succeed unless the invoice has no amount specified, in which case
56656 * [`payment_parameters_from_zero_amount_invoice`] should be used.
56658 * [`ChannelManager::send_payment`]: lightning::ln::channelmanager::ChannelManager::send_payment
56659 * [`ChannelManager::send_preflight_probes`]: lightning::ln::channelmanager::ChannelManager::send_preflight_probes
56661 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice);
56664 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
56665 * See [`PhantomKeysManager`] for more information on phantom node payments.
56667 * `phantom_route_hints` parameter:
56668 * * Contains channel info for all nodes participating in the phantom invoice
56669 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
56670 * participating node
56671 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
56672 * updated when a channel becomes disabled or closes
56673 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
56674 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
56677 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
56678 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
56679 * If `None` is provided for `payment_hash`, then one will be created.
56681 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
56682 * in excess of the current time.
56684 * `duration_since_epoch` is the current time since epoch in seconds.
56686 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
56687 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`] - 3.
56688 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
56689 * confirmations during routing.
56691 * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
56692 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
56695 * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
56696 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
56697 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
56698 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
56699 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
56700 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
56702 * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
56703 * available and the current time is supplied by the caller.
56705 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);
56708 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
56709 * See [`PhantomKeysManager`] for more information on phantom node payments.
56711 * `phantom_route_hints` parameter:
56712 * * Contains channel info for all nodes participating in the phantom invoice
56713 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
56714 * participating node
56715 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
56716 * updated when a channel becomes disabled or closes
56717 * * Note that the route hints generated from `phantom_route_hints` will be limited to a maximum
56718 * of 3 hints to ensure that the invoice can be scanned in a QR code. These hints are selected
56719 * in the order that the nodes in `PhantomRouteHints` are specified, selecting one hint per node
56720 * until the maximum is hit. Callers may provide as many `PhantomRouteHints::channels` as
56721 * desired, but note that some nodes will be trimmed if more than 3 nodes are provided.
56723 * `description_hash` is a SHA-256 hash of the description text
56725 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
56726 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
56727 * If `None` is provided for `payment_hash`, then one will be created.
56729 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
56730 * in excess of the current time.
56732 * `duration_since_epoch` is the current time since epoch in seconds.
56734 * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
56735 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
56738 * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
56739 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
56740 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
56741 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
56742 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
56744 * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
56745 * available and the current time is supplied by the caller.
56747 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);
56750 * Utility to construct an invoice. Generally, unless you want to do something like a custom
56751 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
56752 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
56753 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
56754 * that the payment secret is valid when the invoice is paid.
56756 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
56757 * in excess of the current time.
56759 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
56760 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
56761 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
56762 * confirmations during routing.
56764 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
56766 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);
56769 * Utility to construct an invoice. Generally, unless you want to do something like a custom
56770 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
56771 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
56772 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
56773 * that the payment secret is valid when the invoice is paid.
56774 * Use this variant if you want to pass the `description_hash` to the invoice.
56776 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
56777 * in excess of the current time.
56779 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
56780 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
56781 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
56782 * confirmations during routing.
56784 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
56786 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);
56789 * See [`create_invoice_from_channelmanager_with_description_hash`]
56790 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
56791 * available and the current time is supplied by the caller.
56793 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);
56796 * See [`create_invoice_from_channelmanager`]
56797 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
56798 * available and the current time is supplied by the caller.
56800 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);
56803 * See [`create_invoice_from_channelmanager_and_duration_since_epoch`]
56804 * This version allows for providing a custom [`PaymentHash`] for the invoice.
56805 * This may be useful if you're building an on-chain swap or involving another protocol where
56806 * the payment hash is also involved outside the scope of lightning.
56808 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);
56811 * Read a SiPrefix object from a string
56813 struct LDKCResult_SiPrefixBolt11ParseErrorZ SiPrefix_from_str(struct LDKStr s);
56816 * Read a Bolt11Invoice object from a string
56818 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ Bolt11Invoice_from_str(struct LDKStr s);
56821 * Read a SignedRawBolt11Invoice object from a string
56823 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ SignedRawBolt11Invoice_from_str(struct LDKStr s);
56826 * Get the string representation of a Bolt11ParseError object
56828 struct LDKStr Bolt11ParseError_to_str(const struct LDKBolt11ParseError *NONNULL_PTR o);
56831 * Get the string representation of a ParseOrSemanticError object
56833 struct LDKStr ParseOrSemanticError_to_str(const struct LDKParseOrSemanticError *NONNULL_PTR o);
56836 * Get the string representation of a Bolt11Invoice object
56838 struct LDKStr Bolt11Invoice_to_str(const struct LDKBolt11Invoice *NONNULL_PTR o);
56841 * Get the string representation of a SignedRawBolt11Invoice object
56843 struct LDKStr SignedRawBolt11Invoice_to_str(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o);
56846 * Get the string representation of a Currency object
56848 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
56851 * Get the string representation of a SiPrefix object
56853 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
56856 * Frees any resources used by the GraphSyncError
56858 void GraphSyncError_free(struct LDKGraphSyncError this_ptr);
56861 * Creates a copy of the GraphSyncError
56863 struct LDKGraphSyncError GraphSyncError_clone(const struct LDKGraphSyncError *NONNULL_PTR orig);
56866 * Utility method to constructs a new DecodeError-variant GraphSyncError
56868 struct LDKGraphSyncError GraphSyncError_decode_error(struct LDKDecodeError a);
56871 * Utility method to constructs a new LightningError-variant GraphSyncError
56873 struct LDKGraphSyncError GraphSyncError_lightning_error(struct LDKLightningError a);
56876 * Frees any resources used by the RapidGossipSync, if is_owned is set and inner is non-NULL.
56878 void RapidGossipSync_free(struct LDKRapidGossipSync this_obj);
56881 * Instantiate a new [`RapidGossipSync`] instance.
56883 MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
56886 * Sync gossip data from a file.
56887 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
56889 * `network_graph`: The network graph to apply the updates to
56891 * `sync_path`: Path to the file where the gossip update data is located
56894 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_sync_network_graph_with_file_path(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKStr sync_path);
56897 * Update network graph from binary data.
56898 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
56900 * `update_data`: `&[u8]` binary stream that comprises the update data
56902 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data);
56905 * Update network graph from binary data.
56906 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
56908 * `update_data`: `&[u8]` binary stream that comprises the update data
56909 * `current_time_unix`: `Option<u64>` optional current timestamp to verify data age
56911 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);
56914 * Returns whether a rapid gossip sync has completed at least once.
56916 MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg);
56918 #endif /* LDK_C_BINDINGS_H */
56920 #include "ldk_ver.h"