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;
6360 * Builds an [`InvoiceRequest`] from an [`Offer`] for the \"offer to be paid\" flow.
6362 * See [module-level documentation] for usage.
6364 * [module-level documentation]: self
6366 typedef struct MUST_USE_STRUCT LDKInvoiceRequestWithDerivedPayerIdBuilder {
6368 * A pointer to the opaque Rust object.
6369 * Nearly everywhere, inner must be non-null, however in places where
6370 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6372 LDKnativeInvoiceRequestWithDerivedPayerIdBuilder *inner;
6374 * Indicates that this is the only struct which contains the same pointer.
6375 * Rust functions which take ownership of an object provided via an argument require
6376 * this to be true and invalidate the object pointed to by inner.
6379 } LDKInvoiceRequestWithDerivedPayerIdBuilder;
6382 * The contents of CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ
6384 typedef union LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZPtr {
6386 * A pointer to the contents in the success state.
6387 * Reading from this pointer when `result_ok` is not set is undefined.
6389 struct LDKInvoiceRequestWithDerivedPayerIdBuilder *result;
6391 * A pointer to the contents in the error state.
6392 * Reading from this pointer when `result_ok` is set is undefined.
6394 enum LDKBolt12SemanticError *err;
6395 } LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZPtr;
6398 * A CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
6399 * containing a crate::lightning::offers::invoice_request::InvoiceRequestWithDerivedPayerIdBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
6400 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6402 typedef struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ {
6404 * The contents of this CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ, accessible via either
6405 * `err` or `result` depending on the state of `result_ok`.
6407 union LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZPtr contents;
6409 * Whether this CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ represents a success state.
6412 } LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ;
6417 * Builds an [`InvoiceRequest`] from an [`Offer`] for the \"offer to be paid\" flow.
6419 * See [module-level documentation] for usage.
6421 * [module-level documentation]: self
6423 typedef struct MUST_USE_STRUCT LDKInvoiceRequestWithExplicitPayerIdBuilder {
6425 * A pointer to the opaque Rust object.
6426 * Nearly everywhere, inner must be non-null, however in places where
6427 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6429 LDKnativeInvoiceRequestWithExplicitPayerIdBuilder *inner;
6431 * Indicates that this is the only struct which contains the same pointer.
6432 * Rust functions which take ownership of an object provided via an argument require
6433 * this to be true and invalidate the object pointed to by inner.
6436 } LDKInvoiceRequestWithExplicitPayerIdBuilder;
6439 * The contents of CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ
6441 typedef union LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZPtr {
6443 * A pointer to the contents in the success state.
6444 * Reading from this pointer when `result_ok` is not set is undefined.
6446 struct LDKInvoiceRequestWithExplicitPayerIdBuilder *result;
6448 * A pointer to the contents in the error state.
6449 * Reading from this pointer when `result_ok` is set is undefined.
6451 enum LDKBolt12SemanticError *err;
6452 } LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZPtr;
6455 * A CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
6456 * containing a crate::lightning::offers::invoice_request::InvoiceRequestWithExplicitPayerIdBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
6457 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6459 typedef struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ {
6461 * The contents of this CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ, accessible via either
6462 * `err` or `result` depending on the state of `result_ok`.
6464 union LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZPtr contents;
6466 * Whether this CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ represents a success state.
6469 } LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ;
6474 * An `Offer` is a potentially long-lived proposal for payment of a good or service.
6476 * An offer is a precursor to an [`InvoiceRequest`]. A merchant publishes an offer from which a
6477 * customer may request an [`Bolt12Invoice`] for a specific quantity and using an amount sufficient
6478 * to cover that quantity (i.e., at least `quantity * amount`). See [`Offer::amount`].
6480 * Offers may be denominated in currency other than bitcoin but are ultimately paid using the
6483 * Through the use of [`BlindedPath`]s, offers provide recipient privacy.
6485 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
6486 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
6488 typedef struct MUST_USE_STRUCT LDKOffer {
6490 * A pointer to the opaque Rust object.
6491 * Nearly everywhere, inner must be non-null, however in places where
6492 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6494 LDKnativeOffer *inner;
6496 * Indicates that this is the only struct which contains the same pointer.
6497 * Rust functions which take ownership of an object provided via an argument require
6498 * this to be true and invalidate the object pointed to by inner.
6504 * The contents of CResult_OfferBolt12ParseErrorZ
6506 typedef union LDKCResult_OfferBolt12ParseErrorZPtr {
6508 * A pointer to the contents in the success state.
6509 * Reading from this pointer when `result_ok` is not set is undefined.
6511 struct LDKOffer *result;
6513 * A pointer to the contents in the error state.
6514 * Reading from this pointer when `result_ok` is set is undefined.
6516 struct LDKBolt12ParseError *err;
6517 } LDKCResult_OfferBolt12ParseErrorZPtr;
6520 * A CResult_OfferBolt12ParseErrorZ represents the result of a fallible operation,
6521 * containing a crate::lightning::offers::offer::Offer on success and a crate::lightning::offers::parse::Bolt12ParseError on failure.
6522 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6524 typedef struct LDKCResult_OfferBolt12ParseErrorZ {
6526 * The contents of this CResult_OfferBolt12ParseErrorZ, accessible via either
6527 * `err` or `result` depending on the state of `result_ok`.
6529 union LDKCResult_OfferBolt12ParseErrorZPtr contents;
6531 * Whether this CResult_OfferBolt12ParseErrorZ represents a success state.
6534 } LDKCResult_OfferBolt12ParseErrorZ;
6537 * The contents of CResult_NodeIdDecodeErrorZ
6539 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
6541 * A pointer to the contents in the success state.
6542 * Reading from this pointer when `result_ok` is not set is undefined.
6544 struct LDKNodeId *result;
6546 * A pointer to the contents in the error state.
6547 * Reading from this pointer when `result_ok` is set is undefined.
6549 struct LDKDecodeError *err;
6550 } LDKCResult_NodeIdDecodeErrorZPtr;
6553 * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
6554 * containing a crate::lightning::routing::gossip::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
6555 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6557 typedef struct LDKCResult_NodeIdDecodeErrorZ {
6559 * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
6560 * `err` or `result` depending on the state of `result_ok`.
6562 union LDKCResult_NodeIdDecodeErrorZPtr contents;
6564 * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
6567 } LDKCResult_NodeIdDecodeErrorZ;
6570 * The contents of CResult_PublicKeySecp256k1ErrorZ
6572 typedef union LDKCResult_PublicKeySecp256k1ErrorZPtr {
6574 * A pointer to the contents in the success state.
6575 * Reading from this pointer when `result_ok` is not set is undefined.
6577 struct LDKPublicKey *result;
6579 * A pointer to the contents in the error state.
6580 * Reading from this pointer when `result_ok` is set is undefined.
6582 enum LDKSecp256k1Error *err;
6583 } LDKCResult_PublicKeySecp256k1ErrorZPtr;
6586 * A CResult_PublicKeySecp256k1ErrorZ represents the result of a fallible operation,
6587 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
6588 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6590 typedef struct LDKCResult_PublicKeySecp256k1ErrorZ {
6592 * The contents of this CResult_PublicKeySecp256k1ErrorZ, accessible via either
6593 * `err` or `result` depending on the state of `result_ok`.
6595 union LDKCResult_PublicKeySecp256k1ErrorZPtr contents;
6597 * Whether this CResult_PublicKeySecp256k1ErrorZ represents a success state.
6600 } LDKCResult_PublicKeySecp256k1ErrorZ;
6605 * A [`channel_update`] message to be sent to or received from a peer.
6607 * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
6609 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
6611 * A pointer to the opaque Rust object.
6612 * Nearly everywhere, inner must be non-null, however in places where
6613 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6615 LDKnativeChannelUpdate *inner;
6617 * Indicates that this is the only struct which contains the same pointer.
6618 * Rust functions which take ownership of an object provided via an argument require
6619 * this to be true and invalidate the object pointed to by inner.
6625 * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
6626 * return packet by a node along the route. See [BOLT #4] for details.
6628 * [BOLT #4]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md
6630 typedef enum LDKNetworkUpdate_Tag {
6632 * An error indicating a `channel_update` messages should be applied via
6633 * [`NetworkGraph::update_channel`].
6635 LDKNetworkUpdate_ChannelUpdateMessage,
6637 * An error indicating that a channel failed to route a payment, which should be applied via
6638 * [`NetworkGraph::channel_failed_permanent`] if permanent.
6640 LDKNetworkUpdate_ChannelFailure,
6642 * An error indicating that a node failed to route a payment, which should be applied via
6643 * [`NetworkGraph::node_failed_permanent`] if permanent.
6645 LDKNetworkUpdate_NodeFailure,
6647 * Must be last for serialization purposes
6649 LDKNetworkUpdate_Sentinel,
6650 } LDKNetworkUpdate_Tag;
6652 typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
6654 * The update to apply via [`NetworkGraph::update_channel`].
6656 struct LDKChannelUpdate msg;
6657 } LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
6659 typedef struct LDKNetworkUpdate_LDKChannelFailure_Body {
6661 * The short channel id of the closed channel.
6663 uint64_t short_channel_id;
6665 * Whether the channel should be permanently removed or temporarily disabled until a new
6666 * `channel_update` message is received.
6669 } LDKNetworkUpdate_LDKChannelFailure_Body;
6671 typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
6673 * The node id of the failed node.
6675 struct LDKPublicKey node_id;
6677 * Whether the node should be permanently removed from consideration or can be restored
6678 * when a new `channel_update` message is received.
6681 } LDKNetworkUpdate_LDKNodeFailure_Body;
6683 typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
6684 LDKNetworkUpdate_Tag tag;
6686 LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
6687 LDKNetworkUpdate_LDKChannelFailure_Body channel_failure;
6688 LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
6693 * An enum which can either contain a crate::lightning::routing::gossip::NetworkUpdate or not
6695 typedef enum LDKCOption_NetworkUpdateZ_Tag {
6697 * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::gossip::NetworkUpdate
6699 LDKCOption_NetworkUpdateZ_Some,
6701 * When we're in this state, this COption_NetworkUpdateZ contains nothing
6703 LDKCOption_NetworkUpdateZ_None,
6705 * Must be last for serialization purposes
6707 LDKCOption_NetworkUpdateZ_Sentinel,
6708 } LDKCOption_NetworkUpdateZ_Tag;
6710 typedef struct LDKCOption_NetworkUpdateZ {
6711 LDKCOption_NetworkUpdateZ_Tag tag;
6714 struct LDKNetworkUpdate some;
6717 } LDKCOption_NetworkUpdateZ;
6720 * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
6722 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
6724 * A pointer to the contents in the success state.
6725 * Reading from this pointer when `result_ok` is not set is undefined.
6727 struct LDKCOption_NetworkUpdateZ *result;
6729 * A pointer to the contents in the error state.
6730 * Reading from this pointer when `result_ok` is set is undefined.
6732 struct LDKDecodeError *err;
6733 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
6736 * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
6737 * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
6738 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6740 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
6742 * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
6743 * `err` or `result` depending on the state of `result_ok`.
6745 union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
6747 * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
6750 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
6753 * The contents of CResult_TxOutUtxoLookupErrorZ
6755 typedef union LDKCResult_TxOutUtxoLookupErrorZPtr {
6757 * A pointer to the contents in the success state.
6758 * Reading from this pointer when `result_ok` is not set is undefined.
6760 struct LDKTxOut *result;
6762 * A pointer to the contents in the error state.
6763 * Reading from this pointer when `result_ok` is set is undefined.
6765 enum LDKUtxoLookupError *err;
6766 } LDKCResult_TxOutUtxoLookupErrorZPtr;
6769 * A CResult_TxOutUtxoLookupErrorZ represents the result of a fallible operation,
6770 * containing a crate::c_types::TxOut on success and a crate::lightning::routing::utxo::UtxoLookupError on failure.
6771 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6773 typedef struct LDKCResult_TxOutUtxoLookupErrorZ {
6775 * The contents of this CResult_TxOutUtxoLookupErrorZ, accessible via either
6776 * `err` or `result` depending on the state of `result_ok`.
6778 union LDKCResult_TxOutUtxoLookupErrorZPtr contents;
6780 * Whether this CResult_TxOutUtxoLookupErrorZ represents a success state.
6783 } LDKCResult_TxOutUtxoLookupErrorZ;
6788 * Represents a future resolution of a [`UtxoLookup::get_utxo`] query resolving async.
6790 * See [`UtxoResult::Async`] and [`UtxoFuture::resolve`] for more info.
6792 typedef struct MUST_USE_STRUCT LDKUtxoFuture {
6794 * A pointer to the opaque Rust object.
6795 * Nearly everywhere, inner must be non-null, however in places where
6796 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6798 LDKnativeUtxoFuture *inner;
6800 * Indicates that this is the only struct which contains the same pointer.
6801 * Rust functions which take ownership of an object provided via an argument require
6802 * this to be true and invalidate the object pointed to by inner.
6808 * The result of a [`UtxoLookup::get_utxo`] call. A call may resolve either synchronously,
6809 * returning the `Sync` variant, or asynchronously, returning an [`UtxoFuture`] in the `Async`
6812 typedef enum LDKUtxoResult_Tag {
6814 * A result which was resolved synchronously. It either includes a [`TxOut`] for the output
6815 * requested or a [`UtxoLookupError`].
6819 * A result which will be resolved asynchronously. It includes a [`UtxoFuture`], a `clone` of
6820 * which you must keep locally and call [`UtxoFuture::resolve`] on once the lookup completes.
6822 * Note that in order to avoid runaway memory usage, the number of parallel checks is limited,
6823 * but only fairly loosely. Because a pending checks block all message processing, leaving
6824 * checks pending for an extended time may cause DoS of other functions. It is recommended you
6825 * keep a tight timeout on lookups, on the order of a few seconds.
6827 LDKUtxoResult_Async,
6829 * Must be last for serialization purposes
6831 LDKUtxoResult_Sentinel,
6832 } LDKUtxoResult_Tag;
6834 typedef struct MUST_USE_STRUCT LDKUtxoResult {
6835 LDKUtxoResult_Tag tag;
6838 struct LDKCResult_TxOutUtxoLookupErrorZ sync;
6841 struct LDKUtxoFuture async;
6847 * The `UtxoLookup` trait defines behavior for accessing on-chain UTXOs.
6849 typedef struct LDKUtxoLookup {
6851 * An opaque pointer which is passed to your function implementations as an argument.
6852 * This has no meaning in the LDK, and can be NULL or any other value.
6856 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
6857 * Returns an error if `chain_hash` is for a different chain or if such a transaction output is
6860 * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id
6862 struct LDKUtxoResult (*get_utxo)(const void *this_arg, const uint8_t (*chain_hash)[32], uint64_t short_channel_id);
6864 * Frees any resources associated with this object given its this_arg pointer.
6865 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6867 void (*free)(void *this_arg);
6871 * An enum which can either contain a crate::lightning::routing::utxo::UtxoLookup or not
6873 typedef enum LDKCOption_UtxoLookupZ_Tag {
6875 * When we're in this state, this COption_UtxoLookupZ contains a crate::lightning::routing::utxo::UtxoLookup
6877 LDKCOption_UtxoLookupZ_Some,
6879 * When we're in this state, this COption_UtxoLookupZ contains nothing
6881 LDKCOption_UtxoLookupZ_None,
6883 * Must be last for serialization purposes
6885 LDKCOption_UtxoLookupZ_Sentinel,
6886 } LDKCOption_UtxoLookupZ_Tag;
6888 typedef struct LDKCOption_UtxoLookupZ {
6889 LDKCOption_UtxoLookupZ_Tag tag;
6892 struct LDKUtxoLookup some;
6895 } LDKCOption_UtxoLookupZ;
6898 * The contents of CResult_NoneLightningErrorZ
6900 typedef union LDKCResult_NoneLightningErrorZPtr {
6902 * Note that this value is always NULL, as there are no contents in the OK variant
6906 * A pointer to the contents in the error state.
6907 * Reading from this pointer when `result_ok` is set is undefined.
6909 struct LDKLightningError *err;
6910 } LDKCResult_NoneLightningErrorZPtr;
6913 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
6914 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
6915 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6917 typedef struct LDKCResult_NoneLightningErrorZ {
6919 * The contents of this CResult_NoneLightningErrorZ, accessible via either
6920 * `err` or `result` depending on the state of `result_ok`.
6922 union LDKCResult_NoneLightningErrorZPtr contents;
6924 * Whether this CResult_NoneLightningErrorZ represents a success state.
6927 } LDKCResult_NoneLightningErrorZ;
6930 * The contents of CResult_boolLightningErrorZ
6932 typedef union LDKCResult_boolLightningErrorZPtr {
6934 * A pointer to the contents in the success state.
6935 * Reading from this pointer when `result_ok` is not set is undefined.
6939 * A pointer to the contents in the error state.
6940 * Reading from this pointer when `result_ok` is set is undefined.
6942 struct LDKLightningError *err;
6943 } LDKCResult_boolLightningErrorZPtr;
6946 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
6947 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
6948 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6950 typedef struct LDKCResult_boolLightningErrorZ {
6952 * The contents of this CResult_boolLightningErrorZ, accessible via either
6953 * `err` or `result` depending on the state of `result_ok`.
6955 union LDKCResult_boolLightningErrorZPtr contents;
6957 * Whether this CResult_boolLightningErrorZ represents a success state.
6960 } LDKCResult_boolLightningErrorZ;
6965 * A [`channel_announcement`] message to be sent to or received from a peer.
6967 * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
6969 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
6971 * A pointer to the opaque Rust object.
6972 * Nearly everywhere, inner must be non-null, however in places where
6973 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6975 LDKnativeChannelAnnouncement *inner;
6977 * Indicates that this is the only struct which contains the same pointer.
6978 * Rust functions which take ownership of an object provided via an argument require
6979 * this to be true and invalidate the object pointed to by inner.
6982 } LDKChannelAnnouncement;
6985 * A tuple of 3 elements. See the individual fields for the types contained.
6987 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
6989 * The element at position 0
6991 struct LDKChannelAnnouncement a;
6993 * The element at position 1
6995 struct LDKChannelUpdate b;
6997 * The element at position 2
6999 struct LDKChannelUpdate c;
7000 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
7003 * An enum which can either contain a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ or not
7005 typedef enum LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag {
7007 * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
7009 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some,
7011 * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains nothing
7013 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None,
7015 * Must be last for serialization purposes
7017 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Sentinel,
7018 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag;
7020 typedef struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
7021 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag tag;
7024 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ some;
7027 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
7032 * An [`accept_channel`] message to be sent to or received from a peer.
7034 * Used in V1 channel establishment
7036 * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message
7038 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
7040 * A pointer to the opaque Rust object.
7041 * Nearly everywhere, inner must be non-null, however in places where
7042 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7044 LDKnativeAcceptChannel *inner;
7046 * Indicates that this is the only struct which contains the same pointer.
7047 * Rust functions which take ownership of an object provided via an argument require
7048 * this to be true and invalidate the object pointed to by inner.
7056 * An accept_channel2 message to be sent by or received from the channel accepter.
7058 * Used in V2 channel establishment
7061 typedef struct MUST_USE_STRUCT LDKAcceptChannelV2 {
7063 * A pointer to the opaque Rust object.
7064 * Nearly everywhere, inner must be non-null, however in places where
7065 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7067 LDKnativeAcceptChannelV2 *inner;
7069 * Indicates that this is the only struct which contains the same pointer.
7070 * Rust functions which take ownership of an object provided via an argument require
7071 * this to be true and invalidate the object pointed to by inner.
7074 } LDKAcceptChannelV2;
7079 * An [`open_channel`] message to be sent to or received from a peer.
7081 * Used in V1 channel establishment
7083 * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message
7085 typedef struct MUST_USE_STRUCT LDKOpenChannel {
7087 * A pointer to the opaque Rust object.
7088 * Nearly everywhere, inner must be non-null, however in places where
7089 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7091 LDKnativeOpenChannel *inner;
7093 * Indicates that this is the only struct which contains the same pointer.
7094 * Rust functions which take ownership of an object provided via an argument require
7095 * this to be true and invalidate the object pointed to by inner.
7103 * An open_channel2 message to be sent by or received from the channel initiator.
7105 * Used in V2 channel establishment
7108 typedef struct MUST_USE_STRUCT LDKOpenChannelV2 {
7110 * A pointer to the opaque Rust object.
7111 * Nearly everywhere, inner must be non-null, however in places where
7112 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7114 LDKnativeOpenChannelV2 *inner;
7116 * Indicates that this is the only struct which contains the same pointer.
7117 * Rust functions which take ownership of an object provided via an argument require
7118 * this to be true and invalidate the object pointed to by inner.
7126 * A [`funding_created`] message to be sent to or received from a peer.
7128 * Used in V1 channel establishment
7130 * [`funding_created`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_created-message
7132 typedef struct MUST_USE_STRUCT LDKFundingCreated {
7134 * A pointer to the opaque Rust object.
7135 * Nearly everywhere, inner must be non-null, however in places where
7136 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7138 LDKnativeFundingCreated *inner;
7140 * Indicates that this is the only struct which contains the same pointer.
7141 * Rust functions which take ownership of an object provided via an argument require
7142 * this to be true and invalidate the object pointed to by inner.
7145 } LDKFundingCreated;
7150 * A [`funding_signed`] message to be sent to or received from a peer.
7152 * Used in V1 channel establishment
7154 * [`funding_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_signed-message
7156 typedef struct MUST_USE_STRUCT LDKFundingSigned {
7158 * A pointer to the opaque Rust object.
7159 * Nearly everywhere, inner must be non-null, however in places where
7160 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7162 LDKnativeFundingSigned *inner;
7164 * Indicates that this is the only struct which contains the same pointer.
7165 * Rust functions which take ownership of an object provided via an argument require
7166 * this to be true and invalidate the object pointed to by inner.
7174 * An stfu (quiescence) message to be sent by or received from the stfu initiator.
7176 typedef struct MUST_USE_STRUCT LDKStfu {
7178 * A pointer to the opaque Rust object.
7179 * Nearly everywhere, inner must be non-null, however in places where
7180 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7182 LDKnativeStfu *inner;
7184 * Indicates that this is the only struct which contains the same pointer.
7185 * Rust functions which take ownership of an object provided via an argument require
7186 * this to be true and invalidate the object pointed to by inner.
7194 * A splice message to be sent by or received from the stfu initiator (splice initiator).
7196 typedef struct MUST_USE_STRUCT LDKSplice {
7198 * A pointer to the opaque Rust object.
7199 * Nearly everywhere, inner must be non-null, however in places where
7200 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7202 LDKnativeSplice *inner;
7204 * Indicates that this is the only struct which contains the same pointer.
7205 * Rust functions which take ownership of an object provided via an argument require
7206 * this to be true and invalidate the object pointed to by inner.
7214 * A splice_ack message to be received by or sent to the splice initiator.
7217 typedef struct MUST_USE_STRUCT LDKSpliceAck {
7219 * A pointer to the opaque Rust object.
7220 * Nearly everywhere, inner must be non-null, however in places where
7221 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7223 LDKnativeSpliceAck *inner;
7225 * Indicates that this is the only struct which contains the same pointer.
7226 * Rust functions which take ownership of an object provided via an argument require
7227 * this to be true and invalidate the object pointed to by inner.
7235 * A splice_locked message to be sent to or received from a peer.
7238 typedef struct MUST_USE_STRUCT LDKSpliceLocked {
7240 * A pointer to the opaque Rust object.
7241 * Nearly everywhere, inner must be non-null, however in places where
7242 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7244 LDKnativeSpliceLocked *inner;
7246 * Indicates that this is the only struct which contains the same pointer.
7247 * Rust functions which take ownership of an object provided via an argument require
7248 * this to be true and invalidate the object pointed to by inner.
7256 * A tx_add_input message for adding an input during interactive transaction construction
7259 typedef struct MUST_USE_STRUCT LDKTxAddInput {
7261 * A pointer to the opaque Rust object.
7262 * Nearly everywhere, inner must be non-null, however in places where
7263 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7265 LDKnativeTxAddInput *inner;
7267 * Indicates that this is the only struct which contains the same pointer.
7268 * Rust functions which take ownership of an object provided via an argument require
7269 * this to be true and invalidate the object pointed to by inner.
7277 * A tx_add_output message for adding an output during interactive transaction construction.
7280 typedef struct MUST_USE_STRUCT LDKTxAddOutput {
7282 * A pointer to the opaque Rust object.
7283 * Nearly everywhere, inner must be non-null, however in places where
7284 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7286 LDKnativeTxAddOutput *inner;
7288 * Indicates that this is the only struct which contains the same pointer.
7289 * Rust functions which take ownership of an object provided via an argument require
7290 * this to be true and invalidate the object pointed to by inner.
7298 * A tx_remove_input message for removing an input during interactive transaction construction.
7301 typedef struct MUST_USE_STRUCT LDKTxRemoveInput {
7303 * A pointer to the opaque Rust object.
7304 * Nearly everywhere, inner must be non-null, however in places where
7305 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7307 LDKnativeTxRemoveInput *inner;
7309 * Indicates that this is the only struct which contains the same pointer.
7310 * Rust functions which take ownership of an object provided via an argument require
7311 * this to be true and invalidate the object pointed to by inner.
7319 * A tx_remove_output message for removing an output during interactive transaction construction.
7322 typedef struct MUST_USE_STRUCT LDKTxRemoveOutput {
7324 * A pointer to the opaque Rust object.
7325 * Nearly everywhere, inner must be non-null, however in places where
7326 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7328 LDKnativeTxRemoveOutput *inner;
7330 * Indicates that this is the only struct which contains the same pointer.
7331 * Rust functions which take ownership of an object provided via an argument require
7332 * this to be true and invalidate the object pointed to by inner.
7335 } LDKTxRemoveOutput;
7340 * A tx_complete message signalling the conclusion of a peer's transaction contributions during
7341 * interactive transaction construction.
7344 typedef struct MUST_USE_STRUCT LDKTxComplete {
7346 * A pointer to the opaque Rust object.
7347 * Nearly everywhere, inner must be non-null, however in places where
7348 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7350 LDKnativeTxComplete *inner;
7352 * Indicates that this is the only struct which contains the same pointer.
7353 * Rust functions which take ownership of an object provided via an argument require
7354 * this to be true and invalidate the object pointed to by inner.
7362 * A tx_signatures message containing the sender's signatures for a transaction constructed with
7363 * interactive transaction construction.
7366 typedef struct MUST_USE_STRUCT LDKTxSignatures {
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 LDKnativeTxSignatures *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_init_rbf message which initiates a replacement of the transaction after it's been
7388 typedef struct MUST_USE_STRUCT LDKTxInitRbf {
7390 * A pointer to the opaque Rust object.
7391 * Nearly everywhere, inner must be non-null, however in places where
7392 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7394 LDKnativeTxInitRbf *inner;
7396 * Indicates that this is the only struct which contains the same pointer.
7397 * Rust functions which take ownership of an object provided via an argument require
7398 * this to be true and invalidate the object pointed to by inner.
7406 * A tx_ack_rbf message which acknowledges replacement of the transaction after it's been
7410 typedef struct MUST_USE_STRUCT LDKTxAckRbf {
7412 * A pointer to the opaque Rust object.
7413 * Nearly everywhere, inner must be non-null, however in places where
7414 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7416 LDKnativeTxAckRbf *inner;
7418 * Indicates that this is the only struct which contains the same pointer.
7419 * Rust functions which take ownership of an object provided via an argument require
7420 * this to be true and invalidate the object pointed to by inner.
7428 * A tx_abort message which signals the cancellation of an in-progress transaction negotiation.
7431 typedef struct MUST_USE_STRUCT LDKTxAbort {
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 LDKnativeTxAbort *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 [`channel_ready`] message to be sent to or received from a peer.
7451 * [`channel_ready`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-channel_ready-message
7453 typedef struct MUST_USE_STRUCT LDKChannelReady {
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 LDKnativeChannelReady *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 * An [`announcement_signatures`] message to be sent to or received from a peer.
7473 * [`announcement_signatures`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-announcement_signatures-message
7475 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
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 LDKnativeAnnouncementSignatures *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.
7488 } LDKAnnouncementSignatures;
7493 * Struct used to return values from [`RevokeAndACK`] messages, containing a bunch of commitment
7494 * transaction updates if they were pending.
7496 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
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 LDKnativeCommitmentUpdate *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.
7509 } LDKCommitmentUpdate;
7514 * A [`revoke_and_ack`] message to be sent to or received from a peer.
7516 * [`revoke_and_ack`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#completing-the-transition-to-the-updated-state-revoke_and_ack
7518 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
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 LDKnativeRevokeAndACK *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 * A [`closing_signed`] message to be sent to or received from a peer.
7538 * [`closing_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-negotiation-closing_signed
7540 typedef struct MUST_USE_STRUCT LDKClosingSigned {
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 LDKnativeClosingSigned *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.
7558 * A [`shutdown`] message to be sent to or received from a peer.
7560 * [`shutdown`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-initiation-shutdown
7562 typedef struct MUST_USE_STRUCT LDKShutdown {
7564 * A pointer to the opaque Rust object.
7565 * Nearly everywhere, inner must be non-null, however in places where
7566 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7568 LDKnativeShutdown *inner;
7570 * Indicates that this is the only struct which contains the same pointer.
7571 * Rust functions which take ownership of an object provided via an argument require
7572 * this to be true and invalidate the object pointed to by inner.
7580 * A [`channel_reestablish`] message to be sent to or received from a peer.
7582 * [`channel_reestablish`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#message-retransmission
7584 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
7586 * A pointer to the opaque Rust object.
7587 * Nearly everywhere, inner must be non-null, however in places where
7588 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7590 LDKnativeChannelReestablish *inner;
7592 * Indicates that this is the only struct which contains the same pointer.
7593 * Rust functions which take ownership of an object provided via an argument require
7594 * this to be true and invalidate the object pointed to by inner.
7597 } LDKChannelReestablish;
7602 * A [`node_announcement`] message to be sent to or received from a peer.
7604 * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
7606 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
7608 * A pointer to the opaque Rust object.
7609 * Nearly everywhere, inner must be non-null, however in places where
7610 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7612 LDKnativeNodeAnnouncement *inner;
7614 * Indicates that this is the only struct which contains the same pointer.
7615 * Rust functions which take ownership of an object provided via an argument require
7616 * this to be true and invalidate the object pointed to by inner.
7619 } LDKNodeAnnouncement;
7624 * An [`error`] message to be sent to or received from a peer.
7626 * [`error`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
7628 typedef struct MUST_USE_STRUCT LDKErrorMessage {
7630 * A pointer to the opaque Rust object.
7631 * Nearly everywhere, inner must be non-null, however in places where
7632 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7634 LDKnativeErrorMessage *inner;
7636 * Indicates that this is the only struct which contains the same pointer.
7637 * Rust functions which take ownership of an object provided via an argument require
7638 * this to be true and invalidate the object pointed to by inner.
7646 * A [`warning`] message to be sent to or received from a peer.
7648 * [`warning`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
7650 typedef struct MUST_USE_STRUCT LDKWarningMessage {
7652 * A pointer to the opaque Rust object.
7653 * Nearly everywhere, inner must be non-null, however in places where
7654 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7656 LDKnativeWarningMessage *inner;
7658 * Indicates that this is the only struct which contains the same pointer.
7659 * Rust functions which take ownership of an object provided via an argument require
7660 * this to be true and invalidate the object pointed to by inner.
7663 } LDKWarningMessage;
7666 * Used to put an error message in a [`LightningError`].
7668 typedef enum LDKErrorAction_Tag {
7670 * The peer took some action which made us think they were useless. Disconnect them.
7672 LDKErrorAction_DisconnectPeer,
7674 * The peer did something incorrect. Tell them without closing any channels and disconnect them.
7676 LDKErrorAction_DisconnectPeerWithWarning,
7678 * The peer did something harmless that we weren't able to process, just log and ignore
7680 LDKErrorAction_IgnoreError,
7682 * The peer did something harmless that we weren't able to meaningfully process.
7683 * If the error is logged, log it at the given level.
7685 LDKErrorAction_IgnoreAndLog,
7687 * The peer provided us with a gossip message which we'd already seen. In most cases this
7688 * should be ignored, but it may result in the message being forwarded if it is a duplicate of
7689 * our own channel announcements.
7691 LDKErrorAction_IgnoreDuplicateGossip,
7693 * The peer did something incorrect. Tell them.
7695 LDKErrorAction_SendErrorMessage,
7697 * The peer did something incorrect. Tell them without closing any channels.
7699 LDKErrorAction_SendWarningMessage,
7701 * Must be last for serialization purposes
7703 LDKErrorAction_Sentinel,
7704 } LDKErrorAction_Tag;
7706 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
7708 * An error message which we should make an effort to send before we disconnect.
7710 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
7712 struct LDKErrorMessage msg;
7713 } LDKErrorAction_LDKDisconnectPeer_Body;
7715 typedef struct LDKErrorAction_LDKDisconnectPeerWithWarning_Body {
7717 * A warning message which we should make an effort to send before we disconnect.
7719 struct LDKWarningMessage msg;
7720 } LDKErrorAction_LDKDisconnectPeerWithWarning_Body;
7722 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
7724 * The message to send.
7726 struct LDKErrorMessage msg;
7727 } LDKErrorAction_LDKSendErrorMessage_Body;
7729 typedef struct LDKErrorAction_LDKSendWarningMessage_Body {
7731 * The message to send.
7733 struct LDKWarningMessage msg;
7735 * The peer may have done something harmless that we weren't able to meaningfully process,
7736 * though we should still tell them about it.
7737 * If this event is logged, log it at the given level.
7739 enum LDKLevel log_level;
7740 } LDKErrorAction_LDKSendWarningMessage_Body;
7742 typedef struct MUST_USE_STRUCT LDKErrorAction {
7743 LDKErrorAction_Tag tag;
7745 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
7746 LDKErrorAction_LDKDisconnectPeerWithWarning_Body disconnect_peer_with_warning;
7748 enum LDKLevel ignore_and_log;
7750 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
7751 LDKErrorAction_LDKSendWarningMessage_Body send_warning_message;
7758 * A [`query_channel_range`] message is used to query a peer for channel
7759 * UTXOs in a range of blocks. The recipient of a query makes a best
7760 * effort to reply to the query using one or more [`ReplyChannelRange`]
7763 * [`query_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
7765 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
7767 * A pointer to the opaque Rust object.
7768 * Nearly everywhere, inner must be non-null, however in places where
7769 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7771 LDKnativeQueryChannelRange *inner;
7773 * Indicates that this is the only struct which contains the same pointer.
7774 * Rust functions which take ownership of an object provided via an argument require
7775 * this to be true and invalidate the object pointed to by inner.
7778 } LDKQueryChannelRange;
7783 * A [`query_short_channel_ids`] message is used to query a peer for
7784 * routing gossip messages related to one or more `short_channel_id`s.
7786 * The query recipient will reply with the latest, if available,
7787 * [`ChannelAnnouncement`], [`ChannelUpdate`] and [`NodeAnnouncement`] messages
7788 * it maintains for the requested `short_channel_id`s followed by a
7789 * [`ReplyShortChannelIdsEnd`] message. The `short_channel_id`s sent in
7790 * this query are encoded. We only support `encoding_type=0` uncompressed
7791 * serialization and do not support `encoding_type=1` zlib serialization.
7793 * [`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
7795 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
7797 * A pointer to the opaque Rust object.
7798 * Nearly everywhere, inner must be non-null, however in places where
7799 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7801 LDKnativeQueryShortChannelIds *inner;
7803 * Indicates that this is the only struct which contains the same pointer.
7804 * Rust functions which take ownership of an object provided via an argument require
7805 * this to be true and invalidate the object pointed to by inner.
7808 } LDKQueryShortChannelIds;
7813 * A [`reply_channel_range`] message is a reply to a [`QueryChannelRange`]
7816 * Multiple `reply_channel_range` messages can be sent in reply
7817 * to a single [`QueryChannelRange`] message. The query recipient makes a
7818 * best effort to respond based on their local network view which may
7819 * not be a perfect view of the network. The `short_channel_id`s in the
7820 * reply are encoded. We only support `encoding_type=0` uncompressed
7821 * serialization and do not support `encoding_type=1` zlib serialization.
7823 * [`reply_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
7825 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
7827 * A pointer to the opaque Rust object.
7828 * Nearly everywhere, inner must be non-null, however in places where
7829 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7831 LDKnativeReplyChannelRange *inner;
7833 * Indicates that this is the only struct which contains the same pointer.
7834 * Rust functions which take ownership of an object provided via an argument require
7835 * this to be true and invalidate the object pointed to by inner.
7838 } LDKReplyChannelRange;
7843 * A [`gossip_timestamp_filter`] message is used by a node to request
7844 * gossip relay for messages in the requested time range when the
7845 * `gossip_queries` feature has been negotiated.
7847 * [`gossip_timestamp_filter`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-gossip_timestamp_filter-message
7849 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
7851 * A pointer to the opaque Rust object.
7852 * Nearly everywhere, inner must be non-null, however in places where
7853 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7855 LDKnativeGossipTimestampFilter *inner;
7857 * Indicates that this is the only struct which contains the same pointer.
7858 * Rust functions which take ownership of an object provided via an argument require
7859 * this to be true and invalidate the object pointed to by inner.
7862 } LDKGossipTimestampFilter;
7865 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
7866 * broadcast to most peers).
7867 * These events are handled by PeerManager::process_events if you are using a PeerManager.
7869 typedef enum LDKMessageSendEvent_Tag {
7871 * Used to indicate that we've accepted a channel open and should send the accept_channel
7872 * message provided to the given peer.
7874 LDKMessageSendEvent_SendAcceptChannel,
7876 * Used to indicate that we've accepted a V2 channel open and should send the accept_channel2
7877 * message provided to the given peer.
7879 LDKMessageSendEvent_SendAcceptChannelV2,
7881 * Used to indicate that we've initiated a channel open and should send the open_channel
7882 * message provided to the given peer.
7884 LDKMessageSendEvent_SendOpenChannel,
7886 * Used to indicate that we've initiated a V2 channel open and should send the open_channel2
7887 * message provided to the given peer.
7889 LDKMessageSendEvent_SendOpenChannelV2,
7891 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
7893 LDKMessageSendEvent_SendFundingCreated,
7895 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
7897 LDKMessageSendEvent_SendFundingSigned,
7899 * Used to indicate that a stfu message should be sent to the peer with the given node id.
7901 LDKMessageSendEvent_SendStfu,
7903 * Used to indicate that a splice message should be sent to the peer with the given node id.
7905 LDKMessageSendEvent_SendSplice,
7907 * Used to indicate that a splice_ack message should be sent to the peer with the given node id.
7909 LDKMessageSendEvent_SendSpliceAck,
7911 * Used to indicate that a splice_locked message should be sent to the peer with the given node id.
7913 LDKMessageSendEvent_SendSpliceLocked,
7915 * Used to indicate that a tx_add_input message should be sent to the peer with the given node_id.
7917 LDKMessageSendEvent_SendTxAddInput,
7919 * Used to indicate that a tx_add_output message should be sent to the peer with the given node_id.
7921 LDKMessageSendEvent_SendTxAddOutput,
7923 * Used to indicate that a tx_remove_input message should be sent to the peer with the given node_id.
7925 LDKMessageSendEvent_SendTxRemoveInput,
7927 * Used to indicate that a tx_remove_output message should be sent to the peer with the given node_id.
7929 LDKMessageSendEvent_SendTxRemoveOutput,
7931 * Used to indicate that a tx_complete message should be sent to the peer with the given node_id.
7933 LDKMessageSendEvent_SendTxComplete,
7935 * Used to indicate that a tx_signatures message should be sent to the peer with the given node_id.
7937 LDKMessageSendEvent_SendTxSignatures,
7939 * Used to indicate that a tx_init_rbf message should be sent to the peer with the given node_id.
7941 LDKMessageSendEvent_SendTxInitRbf,
7943 * Used to indicate that a tx_ack_rbf message should be sent to the peer with the given node_id.
7945 LDKMessageSendEvent_SendTxAckRbf,
7947 * Used to indicate that a tx_abort message should be sent to the peer with the given node_id.
7949 LDKMessageSendEvent_SendTxAbort,
7951 * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
7953 LDKMessageSendEvent_SendChannelReady,
7955 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
7957 LDKMessageSendEvent_SendAnnouncementSignatures,
7959 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
7960 * message should be sent to the peer with the given node_id.
7962 LDKMessageSendEvent_UpdateHTLCs,
7964 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
7966 LDKMessageSendEvent_SendRevokeAndACK,
7968 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
7970 LDKMessageSendEvent_SendClosingSigned,
7972 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
7974 LDKMessageSendEvent_SendShutdown,
7976 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
7978 LDKMessageSendEvent_SendChannelReestablish,
7980 * Used to send a channel_announcement and channel_update to a specific peer, likely on
7981 * initial connection to ensure our peers know about our channels.
7983 LDKMessageSendEvent_SendChannelAnnouncement,
7985 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
7986 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
7988 * Note that after doing so, you very likely (unless you did so very recently) want to
7989 * broadcast a node_announcement (e.g. via [`PeerManager::broadcast_node_announcement`]). This
7990 * ensures that any nodes which see our channel_announcement also have a relevant
7991 * node_announcement, including relevant feature flags which may be important for routing
7994 * [`PeerManager::broadcast_node_announcement`]: crate::ln::peer_handler::PeerManager::broadcast_node_announcement
7996 LDKMessageSendEvent_BroadcastChannelAnnouncement,
7998 * Used to indicate that a channel_update should be broadcast to all peers.
8000 LDKMessageSendEvent_BroadcastChannelUpdate,
8002 * Used to indicate that a node_announcement should be broadcast to all peers.
8004 LDKMessageSendEvent_BroadcastNodeAnnouncement,
8006 * Used to indicate that a channel_update should be sent to a single peer.
8007 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
8008 * private channel and we shouldn't be informing all of our peers of channel parameters.
8010 LDKMessageSendEvent_SendChannelUpdate,
8012 * Broadcast an error downstream to be handled
8014 LDKMessageSendEvent_HandleError,
8016 * Query a peer for channels with funding transaction UTXOs in a block range.
8018 LDKMessageSendEvent_SendChannelRangeQuery,
8020 * Request routing gossip messages from a peer for a list of channels identified by
8021 * their short_channel_ids.
8023 LDKMessageSendEvent_SendShortIdsQuery,
8025 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
8026 * emitted during processing of the query.
8028 LDKMessageSendEvent_SendReplyChannelRange,
8030 * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
8031 * enable receiving gossip messages from the peer.
8033 LDKMessageSendEvent_SendGossipTimestampFilter,
8035 * Must be last for serialization purposes
8037 LDKMessageSendEvent_Sentinel,
8038 } LDKMessageSendEvent_Tag;
8040 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
8042 * The node_id of the node which should receive this message
8044 struct LDKPublicKey node_id;
8046 * The message which should be sent.
8048 struct LDKAcceptChannel msg;
8049 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
8051 typedef struct LDKMessageSendEvent_LDKSendAcceptChannelV2_Body {
8053 * The node_id of the node which should receive this message
8055 struct LDKPublicKey node_id;
8057 * The message which should be sent.
8059 struct LDKAcceptChannelV2 msg;
8060 } LDKMessageSendEvent_LDKSendAcceptChannelV2_Body;
8062 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
8064 * The node_id of the node which should receive this message
8066 struct LDKPublicKey node_id;
8068 * The message which should be sent.
8070 struct LDKOpenChannel msg;
8071 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
8073 typedef struct LDKMessageSendEvent_LDKSendOpenChannelV2_Body {
8075 * The node_id of the node which should receive this message
8077 struct LDKPublicKey node_id;
8079 * The message which should be sent.
8081 struct LDKOpenChannelV2 msg;
8082 } LDKMessageSendEvent_LDKSendOpenChannelV2_Body;
8084 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
8086 * The node_id of the node which should receive this message
8088 struct LDKPublicKey node_id;
8090 * The message which should be sent.
8092 struct LDKFundingCreated msg;
8093 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
8095 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
8097 * The node_id of the node which should receive this message
8099 struct LDKPublicKey node_id;
8101 * The message which should be sent.
8103 struct LDKFundingSigned msg;
8104 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
8106 typedef struct LDKMessageSendEvent_LDKSendStfu_Body {
8108 * The node_id of the node which should receive this message
8110 struct LDKPublicKey node_id;
8112 * The message which should be sent.
8115 } LDKMessageSendEvent_LDKSendStfu_Body;
8117 typedef struct LDKMessageSendEvent_LDKSendSplice_Body {
8119 * The node_id of the node which should receive this message
8121 struct LDKPublicKey node_id;
8123 * The message which should be sent.
8125 struct LDKSplice msg;
8126 } LDKMessageSendEvent_LDKSendSplice_Body;
8128 typedef struct LDKMessageSendEvent_LDKSendSpliceAck_Body {
8130 * The node_id of the node which should receive this message
8132 struct LDKPublicKey node_id;
8134 * The message which should be sent.
8136 struct LDKSpliceAck msg;
8137 } LDKMessageSendEvent_LDKSendSpliceAck_Body;
8139 typedef struct LDKMessageSendEvent_LDKSendSpliceLocked_Body {
8141 * The node_id of the node which should receive this message
8143 struct LDKPublicKey node_id;
8145 * The message which should be sent.
8147 struct LDKSpliceLocked msg;
8148 } LDKMessageSendEvent_LDKSendSpliceLocked_Body;
8150 typedef struct LDKMessageSendEvent_LDKSendTxAddInput_Body {
8152 * The node_id of the node which should receive this message
8154 struct LDKPublicKey node_id;
8156 * The message which should be sent.
8158 struct LDKTxAddInput msg;
8159 } LDKMessageSendEvent_LDKSendTxAddInput_Body;
8161 typedef struct LDKMessageSendEvent_LDKSendTxAddOutput_Body {
8163 * The node_id of the node which should receive this message
8165 struct LDKPublicKey node_id;
8167 * The message which should be sent.
8169 struct LDKTxAddOutput msg;
8170 } LDKMessageSendEvent_LDKSendTxAddOutput_Body;
8172 typedef struct LDKMessageSendEvent_LDKSendTxRemoveInput_Body {
8174 * The node_id of the node which should receive this message
8176 struct LDKPublicKey node_id;
8178 * The message which should be sent.
8180 struct LDKTxRemoveInput msg;
8181 } LDKMessageSendEvent_LDKSendTxRemoveInput_Body;
8183 typedef struct LDKMessageSendEvent_LDKSendTxRemoveOutput_Body {
8185 * The node_id of the node which should receive this message
8187 struct LDKPublicKey node_id;
8189 * The message which should be sent.
8191 struct LDKTxRemoveOutput msg;
8192 } LDKMessageSendEvent_LDKSendTxRemoveOutput_Body;
8194 typedef struct LDKMessageSendEvent_LDKSendTxComplete_Body {
8196 * The node_id of the node which should receive this message
8198 struct LDKPublicKey node_id;
8200 * The message which should be sent.
8202 struct LDKTxComplete msg;
8203 } LDKMessageSendEvent_LDKSendTxComplete_Body;
8205 typedef struct LDKMessageSendEvent_LDKSendTxSignatures_Body {
8207 * The node_id of the node which should receive this message
8209 struct LDKPublicKey node_id;
8211 * The message which should be sent.
8213 struct LDKTxSignatures msg;
8214 } LDKMessageSendEvent_LDKSendTxSignatures_Body;
8216 typedef struct LDKMessageSendEvent_LDKSendTxInitRbf_Body {
8218 * The node_id of the node which should receive this message
8220 struct LDKPublicKey node_id;
8222 * The message which should be sent.
8224 struct LDKTxInitRbf msg;
8225 } LDKMessageSendEvent_LDKSendTxInitRbf_Body;
8227 typedef struct LDKMessageSendEvent_LDKSendTxAckRbf_Body {
8229 * The node_id of the node which should receive this message
8231 struct LDKPublicKey node_id;
8233 * The message which should be sent.
8235 struct LDKTxAckRbf msg;
8236 } LDKMessageSendEvent_LDKSendTxAckRbf_Body;
8238 typedef struct LDKMessageSendEvent_LDKSendTxAbort_Body {
8240 * The node_id of the node which should receive this message
8242 struct LDKPublicKey node_id;
8244 * The message which should be sent.
8246 struct LDKTxAbort msg;
8247 } LDKMessageSendEvent_LDKSendTxAbort_Body;
8249 typedef struct LDKMessageSendEvent_LDKSendChannelReady_Body {
8251 * The node_id of the node which should receive these message(s)
8253 struct LDKPublicKey node_id;
8255 * The channel_ready message which should be sent.
8257 struct LDKChannelReady msg;
8258 } LDKMessageSendEvent_LDKSendChannelReady_Body;
8260 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
8262 * The node_id of the node which should receive these message(s)
8264 struct LDKPublicKey node_id;
8266 * The announcement_signatures message which should be sent.
8268 struct LDKAnnouncementSignatures msg;
8269 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
8271 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
8273 * The node_id of the node which should receive these message(s)
8275 struct LDKPublicKey node_id;
8277 * The update messages which should be sent. ALL messages in the struct should be sent!
8279 struct LDKCommitmentUpdate updates;
8280 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
8282 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
8284 * The node_id of the node which should receive this message
8286 struct LDKPublicKey node_id;
8288 * The message which should be sent.
8290 struct LDKRevokeAndACK msg;
8291 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
8293 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
8295 * The node_id of the node which should receive this message
8297 struct LDKPublicKey node_id;
8299 * The message which should be sent.
8301 struct LDKClosingSigned msg;
8302 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
8304 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
8306 * The node_id of the node which should receive this message
8308 struct LDKPublicKey node_id;
8310 * The message which should be sent.
8312 struct LDKShutdown msg;
8313 } LDKMessageSendEvent_LDKSendShutdown_Body;
8315 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
8317 * The node_id of the node which should receive this message
8319 struct LDKPublicKey node_id;
8321 * The message which should be sent.
8323 struct LDKChannelReestablish msg;
8324 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
8326 typedef struct LDKMessageSendEvent_LDKSendChannelAnnouncement_Body {
8328 * The node_id of the node which should receive this message
8330 struct LDKPublicKey node_id;
8332 * The channel_announcement which should be sent.
8334 struct LDKChannelAnnouncement msg;
8336 * The followup channel_update which should be sent.
8338 struct LDKChannelUpdate update_msg;
8339 } LDKMessageSendEvent_LDKSendChannelAnnouncement_Body;
8341 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
8343 * The channel_announcement which should be sent.
8345 struct LDKChannelAnnouncement msg;
8347 * The followup channel_update which should be sent.
8349 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
8351 struct LDKChannelUpdate update_msg;
8352 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
8354 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
8356 * The channel_update which should be sent.
8358 struct LDKChannelUpdate msg;
8359 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
8361 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
8363 * The node_announcement which should be sent.
8365 struct LDKNodeAnnouncement msg;
8366 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
8368 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
8370 * The node_id of the node which should receive this message
8372 struct LDKPublicKey node_id;
8374 * The channel_update which should be sent.
8376 struct LDKChannelUpdate msg;
8377 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
8379 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
8381 * The node_id of the node which should receive this message
8383 struct LDKPublicKey node_id;
8385 * The action which should be taken.
8387 struct LDKErrorAction action;
8388 } LDKMessageSendEvent_LDKHandleError_Body;
8390 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
8392 * The node_id of this message recipient
8394 struct LDKPublicKey node_id;
8396 * The query_channel_range which should be sent.
8398 struct LDKQueryChannelRange msg;
8399 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
8401 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
8403 * The node_id of this message recipient
8405 struct LDKPublicKey node_id;
8407 * The query_short_channel_ids which should be sent.
8409 struct LDKQueryShortChannelIds msg;
8410 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
8412 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
8414 * The node_id of this message recipient
8416 struct LDKPublicKey node_id;
8418 * The reply_channel_range which should be sent.
8420 struct LDKReplyChannelRange msg;
8421 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
8423 typedef struct LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body {
8425 * The node_id of this message recipient
8427 struct LDKPublicKey node_id;
8429 * The gossip_timestamp_filter which should be sent.
8431 struct LDKGossipTimestampFilter msg;
8432 } LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body;
8434 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
8435 LDKMessageSendEvent_Tag tag;
8437 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
8438 LDKMessageSendEvent_LDKSendAcceptChannelV2_Body send_accept_channel_v2;
8439 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
8440 LDKMessageSendEvent_LDKSendOpenChannelV2_Body send_open_channel_v2;
8441 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
8442 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
8443 LDKMessageSendEvent_LDKSendStfu_Body send_stfu;
8444 LDKMessageSendEvent_LDKSendSplice_Body send_splice;
8445 LDKMessageSendEvent_LDKSendSpliceAck_Body send_splice_ack;
8446 LDKMessageSendEvent_LDKSendSpliceLocked_Body send_splice_locked;
8447 LDKMessageSendEvent_LDKSendTxAddInput_Body send_tx_add_input;
8448 LDKMessageSendEvent_LDKSendTxAddOutput_Body send_tx_add_output;
8449 LDKMessageSendEvent_LDKSendTxRemoveInput_Body send_tx_remove_input;
8450 LDKMessageSendEvent_LDKSendTxRemoveOutput_Body send_tx_remove_output;
8451 LDKMessageSendEvent_LDKSendTxComplete_Body send_tx_complete;
8452 LDKMessageSendEvent_LDKSendTxSignatures_Body send_tx_signatures;
8453 LDKMessageSendEvent_LDKSendTxInitRbf_Body send_tx_init_rbf;
8454 LDKMessageSendEvent_LDKSendTxAckRbf_Body send_tx_ack_rbf;
8455 LDKMessageSendEvent_LDKSendTxAbort_Body send_tx_abort;
8456 LDKMessageSendEvent_LDKSendChannelReady_Body send_channel_ready;
8457 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
8458 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
8459 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
8460 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
8461 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
8462 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
8463 LDKMessageSendEvent_LDKSendChannelAnnouncement_Body send_channel_announcement;
8464 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
8465 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
8466 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
8467 LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
8468 LDKMessageSendEvent_LDKHandleError_Body handle_error;
8469 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
8470 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
8471 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
8472 LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body send_gossip_timestamp_filter;
8474 } LDKMessageSendEvent;
8477 * A dynamically-allocated array of crate::lightning::events::MessageSendEvents of arbitrary size.
8478 * This corresponds to std::vector in C++
8480 typedef struct LDKCVec_MessageSendEventZ {
8482 * The elements in the array.
8483 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8485 struct LDKMessageSendEvent *data;
8487 * The number of elements pointed to by `data`.
8490 } LDKCVec_MessageSendEventZ;
8495 * Details about one direction of a channel as received within a [`ChannelUpdate`].
8497 typedef struct MUST_USE_STRUCT LDKChannelUpdateInfo {
8499 * A pointer to the opaque Rust object.
8500 * Nearly everywhere, inner must be non-null, however in places where
8501 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8503 LDKnativeChannelUpdateInfo *inner;
8505 * Indicates that this is the only struct which contains the same pointer.
8506 * Rust functions which take ownership of an object provided via an argument require
8507 * this to be true and invalidate the object pointed to by inner.
8510 } LDKChannelUpdateInfo;
8513 * The contents of CResult_ChannelUpdateInfoDecodeErrorZ
8515 typedef union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr {
8517 * A pointer to the contents in the success state.
8518 * Reading from this pointer when `result_ok` is not set is undefined.
8520 struct LDKChannelUpdateInfo *result;
8522 * A pointer to the contents in the error state.
8523 * Reading from this pointer when `result_ok` is set is undefined.
8525 struct LDKDecodeError *err;
8526 } LDKCResult_ChannelUpdateInfoDecodeErrorZPtr;
8529 * A CResult_ChannelUpdateInfoDecodeErrorZ represents the result of a fallible operation,
8530 * containing a crate::lightning::routing::gossip::ChannelUpdateInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8531 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8533 typedef struct LDKCResult_ChannelUpdateInfoDecodeErrorZ {
8535 * The contents of this CResult_ChannelUpdateInfoDecodeErrorZ, accessible via either
8536 * `err` or `result` depending on the state of `result_ok`.
8538 union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr contents;
8540 * Whether this CResult_ChannelUpdateInfoDecodeErrorZ represents a success state.
8543 } LDKCResult_ChannelUpdateInfoDecodeErrorZ;
8548 * Details about a channel (both directions).
8549 * Received within a channel announcement.
8551 typedef struct MUST_USE_STRUCT LDKChannelInfo {
8553 * A pointer to the opaque Rust object.
8554 * Nearly everywhere, inner must be non-null, however in places where
8555 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8557 LDKnativeChannelInfo *inner;
8559 * Indicates that this is the only struct which contains the same pointer.
8560 * Rust functions which take ownership of an object provided via an argument require
8561 * this to be true and invalidate the object pointed to by inner.
8567 * The contents of CResult_ChannelInfoDecodeErrorZ
8569 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
8571 * A pointer to the contents in the success state.
8572 * Reading from this pointer when `result_ok` is not set is undefined.
8574 struct LDKChannelInfo *result;
8576 * A pointer to the contents in the error state.
8577 * Reading from this pointer when `result_ok` is set is undefined.
8579 struct LDKDecodeError *err;
8580 } LDKCResult_ChannelInfoDecodeErrorZPtr;
8583 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
8584 * containing a crate::lightning::routing::gossip::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8585 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8587 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
8589 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
8590 * `err` or `result` depending on the state of `result_ok`.
8592 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
8594 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
8597 } LDKCResult_ChannelInfoDecodeErrorZ;
8602 * Fees for routing via a given channel or a node
8604 typedef struct MUST_USE_STRUCT LDKRoutingFees {
8606 * A pointer to the opaque Rust object.
8607 * Nearly everywhere, inner must be non-null, however in places where
8608 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8610 LDKnativeRoutingFees *inner;
8612 * Indicates that this is the only struct which contains the same pointer.
8613 * Rust functions which take ownership of an object provided via an argument require
8614 * this to be true and invalidate the object pointed to by inner.
8620 * The contents of CResult_RoutingFeesDecodeErrorZ
8622 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
8624 * A pointer to the contents in the success state.
8625 * Reading from this pointer when `result_ok` is not set is undefined.
8627 struct LDKRoutingFees *result;
8629 * A pointer to the contents in the error state.
8630 * Reading from this pointer when `result_ok` is set is undefined.
8632 struct LDKDecodeError *err;
8633 } LDKCResult_RoutingFeesDecodeErrorZPtr;
8636 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
8637 * containing a crate::lightning::routing::gossip::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
8638 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8640 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
8642 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
8643 * `err` or `result` depending on the state of `result_ok`.
8645 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
8647 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
8650 } LDKCResult_RoutingFeesDecodeErrorZ;
8653 * A 4-byte byte array.
8655 typedef struct LDKFourBytes {
8663 * A 12-byte byte array.
8665 typedef struct LDKTwelveBytes {
8675 * Represents a hostname for serialization purposes.
8676 * Only the character set and length will be validated.
8677 * The character set consists of ASCII alphanumeric characters, hyphens, and periods.
8678 * Its length is guaranteed to be representable by a single byte.
8679 * This serialization is used by [`BOLT 7`] hostnames.
8681 * [`BOLT 7`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md
8683 typedef struct MUST_USE_STRUCT LDKHostname {
8685 * A pointer to the opaque Rust object.
8686 * Nearly everywhere, inner must be non-null, however in places where
8687 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8689 LDKnativeHostname *inner;
8691 * Indicates that this is the only struct which contains the same pointer.
8692 * Rust functions which take ownership of an object provided via an argument require
8693 * this to be true and invalidate the object pointed to by inner.
8699 * An address which can be used to connect to a remote peer.
8701 typedef enum LDKSocketAddress_Tag {
8703 * An IPv4 address and port on which the peer is listening.
8705 LDKSocketAddress_TcpIpV4,
8707 * An IPv6 address and port on which the peer is listening.
8709 LDKSocketAddress_TcpIpV6,
8711 * An old-style Tor onion address/port on which the peer is listening.
8713 * This field is deprecated and the Tor network generally no longer supports V2 Onion
8714 * addresses. Thus, the details are not parsed here.
8716 LDKSocketAddress_OnionV2,
8718 * A new-style Tor onion address/port on which the peer is listening.
8720 * To create the human-readable \"hostname\", concatenate the ED25519 pubkey, checksum, and version,
8721 * wrap as base32 and append \".onion\".
8723 LDKSocketAddress_OnionV3,
8725 * A hostname/port on which the peer is listening.
8727 LDKSocketAddress_Hostname,
8729 * Must be last for serialization purposes
8731 LDKSocketAddress_Sentinel,
8732 } LDKSocketAddress_Tag;
8734 typedef struct LDKSocketAddress_LDKTcpIpV4_Body {
8736 * The 4-byte IPv4 address
8738 struct LDKFourBytes addr;
8740 * The port on which the node is listening
8743 } LDKSocketAddress_LDKTcpIpV4_Body;
8745 typedef struct LDKSocketAddress_LDKTcpIpV6_Body {
8747 * The 16-byte IPv6 address
8749 struct LDKSixteenBytes addr;
8751 * The port on which the node is listening
8754 } LDKSocketAddress_LDKTcpIpV6_Body;
8756 typedef struct LDKSocketAddress_LDKOnionV3_Body {
8758 * The ed25519 long-term public key of the peer
8760 struct LDKThirtyTwoBytes ed25519_pubkey;
8762 * The checksum of the pubkey and version, as included in the onion address
8766 * The version byte, as defined by the Tor Onion v3 spec.
8770 * The port on which the node is listening
8773 } LDKSocketAddress_LDKOnionV3_Body;
8775 typedef struct LDKSocketAddress_LDKHostname_Body {
8777 * The hostname on which the node is listening.
8779 struct LDKHostname hostname;
8781 * The port on which the node is listening.
8784 } LDKSocketAddress_LDKHostname_Body;
8786 typedef struct MUST_USE_STRUCT LDKSocketAddress {
8787 LDKSocketAddress_Tag tag;
8789 LDKSocketAddress_LDKTcpIpV4_Body tcp_ip_v4;
8790 LDKSocketAddress_LDKTcpIpV6_Body tcp_ip_v6;
8792 struct LDKTwelveBytes onion_v2;
8794 LDKSocketAddress_LDKOnionV3_Body onion_v3;
8795 LDKSocketAddress_LDKHostname_Body hostname;
8800 * A dynamically-allocated array of crate::lightning::ln::msgs::SocketAddresss of arbitrary size.
8801 * This corresponds to std::vector in C++
8803 typedef struct LDKCVec_SocketAddressZ {
8805 * The elements in the array.
8806 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8808 struct LDKSocketAddress *data;
8810 * The number of elements pointed to by `data`.
8813 } LDKCVec_SocketAddressZ;
8818 * Information received in the latest node_announcement from this node.
8820 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
8822 * A pointer to the opaque Rust object.
8823 * Nearly everywhere, inner must be non-null, however in places where
8824 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8826 LDKnativeNodeAnnouncementInfo *inner;
8828 * Indicates that this is the only struct which contains the same pointer.
8829 * Rust functions which take ownership of an object provided via an argument require
8830 * this to be true and invalidate the object pointed to by inner.
8833 } LDKNodeAnnouncementInfo;
8836 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
8838 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
8840 * A pointer to the contents in the success state.
8841 * Reading from this pointer when `result_ok` is not set is undefined.
8843 struct LDKNodeAnnouncementInfo *result;
8845 * A pointer to the contents in the error state.
8846 * Reading from this pointer when `result_ok` is set is undefined.
8848 struct LDKDecodeError *err;
8849 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
8852 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
8853 * containing a crate::lightning::routing::gossip::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8854 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8856 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
8858 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
8859 * `err` or `result` depending on the state of `result_ok`.
8861 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
8863 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
8866 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
8871 * A user-defined name for a node, which may be used when displaying the node in a graph.
8873 * Since node aliases are provided by third parties, they are a potential avenue for injection
8874 * attacks. Care must be taken when processing.
8876 typedef struct MUST_USE_STRUCT LDKNodeAlias {
8878 * A pointer to the opaque Rust object.
8879 * Nearly everywhere, inner must be non-null, however in places where
8880 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8882 LDKnativeNodeAlias *inner;
8884 * Indicates that this is the only struct which contains the same pointer.
8885 * Rust functions which take ownership of an object provided via an argument require
8886 * this to be true and invalidate the object pointed to by inner.
8892 * The contents of CResult_NodeAliasDecodeErrorZ
8894 typedef union LDKCResult_NodeAliasDecodeErrorZPtr {
8896 * A pointer to the contents in the success state.
8897 * Reading from this pointer when `result_ok` is not set is undefined.
8899 struct LDKNodeAlias *result;
8901 * A pointer to the contents in the error state.
8902 * Reading from this pointer when `result_ok` is set is undefined.
8904 struct LDKDecodeError *err;
8905 } LDKCResult_NodeAliasDecodeErrorZPtr;
8908 * A CResult_NodeAliasDecodeErrorZ represents the result of a fallible operation,
8909 * containing a crate::lightning::routing::gossip::NodeAlias on success and a crate::lightning::ln::msgs::DecodeError on failure.
8910 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8912 typedef struct LDKCResult_NodeAliasDecodeErrorZ {
8914 * The contents of this CResult_NodeAliasDecodeErrorZ, accessible via either
8915 * `err` or `result` depending on the state of `result_ok`.
8917 union LDKCResult_NodeAliasDecodeErrorZPtr contents;
8919 * Whether this CResult_NodeAliasDecodeErrorZ represents a success state.
8922 } LDKCResult_NodeAliasDecodeErrorZ;
8927 * Details about a node in the network, known from the network announcement.
8929 typedef struct MUST_USE_STRUCT LDKNodeInfo {
8931 * A pointer to the opaque Rust object.
8932 * Nearly everywhere, inner must be non-null, however in places where
8933 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8935 LDKnativeNodeInfo *inner;
8937 * Indicates that this is the only struct which contains the same pointer.
8938 * Rust functions which take ownership of an object provided via an argument require
8939 * this to be true and invalidate the object pointed to by inner.
8945 * The contents of CResult_NodeInfoDecodeErrorZ
8947 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
8949 * A pointer to the contents in the success state.
8950 * Reading from this pointer when `result_ok` is not set is undefined.
8952 struct LDKNodeInfo *result;
8954 * A pointer to the contents in the error state.
8955 * Reading from this pointer when `result_ok` is set is undefined.
8957 struct LDKDecodeError *err;
8958 } LDKCResult_NodeInfoDecodeErrorZPtr;
8961 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
8962 * containing a crate::lightning::routing::gossip::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8963 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8965 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
8967 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
8968 * `err` or `result` depending on the state of `result_ok`.
8970 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
8972 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
8975 } LDKCResult_NodeInfoDecodeErrorZ;
8978 * The contents of CResult_NetworkGraphDecodeErrorZ
8980 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
8982 * A pointer to the contents in the success state.
8983 * Reading from this pointer when `result_ok` is not set is undefined.
8985 struct LDKNetworkGraph *result;
8987 * A pointer to the contents in the error state.
8988 * Reading from this pointer when `result_ok` is set is undefined.
8990 struct LDKDecodeError *err;
8991 } LDKCResult_NetworkGraphDecodeErrorZPtr;
8994 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
8995 * containing a crate::lightning::routing::gossip::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
8996 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8998 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
9000 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
9001 * `err` or `result` depending on the state of `result_ok`.
9003 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
9005 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
9008 } LDKCResult_NetworkGraphDecodeErrorZ;
9011 * An enum which can either contain a crate::c_types::derived::CVec_SocketAddressZ or not
9013 typedef enum LDKCOption_CVec_SocketAddressZZ_Tag {
9015 * When we're in this state, this COption_CVec_SocketAddressZZ contains a crate::c_types::derived::CVec_SocketAddressZ
9017 LDKCOption_CVec_SocketAddressZZ_Some,
9019 * When we're in this state, this COption_CVec_SocketAddressZZ contains nothing
9021 LDKCOption_CVec_SocketAddressZZ_None,
9023 * Must be last for serialization purposes
9025 LDKCOption_CVec_SocketAddressZZ_Sentinel,
9026 } LDKCOption_CVec_SocketAddressZZ_Tag;
9028 typedef struct LDKCOption_CVec_SocketAddressZZ {
9029 LDKCOption_CVec_SocketAddressZZ_Tag tag;
9032 struct LDKCVec_SocketAddressZ some;
9035 } LDKCOption_CVec_SocketAddressZZ;
9038 * The contents of CResult_u64ShortChannelIdErrorZ
9040 typedef union LDKCResult_u64ShortChannelIdErrorZPtr {
9042 * A pointer to the contents in the success state.
9043 * Reading from this pointer when `result_ok` is not set is undefined.
9047 * A pointer to the contents in the error state.
9048 * Reading from this pointer when `result_ok` is set is undefined.
9050 enum LDKShortChannelIdError *err;
9051 } LDKCResult_u64ShortChannelIdErrorZPtr;
9054 * A CResult_u64ShortChannelIdErrorZ represents the result of a fallible operation,
9055 * containing a u64 on success and a crate::lightning::util::scid_utils::ShortChannelIdError on failure.
9056 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9058 typedef struct LDKCResult_u64ShortChannelIdErrorZ {
9060 * The contents of this CResult_u64ShortChannelIdErrorZ, accessible via either
9061 * `err` or `result` depending on the state of `result_ok`.
9063 union LDKCResult_u64ShortChannelIdErrorZPtr contents;
9065 * Whether this CResult_u64ShortChannelIdErrorZ represents a success state.
9068 } LDKCResult_u64ShortChannelIdErrorZ;
9073 * Information about an incoming HTLC, including the [`PendingHTLCRouting`] describing where it
9076 typedef struct MUST_USE_STRUCT LDKPendingHTLCInfo {
9078 * A pointer to the opaque Rust object.
9079 * Nearly everywhere, inner must be non-null, however in places where
9080 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9082 LDKnativePendingHTLCInfo *inner;
9084 * Indicates that this is the only struct which contains the same pointer.
9085 * Rust functions which take ownership of an object provided via an argument require
9086 * this to be true and invalidate the object pointed to by inner.
9089 } LDKPendingHTLCInfo;
9094 * Invalid inbound onion payment.
9096 typedef struct MUST_USE_STRUCT LDKInboundHTLCErr {
9098 * A pointer to the opaque Rust object.
9099 * Nearly everywhere, inner must be non-null, however in places where
9100 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9102 LDKnativeInboundHTLCErr *inner;
9104 * Indicates that this is the only struct which contains the same pointer.
9105 * Rust functions which take ownership of an object provided via an argument require
9106 * this to be true and invalidate the object pointed to by inner.
9109 } LDKInboundHTLCErr;
9112 * The contents of CResult_PendingHTLCInfoInboundHTLCErrZ
9114 typedef union LDKCResult_PendingHTLCInfoInboundHTLCErrZPtr {
9116 * A pointer to the contents in the success state.
9117 * Reading from this pointer when `result_ok` is not set is undefined.
9119 struct LDKPendingHTLCInfo *result;
9121 * A pointer to the contents in the error state.
9122 * Reading from this pointer when `result_ok` is set is undefined.
9124 struct LDKInboundHTLCErr *err;
9125 } LDKCResult_PendingHTLCInfoInboundHTLCErrZPtr;
9128 * A CResult_PendingHTLCInfoInboundHTLCErrZ represents the result of a fallible operation,
9129 * containing a crate::lightning::ln::channelmanager::PendingHTLCInfo on success and a crate::lightning::ln::onion_payment::InboundHTLCErr on failure.
9130 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9132 typedef struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ {
9134 * The contents of this CResult_PendingHTLCInfoInboundHTLCErrZ, accessible via either
9135 * `err` or `result` depending on the state of `result_ok`.
9137 union LDKCResult_PendingHTLCInfoInboundHTLCErrZPtr contents;
9139 * Whether this CResult_PendingHTLCInfoInboundHTLCErrZ represents a success state.
9142 } LDKCResult_PendingHTLCInfoInboundHTLCErrZ;
9145 * A dynamically-allocated array of crate::lightning::ln::chan_utils::HTLCOutputInCommitments of arbitrary size.
9146 * This corresponds to std::vector in C++
9148 typedef struct LDKCVec_HTLCOutputInCommitmentZ {
9150 * The elements in the array.
9151 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9153 struct LDKHTLCOutputInCommitment *data;
9155 * The number of elements pointed to by `data`.
9158 } LDKCVec_HTLCOutputInCommitmentZ;
9161 * A dynamically-allocated array of crate::lightning::sign::HTLCDescriptors of arbitrary size.
9162 * This corresponds to std::vector in C++
9164 typedef struct LDKCVec_HTLCDescriptorZ {
9166 * The elements in the array.
9167 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9169 struct LDKHTLCDescriptor *data;
9171 * The number of elements pointed to by `data`.
9174 } LDKCVec_HTLCDescriptorZ;
9179 * An unspent transaction output that is available to spend resulting from a successful
9180 * [`CoinSelection`] attempt.
9182 typedef struct MUST_USE_STRUCT LDKUtxo {
9184 * A pointer to the opaque Rust object.
9185 * Nearly everywhere, inner must be non-null, however in places where
9186 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9188 LDKnativeUtxo *inner;
9190 * Indicates that this is the only struct which contains the same pointer.
9191 * Rust functions which take ownership of an object provided via an argument require
9192 * this to be true and invalidate the object pointed to by inner.
9198 * A dynamically-allocated array of crate::lightning::events::bump_transaction::Utxos of arbitrary size.
9199 * This corresponds to std::vector in C++
9201 typedef struct LDKCVec_UtxoZ {
9203 * The elements in the array.
9204 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9206 struct LDKUtxo *data;
9208 * The number of elements pointed to by `data`.
9214 * An enum which can either contain a crate::c_types::TxOut or not
9216 typedef enum LDKCOption_TxOutZ_Tag {
9218 * When we're in this state, this COption_TxOutZ contains a crate::c_types::TxOut
9220 LDKCOption_TxOutZ_Some,
9222 * When we're in this state, this COption_TxOutZ contains nothing
9224 LDKCOption_TxOutZ_None,
9226 * Must be last for serialization purposes
9228 LDKCOption_TxOutZ_Sentinel,
9229 } LDKCOption_TxOutZ_Tag;
9231 typedef struct LDKCOption_TxOutZ {
9232 LDKCOption_TxOutZ_Tag tag;
9235 struct LDKTxOut some;
9238 } LDKCOption_TxOutZ;
9243 * An input that must be included in a transaction when performing coin selection through
9244 * [`CoinSelectionSource::select_confirmed_utxos`]. It is guaranteed to be a SegWit input, so it
9245 * must have an empty [`TxIn::script_sig`] when spent.
9247 typedef struct MUST_USE_STRUCT LDKInput {
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 LDKnativeInput *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::Inputs of arbitrary size.
9264 * This corresponds to std::vector in C++
9266 typedef struct LDKCVec_InputZ {
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 LDKInput *data;
9273 * The number of elements pointed to by `data`.
9281 * The result of a successful coin selection attempt for a transaction requiring additional UTXOs
9282 * to cover its fees.
9284 typedef struct MUST_USE_STRUCT LDKCoinSelection {
9286 * A pointer to the opaque Rust object.
9287 * Nearly everywhere, inner must be non-null, however in places where
9288 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9290 LDKnativeCoinSelection *inner;
9292 * Indicates that this is the only struct which contains the same pointer.
9293 * Rust functions which take ownership of an object provided via an argument require
9294 * this to be true and invalidate the object pointed to by inner.
9300 * The contents of CResult_CoinSelectionNoneZ
9302 typedef union LDKCResult_CoinSelectionNoneZPtr {
9304 * A pointer to the contents in the success state.
9305 * Reading from this pointer when `result_ok` is not set is undefined.
9307 struct LDKCoinSelection *result;
9309 * Note that this value is always NULL, as there are no contents in the Err variant
9312 } LDKCResult_CoinSelectionNoneZPtr;
9315 * A CResult_CoinSelectionNoneZ represents the result of a fallible operation,
9316 * containing a crate::lightning::events::bump_transaction::CoinSelection on success and a () on failure.
9317 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9319 typedef struct LDKCResult_CoinSelectionNoneZ {
9321 * The contents of this CResult_CoinSelectionNoneZ, accessible via either
9322 * `err` or `result` depending on the state of `result_ok`.
9324 union LDKCResult_CoinSelectionNoneZPtr contents;
9326 * Whether this CResult_CoinSelectionNoneZ represents a success state.
9329 } LDKCResult_CoinSelectionNoneZ;
9332 * The contents of CResult_CVec_UtxoZNoneZ
9334 typedef union LDKCResult_CVec_UtxoZNoneZPtr {
9336 * A pointer to the contents in the success state.
9337 * Reading from this pointer when `result_ok` is not set is undefined.
9339 struct LDKCVec_UtxoZ *result;
9341 * Note that this value is always NULL, as there are no contents in the Err variant
9344 } LDKCResult_CVec_UtxoZNoneZPtr;
9347 * A CResult_CVec_UtxoZNoneZ represents the result of a fallible operation,
9348 * containing a crate::c_types::derived::CVec_UtxoZ on success and a () on failure.
9349 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9351 typedef struct LDKCResult_CVec_UtxoZNoneZ {
9353 * The contents of this CResult_CVec_UtxoZNoneZ, accessible via either
9354 * `err` or `result` depending on the state of `result_ok`.
9356 union LDKCResult_CVec_UtxoZNoneZPtr contents;
9358 * Whether this CResult_CVec_UtxoZNoneZ represents a success state.
9361 } LDKCResult_CVec_UtxoZNoneZ;
9366 * An unknown payment context.
9368 typedef struct MUST_USE_STRUCT LDKUnknownPaymentContext {
9370 * A pointer to the opaque Rust object.
9371 * Nearly everywhere, inner must be non-null, however in places where
9372 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9374 LDKnativeUnknownPaymentContext *inner;
9376 * Indicates that this is the only struct which contains the same pointer.
9377 * Rust functions which take ownership of an object provided via an argument require
9378 * this to be true and invalidate the object pointed to by inner.
9381 } LDKUnknownPaymentContext;
9386 * The context of a payment made for an invoice requested from a BOLT 12 [`Offer`].
9388 * [`Offer`]: crate::offers::offer::Offer
9390 typedef struct MUST_USE_STRUCT LDKBolt12OfferContext {
9392 * A pointer to the opaque Rust object.
9393 * Nearly everywhere, inner must be non-null, however in places where
9394 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9396 LDKnativeBolt12OfferContext *inner;
9398 * Indicates that this is the only struct which contains the same pointer.
9399 * Rust functions which take ownership of an object provided via an argument require
9400 * this to be true and invalidate the object pointed to by inner.
9403 } LDKBolt12OfferContext;
9408 * The context of a payment made for an invoice sent for a BOLT 12 [`Refund`].
9410 * [`Refund`]: crate::offers::refund::Refund
9412 typedef struct MUST_USE_STRUCT LDKBolt12RefundContext {
9414 * A pointer to the opaque Rust object.
9415 * Nearly everywhere, inner must be non-null, however in places where
9416 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9418 LDKnativeBolt12RefundContext *inner;
9420 * Indicates that this is the only struct which contains the same pointer.
9421 * Rust functions which take ownership of an object provided via an argument require
9422 * this to be true and invalidate the object pointed to by inner.
9425 } LDKBolt12RefundContext;
9428 * The context of an inbound payment, which is included in a [`BlindedPath`] via [`ReceiveTlvs`]
9429 * and surfaced in [`PaymentPurpose`].
9431 * [`BlindedPath`]: crate::blinded_path::BlindedPath
9432 * [`PaymentPurpose`]: crate::events::PaymentPurpose
9434 typedef enum LDKPaymentContext_Tag {
9436 * The payment context was unknown.
9438 LDKPaymentContext_Unknown,
9440 * The payment was made for an invoice requested from a BOLT 12 [`Offer`].
9442 * [`Offer`]: crate::offers::offer::Offer
9444 LDKPaymentContext_Bolt12Offer,
9446 * The payment was made for an invoice sent for a BOLT 12 [`Refund`].
9448 * [`Refund`]: crate::offers::refund::Refund
9450 LDKPaymentContext_Bolt12Refund,
9452 * Must be last for serialization purposes
9454 LDKPaymentContext_Sentinel,
9455 } LDKPaymentContext_Tag;
9457 typedef struct MUST_USE_STRUCT LDKPaymentContext {
9458 LDKPaymentContext_Tag tag;
9461 struct LDKUnknownPaymentContext unknown;
9464 struct LDKBolt12OfferContext bolt12_offer;
9467 struct LDKBolt12RefundContext bolt12_refund;
9470 } LDKPaymentContext;
9473 * An enum which can either contain a crate::lightning::blinded_path::payment::PaymentContext or not
9475 typedef enum LDKCOption_PaymentContextZ_Tag {
9477 * When we're in this state, this COption_PaymentContextZ contains a crate::lightning::blinded_path::payment::PaymentContext
9479 LDKCOption_PaymentContextZ_Some,
9481 * When we're in this state, this COption_PaymentContextZ contains nothing
9483 LDKCOption_PaymentContextZ_None,
9485 * Must be last for serialization purposes
9487 LDKCOption_PaymentContextZ_Sentinel,
9488 } LDKCOption_PaymentContextZ_Tag;
9490 typedef struct LDKCOption_PaymentContextZ {
9491 LDKCOption_PaymentContextZ_Tag tag;
9494 struct LDKPaymentContext some;
9497 } LDKCOption_PaymentContextZ;
9500 * A tuple of 2 elements. See the individual fields for the types contained.
9502 typedef struct LDKC2Tuple_u64u16Z {
9504 * The element at position 0
9508 * The element at position 1
9511 } LDKC2Tuple_u64u16Z;
9514 * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u16Z or not
9516 typedef enum LDKCOption_C2Tuple_u64u16ZZ_Tag {
9518 * When we're in this state, this COption_C2Tuple_u64u16ZZ contains a crate::c_types::derived::C2Tuple_u64u16Z
9520 LDKCOption_C2Tuple_u64u16ZZ_Some,
9522 * When we're in this state, this COption_C2Tuple_u64u16ZZ contains nothing
9524 LDKCOption_C2Tuple_u64u16ZZ_None,
9526 * Must be last for serialization purposes
9528 LDKCOption_C2Tuple_u64u16ZZ_Sentinel,
9529 } LDKCOption_C2Tuple_u64u16ZZ_Tag;
9531 typedef struct LDKCOption_C2Tuple_u64u16ZZ {
9532 LDKCOption_C2Tuple_u64u16ZZ_Tag tag;
9535 struct LDKC2Tuple_u64u16Z some;
9538 } LDKCOption_C2Tuple_u64u16ZZ;
9541 * An enum which can either contain a crate::lightning::ln::channelmanager::ChannelShutdownState or not
9543 typedef enum LDKCOption_ChannelShutdownStateZ_Tag {
9545 * When we're in this state, this COption_ChannelShutdownStateZ contains a crate::lightning::ln::channelmanager::ChannelShutdownState
9547 LDKCOption_ChannelShutdownStateZ_Some,
9549 * When we're in this state, this COption_ChannelShutdownStateZ contains nothing
9551 LDKCOption_ChannelShutdownStateZ_None,
9553 * Must be last for serialization purposes
9555 LDKCOption_ChannelShutdownStateZ_Sentinel,
9556 } LDKCOption_ChannelShutdownStateZ_Tag;
9558 typedef struct LDKCOption_ChannelShutdownStateZ {
9559 LDKCOption_ChannelShutdownStateZ_Tag tag;
9562 enum LDKChannelShutdownState some;
9565 } LDKCOption_ChannelShutdownStateZ;
9568 * The contents of CResult_ChannelIdAPIErrorZ
9570 typedef union LDKCResult_ChannelIdAPIErrorZPtr {
9572 * A pointer to the contents in the success state.
9573 * Reading from this pointer when `result_ok` is not set is undefined.
9575 struct LDKChannelId *result;
9577 * A pointer to the contents in the error state.
9578 * Reading from this pointer when `result_ok` is set is undefined.
9580 struct LDKAPIError *err;
9581 } LDKCResult_ChannelIdAPIErrorZPtr;
9584 * A CResult_ChannelIdAPIErrorZ represents the result of a fallible operation,
9585 * containing a crate::lightning::ln::types::ChannelId on success and a crate::lightning::util::errors::APIError on failure.
9586 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9588 typedef struct LDKCResult_ChannelIdAPIErrorZ {
9590 * The contents of this CResult_ChannelIdAPIErrorZ, accessible via either
9591 * `err` or `result` depending on the state of `result_ok`.
9593 union LDKCResult_ChannelIdAPIErrorZPtr contents;
9595 * Whether this CResult_ChannelIdAPIErrorZ represents a success state.
9598 } LDKCResult_ChannelIdAPIErrorZ;
9601 * Used by [`ChannelManager::list_recent_payments`] to express the status of recent payments.
9602 * These include payments that have yet to find a successful path, or have unresolved HTLCs.
9604 typedef enum LDKRecentPaymentDetails_Tag {
9606 * When an invoice was requested and thus a payment has not yet been sent.
9608 LDKRecentPaymentDetails_AwaitingInvoice,
9610 * When a payment is still being sent and awaiting successful delivery.
9612 LDKRecentPaymentDetails_Pending,
9614 * When a pending payment is fulfilled, we continue tracking it until all pending HTLCs have
9615 * been resolved. Upon receiving [`Event::PaymentSent`], we delay for a few minutes before the
9616 * payment is removed from tracking.
9618 LDKRecentPaymentDetails_Fulfilled,
9620 * After a payment's retries are exhausted per the provided [`Retry`], or it is explicitly
9621 * abandoned via [`ChannelManager::abandon_payment`], it is marked as abandoned until all
9622 * pending HTLCs for this payment resolve and an [`Event::PaymentFailed`] is generated.
9624 LDKRecentPaymentDetails_Abandoned,
9626 * Must be last for serialization purposes
9628 LDKRecentPaymentDetails_Sentinel,
9629 } LDKRecentPaymentDetails_Tag;
9631 typedef struct LDKRecentPaymentDetails_LDKAwaitingInvoice_Body {
9633 * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
9634 * a payment and ensure idempotency in LDK.
9636 struct LDKThirtyTwoBytes payment_id;
9637 } LDKRecentPaymentDetails_LDKAwaitingInvoice_Body;
9639 typedef struct LDKRecentPaymentDetails_LDKPending_Body {
9641 * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
9642 * a payment and ensure idempotency in LDK.
9644 struct LDKThirtyTwoBytes payment_id;
9646 * Hash of the payment that is currently being sent but has yet to be fulfilled or
9649 struct LDKThirtyTwoBytes payment_hash;
9651 * Total amount (in msat, excluding fees) across all paths for this payment,
9652 * not just the amount currently inflight.
9654 uint64_t total_msat;
9655 } LDKRecentPaymentDetails_LDKPending_Body;
9657 typedef struct LDKRecentPaymentDetails_LDKFulfilled_Body {
9659 * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
9660 * a payment and ensure idempotency in LDK.
9662 struct LDKThirtyTwoBytes payment_id;
9664 * Hash of the payment that was claimed. `None` for serializations of [`ChannelManager`]
9665 * made before LDK version 0.0.104.
9667 struct LDKCOption_ThirtyTwoBytesZ payment_hash;
9668 } LDKRecentPaymentDetails_LDKFulfilled_Body;
9670 typedef struct LDKRecentPaymentDetails_LDKAbandoned_Body {
9672 * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
9673 * a payment and ensure idempotency in LDK.
9675 struct LDKThirtyTwoBytes payment_id;
9677 * Hash of the payment that we have given up trying to send.
9679 struct LDKThirtyTwoBytes payment_hash;
9680 } LDKRecentPaymentDetails_LDKAbandoned_Body;
9682 typedef struct MUST_USE_STRUCT LDKRecentPaymentDetails {
9683 LDKRecentPaymentDetails_Tag tag;
9685 LDKRecentPaymentDetails_LDKAwaitingInvoice_Body awaiting_invoice;
9686 LDKRecentPaymentDetails_LDKPending_Body pending;
9687 LDKRecentPaymentDetails_LDKFulfilled_Body fulfilled;
9688 LDKRecentPaymentDetails_LDKAbandoned_Body abandoned;
9690 } LDKRecentPaymentDetails;
9693 * A dynamically-allocated array of crate::lightning::ln::channelmanager::RecentPaymentDetailss of arbitrary size.
9694 * This corresponds to std::vector in C++
9696 typedef struct LDKCVec_RecentPaymentDetailsZ {
9698 * The elements in the array.
9699 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9701 struct LDKRecentPaymentDetails *data;
9703 * The number of elements pointed to by `data`.
9706 } LDKCVec_RecentPaymentDetailsZ;
9709 * If a payment fails to send with [`ChannelManager::send_payment_with_route`], it can be in one
9710 * of several states. This enum is returned as the Err() type describing which state the payment
9711 * is in, see the description of individual enum states for more.
9713 * [`ChannelManager::send_payment_with_route`]: crate::ln::channelmanager::ChannelManager::send_payment_with_route
9715 typedef enum LDKPaymentSendFailure_Tag {
9717 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
9718 * send the payment at all.
9720 * You can freely resend the payment in full (with the parameter error fixed).
9722 * Because the payment failed outright, no payment tracking is done and no
9723 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
9725 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
9726 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
9728 LDKPaymentSendFailure_ParameterError,
9730 * A parameter in a single path which was passed to send_payment was invalid, preventing us
9731 * from attempting to send the payment at all.
9733 * You can freely resend the payment in full (with the parameter error fixed).
9735 * Because the payment failed outright, no payment tracking is done and no
9736 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
9738 * The results here are ordered the same as the paths in the route object which was passed to
9741 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
9742 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
9744 LDKPaymentSendFailure_PathParameterError,
9746 * All paths which were attempted failed to send, with no channel state change taking place.
9747 * You can freely resend the payment in full (though you probably want to do so over different
9748 * paths than the ones selected).
9750 * Because the payment failed outright, no payment tracking is done and no
9751 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
9753 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
9754 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
9756 LDKPaymentSendFailure_AllFailedResendSafe,
9758 * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
9759 * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
9761 * [`PaymentId`]: crate::ln::channelmanager::PaymentId
9762 * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
9763 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
9765 LDKPaymentSendFailure_DuplicatePayment,
9767 * Some paths that were attempted failed to send, though some paths may have succeeded. At least
9768 * some paths have irrevocably committed to the HTLC.
9770 * The results here are ordered the same as the paths in the route object that was passed to
9773 * Any entries that contain `Err(APIError::MonitorUpdateInprogress)` will send once a
9774 * [`MonitorEvent::Completed`] is provided for the next-hop channel with the latest update_id.
9776 * [`MonitorEvent::Completed`]: crate::chain::channelmonitor::MonitorEvent::Completed
9778 LDKPaymentSendFailure_PartialFailure,
9780 * Must be last for serialization purposes
9782 LDKPaymentSendFailure_Sentinel,
9783 } LDKPaymentSendFailure_Tag;
9785 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
9787 * The errors themselves, in the same order as the paths from the route.
9789 struct LDKCVec_CResult_NoneAPIErrorZZ results;
9791 * If some paths failed without irrevocably committing to the new HTLC(s), this will
9792 * contain a [`RouteParameters`] object for the failing paths.
9794 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
9796 struct LDKRouteParameters failed_paths_retry;
9798 * The payment id for the payment, which is now at least partially pending.
9800 struct LDKThirtyTwoBytes payment_id;
9801 } LDKPaymentSendFailure_LDKPartialFailure_Body;
9803 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
9804 LDKPaymentSendFailure_Tag tag;
9807 struct LDKAPIError parameter_error;
9810 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
9813 struct LDKCVec_APIErrorZ all_failed_resend_safe;
9815 LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
9817 } LDKPaymentSendFailure;
9820 * The contents of CResult_NonePaymentSendFailureZ
9822 typedef union LDKCResult_NonePaymentSendFailureZPtr {
9824 * Note that this value is always NULL, as there are no contents in the OK variant
9828 * A pointer to the contents in the error state.
9829 * Reading from this pointer when `result_ok` is set is undefined.
9831 struct LDKPaymentSendFailure *err;
9832 } LDKCResult_NonePaymentSendFailureZPtr;
9835 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
9836 * containing a () on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
9837 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9839 typedef struct LDKCResult_NonePaymentSendFailureZ {
9841 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
9842 * `err` or `result` depending on the state of `result_ok`.
9844 union LDKCResult_NonePaymentSendFailureZPtr contents;
9846 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
9849 } LDKCResult_NonePaymentSendFailureZ;
9852 * The contents of CResult_NoneRetryableSendFailureZ
9854 typedef union LDKCResult_NoneRetryableSendFailureZPtr {
9856 * Note that this value is always NULL, as there are no contents in the OK variant
9860 * A pointer to the contents in the error state.
9861 * Reading from this pointer when `result_ok` is set is undefined.
9863 enum LDKRetryableSendFailure *err;
9864 } LDKCResult_NoneRetryableSendFailureZPtr;
9867 * A CResult_NoneRetryableSendFailureZ represents the result of a fallible operation,
9868 * containing a () on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
9869 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9871 typedef struct LDKCResult_NoneRetryableSendFailureZ {
9873 * The contents of this CResult_NoneRetryableSendFailureZ, accessible via either
9874 * `err` or `result` depending on the state of `result_ok`.
9876 union LDKCResult_NoneRetryableSendFailureZPtr contents;
9878 * Whether this CResult_NoneRetryableSendFailureZ represents a success state.
9881 } LDKCResult_NoneRetryableSendFailureZ;
9884 * The contents of CResult_ThirtyTwoBytesPaymentSendFailureZ
9886 typedef union LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr {
9888 * A pointer to the contents in the success state.
9889 * Reading from this pointer when `result_ok` is not set is undefined.
9891 struct LDKThirtyTwoBytes *result;
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_ThirtyTwoBytesPaymentSendFailureZPtr;
9900 * A CResult_ThirtyTwoBytesPaymentSendFailureZ represents the result of a fallible operation,
9901 * containing a crate::c_types::ThirtyTwoBytes 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_ThirtyTwoBytesPaymentSendFailureZ {
9906 * The contents of this CResult_ThirtyTwoBytesPaymentSendFailureZ, accessible via either
9907 * `err` or `result` depending on the state of `result_ok`.
9909 union LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr contents;
9911 * Whether this CResult_ThirtyTwoBytesPaymentSendFailureZ represents a success state.
9914 } LDKCResult_ThirtyTwoBytesPaymentSendFailureZ;
9917 * The contents of CResult_ThirtyTwoBytesRetryableSendFailureZ
9919 typedef union LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr {
9921 * A pointer to the contents in the success state.
9922 * Reading from this pointer when `result_ok` is not set is undefined.
9924 struct LDKThirtyTwoBytes *result;
9926 * A pointer to the contents in the error state.
9927 * Reading from this pointer when `result_ok` is set is undefined.
9929 enum LDKRetryableSendFailure *err;
9930 } LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr;
9933 * A CResult_ThirtyTwoBytesRetryableSendFailureZ represents the result of a fallible operation,
9934 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
9935 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9937 typedef struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ {
9939 * The contents of this CResult_ThirtyTwoBytesRetryableSendFailureZ, accessible via either
9940 * `err` or `result` depending on the state of `result_ok`.
9942 union LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr contents;
9944 * Whether this CResult_ThirtyTwoBytesRetryableSendFailureZ represents a success state.
9947 } LDKCResult_ThirtyTwoBytesRetryableSendFailureZ;
9950 * A tuple of 2 elements. See the individual fields for the types contained.
9952 typedef struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ {
9954 * The element at position 0
9956 struct LDKThirtyTwoBytes a;
9958 * The element at position 1
9960 struct LDKThirtyTwoBytes b;
9961 } LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ;
9964 * The contents of CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ
9966 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr {
9968 * A pointer to the contents in the success state.
9969 * Reading from this pointer when `result_ok` is not set is undefined.
9971 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *result;
9973 * A pointer to the contents in the error state.
9974 * Reading from this pointer when `result_ok` is set is undefined.
9976 struct LDKPaymentSendFailure *err;
9977 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr;
9980 * A CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ represents the result of a fallible operation,
9981 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
9982 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9984 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ {
9986 * The contents of this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ, accessible via either
9987 * `err` or `result` depending on the state of `result_ok`.
9989 union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr contents;
9991 * Whether this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ represents a success state.
9994 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ;
9997 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZs of arbitrary size.
9998 * This corresponds to std::vector in C++
10000 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ {
10002 * The elements in the array.
10003 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10005 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *data;
10007 * The number of elements pointed to by `data`.
10010 } LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ;
10013 * Indicates that we failed to send a payment probe. Further errors may be surfaced later via
10014 * [`Event::ProbeFailed`].
10016 * [`Event::ProbeFailed`]: crate::events::Event::ProbeFailed
10018 typedef enum LDKProbeSendFailure_Tag {
10020 * We were unable to find a route to the destination.
10022 LDKProbeSendFailure_RouteNotFound,
10024 * We failed to send the payment probes.
10026 LDKProbeSendFailure_SendingFailed,
10028 * Must be last for serialization purposes
10030 LDKProbeSendFailure_Sentinel,
10031 } LDKProbeSendFailure_Tag;
10033 typedef struct MUST_USE_STRUCT LDKProbeSendFailure {
10034 LDKProbeSendFailure_Tag tag;
10037 struct LDKPaymentSendFailure sending_failed;
10040 } LDKProbeSendFailure;
10043 * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ
10045 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr {
10047 * A pointer to the contents in the success state.
10048 * Reading from this pointer when `result_ok` is not set is undefined.
10050 struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ *result;
10052 * A pointer to the contents in the error state.
10053 * Reading from this pointer when `result_ok` is set is undefined.
10055 struct LDKProbeSendFailure *err;
10056 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr;
10059 * A CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ represents the result of a fallible operation,
10060 * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ on success and a crate::lightning::ln::outbound_payment::ProbeSendFailure on failure.
10061 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10063 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ {
10065 * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ, accessible via either
10066 * `err` or `result` depending on the state of `result_ok`.
10068 union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr contents;
10070 * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ represents a success state.
10073 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ;
10076 * A tuple of 2 elements. See the individual fields for the types contained.
10078 typedef struct LDKC2Tuple_ChannelIdPublicKeyZ {
10080 * The element at position 0
10082 struct LDKChannelId a;
10084 * The element at position 1
10086 struct LDKPublicKey b;
10087 } LDKC2Tuple_ChannelIdPublicKeyZ;
10090 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ChannelIdPublicKeyZs of arbitrary size.
10091 * This corresponds to std::vector in C++
10093 typedef struct LDKCVec_C2Tuple_ChannelIdPublicKeyZZ {
10095 * The elements in the array.
10096 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10098 struct LDKC2Tuple_ChannelIdPublicKeyZ *data;
10100 * The number of elements pointed to by `data`.
10103 } LDKCVec_C2Tuple_ChannelIdPublicKeyZZ;
10106 * A dynamically-allocated array of crate::lightning::ln::types::ChannelIds of arbitrary size.
10107 * This corresponds to std::vector in C++
10109 typedef struct LDKCVec_ChannelIdZ {
10111 * The elements in the array.
10112 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10114 struct LDKChannelId *data;
10116 * The number of elements pointed to by `data`.
10119 } LDKCVec_ChannelIdZ;
10122 * An enum which can either contain a crate::c_types::Str or not
10124 typedef enum LDKCOption_StrZ_Tag {
10126 * When we're in this state, this COption_StrZ contains a crate::c_types::Str
10128 LDKCOption_StrZ_Some,
10130 * When we're in this state, this COption_StrZ contains nothing
10132 LDKCOption_StrZ_None,
10134 * Must be last for serialization purposes
10136 LDKCOption_StrZ_Sentinel,
10137 } LDKCOption_StrZ_Tag;
10139 typedef struct LDKCOption_StrZ {
10140 LDKCOption_StrZ_Tag tag;
10143 struct LDKStr some;
10149 * The contents of CResult_NoneBolt12SemanticErrorZ
10151 typedef union LDKCResult_NoneBolt12SemanticErrorZPtr {
10153 * Note that this value is always NULL, as there are no contents in the OK variant
10157 * A pointer to the contents in the error state.
10158 * Reading from this pointer when `result_ok` is set is undefined.
10160 enum LDKBolt12SemanticError *err;
10161 } LDKCResult_NoneBolt12SemanticErrorZPtr;
10164 * A CResult_NoneBolt12SemanticErrorZ represents the result of a fallible operation,
10165 * containing a () on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
10166 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10168 typedef struct LDKCResult_NoneBolt12SemanticErrorZ {
10170 * The contents of this CResult_NoneBolt12SemanticErrorZ, accessible via either
10171 * `err` or `result` depending on the state of `result_ok`.
10173 union LDKCResult_NoneBolt12SemanticErrorZPtr contents;
10175 * Whether this CResult_NoneBolt12SemanticErrorZ represents a success state.
10178 } LDKCResult_NoneBolt12SemanticErrorZ;
10181 * The contents of CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ
10183 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr {
10185 * A pointer to the contents in the success state.
10186 * Reading from this pointer when `result_ok` is not set is undefined.
10188 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *result;
10190 * Note that this value is always NULL, as there are no contents in the Err variant
10193 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr;
10196 * A CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ represents the result of a fallible operation,
10197 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ on success and a () on failure.
10198 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10200 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ {
10202 * The contents of this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ, accessible via either
10203 * `err` or `result` depending on the state of `result_ok`.
10205 union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr contents;
10207 * Whether this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ represents a success state.
10210 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ;
10213 * The contents of CResult_ThirtyTwoBytesAPIErrorZ
10215 typedef union LDKCResult_ThirtyTwoBytesAPIErrorZPtr {
10217 * A pointer to the contents in the success state.
10218 * Reading from this pointer when `result_ok` is not set is undefined.
10220 struct LDKThirtyTwoBytes *result;
10222 * A pointer to the contents in the error state.
10223 * Reading from this pointer when `result_ok` is set is undefined.
10225 struct LDKAPIError *err;
10226 } LDKCResult_ThirtyTwoBytesAPIErrorZPtr;
10229 * A CResult_ThirtyTwoBytesAPIErrorZ represents the result of a fallible operation,
10230 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
10231 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10233 typedef struct LDKCResult_ThirtyTwoBytesAPIErrorZ {
10235 * The contents of this CResult_ThirtyTwoBytesAPIErrorZ, accessible via either
10236 * `err` or `result` depending on the state of `result_ok`.
10238 union LDKCResult_ThirtyTwoBytesAPIErrorZPtr contents;
10240 * Whether this CResult_ThirtyTwoBytesAPIErrorZ represents a success state.
10243 } LDKCResult_ThirtyTwoBytesAPIErrorZ;
10248 * An `InvoiceRequest` is a request for a [`Bolt12Invoice`] formulated from an [`Offer`].
10250 * An offer may provide choices such as quantity, amount, chain, features, etc. An invoice request
10251 * specifies these such that its recipient can send an invoice for payment.
10253 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
10254 * [`Offer`]: crate::offers::offer::Offer
10256 typedef struct MUST_USE_STRUCT LDKInvoiceRequest {
10258 * A pointer to the opaque Rust object.
10259 * Nearly everywhere, inner must be non-null, however in places where
10260 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10262 LDKnativeInvoiceRequest *inner;
10264 * Indicates that this is the only struct which contains the same pointer.
10265 * Rust functions which take ownership of an object provided via an argument require
10266 * this to be true and invalidate the object pointed to by inner.
10269 } LDKInvoiceRequest;
10274 * An error in response to an [`InvoiceRequest`] or an [`Bolt12Invoice`].
10276 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
10277 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
10279 typedef struct MUST_USE_STRUCT LDKInvoiceError {
10281 * A pointer to the opaque Rust object.
10282 * Nearly everywhere, inner must be non-null, however in places where
10283 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10285 LDKnativeInvoiceError *inner;
10287 * Indicates that this is the only struct which contains the same pointer.
10288 * Rust functions which take ownership of an object provided via an argument require
10289 * this to be true and invalidate the object pointed to by inner.
10295 * Possible BOLT 12 Offers messages sent and received via an [`OnionMessage`].
10297 * [`OnionMessage`]: crate::ln::msgs::OnionMessage
10299 typedef enum LDKOffersMessage_Tag {
10301 * A request for a [`Bolt12Invoice`] for a particular [`Offer`].
10303 * [`Offer`]: crate::offers::offer::Offer
10305 LDKOffersMessage_InvoiceRequest,
10307 * A [`Bolt12Invoice`] sent in response to an [`InvoiceRequest`] or a [`Refund`].
10309 * [`Refund`]: crate::offers::refund::Refund
10311 LDKOffersMessage_Invoice,
10313 * An error from handling an [`OffersMessage`].
10315 LDKOffersMessage_InvoiceError,
10317 * Must be last for serialization purposes
10319 LDKOffersMessage_Sentinel,
10320 } LDKOffersMessage_Tag;
10322 typedef struct MUST_USE_STRUCT LDKOffersMessage {
10323 LDKOffersMessage_Tag tag;
10326 struct LDKInvoiceRequest invoice_request;
10329 struct LDKBolt12Invoice invoice;
10332 struct LDKInvoiceError invoice_error;
10335 } LDKOffersMessage;
10338 * An enum which can either contain a crate::lightning::onion_message::offers::OffersMessage or not
10340 typedef enum LDKCOption_OffersMessageZ_Tag {
10342 * When we're in this state, this COption_OffersMessageZ contains a crate::lightning::onion_message::offers::OffersMessage
10344 LDKCOption_OffersMessageZ_Some,
10346 * When we're in this state, this COption_OffersMessageZ contains nothing
10348 LDKCOption_OffersMessageZ_None,
10350 * Must be last for serialization purposes
10352 LDKCOption_OffersMessageZ_Sentinel,
10353 } LDKCOption_OffersMessageZ_Tag;
10355 typedef struct LDKCOption_OffersMessageZ {
10356 LDKCOption_OffersMessageZ_Tag tag;
10359 struct LDKOffersMessage some;
10362 } LDKCOption_OffersMessageZ;
10365 * The destination of an onion message.
10367 typedef enum LDKDestination_Tag {
10369 * We're sending this onion message to a node.
10371 LDKDestination_Node,
10373 * We're sending this onion message to a blinded path.
10375 LDKDestination_BlindedPath,
10377 * Must be last for serialization purposes
10379 LDKDestination_Sentinel,
10380 } LDKDestination_Tag;
10382 typedef struct MUST_USE_STRUCT LDKDestination {
10383 LDKDestination_Tag tag;
10386 struct LDKPublicKey node;
10389 struct LDKBlindedPath blinded_path;
10395 * A tuple of 3 elements. See the individual fields for the types contained.
10397 typedef struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ {
10399 * The element at position 0
10401 struct LDKOffersMessage a;
10403 * The element at position 1
10405 struct LDKDestination b;
10407 * The element at position 2
10409 struct LDKBlindedPath c;
10410 } LDKC3Tuple_OffersMessageDestinationBlindedPathZ;
10413 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OffersMessageDestinationBlindedPathZs of arbitrary size.
10414 * This corresponds to std::vector in C++
10416 typedef struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ {
10418 * The elements in the array.
10419 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10421 struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ *data;
10423 * The number of elements pointed to by `data`.
10426 } LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ;
10431 * Information needed for constructing an invoice route hint for this channel.
10433 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
10435 * A pointer to the opaque Rust object.
10436 * Nearly everywhere, inner must be non-null, however in places where
10437 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10439 LDKnativeCounterpartyForwardingInfo *inner;
10441 * Indicates that this is the only struct which contains the same pointer.
10442 * Rust functions which take ownership of an object provided via an argument require
10443 * this to be true and invalidate the object pointed to by inner.
10446 } LDKCounterpartyForwardingInfo;
10449 * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
10451 typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
10453 * A pointer to the contents in the success state.
10454 * Reading from this pointer when `result_ok` is not set is undefined.
10456 struct LDKCounterpartyForwardingInfo *result;
10458 * A pointer to the contents in the error state.
10459 * Reading from this pointer when `result_ok` is set is undefined.
10461 struct LDKDecodeError *err;
10462 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
10465 * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
10466 * containing a crate::lightning::ln::channelmanager::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
10467 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10469 typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
10471 * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
10472 * `err` or `result` depending on the state of `result_ok`.
10474 union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
10476 * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
10479 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
10484 * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
10485 * to better separate parameters.
10487 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
10489 * A pointer to the opaque Rust object.
10490 * Nearly everywhere, inner must be non-null, however in places where
10491 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10493 LDKnativeChannelCounterparty *inner;
10495 * Indicates that this is the only struct which contains the same pointer.
10496 * Rust functions which take ownership of an object provided via an argument require
10497 * this to be true and invalidate the object pointed to by inner.
10500 } LDKChannelCounterparty;
10503 * The contents of CResult_ChannelCounterpartyDecodeErrorZ
10505 typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
10507 * A pointer to the contents in the success state.
10508 * Reading from this pointer when `result_ok` is not set is undefined.
10510 struct LDKChannelCounterparty *result;
10512 * A pointer to the contents in the error state.
10513 * Reading from this pointer when `result_ok` is set is undefined.
10515 struct LDKDecodeError *err;
10516 } LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
10519 * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
10520 * containing a crate::lightning::ln::channelmanager::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
10521 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10523 typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
10525 * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
10526 * `err` or `result` depending on the state of `result_ok`.
10528 union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
10530 * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
10533 } LDKCResult_ChannelCounterpartyDecodeErrorZ;
10536 * The contents of CResult_ChannelDetailsDecodeErrorZ
10538 typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
10540 * A pointer to the contents in the success state.
10541 * Reading from this pointer when `result_ok` is not set is undefined.
10543 struct LDKChannelDetails *result;
10545 * A pointer to the contents in the error state.
10546 * Reading from this pointer when `result_ok` is set is undefined.
10548 struct LDKDecodeError *err;
10549 } LDKCResult_ChannelDetailsDecodeErrorZPtr;
10552 * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
10553 * containing a crate::lightning::ln::channelmanager::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
10554 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10556 typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
10558 * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
10559 * `err` or `result` depending on the state of `result_ok`.
10561 union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
10563 * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
10566 } LDKCResult_ChannelDetailsDecodeErrorZ;
10571 * Route hints used in constructing invoices for [phantom node payents].
10573 * [phantom node payments]: crate::sign::PhantomKeysManager
10575 typedef struct MUST_USE_STRUCT LDKPhantomRouteHints {
10577 * A pointer to the opaque Rust object.
10578 * Nearly everywhere, inner must be non-null, however in places where
10579 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10581 LDKnativePhantomRouteHints *inner;
10583 * Indicates that this is the only struct which contains the same pointer.
10584 * Rust functions which take ownership of an object provided via an argument require
10585 * this to be true and invalidate the object pointed to by inner.
10588 } LDKPhantomRouteHints;
10591 * The contents of CResult_PhantomRouteHintsDecodeErrorZ
10593 typedef union LDKCResult_PhantomRouteHintsDecodeErrorZPtr {
10595 * A pointer to the contents in the success state.
10596 * Reading from this pointer when `result_ok` is not set is undefined.
10598 struct LDKPhantomRouteHints *result;
10600 * A pointer to the contents in the error state.
10601 * Reading from this pointer when `result_ok` is set is undefined.
10603 struct LDKDecodeError *err;
10604 } LDKCResult_PhantomRouteHintsDecodeErrorZPtr;
10607 * A CResult_PhantomRouteHintsDecodeErrorZ represents the result of a fallible operation,
10608 * containing a crate::lightning::ln::channelmanager::PhantomRouteHints on success and a crate::lightning::ln::msgs::DecodeError on failure.
10609 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10611 typedef struct LDKCResult_PhantomRouteHintsDecodeErrorZ {
10613 * The contents of this CResult_PhantomRouteHintsDecodeErrorZ, accessible via either
10614 * `err` or `result` depending on the state of `result_ok`.
10616 union LDKCResult_PhantomRouteHintsDecodeErrorZPtr contents;
10618 * Whether this CResult_PhantomRouteHintsDecodeErrorZ represents a success state.
10621 } LDKCResult_PhantomRouteHintsDecodeErrorZ;
10626 * Information used to forward or fail this HTLC that is being forwarded within a blinded path.
10628 typedef struct MUST_USE_STRUCT LDKBlindedForward {
10630 * A pointer to the opaque Rust object.
10631 * Nearly everywhere, inner must be non-null, however in places where
10632 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10634 LDKnativeBlindedForward *inner;
10636 * Indicates that this is the only struct which contains the same pointer.
10637 * Rust functions which take ownership of an object provided via an argument require
10638 * this to be true and invalidate the object pointed to by inner.
10641 } LDKBlindedForward;
10644 * The contents of CResult_BlindedForwardDecodeErrorZ
10646 typedef union LDKCResult_BlindedForwardDecodeErrorZPtr {
10648 * A pointer to the contents in the success state.
10649 * Reading from this pointer when `result_ok` is not set is undefined.
10651 struct LDKBlindedForward *result;
10653 * A pointer to the contents in the error state.
10654 * Reading from this pointer when `result_ok` is set is undefined.
10656 struct LDKDecodeError *err;
10657 } LDKCResult_BlindedForwardDecodeErrorZPtr;
10660 * A CResult_BlindedForwardDecodeErrorZ represents the result of a fallible operation,
10661 * containing a crate::lightning::ln::channelmanager::BlindedForward on success and a crate::lightning::ln::msgs::DecodeError on failure.
10662 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10664 typedef struct LDKCResult_BlindedForwardDecodeErrorZ {
10666 * The contents of this CResult_BlindedForwardDecodeErrorZ, accessible via either
10667 * `err` or `result` depending on the state of `result_ok`.
10669 union LDKCResult_BlindedForwardDecodeErrorZPtr contents;
10671 * Whether this CResult_BlindedForwardDecodeErrorZ represents a success state.
10674 } LDKCResult_BlindedForwardDecodeErrorZ;
10679 * BOLT 4 onion packet including hop data for the next peer.
10681 typedef struct MUST_USE_STRUCT LDKOnionPacket {
10683 * A pointer to the opaque Rust object.
10684 * Nearly everywhere, inner must be non-null, however in places where
10685 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10687 LDKnativeOnionPacket *inner;
10689 * Indicates that this is the only struct which contains the same pointer.
10690 * Rust functions which take ownership of an object provided via an argument require
10691 * this to be true and invalidate the object pointed to by inner.
10699 * Information communicated in the onion to the recipient for multi-part tracking and proof that
10700 * the payment is associated with an invoice.
10702 typedef struct MUST_USE_STRUCT LDKFinalOnionHopData {
10704 * A pointer to the opaque Rust object.
10705 * Nearly everywhere, inner must be non-null, however in places where
10706 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10708 LDKnativeFinalOnionHopData *inner;
10710 * Indicates that this is the only struct which contains the same pointer.
10711 * Rust functions which take ownership of an object provided via an argument require
10712 * this to be true and invalidate the object pointed to by inner.
10715 } LDKFinalOnionHopData;
10718 * Information about where a received HTLC('s onion) has indicated the HTLC should go.
10720 typedef enum LDKPendingHTLCRouting_Tag {
10722 * An HTLC which should be forwarded on to another node.
10724 LDKPendingHTLCRouting_Forward,
10726 * The onion indicates that this is a payment for an invoice (supposedly) generated by us.
10728 * Note that at this point, we have not checked that the invoice being paid was actually
10729 * generated by us, but rather it's claiming to pay an invoice of ours.
10731 LDKPendingHTLCRouting_Receive,
10733 * The onion indicates that this is for payment to us but which contains the preimage for
10734 * claiming included, and is unrelated to any invoice we'd previously generated (aka a
10735 * \"keysend\" or \"spontaneous\" payment).
10737 LDKPendingHTLCRouting_ReceiveKeysend,
10739 * Must be last for serialization purposes
10741 LDKPendingHTLCRouting_Sentinel,
10742 } LDKPendingHTLCRouting_Tag;
10744 typedef struct LDKPendingHTLCRouting_LDKForward_Body {
10746 * The onion which should be included in the forwarded HTLC, telling the next hop what to
10747 * do with the HTLC.
10749 struct LDKOnionPacket onion_packet;
10751 * The short channel ID of the channel which we were instructed to forward this HTLC to.
10753 * This could be a real on-chain SCID, an SCID alias, or some other SCID which has meaning
10754 * to the receiving node, such as one returned from
10755 * [`ChannelManager::get_intercept_scid`] or [`ChannelManager::get_phantom_scid`].
10757 uint64_t short_channel_id;
10759 * Set if this HTLC is being forwarded within a blinded path.
10761 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
10763 struct LDKBlindedForward blinded;
10764 } LDKPendingHTLCRouting_LDKForward_Body;
10766 typedef struct LDKPendingHTLCRouting_LDKReceive_Body {
10768 * Information about the amount the sender intended to pay and (potential) proof that this
10769 * is a payment for an invoice we generated. This proof of payment is is also used for
10770 * linking MPP parts of a larger payment.
10772 struct LDKFinalOnionHopData payment_data;
10774 * Additional data which we (allegedly) instructed the sender to include in the onion.
10776 * For HTLCs received by LDK, this will ultimately be exposed in
10777 * [`Event::PaymentClaimable::onion_fields`] as
10778 * [`RecipientOnionFields::payment_metadata`].
10780 struct LDKCOption_CVec_u8ZZ payment_metadata;
10782 * The context of the payment included by the recipient in a blinded path, or `None` if a
10783 * blinded path was not used.
10785 * Used in part to determine the [`events::PaymentPurpose`].
10787 struct LDKCOption_PaymentContextZ payment_context;
10789 * CLTV expiry of the received HTLC.
10791 * Used to track when we should expire pending HTLCs that go unclaimed.
10793 uint32_t incoming_cltv_expiry;
10795 * If the onion had forwarding instructions to one of our phantom node SCIDs, this will
10796 * provide the onion shared secret used to decrypt the next level of forwarding
10799 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
10801 struct LDKThirtyTwoBytes phantom_shared_secret;
10803 * Custom TLVs which were set by the sender.
10805 * For HTLCs received by LDK, this will ultimately be exposed in
10806 * [`Event::PaymentClaimable::onion_fields`] as
10807 * [`RecipientOnionFields::custom_tlvs`].
10809 struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs;
10811 * Set if this HTLC is the final hop in a multi-hop blinded path.
10813 bool requires_blinded_error;
10814 } LDKPendingHTLCRouting_LDKReceive_Body;
10816 typedef struct LDKPendingHTLCRouting_LDKReceiveKeysend_Body {
10818 * Information about the amount the sender intended to pay and possibly a token to
10819 * associate MPP parts of a larger payment.
10821 * This will only be filled in if receiving MPP keysend payments is enabled, and it being
10822 * present will cause deserialization to fail on versions of LDK prior to 0.0.116.
10824 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
10826 struct LDKFinalOnionHopData payment_data;
10828 * Preimage for this onion payment. This preimage is provided by the sender and will be
10829 * used to settle the spontaneous payment.
10831 struct LDKThirtyTwoBytes payment_preimage;
10833 * Additional data which we (allegedly) instructed the sender to include in the onion.
10835 * For HTLCs received by LDK, this will ultimately bubble back up as
10836 * [`RecipientOnionFields::payment_metadata`].
10838 struct LDKCOption_CVec_u8ZZ payment_metadata;
10840 * CLTV expiry of the received HTLC.
10842 * Used to track when we should expire pending HTLCs that go unclaimed.
10844 uint32_t incoming_cltv_expiry;
10846 * Custom TLVs which were set by the sender.
10848 * For HTLCs received by LDK, these will ultimately bubble back up as
10849 * [`RecipientOnionFields::custom_tlvs`].
10851 struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs;
10853 * Set if this HTLC is the final hop in a multi-hop blinded path.
10855 bool requires_blinded_error;
10856 } LDKPendingHTLCRouting_LDKReceiveKeysend_Body;
10858 typedef struct MUST_USE_STRUCT LDKPendingHTLCRouting {
10859 LDKPendingHTLCRouting_Tag tag;
10861 LDKPendingHTLCRouting_LDKForward_Body forward;
10862 LDKPendingHTLCRouting_LDKReceive_Body receive;
10863 LDKPendingHTLCRouting_LDKReceiveKeysend_Body receive_keysend;
10865 } LDKPendingHTLCRouting;
10868 * The contents of CResult_PendingHTLCRoutingDecodeErrorZ
10870 typedef union LDKCResult_PendingHTLCRoutingDecodeErrorZPtr {
10872 * A pointer to the contents in the success state.
10873 * Reading from this pointer when `result_ok` is not set is undefined.
10875 struct LDKPendingHTLCRouting *result;
10877 * A pointer to the contents in the error state.
10878 * Reading from this pointer when `result_ok` is set is undefined.
10880 struct LDKDecodeError *err;
10881 } LDKCResult_PendingHTLCRoutingDecodeErrorZPtr;
10884 * A CResult_PendingHTLCRoutingDecodeErrorZ represents the result of a fallible operation,
10885 * containing a crate::lightning::ln::channelmanager::PendingHTLCRouting on success and a crate::lightning::ln::msgs::DecodeError on failure.
10886 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10888 typedef struct LDKCResult_PendingHTLCRoutingDecodeErrorZ {
10890 * The contents of this CResult_PendingHTLCRoutingDecodeErrorZ, accessible via either
10891 * `err` or `result` depending on the state of `result_ok`.
10893 union LDKCResult_PendingHTLCRoutingDecodeErrorZPtr contents;
10895 * Whether this CResult_PendingHTLCRoutingDecodeErrorZ represents a success state.
10898 } LDKCResult_PendingHTLCRoutingDecodeErrorZ;
10901 * The contents of CResult_PendingHTLCInfoDecodeErrorZ
10903 typedef union LDKCResult_PendingHTLCInfoDecodeErrorZPtr {
10905 * A pointer to the contents in the success state.
10906 * Reading from this pointer when `result_ok` is not set is undefined.
10908 struct LDKPendingHTLCInfo *result;
10910 * A pointer to the contents in the error state.
10911 * Reading from this pointer when `result_ok` is set is undefined.
10913 struct LDKDecodeError *err;
10914 } LDKCResult_PendingHTLCInfoDecodeErrorZPtr;
10917 * A CResult_PendingHTLCInfoDecodeErrorZ represents the result of a fallible operation,
10918 * containing a crate::lightning::ln::channelmanager::PendingHTLCInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
10919 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10921 typedef struct LDKCResult_PendingHTLCInfoDecodeErrorZ {
10923 * The contents of this CResult_PendingHTLCInfoDecodeErrorZ, accessible via either
10924 * `err` or `result` depending on the state of `result_ok`.
10926 union LDKCResult_PendingHTLCInfoDecodeErrorZPtr contents;
10928 * Whether this CResult_PendingHTLCInfoDecodeErrorZ represents a success state.
10931 } LDKCResult_PendingHTLCInfoDecodeErrorZ;
10934 * The contents of CResult_BlindedFailureDecodeErrorZ
10936 typedef union LDKCResult_BlindedFailureDecodeErrorZPtr {
10938 * A pointer to the contents in the success state.
10939 * Reading from this pointer when `result_ok` is not set is undefined.
10941 enum LDKBlindedFailure *result;
10943 * A pointer to the contents in the error state.
10944 * Reading from this pointer when `result_ok` is set is undefined.
10946 struct LDKDecodeError *err;
10947 } LDKCResult_BlindedFailureDecodeErrorZPtr;
10950 * A CResult_BlindedFailureDecodeErrorZ represents the result of a fallible operation,
10951 * containing a crate::lightning::ln::channelmanager::BlindedFailure on success and a crate::lightning::ln::msgs::DecodeError on failure.
10952 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10954 typedef struct LDKCResult_BlindedFailureDecodeErrorZ {
10956 * The contents of this CResult_BlindedFailureDecodeErrorZ, accessible via either
10957 * `err` or `result` depending on the state of `result_ok`.
10959 union LDKCResult_BlindedFailureDecodeErrorZPtr contents;
10961 * Whether this CResult_BlindedFailureDecodeErrorZ represents a success state.
10964 } LDKCResult_BlindedFailureDecodeErrorZ;
10967 * The contents of CResult_ChannelShutdownStateDecodeErrorZ
10969 typedef union LDKCResult_ChannelShutdownStateDecodeErrorZPtr {
10971 * A pointer to the contents in the success state.
10972 * Reading from this pointer when `result_ok` is not set is undefined.
10974 enum LDKChannelShutdownState *result;
10976 * A pointer to the contents in the error state.
10977 * Reading from this pointer when `result_ok` is set is undefined.
10979 struct LDKDecodeError *err;
10980 } LDKCResult_ChannelShutdownStateDecodeErrorZPtr;
10983 * A CResult_ChannelShutdownStateDecodeErrorZ represents the result of a fallible operation,
10984 * containing a crate::lightning::ln::channelmanager::ChannelShutdownState on success and a crate::lightning::ln::msgs::DecodeError on failure.
10985 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10987 typedef struct LDKCResult_ChannelShutdownStateDecodeErrorZ {
10989 * The contents of this CResult_ChannelShutdownStateDecodeErrorZ, accessible via either
10990 * `err` or `result` depending on the state of `result_ok`.
10992 union LDKCResult_ChannelShutdownStateDecodeErrorZPtr contents;
10994 * Whether this CResult_ChannelShutdownStateDecodeErrorZ represents a success state.
10997 } LDKCResult_ChannelShutdownStateDecodeErrorZ;
11002 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
11003 * on-chain transactions to ensure no loss of funds occurs.
11005 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
11006 * information and are actively monitoring the chain.
11008 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
11009 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
11010 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
11011 * returned block hash and the the current chain and then reconnecting blocks to get to the
11012 * best chain) upon deserializing the object!
11014 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
11016 * A pointer to the opaque Rust object.
11017 * Nearly everywhere, inner must be non-null, however in places where
11018 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11020 LDKnativeChannelMonitor *inner;
11022 * Indicates that this is the only struct which contains the same pointer.
11023 * Rust functions which take ownership of an object provided via an argument require
11024 * this to be true and invalidate the object pointed to by inner.
11027 } LDKChannelMonitor;
11030 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
11031 * This corresponds to std::vector in C++
11033 typedef struct LDKCVec_ChannelMonitorZ {
11035 * The elements in the array.
11036 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11038 struct LDKChannelMonitor *data;
11040 * The number of elements pointed to by `data`.
11043 } LDKCVec_ChannelMonitorZ;
11048 * An update generated by the underlying channel itself which contains some new information the
11049 * [`ChannelMonitor`] should be made aware of.
11051 * Because this represents only a small number of updates to the underlying state, it is generally
11052 * much smaller than a full [`ChannelMonitor`]. However, for large single commitment transaction
11053 * updates (e.g. ones during which there are hundreds of HTLCs pending on the commitment
11054 * transaction), a single update may reach upwards of 1 MiB in serialized size.
11056 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
11058 * A pointer to the opaque Rust object.
11059 * Nearly everywhere, inner must be non-null, however in places where
11060 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11062 LDKnativeChannelMonitorUpdate *inner;
11064 * Indicates that this is the only struct which contains the same pointer.
11065 * Rust functions which take ownership of an object provided via an argument require
11066 * this to be true and invalidate the object pointed to by inner.
11069 } LDKChannelMonitorUpdate;
11072 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
11073 * blocks are connected and disconnected.
11075 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
11076 * responsible for maintaining a set of monitors such that they can be updated as channel state
11077 * changes. On each update, *all copies* of a [`ChannelMonitor`] must be updated and the update
11078 * persisted to disk to ensure that the latest [`ChannelMonitor`] state can be reloaded if the
11079 * application crashes.
11081 * See method documentation and [`ChannelMonitorUpdateStatus`] for specific requirements.
11083 typedef struct LDKWatch {
11085 * An opaque pointer which is passed to your function implementations as an argument.
11086 * This has no meaning in the LDK, and can be NULL or any other value.
11090 * Watches a channel identified by `funding_txo` using `monitor`.
11092 * Implementations are responsible for watching the chain for the funding transaction along
11093 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
11094 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
11096 * A return of `Err(())` indicates that the channel should immediately be force-closed without
11097 * broadcasting the funding transaction.
11099 * If the given `funding_txo` has previously been registered via `watch_channel`, `Err(())`
11100 * must be returned.
11102 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
11103 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
11104 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
11106 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
11108 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
11110 * Implementations must call [`ChannelMonitor::update_monitor`] with the given update. This
11111 * may fail (returning an `Err(())`), in which case this should return
11112 * [`ChannelMonitorUpdateStatus::InProgress`] (and the update should never complete). This
11113 * generally implies the channel has been closed (either by the funding outpoint being spent
11114 * on-chain or the [`ChannelMonitor`] having decided to do so and broadcasted a transaction),
11115 * and the [`ChannelManager`] state will be updated once it sees the funding spend on-chain.
11117 * In general, persistence failures should be retried after returning
11118 * [`ChannelMonitorUpdateStatus::InProgress`] and eventually complete. If a failure truly
11119 * cannot be retried, the node should shut down immediately after returning
11120 * [`ChannelMonitorUpdateStatus::UnrecoverableError`], see its documentation for more info.
11122 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
11124 enum LDKChannelMonitorUpdateStatus (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, const struct LDKChannelMonitorUpdate *NONNULL_PTR update);
11126 * Returns any monitor events since the last call. Subsequent calls must only return new
11129 * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
11130 * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
11133 * For details on asynchronous [`ChannelMonitor`] updating and returning
11134 * [`MonitorEvent::Completed`] here, see [`ChannelMonitorUpdateStatus::InProgress`].
11136 struct LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ (*release_pending_monitor_events)(const void *this_arg);
11138 * Frees any resources associated with this object given its this_arg pointer.
11139 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11141 void (*free)(void *this_arg);
11145 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
11146 * This corresponds to std::vector in C++
11148 typedef struct LDKCVec_TransactionZ {
11150 * The elements in the array.
11151 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11153 struct LDKTransaction *data;
11155 * The number of elements pointed to by `data`.
11158 } LDKCVec_TransactionZ;
11161 * An interface to send a transaction to the Bitcoin network.
11163 typedef struct LDKBroadcasterInterface {
11165 * An opaque pointer which is passed to your function implementations as an argument.
11166 * This has no meaning in the LDK, and can be NULL or any other value.
11170 * Sends a list of transactions out to (hopefully) be mined.
11171 * This only needs to handle the actual broadcasting of transactions, LDK will automatically
11172 * rebroadcast transactions that haven't made it into a block.
11174 * In some cases LDK may attempt to broadcast a transaction which double-spends another
11175 * and this isn't a bug and can be safely ignored.
11177 * If more than one transaction is given, these transactions should be considered to be a
11178 * package and broadcast together. Some of the transactions may or may not depend on each other,
11179 * be sure to manage both cases correctly.
11181 * Bitcoin transaction packages are defined in BIP 331 and here:
11182 * <https://github.com/bitcoin/bitcoin/blob/master/doc/policy/packages.md>
11184 void (*broadcast_transactions)(const void *this_arg, struct LDKCVec_TransactionZ txs);
11186 * Frees any resources associated with this object given its this_arg pointer.
11187 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11189 void (*free)(void *this_arg);
11190 } LDKBroadcasterInterface;
11193 * A trait that describes a source of entropy.
11195 typedef struct LDKEntropySource {
11197 * An opaque pointer which is passed to your function implementations as an argument.
11198 * This has no meaning in the LDK, and can be NULL or any other value.
11202 * Gets a unique, cryptographically-secure, random 32-byte value. This method must return a
11203 * different value each time it is called.
11205 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
11207 * Frees any resources associated with this object given its this_arg pointer.
11208 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11210 void (*free)(void *this_arg);
11211 } LDKEntropySource;
11216 * A semantically valid [`InvoiceRequest`] that hasn't been signed.
11220 * This is serialized as a TLV stream, which includes TLV records from the originating message. As
11221 * such, it may include unknown, odd TLV records.
11223 typedef struct MUST_USE_STRUCT LDKUnsignedInvoiceRequest {
11225 * A pointer to the opaque Rust object.
11226 * Nearly everywhere, inner must be non-null, however in places where
11227 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11229 LDKnativeUnsignedInvoiceRequest *inner;
11231 * Indicates that this is the only struct which contains the same pointer.
11232 * Rust functions which take ownership of an object provided via an argument require
11233 * this to be true and invalidate the object pointed to by inner.
11236 } LDKUnsignedInvoiceRequest;
11241 * The unsigned part of a [`channel_update`] message.
11243 * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
11245 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
11247 * A pointer to the opaque Rust object.
11248 * Nearly everywhere, inner must be non-null, however in places where
11249 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11251 LDKnativeUnsignedChannelUpdate *inner;
11253 * Indicates that this is the only struct which contains the same pointer.
11254 * Rust functions which take ownership of an object provided via an argument require
11255 * this to be true and invalidate the object pointed to by inner.
11258 } LDKUnsignedChannelUpdate;
11263 * The unsigned part of a [`node_announcement`] message.
11265 * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
11267 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
11269 * A pointer to the opaque Rust object.
11270 * Nearly everywhere, inner must be non-null, however in places where
11271 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11273 LDKnativeUnsignedNodeAnnouncement *inner;
11275 * Indicates that this is the only struct which contains the same pointer.
11276 * Rust functions which take ownership of an object provided via an argument require
11277 * this to be true and invalidate the object pointed to by inner.
11280 } LDKUnsignedNodeAnnouncement;
11283 * Represents the set of gossip messages that require a signature from a node's identity key.
11285 typedef enum LDKUnsignedGossipMessage_Tag {
11287 * An unsigned channel announcement.
11289 LDKUnsignedGossipMessage_ChannelAnnouncement,
11291 * An unsigned channel update.
11293 LDKUnsignedGossipMessage_ChannelUpdate,
11295 * An unsigned node announcement.
11297 LDKUnsignedGossipMessage_NodeAnnouncement,
11299 * Must be last for serialization purposes
11301 LDKUnsignedGossipMessage_Sentinel,
11302 } LDKUnsignedGossipMessage_Tag;
11304 typedef struct MUST_USE_STRUCT LDKUnsignedGossipMessage {
11305 LDKUnsignedGossipMessage_Tag tag;
11308 struct LDKUnsignedChannelAnnouncement channel_announcement;
11311 struct LDKUnsignedChannelUpdate channel_update;
11314 struct LDKUnsignedNodeAnnouncement node_announcement;
11317 } LDKUnsignedGossipMessage;
11320 * A trait that can handle cryptographic operations at the scope level of a node.
11322 typedef struct LDKNodeSigner {
11324 * An opaque pointer which is passed to your function implementations as an argument.
11325 * This has no meaning in the LDK, and can be NULL or any other value.
11329 * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
11331 * If the implementor of this trait supports [phantom node payments], then every node that is
11332 * intended to be included in the phantom invoice route hints must return the same value from
11335 * This method must return the same value each time it is called.
11337 * [phantom node payments]: PhantomKeysManager
11339 struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
11341 * Get node id based on the provided [`Recipient`].
11343 * This method must return the same value each time it is called with a given [`Recipient`]
11346 * Errors if the [`Recipient`] variant is not supported by the implementation.
11348 struct LDKCResult_PublicKeyNoneZ (*get_node_id)(const void *this_arg, enum LDKRecipient recipient);
11350 * Gets the ECDH shared secret of our node secret and `other_key`, multiplying by `tweak` if
11351 * one is provided. Note that this tweak can be applied to `other_key` instead of our node
11352 * secret, though this is less efficient.
11354 * Note that if this fails while attempting to forward an HTLC, LDK will panic. The error
11355 * should be resolved to allow LDK to resume forwarding HTLCs.
11357 * Errors if the [`Recipient`] variant is not supported by the implementation.
11359 struct LDKCResult_ThirtyTwoBytesNoneZ (*ecdh)(const void *this_arg, enum LDKRecipient recipient, struct LDKPublicKey other_key, struct LDKCOption_BigEndianScalarZ tweak);
11363 * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of
11364 * this trait to parse the invoice and make sure they're signing what they expect, rather than
11365 * blindly signing the hash.
11367 * The `hrp_bytes` are ASCII bytes, while the `invoice_data` is base32.
11369 * The secret key used to sign the invoice is dependent on the [`Recipient`].
11371 * Errors if the [`Recipient`] variant is not supported by the implementation.
11373 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z invoice_data, enum LDKRecipient recipient);
11375 * Signs the [`TaggedHash`] of a BOLT 12 invoice request.
11377 * May be called by a function passed to [`UnsignedInvoiceRequest::sign`] where
11378 * `invoice_request` is the callee.
11380 * Implementors may check that the `invoice_request` is expected rather than blindly signing
11381 * the tagged hash. An `Ok` result should sign `invoice_request.tagged_hash().as_digest()` with
11382 * the node's signing key or an ephemeral key to preserve privacy, whichever is associated with
11383 * [`UnsignedInvoiceRequest::payer_id`].
11385 * [`TaggedHash`]: crate::offers::merkle::TaggedHash
11387 struct LDKCResult_SchnorrSignatureNoneZ (*sign_bolt12_invoice_request)(const void *this_arg, const struct LDKUnsignedInvoiceRequest *NONNULL_PTR invoice_request);
11389 * Signs the [`TaggedHash`] of a BOLT 12 invoice.
11391 * May be called by a function passed to [`UnsignedBolt12Invoice::sign`] where `invoice` is the
11394 * Implementors may check that the `invoice` is expected rather than blindly signing the tagged
11395 * hash. An `Ok` result should sign `invoice.tagged_hash().as_digest()` with the node's signing
11396 * key or an ephemeral key to preserve privacy, whichever is associated with
11397 * [`UnsignedBolt12Invoice::signing_pubkey`].
11399 * [`TaggedHash`]: crate::offers::merkle::TaggedHash
11401 struct LDKCResult_SchnorrSignatureNoneZ (*sign_bolt12_invoice)(const void *this_arg, const struct LDKUnsignedBolt12Invoice *NONNULL_PTR invoice);
11403 * Sign a gossip message.
11405 * Note that if this fails, LDK may panic and the message will not be broadcast to the network
11406 * or a possible channel counterparty. If LDK panics, the error should be resolved to allow the
11407 * message to be broadcast, as otherwise it may prevent one from receiving funds over the
11408 * corresponding channel.
11410 struct LDKCResult_ECDSASignatureNoneZ (*sign_gossip_message)(const void *this_arg, struct LDKUnsignedGossipMessage msg);
11412 * Frees any resources associated with this object given its this_arg pointer.
11413 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11415 void (*free)(void *this_arg);
11419 * A trait that can return signer instances for individual channels.
11421 typedef struct LDKSignerProvider {
11423 * An opaque pointer which is passed to your function implementations as an argument.
11424 * This has no meaning in the LDK, and can be NULL or any other value.
11428 * Generates a unique `channel_keys_id` that can be used to obtain a [`Self::EcdsaSigner`] through
11429 * [`SignerProvider::derive_channel_signer`]. The `user_channel_id` is provided to allow
11430 * implementations of [`SignerProvider`] to maintain a mapping between itself and the generated
11431 * `channel_keys_id`.
11433 * This method must return a different value each time it is called.
11435 struct LDKThirtyTwoBytes (*generate_channel_keys_id)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis, struct LDKU128 user_channel_id);
11437 * Derives the private key material backing a `Signer`.
11439 * To derive a new `Signer`, a fresh `channel_keys_id` should be obtained through
11440 * [`SignerProvider::generate_channel_keys_id`]. Otherwise, an existing `Signer` can be
11441 * re-derived from its `channel_keys_id`, which can be obtained through its trait method
11442 * [`ChannelSigner::channel_keys_id`].
11444 struct LDKWriteableEcdsaChannelSigner (*derive_channel_signer)(const void *this_arg, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id);
11446 * Reads a [`Signer`] for this [`SignerProvider`] from the given input stream.
11447 * This is only called during deserialization of other objects which contain
11448 * [`WriteableEcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s).
11449 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
11450 * contain no versioning scheme. You may wish to include your own version prefix and ensure
11451 * you've read all of the provided bytes to ensure no corruption occurred.
11453 * This method is slowly being phased out -- it will only be called when reading objects
11454 * written by LDK versions prior to 0.0.113.
11456 * [`Signer`]: Self::EcdsaSigner
11457 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
11458 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
11460 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
11462 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
11464 * If this function returns an error, this will result in a channel failing to open.
11466 * This method should return a different value each time it is called, to avoid linking
11467 * on-chain funds across channels as controlled to the same user. `channel_keys_id` may be
11468 * used to derive a unique value for each channel.
11470 struct LDKCResult_CVec_u8ZNoneZ (*get_destination_script)(const void *this_arg, struct LDKThirtyTwoBytes channel_keys_id);
11472 * Get a script pubkey which we will send funds to when closing a channel.
11474 * If this function returns an error, this will result in a channel failing to open or close.
11475 * In the event of a failure when the counterparty is initiating a close, this can result in a
11476 * channel force close.
11478 * This method should return a different value each time it is called, to avoid linking
11479 * on-chain funds across channels as controlled to the same user.
11481 struct LDKCResult_ShutdownScriptNoneZ (*get_shutdown_scriptpubkey)(const void *this_arg);
11483 * Frees any resources associated with this object given its this_arg pointer.
11484 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11486 void (*free)(void *this_arg);
11487 } LDKSignerProvider;
11490 * A trait which should be implemented to provide feerate information on a number of time
11493 * If access to a local mempool is not feasible, feerate estimates should be fetched from a set of
11494 * third-parties hosting them. Note that this enables them to affect the propagation of your
11495 * pre-signed transactions at any time and therefore endangers the safety of channels funds. It
11496 * should be considered carefully as a deployment.
11498 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
11499 * called from inside the library in response to chain events, P2P events, or timer events).
11501 * LDK may generate a substantial number of fee-estimation calls in some cases. You should
11502 * pre-calculate and cache the fee estimate results to ensure you don't substantially slow HTLC
11505 typedef struct LDKFeeEstimator {
11507 * An opaque pointer which is passed to your function implementations as an argument.
11508 * This has no meaning in the LDK, and can be NULL or any other value.
11512 * Gets estimated satoshis of fee required per 1000 Weight-Units.
11514 * LDK will wrap this method and ensure that the value returned is no smaller than 253
11515 * (ie 1 satoshi-per-byte rounded up to ensure later round-downs don't put us below 1 satoshi-per-byte).
11517 * The following unit conversions can be used to convert to sats/KW:
11518 * * satoshis-per-byte * 250
11519 * * satoshis-per-kbyte / 4
11521 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
11523 * Frees any resources associated with this object given its this_arg pointer.
11524 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11526 void (*free)(void *this_arg);
11532 * Data to construct a [`BlindedHop`] for receiving a payment. This payload is custom to LDK and
11533 * may not be valid if received by another lightning implementation.
11535 typedef struct MUST_USE_STRUCT LDKReceiveTlvs {
11537 * A pointer to the opaque Rust object.
11538 * Nearly everywhere, inner must be non-null, however in places where
11539 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11541 LDKnativeReceiveTlvs *inner;
11543 * Indicates that this is the only struct which contains the same pointer.
11544 * Rust functions which take ownership of an object provided via an argument require
11545 * this to be true and invalidate the object pointed to by inner.
11551 * A trait defining behavior for routing an [`OnionMessage`].
11553 typedef struct LDKMessageRouter {
11555 * An opaque pointer which is passed to your function implementations as an argument.
11556 * This has no meaning in the LDK, and can be NULL or any other value.
11560 * Returns a route for sending an [`OnionMessage`] to the given [`Destination`].
11562 struct LDKCResult_OnionMessagePathNoneZ (*find_path)(const void *this_arg, struct LDKPublicKey sender, struct LDKCVec_PublicKeyZ peers, struct LDKDestination destination);
11564 * Creates [`BlindedPath`]s to the `recipient` node. The nodes in `peers` are assumed to be
11565 * direct peers with the `recipient`.
11567 struct LDKCResult_CVec_BlindedPathZNoneZ (*create_blinded_paths)(const void *this_arg, struct LDKPublicKey recipient, struct LDKCVec_PublicKeyZ peers);
11569 * Frees any resources associated with this object given its this_arg pointer.
11570 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11572 void (*free)(void *this_arg);
11573 } LDKMessageRouter;
11576 * A trait defining behavior for routing a payment.
11578 typedef struct LDKRouter {
11580 * An opaque pointer which is passed to your function implementations as an argument.
11581 * This has no meaning in the LDK, and can be NULL or any other value.
11585 * Finds a [`Route`] for a payment between the given `payer` and a payee.
11587 * The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
11588 * and [`RouteParameters::final_value_msat`], respectively.
11590 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
11592 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);
11594 * Finds a [`Route`] for a payment between the given `payer` and a payee.
11596 * The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
11597 * and [`RouteParameters::final_value_msat`], respectively.
11599 * Includes a [`PaymentHash`] and a [`PaymentId`] to be able to correlate the request with a specific
11602 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
11604 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);
11606 * Creates [`BlindedPath`]s for payment to the `recipient` node. The channels in `first_hops`
11607 * are assumed to be with the `recipient`'s peers. The payment secret and any constraints are
11610 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);
11612 * Implementation of MessageRouter for this object.
11614 struct LDKMessageRouter MessageRouter;
11616 * Frees any resources associated with this object given its this_arg pointer.
11617 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11619 void (*free)(void *this_arg);
11625 * A lightning node's channel state machine and payment management logic, which facilitates
11626 * sending, forwarding, and receiving payments through lightning channels.
11628 * [`ChannelManager`] is parameterized by a number of components to achieve this.
11629 * - [`chain::Watch`] (typically [`ChainMonitor`]) for on-chain monitoring and enforcement of each
11631 * - [`BroadcasterInterface`] for broadcasting transactions related to opening, funding, and
11633 * - [`EntropySource`] for providing random data needed for cryptographic operations
11634 * - [`NodeSigner`] for cryptographic operations scoped to the node
11635 * - [`SignerProvider`] for providing signers whose operations are scoped to individual channels
11636 * - [`FeeEstimator`] to determine transaction fee rates needed to have a transaction mined in a
11638 * - [`Router`] for finding payment paths when initiating and retrying payments
11639 * - [`Logger`] for logging operational information of varying degrees
11641 * Additionally, it implements the following traits:
11642 * - [`ChannelMessageHandler`] to handle off-chain channel activity from peers
11643 * - [`MessageSendEventsProvider`] to similarly send such messages to peers
11644 * - [`OffersMessageHandler`] for BOLT 12 message handling and sending
11645 * - [`EventsProvider`] to generate user-actionable [`Event`]s
11646 * - [`chain::Listen`] and [`chain::Confirm`] for notification of on-chain activity
11648 * Thus, [`ChannelManager`] is typically used to parameterize a [`MessageHandler`] and an
11649 * [`OnionMessenger`]. The latter is required to support BOLT 12 functionality.
11651 * # `ChannelManager` vs `ChannelMonitor`
11653 * It's important to distinguish between the *off-chain* management and *on-chain* enforcement of
11654 * lightning channels. [`ChannelManager`] exchanges messages with peers to manage the off-chain
11655 * state of each channel. During this process, it generates a [`ChannelMonitor`] for each channel
11656 * and a [`ChannelMonitorUpdate`] for each relevant change, notifying its parameterized
11657 * [`chain::Watch`] of them.
11659 * An implementation of [`chain::Watch`], such as [`ChainMonitor`], is responsible for aggregating
11660 * these [`ChannelMonitor`]s and applying any [`ChannelMonitorUpdate`]s to them. It then monitors
11661 * for any pertinent on-chain activity, enforcing claims as needed.
11663 * This division of off-chain management and on-chain enforcement allows for interesting node
11664 * setups. For instance, on-chain enforcement could be moved to a separate host or have added
11665 * redundancy, possibly as a watchtower. See [`chain::Watch`] for the relevant interface.
11669 * Use [`ChannelManager::new`] with the most recent [`BlockHash`] when creating a fresh instance.
11670 * Otherwise, if restarting, construct [`ChannelManagerReadArgs`] with the necessary parameters and
11671 * references to any deserialized [`ChannelMonitor`]s that were previously persisted. Use this to
11672 * deserialize the [`ChannelManager`] and feed it any new chain data since it was last online, as
11673 * detailed in the [`ChannelManagerReadArgs`] documentation.
11676 * use bitcoin::BlockHash;
11677 * use bitcoin::network::constants::Network;
11678 * use lightning::chain::BestBlock;
11679 * # use lightning::chain::channelmonitor::ChannelMonitor;
11680 * use lightning::ln::channelmanager::{ChainParameters, ChannelManager, ChannelManagerReadArgs};
11681 * # use lightning::routing::gossip::NetworkGraph;
11682 * use lightning::util::config::UserConfig;
11683 * use lightning::util::ser::ReadableArgs;
11685 * # fn read_channel_monitors() -> Vec<ChannelMonitor<lightning::sign::InMemorySigner>> { vec![] }
11688 * # L: lightning::util::logger::Logger,
11689 * # ES: lightning::sign::EntropySource,
11690 * # S: for <'b> lightning::routing::scoring::LockableScore<'b, ScoreLookUp = SL>,
11691 * # SL: lightning::routing::scoring::ScoreLookUp<ScoreParams = SP>,
11693 * # R: lightning::io::Read,
11695 * # fee_estimator: &dyn lightning::chain::chaininterface::FeeEstimator,
11696 * # chain_monitor: &dyn lightning::chain::Watch<lightning::sign::InMemorySigner>,
11697 * # tx_broadcaster: &dyn lightning::chain::chaininterface::BroadcasterInterface,
11698 * # router: &lightning::routing::router::DefaultRouter<&NetworkGraph<&'a L>, &'a L, &ES, &S, SP, SL>,
11700 * # entropy_source: &ES,
11701 * # node_signer: &dyn lightning::sign::NodeSigner,
11702 * # signer_provider: &lightning::sign::DynSignerProvider,
11703 * # best_block: lightning::chain::BestBlock,
11704 * # current_timestamp: u32,
11706 * # ) -> Result<(), lightning::ln::msgs::DecodeError> {
11707 * // Fresh start with no channels
11708 * let params = ChainParameters {
11709 * network: Network::Bitcoin,
11712 * let default_config = UserConfig::default();
11713 * let channel_manager = ChannelManager::new(
11714 * fee_estimator, chain_monitor, tx_broadcaster, router, logger, entropy_source, node_signer,
11715 * signer_provider, default_config, params, current_timestamp
11718 * // Restart from deserialized data
11719 * let mut channel_monitors = read_channel_monitors();
11720 * let args = ChannelManagerReadArgs::new(
11721 * entropy_source, node_signer, signer_provider, fee_estimator, chain_monitor, tx_broadcaster,
11722 * router, logger, default_config, channel_monitors.iter_mut().collect()
11724 * let (block_hash, channel_manager) =
11725 * <(BlockHash, ChannelManager<_, _, _, _, _, _, _, _>)>::read(&mut reader, args)?;
11727 * // Update the ChannelManager and ChannelMonitors with the latest chain data
11730 * // Move the monitors to the ChannelManager's chain::Watch parameter
11731 * for monitor in channel_monitors {
11732 * chain_monitor.watch_channel(monitor.get_funding_txo().0, monitor);
11740 * The following is required for [`ChannelManager`] to function properly:
11741 * - Handle messages from peers using its [`ChannelMessageHandler`] implementation (typically
11742 * called by [`PeerManager::read_event`] when processing network I/O)
11743 * - Send messages to peers obtained via its [`MessageSendEventsProvider`] implementation
11744 * (typically initiated when [`PeerManager::process_events`] is called)
11745 * - Feed on-chain activity using either its [`chain::Listen`] or [`chain::Confirm`] implementation
11746 * as documented by those traits
11747 * - Perform any periodic channel and payment checks by calling [`timer_tick_occurred`] roughly
11749 * - Persist to disk whenever [`get_and_clear_needs_persistence`] returns `true` using a
11750 * [`Persister`] such as a [`KVStore`] implementation
11751 * - Handle [`Event`]s obtained via its [`EventsProvider`] implementation
11753 * The [`Future`] returned by [`get_event_or_persistence_needed_future`] is useful in determining
11754 * when the last two requirements need to be checked.
11756 * The [`lightning-block-sync`] and [`lightning-transaction-sync`] crates provide utilities that
11757 * simplify feeding in on-chain activity using the [`chain::Listen`] and [`chain::Confirm`] traits,
11758 * respectively. The remaining requirements can be met using the [`lightning-background-processor`]
11759 * crate. For languages other than Rust, the availability of similar utilities may vary.
11763 * [`ChannelManager`]'s primary function involves managing a channel state. Without channels,
11764 * payments can't be sent. Use [`list_channels`] or [`list_usable_channels`] for a snapshot of the
11765 * currently open channels.
11768 * # use lightning::ln::channelmanager::AChannelManager;
11770 * # fn example<T: AChannelManager>(channel_manager: T) {
11771 * # let channel_manager = channel_manager.get_cm();
11772 * let channels = channel_manager.list_usable_channels();
11773 * for details in channels {
11774 * println!(\"{:?}\", details);
11779 * Each channel is identified using a [`ChannelId`], which will change throughout the channel's
11780 * life cycle. Additionally, channels are assigned a `user_channel_id`, which is given in
11781 * [`Event`]s associated with the channel and serves as a fixed identifier but is otherwise unused
11782 * by [`ChannelManager`].
11784 * ## Opening Channels
11786 * To an open a channel with a peer, call [`create_channel`]. This will initiate the process of
11787 * opening an outbound channel, which requires self-funding when handling
11788 * [`Event::FundingGenerationReady`].
11791 * # use bitcoin::{ScriptBuf, Transaction};
11792 * # use bitcoin::secp256k1::PublicKey;
11793 * # use lightning::ln::channelmanager::AChannelManager;
11794 * # use lightning::events::{Event, EventsProvider};
11797 * # fn create_funding_transaction(
11798 * # &self, _amount_sats: u64, _output_script: ScriptBuf
11799 * # ) -> Transaction;
11802 * # fn example<T: AChannelManager, W: Wallet>(channel_manager: T, wallet: W, peer_id: PublicKey) {
11803 * # let channel_manager = channel_manager.get_cm();
11804 * let value_sats = 1_000_000;
11805 * let push_msats = 10_000_000;
11806 * match channel_manager.create_channel(peer_id, value_sats, push_msats, 42, None, None) {
11807 * Ok(channel_id) => println!(\"Opening channel {}\", channel_id),
11808 * Err(e) => println!(\"Error opening channel: {:?}\", e),
11811 * // On the event processing thread once the peer has responded
11812 * channel_manager.process_pending_events(&|event| match event {
11813 * Event::FundingGenerationReady {
11814 * temporary_channel_id, counterparty_node_id, channel_value_satoshis, output_script,
11815 * user_channel_id, ..
11817 * assert_eq!(user_channel_id, 42);
11818 * let funding_transaction = wallet.create_funding_transaction(
11819 * channel_value_satoshis, output_script
11821 * match channel_manager.funding_transaction_generated(
11822 * &temporary_channel_id, &counterparty_node_id, funding_transaction
11824 * Ok(()) => println!(\"Funding channel {}\", temporary_channel_id),
11825 * Err(e) => println!(\"Error funding channel {}: {:?}\", temporary_channel_id, e),
11828 * Event::ChannelPending { channel_id, user_channel_id, former_temporary_channel_id, .. } => {
11829 * assert_eq!(user_channel_id, 42);
11831 * \"Channel {} now {} pending (funding transaction has been broadcasted)\", channel_id,
11832 * former_temporary_channel_id.unwrap()
11835 * Event::ChannelReady { channel_id, user_channel_id, .. } => {
11836 * assert_eq!(user_channel_id, 42);
11837 * println!(\"Channel {} ready\", channel_id);
11845 * ## Accepting Channels
11847 * Inbound channels are initiated by peers and are automatically accepted unless [`ChannelManager`]
11848 * has [`UserConfig::manually_accept_inbound_channels`] set. In that case, the channel may be
11849 * either accepted or rejected when handling [`Event::OpenChannelRequest`].
11852 * # use bitcoin::secp256k1::PublicKey;
11853 * # use lightning::ln::channelmanager::AChannelManager;
11854 * # use lightning::events::{Event, EventsProvider};
11856 * # fn is_trusted(counterparty_node_id: PublicKey) -> bool {
11858 * # unimplemented!()
11861 * # fn example<T: AChannelManager>(channel_manager: T) {
11862 * # let channel_manager = channel_manager.get_cm();
11863 * channel_manager.process_pending_events(&|event| match event {
11864 * Event::OpenChannelRequest { temporary_channel_id, counterparty_node_id, .. } => {
11865 * if !is_trusted(counterparty_node_id) {
11866 * match channel_manager.force_close_without_broadcasting_txn(
11867 * &temporary_channel_id, &counterparty_node_id
11869 * Ok(()) => println!(\"Rejecting channel {}\", temporary_channel_id),
11870 * Err(e) => println!(\"Error rejecting channel {}: {:?}\", temporary_channel_id, e),
11875 * let user_channel_id = 43;
11876 * match channel_manager.accept_inbound_channel(
11877 * &temporary_channel_id, &counterparty_node_id, user_channel_id
11879 * Ok(()) => println!(\"Accepting channel {}\", temporary_channel_id),
11880 * Err(e) => println!(\"Error accepting channel {}: {:?}\", temporary_channel_id, e),
11889 * ## Closing Channels
11891 * There are two ways to close a channel: either cooperatively using [`close_channel`] or
11892 * unilaterally using [`force_close_broadcasting_latest_txn`]. The former is ideal as it makes for
11893 * lower fees and immediate access to funds. However, the latter may be necessary if the
11894 * counterparty isn't behaving properly or has gone offline. [`Event::ChannelClosed`] is generated
11895 * once the channel has been closed successfully.
11898 * # use bitcoin::secp256k1::PublicKey;
11899 * # use lightning::ln::types::ChannelId;
11900 * # use lightning::ln::channelmanager::AChannelManager;
11901 * # use lightning::events::{Event, EventsProvider};
11903 * # fn example<T: AChannelManager>(
11904 * # channel_manager: T, channel_id: ChannelId, counterparty_node_id: PublicKey
11906 * # let channel_manager = channel_manager.get_cm();
11907 * match channel_manager.close_channel(&channel_id, &counterparty_node_id) {
11908 * Ok(()) => println!(\"Closing channel {}\", channel_id),
11909 * Err(e) => println!(\"Error closing channel {}: {:?}\", channel_id, e),
11912 * // On the event processing thread
11913 * channel_manager.process_pending_events(&|event| match event {
11914 * Event::ChannelClosed { channel_id, user_channel_id, .. } => {
11915 * assert_eq!(user_channel_id, 42);
11916 * println!(\"Channel {} closed\", channel_id);
11926 * [`ChannelManager`] is responsible for sending, forwarding, and receiving payments through its
11927 * channels. A payment is typically initiated from a [BOLT 11] invoice or a [BOLT 12] offer, though
11928 * spontaneous (i.e., keysend) payments are also possible. Incoming payments don't require
11929 * maintaining any additional state as [`ChannelManager`] can reconstruct the [`PaymentPreimage`]
11930 * from the [`PaymentSecret`]. Sending payments, however, require tracking in order to retry failed
11933 * After a payment is initiated, it will appear in [`list_recent_payments`] until a short time
11934 * after either an [`Event::PaymentSent`] or [`Event::PaymentFailed`] is handled. Failed HTLCs
11935 * for a payment will be retried according to the payment's [`Retry`] strategy or until
11936 * [`abandon_payment`] is called.
11938 * ## BOLT 11 Invoices
11940 * The [`lightning-invoice`] crate is useful for creating BOLT 11 invoices. Specifically, use the
11941 * functions in its `utils` module for constructing invoices that are compatible with
11942 * [`ChannelManager`]. These functions serve as a convenience for building invoices with the
11943 * [`PaymentHash`] and [`PaymentSecret`] returned from [`create_inbound_payment`]. To provide your
11944 * own [`PaymentHash`], use [`create_inbound_payment_for_hash`] or the corresponding functions in
11945 * the [`lightning-invoice`] `utils` module.
11947 * [`ChannelManager`] generates an [`Event::PaymentClaimable`] once the full payment has been
11948 * received. Call [`claim_funds`] to release the [`PaymentPreimage`], which in turn will result in
11949 * an [`Event::PaymentClaimed`].
11952 * # use lightning::events::{Event, EventsProvider, PaymentPurpose};
11953 * # use lightning::ln::channelmanager::AChannelManager;
11955 * # fn example<T: AChannelManager>(channel_manager: T) {
11956 * # let channel_manager = channel_manager.get_cm();
11957 * // Or use utils::create_invoice_from_channelmanager
11958 * let known_payment_hash = match channel_manager.create_inbound_payment(
11959 * Some(10_000_000), 3600, None
11961 * Ok((payment_hash, _payment_secret)) => {
11962 * println!(\"Creating inbound payment {}\", payment_hash);
11965 * Err(()) => panic!(\"Error creating inbound payment\"),
11968 * // On the event processing thread
11969 * channel_manager.process_pending_events(&|event| match event {
11970 * Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose {
11971 * PaymentPurpose::Bolt11InvoicePayment { payment_preimage: Some(payment_preimage), .. } => {
11972 * assert_eq!(payment_hash, known_payment_hash);
11973 * println!(\"Claiming payment {}\", payment_hash);
11974 * channel_manager.claim_funds(payment_preimage);
11976 * PaymentPurpose::Bolt11InvoicePayment { payment_preimage: None, .. } => {
11977 * println!(\"Unknown payment hash: {}\", payment_hash);
11979 * PaymentPurpose::SpontaneousPayment(payment_preimage) => {
11980 * assert_ne!(payment_hash, known_payment_hash);
11981 * println!(\"Claiming spontaneous payment {}\", payment_hash);
11982 * channel_manager.claim_funds(payment_preimage);
11987 * Event::PaymentClaimed { payment_hash, amount_msat, .. } => {
11988 * assert_eq!(payment_hash, known_payment_hash);
11989 * println!(\"Claimed {} msats\", amount_msat);
11997 * For paying an invoice, [`lightning-invoice`] provides a `payment` module with convenience
11998 * functions for use with [`send_payment`].
12001 * # use lightning::events::{Event, EventsProvider};
12002 * # use lightning::ln::types::PaymentHash;
12003 * # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, RecipientOnionFields, Retry};
12004 * # use lightning::routing::router::RouteParameters;
12006 * # fn example<T: AChannelManager>(
12007 * # channel_manager: T, payment_hash: PaymentHash, recipient_onion: RecipientOnionFields,
12008 * # route_params: RouteParameters, retry: Retry
12010 * # let channel_manager = channel_manager.get_cm();
12011 * // let (payment_hash, recipient_onion, route_params) =
12012 * // payment::payment_parameters_from_invoice(&invoice);
12013 * let payment_id = PaymentId([42; 32]);
12014 * match channel_manager.send_payment(
12015 * payment_hash, recipient_onion, payment_id, route_params, retry
12017 * Ok(()) => println!(\"Sending payment with hash {}\", payment_hash),
12018 * Err(e) => println!(\"Failed sending payment with hash {}: {:?}\", payment_hash, e),
12021 * let expected_payment_id = payment_id;
12022 * let expected_payment_hash = payment_hash;
12024 * channel_manager.list_recent_payments().iter().find(|details| matches!(
12026 * RecentPaymentDetails::Pending {
12027 * payment_id: expected_payment_id,
12028 * payment_hash: expected_payment_hash,
12034 * // On the event processing thread
12035 * channel_manager.process_pending_events(&|event| match event {
12036 * Event::PaymentSent { payment_hash, .. } => println!(\"Paid {}\", payment_hash),
12037 * Event::PaymentFailed { payment_hash, .. } => println!(\"Failed paying {}\", payment_hash),
12044 * ## BOLT 12 Offers
12046 * The [`offers`] module is useful for creating BOLT 12 offers. An [`Offer`] is a precursor to a
12047 * [`Bolt12Invoice`], which must first be requested by the payer. The interchange of these messages
12048 * as defined in the specification is handled by [`ChannelManager`] and its implementation of
12049 * [`OffersMessageHandler`]. However, this only works with an [`Offer`] created using a builder
12050 * returned by [`create_offer_builder`]. With this approach, BOLT 12 offers and invoices are
12051 * stateless just as BOLT 11 invoices are.
12054 * # use lightning::events::{Event, EventsProvider, PaymentPurpose};
12055 * # use lightning::ln::channelmanager::AChannelManager;
12056 * # use lightning::offers::parse::Bolt12SemanticError;
12058 * # fn example<T: AChannelManager>(channel_manager: T) -> Result<(), Bolt12SemanticError> {
12059 * # let channel_manager = channel_manager.get_cm();
12060 * let offer = channel_manager
12061 * .create_offer_builder()?
12063 * # // Needed for compiling for c_bindings
12064 * # let builder: lightning::offers::offer::OfferBuilder<_, _> = offer.into();
12065 * # let offer = builder
12066 * .description(\"coffee\".to_string())
12067 * .amount_msats(10_000_000)
12069 * let bech32_offer = offer.to_string();
12071 * // On the event processing thread
12072 * channel_manager.process_pending_events(&|event| match event {
12073 * Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose {
12074 * PaymentPurpose::Bolt12OfferPayment { payment_preimage: Some(payment_preimage), .. } => {
12075 * println!(\"Claiming payment {}\", payment_hash);
12076 * channel_manager.claim_funds(payment_preimage);
12078 * PaymentPurpose::Bolt12OfferPayment { payment_preimage: None, .. } => {
12079 * println!(\"Unknown payment hash: {}\", payment_hash);
12084 * Event::PaymentClaimed { payment_hash, amount_msat, .. } => {
12085 * println!(\"Claimed {} msats\", amount_msat);
12094 * Use [`pay_for_offer`] to initiated payment, which sends an [`InvoiceRequest`] for an [`Offer`]
12095 * and pays the [`Bolt12Invoice`] response. In addition to success and failure events,
12096 * [`ChannelManager`] may also generate an [`Event::InvoiceRequestFailed`].
12099 * # use lightning::events::{Event, EventsProvider};
12100 * # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, Retry};
12101 * # use lightning::offers::offer::Offer;
12103 * # fn example<T: AChannelManager>(
12104 * # channel_manager: T, offer: &Offer, quantity: Option<u64>, amount_msats: Option<u64>,
12105 * # payer_note: Option<String>, retry: Retry, max_total_routing_fee_msat: Option<u64>
12107 * # let channel_manager = channel_manager.get_cm();
12108 * let payment_id = PaymentId([42; 32]);
12109 * match channel_manager.pay_for_offer(
12110 * offer, quantity, amount_msats, payer_note, payment_id, retry, max_total_routing_fee_msat
12112 * Ok(()) => println!(\"Requesting invoice for offer\"),
12113 * Err(e) => println!(\"Unable to request invoice for offer: {:?}\", e),
12116 * // First the payment will be waiting on an invoice
12117 * let expected_payment_id = payment_id;
12119 * channel_manager.list_recent_payments().iter().find(|details| matches!(
12121 * RecentPaymentDetails::AwaitingInvoice { payment_id: expected_payment_id }
12125 * // Once the invoice is received, a payment will be sent
12127 * channel_manager.list_recent_payments().iter().find(|details| matches!(
12129 * RecentPaymentDetails::Pending { payment_id: expected_payment_id, .. }
12133 * // On the event processing thread
12134 * channel_manager.process_pending_events(&|event| match event {
12135 * Event::PaymentSent { payment_id: Some(payment_id), .. } => println!(\"Paid {}\", payment_id),
12136 * Event::PaymentFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id),
12137 * Event::InvoiceRequestFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id),
12144 * ## BOLT 12 Refunds
12146 * A [`Refund`] is a request for an invoice to be paid. Like *paying* for an [`Offer`], *creating*
12147 * a [`Refund`] involves maintaining state since it represents a future outbound payment.
12148 * Therefore, use [`create_refund_builder`] when creating one, otherwise [`ChannelManager`] will
12149 * refuse to pay any corresponding [`Bolt12Invoice`] that it receives.
12152 * # use core::time::Duration;
12153 * # use lightning::events::{Event, EventsProvider};
12154 * # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, Retry};
12155 * # use lightning::offers::parse::Bolt12SemanticError;
12157 * # fn example<T: AChannelManager>(
12158 * # channel_manager: T, amount_msats: u64, absolute_expiry: Duration, retry: Retry,
12159 * # max_total_routing_fee_msat: Option<u64>
12160 * # ) -> Result<(), Bolt12SemanticError> {
12161 * # let channel_manager = channel_manager.get_cm();
12162 * let payment_id = PaymentId([42; 32]);
12163 * let refund = channel_manager
12164 * .create_refund_builder(
12165 * amount_msats, absolute_expiry, payment_id, retry, max_total_routing_fee_msat
12168 * # // Needed for compiling for c_bindings
12169 * # let builder: lightning::offers::refund::RefundBuilder<_> = refund.into();
12170 * # let refund = builder
12171 * .description(\"coffee\".to_string())
12172 * .payer_note(\"refund for order 1234\".to_string())
12174 * let bech32_refund = refund.to_string();
12176 * // First the payment will be waiting on an invoice
12177 * let expected_payment_id = payment_id;
12179 * channel_manager.list_recent_payments().iter().find(|details| matches!(
12181 * RecentPaymentDetails::AwaitingInvoice { payment_id: expected_payment_id }
12185 * // Once the invoice is received, a payment will be sent
12187 * channel_manager.list_recent_payments().iter().find(|details| matches!(
12189 * RecentPaymentDetails::Pending { payment_id: expected_payment_id, .. }
12193 * // On the event processing thread
12194 * channel_manager.process_pending_events(&|event| match event {
12195 * Event::PaymentSent { payment_id: Some(payment_id), .. } => println!(\"Paid {}\", payment_id),
12196 * Event::PaymentFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id),
12204 * Use [`request_refund_payment`] to send a [`Bolt12Invoice`] for receiving the refund. Similar to
12205 * *creating* an [`Offer`], this is stateless as it represents an inbound payment.
12208 * # use lightning::events::{Event, EventsProvider, PaymentPurpose};
12209 * # use lightning::ln::channelmanager::AChannelManager;
12210 * # use lightning::offers::refund::Refund;
12212 * # fn example<T: AChannelManager>(channel_manager: T, refund: &Refund) {
12213 * # let channel_manager = channel_manager.get_cm();
12214 * let known_payment_hash = match channel_manager.request_refund_payment(refund) {
12216 * let payment_hash = invoice.payment_hash();
12217 * println!(\"Requesting refund payment {}\", payment_hash);
12220 * Err(e) => panic!(\"Unable to request payment for refund: {:?}\", e),
12223 * // On the event processing thread
12224 * channel_manager.process_pending_events(&|event| match event {
12225 * Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose {
12226 * \tPaymentPurpose::Bolt12RefundPayment { payment_preimage: Some(payment_preimage), .. } => {
12227 * assert_eq!(payment_hash, known_payment_hash);
12228 * println!(\"Claiming payment {}\", payment_hash);
12229 * channel_manager.claim_funds(payment_preimage);
12231 * \tPaymentPurpose::Bolt12RefundPayment { payment_preimage: None, .. } => {
12232 * println!(\"Unknown payment hash: {}\", payment_hash);
12237 * Event::PaymentClaimed { payment_hash, amount_msat, .. } => {
12238 * assert_eq!(payment_hash, known_payment_hash);
12239 * println!(\"Claimed {} msats\", amount_msat);
12249 * Implements [`Writeable`] to write out all channel state to disk. Implies [`peer_disconnected`] for
12250 * all peers during write/read (though does not modify this instance, only the instance being
12251 * serialized). This will result in any channels which have not yet exchanged [`funding_created`] (i.e.,
12252 * called [`funding_transaction_generated`] for outbound channels) being closed.
12254 * Note that you can be a bit lazier about writing out `ChannelManager` than you can be with
12255 * [`ChannelMonitor`]. With [`ChannelMonitor`] you MUST durably write each
12256 * [`ChannelMonitorUpdate`] before returning from
12257 * [`chain::Watch::watch_channel`]/[`update_channel`] or before completing async writes. With
12258 * `ChannelManager`s, writing updates happens out-of-band (and will prevent any other
12259 * `ChannelManager` operations from occurring during the serialization process). If the
12260 * deserialized version is out-of-date compared to the [`ChannelMonitor`] passed by reference to
12261 * [`read`], those channels will be force-closed based on the `ChannelMonitor` state and no funds
12262 * will be lost (modulo on-chain transaction fees).
12264 * Note that the deserializer is only implemented for `(`[`BlockHash`]`, `[`ChannelManager`]`)`, which
12265 * tells you the last block hash which was connected. You should get the best block tip before using the manager.
12266 * See [`chain::Listen`] and [`chain::Confirm`] for more details.
12268 * # `ChannelUpdate` Messages
12270 * Note that `ChannelManager` is responsible for tracking liveness of its channels and generating
12271 * [`ChannelUpdate`] messages informing peers that the channel is temporarily disabled. To avoid
12272 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
12273 * offline for a full minute. In order to track this, you must call
12274 * [`timer_tick_occurred`] roughly once per minute, though it doesn't have to be perfect.
12278 * To avoid trivial DoS issues, `ChannelManager` limits the number of inbound connections and
12279 * inbound channels without confirmed funding transactions. This may result in nodes which we do
12280 * not have a channel with being unable to connect to us or open new channels with us if we have
12281 * many peers with unfunded channels.
12283 * Because it is an indication of trust, inbound channels which we've accepted as 0conf are
12284 * exempted from the count of unfunded channels. Similarly, outbound channels and connections are
12285 * never limited. Please ensure you limit the count of such channels yourself.
12289 * Rather than using a plain `ChannelManager`, it is preferable to use either a [`SimpleArcChannelManager`]
12290 * a [`SimpleRefChannelManager`], for conciseness. See their documentation for more details, but
12291 * essentially you should default to using a [`SimpleRefChannelManager`], and use a
12292 * [`SimpleArcChannelManager`] when you require a `ChannelManager` with a static lifetime, such as when
12293 * you're using lightning-net-tokio.
12295 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
12296 * [`MessageHandler`]: crate::ln::peer_handler::MessageHandler
12297 * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
12298 * [`PeerManager::read_event`]: crate::ln::peer_handler::PeerManager::read_event
12299 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
12300 * [`timer_tick_occurred`]: Self::timer_tick_occurred
12301 * [`get_and_clear_needs_persistence`]: Self::get_and_clear_needs_persistence
12302 * [`Persister`]: crate::util::persist::Persister
12303 * [`KVStore`]: crate::util::persist::KVStore
12304 * [`get_event_or_persistence_needed_future`]: Self::get_event_or_persistence_needed_future
12305 * [`lightning-block-sync`]: https://docs.rs/lightning_block_sync/latest/lightning_block_sync
12306 * [`lightning-transaction-sync`]: https://docs.rs/lightning_transaction_sync/latest/lightning_transaction_sync
12307 * [`lightning-background-processor`]: https://docs.rs/lightning_background_processor/lightning_background_processor
12308 * [`list_channels`]: Self::list_channels
12309 * [`list_usable_channels`]: Self::list_usable_channels
12310 * [`create_channel`]: Self::create_channel
12311 * [`close_channel`]: Self::force_close_broadcasting_latest_txn
12312 * [`force_close_broadcasting_latest_txn`]: Self::force_close_broadcasting_latest_txn
12313 * [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md
12314 * [BOLT 12]: https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md
12315 * [`list_recent_payments`]: Self::list_recent_payments
12316 * [`abandon_payment`]: Self::abandon_payment
12317 * [`lightning-invoice`]: https://docs.rs/lightning_invoice/latest/lightning_invoice
12318 * [`create_inbound_payment`]: Self::create_inbound_payment
12319 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
12320 * [`claim_funds`]: Self::claim_funds
12321 * [`send_payment`]: Self::send_payment
12322 * [`offers`]: crate::offers
12323 * [`create_offer_builder`]: Self::create_offer_builder
12324 * [`pay_for_offer`]: Self::pay_for_offer
12325 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
12326 * [`create_refund_builder`]: Self::create_refund_builder
12327 * [`request_refund_payment`]: Self::request_refund_payment
12328 * [`peer_disconnected`]: msgs::ChannelMessageHandler::peer_disconnected
12329 * [`funding_created`]: msgs::FundingCreated
12330 * [`funding_transaction_generated`]: Self::funding_transaction_generated
12331 * [`BlockHash`]: bitcoin::hash_types::BlockHash
12332 * [`update_channel`]: chain::Watch::update_channel
12333 * [`ChannelUpdate`]: msgs::ChannelUpdate
12334 * [`read`]: ReadableArgs::read
12336 typedef struct MUST_USE_STRUCT LDKChannelManager {
12338 * A pointer to the opaque Rust object.
12339 * Nearly everywhere, inner must be non-null, however in places where
12340 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12342 LDKnativeChannelManager *inner;
12344 * Indicates that this is the only struct which contains the same pointer.
12345 * Rust functions which take ownership of an object provided via an argument require
12346 * this to be true and invalidate the object pointed to by inner.
12349 } LDKChannelManager;
12352 * A tuple of 2 elements. See the individual fields for the types contained.
12354 typedef struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ {
12356 * The element at position 0
12358 struct LDKThirtyTwoBytes a;
12360 * The element at position 1
12362 struct LDKChannelManager b;
12363 } LDKC2Tuple_ThirtyTwoBytesChannelManagerZ;
12366 * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ
12368 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr {
12370 * A pointer to the contents in the success state.
12371 * Reading from this pointer when `result_ok` is not set is undefined.
12373 struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ *result;
12375 * A pointer to the contents in the error state.
12376 * Reading from this pointer when `result_ok` is set is undefined.
12378 struct LDKDecodeError *err;
12379 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr;
12382 * A CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ represents the result of a fallible operation,
12383 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
12384 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12386 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ {
12388 * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ, accessible via either
12389 * `err` or `result` depending on the state of `result_ok`.
12391 union LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr contents;
12393 * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ represents a success state.
12396 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ;
12399 * Options for how to set the max dust exposure allowed on a channel. See
12400 * [`ChannelConfig::max_dust_htlc_exposure`] for details.
12402 typedef enum LDKMaxDustHTLCExposure_Tag {
12404 * This sets a fixed limit on the total dust exposure in millisatoshis. Setting this too low
12405 * may prevent the sending or receipt of low-value HTLCs on high-traffic nodes, however this
12406 * limit is very important to prevent stealing of large amounts of dust HTLCs by miners
12407 * through [fee griefing
12408 * attacks](https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-May/002714.html).
12410 * Note that if the feerate increases significantly, without a manual increase
12411 * to this maximum the channel may be unable to send/receive HTLCs between the maximum dust
12412 * exposure and the new minimum value for HTLCs to be economically viable to claim.
12414 LDKMaxDustHTLCExposure_FixedLimitMsat,
12416 * This sets a multiplier on the [`ConfirmationTarget::OnChainSweep`] feerate (in sats/KW) to
12417 * determine the maximum allowed dust exposure. If this variant is used then the maximum dust
12418 * exposure in millisatoshis is calculated as:
12419 * `feerate_per_kw * value`. For example, with our default value
12420 * `FeeRateMultiplier(10_000)`:
12422 * - For the minimum fee rate of 1 sat/vByte (250 sat/KW, although the minimum
12423 * defaults to 253 sats/KW for rounding, see [`FeeEstimator`]), the max dust exposure would
12424 * be 253 * 10_000 = 2,530,000 msats.
12425 * - For a fee rate of 30 sat/vByte (7500 sat/KW), the max dust exposure would be
12426 * 7500 * 50_000 = 75,000,000 msats (0.00075 BTC).
12428 * Note, if you're using a third-party fee estimator, this may leave you more exposed to a
12429 * fee griefing attack, where your fee estimator may purposely overestimate the fee rate,
12430 * causing you to accept more dust HTLCs than you would otherwise.
12432 * This variant is primarily meant to serve pre-anchor channels, as HTLC fees being included
12433 * on HTLC outputs means your channel may be subject to more dust exposure in the event of
12434 * increases in fee rate.
12436 * # Backwards Compatibility
12437 * This variant only became available in LDK 0.0.116, so if you downgrade to a prior version
12438 * by default this will be set to a [`Self::FixedLimitMsat`] of 5,000,000 msat.
12440 * [`FeeEstimator`]: crate::chain::chaininterface::FeeEstimator
12441 * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep
12443 LDKMaxDustHTLCExposure_FeeRateMultiplier,
12445 * Must be last for serialization purposes
12447 LDKMaxDustHTLCExposure_Sentinel,
12448 } LDKMaxDustHTLCExposure_Tag;
12450 typedef struct MUST_USE_STRUCT LDKMaxDustHTLCExposure {
12451 LDKMaxDustHTLCExposure_Tag tag;
12454 uint64_t fixed_limit_msat;
12457 uint64_t fee_rate_multiplier;
12460 } LDKMaxDustHTLCExposure;
12463 * The contents of CResult_MaxDustHTLCExposureDecodeErrorZ
12465 typedef union LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr {
12467 * A pointer to the contents in the success state.
12468 * Reading from this pointer when `result_ok` is not set is undefined.
12470 struct LDKMaxDustHTLCExposure *result;
12472 * A pointer to the contents in the error state.
12473 * Reading from this pointer when `result_ok` is set is undefined.
12475 struct LDKDecodeError *err;
12476 } LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr;
12479 * A CResult_MaxDustHTLCExposureDecodeErrorZ represents the result of a fallible operation,
12480 * containing a crate::lightning::util::config::MaxDustHTLCExposure on success and a crate::lightning::ln::msgs::DecodeError on failure.
12481 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12483 typedef struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ {
12485 * The contents of this CResult_MaxDustHTLCExposureDecodeErrorZ, accessible via either
12486 * `err` or `result` depending on the state of `result_ok`.
12488 union LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr contents;
12490 * Whether this CResult_MaxDustHTLCExposureDecodeErrorZ represents a success state.
12493 } LDKCResult_MaxDustHTLCExposureDecodeErrorZ;
12498 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
12499 * with our counterparty.
12501 typedef struct MUST_USE_STRUCT LDKChannelConfig {
12503 * A pointer to the opaque Rust object.
12504 * Nearly everywhere, inner must be non-null, however in places where
12505 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12507 LDKnativeChannelConfig *inner;
12509 * Indicates that this is the only struct which contains the same pointer.
12510 * Rust functions which take ownership of an object provided via an argument require
12511 * this to be true and invalidate the object pointed to by inner.
12514 } LDKChannelConfig;
12517 * The contents of CResult_ChannelConfigDecodeErrorZ
12519 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
12521 * A pointer to the contents in the success state.
12522 * Reading from this pointer when `result_ok` is not set is undefined.
12524 struct LDKChannelConfig *result;
12526 * A pointer to the contents in the error state.
12527 * Reading from this pointer when `result_ok` is set is undefined.
12529 struct LDKDecodeError *err;
12530 } LDKCResult_ChannelConfigDecodeErrorZPtr;
12533 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
12534 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
12535 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12537 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
12539 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
12540 * `err` or `result` depending on the state of `result_ok`.
12542 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
12544 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
12547 } LDKCResult_ChannelConfigDecodeErrorZ;
12550 * An enum which can either contain a crate::lightning::util::config::MaxDustHTLCExposure or not
12552 typedef enum LDKCOption_MaxDustHTLCExposureZ_Tag {
12554 * When we're in this state, this COption_MaxDustHTLCExposureZ contains a crate::lightning::util::config::MaxDustHTLCExposure
12556 LDKCOption_MaxDustHTLCExposureZ_Some,
12558 * When we're in this state, this COption_MaxDustHTLCExposureZ contains nothing
12560 LDKCOption_MaxDustHTLCExposureZ_None,
12562 * Must be last for serialization purposes
12564 LDKCOption_MaxDustHTLCExposureZ_Sentinel,
12565 } LDKCOption_MaxDustHTLCExposureZ_Tag;
12567 typedef struct LDKCOption_MaxDustHTLCExposureZ {
12568 LDKCOption_MaxDustHTLCExposureZ_Tag tag;
12571 struct LDKMaxDustHTLCExposure some;
12574 } LDKCOption_MaxDustHTLCExposureZ;
12577 * An enum which can either contain a crate::lightning::util::errors::APIError or not
12579 typedef enum LDKCOption_APIErrorZ_Tag {
12581 * When we're in this state, this COption_APIErrorZ contains a crate::lightning::util::errors::APIError
12583 LDKCOption_APIErrorZ_Some,
12585 * When we're in this state, this COption_APIErrorZ contains nothing
12587 LDKCOption_APIErrorZ_None,
12589 * Must be last for serialization purposes
12591 LDKCOption_APIErrorZ_Sentinel,
12592 } LDKCOption_APIErrorZ_Tag;
12594 typedef struct LDKCOption_APIErrorZ {
12595 LDKCOption_APIErrorZ_Tag tag;
12598 struct LDKAPIError some;
12601 } LDKCOption_APIErrorZ;
12604 * The contents of CResult_COption_APIErrorZDecodeErrorZ
12606 typedef union LDKCResult_COption_APIErrorZDecodeErrorZPtr {
12608 * A pointer to the contents in the success state.
12609 * Reading from this pointer when `result_ok` is not set is undefined.
12611 struct LDKCOption_APIErrorZ *result;
12613 * A pointer to the contents in the error state.
12614 * Reading from this pointer when `result_ok` is set is undefined.
12616 struct LDKDecodeError *err;
12617 } LDKCResult_COption_APIErrorZDecodeErrorZPtr;
12620 * A CResult_COption_APIErrorZDecodeErrorZ represents the result of a fallible operation,
12621 * containing a crate::c_types::derived::COption_APIErrorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
12622 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12624 typedef struct LDKCResult_COption_APIErrorZDecodeErrorZ {
12626 * The contents of this CResult_COption_APIErrorZDecodeErrorZ, accessible via either
12627 * `err` or `result` depending on the state of `result_ok`.
12629 union LDKCResult_COption_APIErrorZDecodeErrorZPtr contents;
12631 * Whether this CResult_COption_APIErrorZDecodeErrorZ represents a success state.
12634 } LDKCResult_COption_APIErrorZDecodeErrorZ;
12637 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
12639 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
12641 * A pointer to the contents in the success state.
12642 * Reading from this pointer when `result_ok` is not set is undefined.
12644 struct LDKChannelMonitorUpdate *result;
12646 * A pointer to the contents in the error state.
12647 * Reading from this pointer when `result_ok` is set is undefined.
12649 struct LDKDecodeError *err;
12650 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
12653 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
12654 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
12655 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12657 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
12659 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
12660 * `err` or `result` depending on the state of `result_ok`.
12662 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
12664 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
12667 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
12670 * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
12672 typedef enum LDKCOption_MonitorEventZ_Tag {
12674 * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
12676 LDKCOption_MonitorEventZ_Some,
12678 * When we're in this state, this COption_MonitorEventZ contains nothing
12680 LDKCOption_MonitorEventZ_None,
12682 * Must be last for serialization purposes
12684 LDKCOption_MonitorEventZ_Sentinel,
12685 } LDKCOption_MonitorEventZ_Tag;
12687 typedef struct LDKCOption_MonitorEventZ {
12688 LDKCOption_MonitorEventZ_Tag tag;
12691 struct LDKMonitorEvent some;
12694 } LDKCOption_MonitorEventZ;
12697 * The contents of CResult_COption_MonitorEventZDecodeErrorZ
12699 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
12701 * A pointer to the contents in the success state.
12702 * Reading from this pointer when `result_ok` is not set is undefined.
12704 struct LDKCOption_MonitorEventZ *result;
12706 * A pointer to the contents in the error state.
12707 * Reading from this pointer when `result_ok` is set is undefined.
12709 struct LDKDecodeError *err;
12710 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
12713 * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
12714 * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
12715 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12717 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
12719 * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
12720 * `err` or `result` depending on the state of `result_ok`.
12722 union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
12724 * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
12727 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
12730 * The contents of CResult_HTLCUpdateDecodeErrorZ
12732 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
12734 * A pointer to the contents in the success state.
12735 * Reading from this pointer when `result_ok` is not set is undefined.
12737 struct LDKHTLCUpdate *result;
12739 * A pointer to the contents in the error state.
12740 * Reading from this pointer when `result_ok` is set is undefined.
12742 struct LDKDecodeError *err;
12743 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
12746 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
12747 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
12748 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12750 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
12752 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
12753 * `err` or `result` depending on the state of `result_ok`.
12755 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
12757 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
12760 } LDKCResult_HTLCUpdateDecodeErrorZ;
12763 * A tuple of 2 elements. See the individual fields for the types contained.
12765 typedef struct LDKC2Tuple_OutPointCVec_u8ZZ {
12767 * The element at position 0
12769 struct LDKOutPoint a;
12771 * The element at position 1
12773 struct LDKCVec_u8Z b;
12774 } LDKC2Tuple_OutPointCVec_u8ZZ;
12777 * A tuple of 2 elements. See the individual fields for the types contained.
12779 typedef struct LDKC2Tuple_u32CVec_u8ZZ {
12781 * The element at position 0
12785 * The element at position 1
12787 struct LDKCVec_u8Z b;
12788 } LDKC2Tuple_u32CVec_u8ZZ;
12791 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32CVec_u8ZZs of arbitrary size.
12792 * This corresponds to std::vector in C++
12794 typedef struct LDKCVec_C2Tuple_u32CVec_u8ZZZ {
12796 * The elements in the array.
12797 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12799 struct LDKC2Tuple_u32CVec_u8ZZ *data;
12801 * The number of elements pointed to by `data`.
12804 } LDKCVec_C2Tuple_u32CVec_u8ZZZ;
12807 * A tuple of 2 elements. See the individual fields for the types contained.
12809 typedef struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ {
12811 * The element at position 0
12813 struct LDKThirtyTwoBytes a;
12815 * The element at position 1
12817 struct LDKCVec_C2Tuple_u32CVec_u8ZZZ b;
12818 } LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ;
12821 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZs of arbitrary size.
12822 * This corresponds to std::vector in C++
12824 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ {
12826 * The elements in the array.
12827 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12829 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *data;
12831 * The number of elements pointed to by `data`.
12834 } LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ;
12837 * A dynamically-allocated array of crate::lightning::ln::chan_utils::CommitmentTransactions of arbitrary size.
12838 * This corresponds to std::vector in C++
12840 typedef struct LDKCVec_CommitmentTransactionZ {
12842 * The elements in the array.
12843 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12845 struct LDKCommitmentTransaction *data;
12847 * The number of elements pointed to by `data`.
12850 } LDKCVec_CommitmentTransactionZ;
12853 * A tuple of 2 elements. See the individual fields for the types contained.
12855 typedef struct LDKC2Tuple_u32TxOutZ {
12857 * The element at position 0
12861 * The element at position 1
12864 } LDKC2Tuple_u32TxOutZ;
12867 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
12868 * This corresponds to std::vector in C++
12870 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
12872 * The elements in the array.
12873 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12875 struct LDKC2Tuple_u32TxOutZ *data;
12877 * The number of elements pointed to by `data`.
12880 } LDKCVec_C2Tuple_u32TxOutZZ;
12883 * A tuple of 2 elements. See the individual fields for the types contained.
12885 typedef struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ {
12887 * The element at position 0
12889 struct LDKThirtyTwoBytes a;
12891 * The element at position 1
12893 struct LDKCVec_C2Tuple_u32TxOutZZ b;
12894 } LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ;
12897 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
12898 * This corresponds to std::vector in C++
12900 typedef struct LDKCVec_TransactionOutputsZ {
12902 * The elements in the array.
12903 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12905 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ *data;
12907 * The number of elements pointed to by `data`.
12910 } LDKCVec_TransactionOutputsZ;
12913 * Details about the balance(s) available for spending once the channel appears on chain.
12915 * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
12918 typedef enum LDKBalance_Tag {
12920 * The channel is not yet closed (or the commitment or closing transaction has not yet
12921 * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
12922 * force-closed now.
12924 LDKBalance_ClaimableOnChannelClose,
12926 * The channel has been closed, and the given balance is ours but awaiting confirmations until
12927 * we consider it spendable.
12929 LDKBalance_ClaimableAwaitingConfirmations,
12931 * The channel has been closed, and the given balance should be ours but awaiting spending
12932 * transaction confirmation. If the spending transaction does not confirm in time, it is
12933 * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
12935 * Once the spending transaction confirms, before it has reached enough confirmations to be
12936 * considered safe from chain reorganizations, the balance will instead be provided via
12937 * [`Balance::ClaimableAwaitingConfirmations`].
12939 LDKBalance_ContentiousClaimable,
12941 * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
12942 * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
12943 * likely to be claimed by our counterparty before we do.
12945 LDKBalance_MaybeTimeoutClaimableHTLC,
12947 * HTLCs which we received from our counterparty which are claimable with a preimage which we
12948 * do not currently have. This will only be claimable if we receive the preimage from the node
12949 * to which we forwarded this HTLC before the timeout.
12951 LDKBalance_MaybePreimageClaimableHTLC,
12953 * The channel has been closed, and our counterparty broadcasted a revoked commitment
12956 * Thus, we're able to claim all outputs in the commitment transaction, one of which has the
12957 * following amount.
12959 LDKBalance_CounterpartyRevokedOutputClaimable,
12961 * Must be last for serialization purposes
12963 LDKBalance_Sentinel,
12966 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
12968 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
12969 * required to do so.
12971 uint64_t amount_satoshis;
12972 } LDKBalance_LDKClaimableOnChannelClose_Body;
12974 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
12976 * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
12977 * were spent in broadcasting the transaction.
12979 uint64_t amount_satoshis;
12981 * The height at which an [`Event::SpendableOutputs`] event will be generated for this
12984 uint32_t confirmation_height;
12985 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
12987 typedef struct LDKBalance_LDKContentiousClaimable_Body {
12989 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
12990 * required to do so.
12992 uint64_t amount_satoshis;
12994 * The height at which the counterparty may be able to claim the balance if we have not
12997 uint32_t timeout_height;
12999 * The payment hash that locks this HTLC.
13001 struct LDKThirtyTwoBytes payment_hash;
13003 * The preimage that can be used to claim this HTLC.
13005 struct LDKThirtyTwoBytes payment_preimage;
13006 } LDKBalance_LDKContentiousClaimable_Body;
13008 typedef struct LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body {
13010 * The amount potentially available to claim, in satoshis, excluding the on-chain fees
13011 * which will be required to do so.
13013 uint64_t amount_satoshis;
13015 * The height at which we will be able to claim the balance if our counterparty has not
13018 uint32_t claimable_height;
13020 * The payment hash whose preimage our counterparty needs to claim this HTLC.
13022 struct LDKThirtyTwoBytes payment_hash;
13023 } LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body;
13025 typedef struct LDKBalance_LDKMaybePreimageClaimableHTLC_Body {
13027 * The amount potentially available to claim, in satoshis, excluding the on-chain fees
13028 * which will be required to do so.
13030 uint64_t amount_satoshis;
13032 * The height at which our counterparty will be able to claim the balance if we have not
13033 * yet received the preimage and claimed it ourselves.
13035 uint32_t expiry_height;
13037 * The payment hash whose preimage we need to claim this HTLC.
13039 struct LDKThirtyTwoBytes payment_hash;
13040 } LDKBalance_LDKMaybePreimageClaimableHTLC_Body;
13042 typedef struct LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body {
13044 * The amount, in satoshis, of the output which we can claim.
13046 * Note that for outputs from HTLC balances this may be excluding some on-chain fees that
13047 * were already spent.
13049 uint64_t amount_satoshis;
13050 } LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body;
13052 typedef struct MUST_USE_STRUCT LDKBalance {
13053 LDKBalance_Tag tag;
13055 LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
13056 LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
13057 LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
13058 LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body maybe_timeout_claimable_htlc;
13059 LDKBalance_LDKMaybePreimageClaimableHTLC_Body maybe_preimage_claimable_htlc;
13060 LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body counterparty_revoked_output_claimable;
13065 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
13066 * This corresponds to std::vector in C++
13068 typedef struct LDKCVec_BalanceZ {
13070 * The elements in the array.
13071 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13073 struct LDKBalance *data;
13075 * The number of elements pointed to by `data`.
13078 } LDKCVec_BalanceZ;
13081 * A tuple of 2 elements. See the individual fields for the types contained.
13083 typedef struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ {
13085 * The element at position 0
13087 struct LDKThirtyTwoBytes a;
13089 * The element at position 1
13091 struct LDKChannelMonitor b;
13092 } LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ;
13095 * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ
13097 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr {
13099 * A pointer to the contents in the success state.
13100 * Reading from this pointer when `result_ok` is not set is undefined.
13102 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *result;
13104 * A pointer to the contents in the error state.
13105 * Reading from this pointer when `result_ok` is set is undefined.
13107 struct LDKDecodeError *err;
13108 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr;
13111 * A CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
13112 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
13113 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13115 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ {
13117 * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ, accessible via either
13118 * `err` or `result` depending on the state of `result_ok`.
13120 union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr contents;
13122 * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ represents a success state.
13125 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ;
13128 * Defines a type identifier for sending messages over the wire.
13130 * Messages implementing this trait specify a type and must be [`Writeable`].
13132 typedef struct LDKType {
13134 * An opaque pointer which is passed to your function implementations as an argument.
13135 * This has no meaning in the LDK, and can be NULL or any other value.
13139 * Returns the type identifying the message payload.
13141 uint16_t (*type_id)(const void *this_arg);
13143 * Return a human-readable "debug" string describing this object
13145 struct LDKStr (*debug_str)(const void *this_arg);
13147 * Serialize the object into a byte array
13149 struct LDKCVec_u8Z (*write)(const void *this_arg);
13151 * Called, if set, after this Type has been cloned into a duplicate object.
13152 * The new Type is provided, and should be mutated as needed to perform a
13153 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
13155 void (*cloned)(struct LDKType *NONNULL_PTR new_Type);
13157 * Frees any resources associated with this object given its this_arg pointer.
13158 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13160 void (*free)(void *this_arg);
13164 * A tuple of 2 elements. See the individual fields for the types contained.
13166 typedef struct LDKC2Tuple_PublicKeyTypeZ {
13168 * The element at position 0
13170 struct LDKPublicKey a;
13172 * The element at position 1
13175 } LDKC2Tuple_PublicKeyTypeZ;
13178 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
13179 * This corresponds to std::vector in C++
13181 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
13183 * The elements in the array.
13184 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13186 struct LDKC2Tuple_PublicKeyTypeZ *data;
13188 * The number of elements pointed to by `data`.
13191 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
13194 * A tuple of 2 elements. See the individual fields for the types contained.
13196 typedef struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ {
13198 * The element at position 0
13200 struct LDKPublicKey a;
13202 * The element at position 1
13204 struct LDKCVec_SocketAddressZ b;
13205 } LDKC2Tuple_PublicKeyCVec_SocketAddressZZ;
13208 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyCVec_SocketAddressZZs of arbitrary size.
13209 * This corresponds to std::vector in C++
13211 typedef struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ {
13213 * The elements in the array.
13214 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13216 struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *data;
13218 * The number of elements pointed to by `data`.
13221 } LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ;
13224 * The contents of an onion message.
13226 typedef struct LDKOnionMessageContents {
13228 * An opaque pointer which is passed to your function implementations as an argument.
13229 * This has no meaning in the LDK, and can be NULL or any other value.
13233 * Returns the TLV type identifying the message contents. MUST be >= 64.
13235 uint64_t (*tlv_type)(const void *this_arg);
13237 * Serialize the object into a byte array
13239 struct LDKCVec_u8Z (*write)(const void *this_arg);
13241 * Return a human-readable "debug" string describing this object
13243 struct LDKStr (*debug_str)(const void *this_arg);
13245 * Called, if set, after this OnionMessageContents has been cloned into a duplicate object.
13246 * The new OnionMessageContents is provided, and should be mutated as needed to perform a
13247 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
13249 void (*cloned)(struct LDKOnionMessageContents *NONNULL_PTR new_OnionMessageContents);
13251 * Frees any resources associated with this object given its this_arg pointer.
13252 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13254 void (*free)(void *this_arg);
13255 } LDKOnionMessageContents;
13258 * An enum which can either contain a crate::lightning::onion_message::packet::OnionMessageContents or not
13260 typedef enum LDKCOption_OnionMessageContentsZ_Tag {
13262 * When we're in this state, this COption_OnionMessageContentsZ contains a crate::lightning::onion_message::packet::OnionMessageContents
13264 LDKCOption_OnionMessageContentsZ_Some,
13266 * When we're in this state, this COption_OnionMessageContentsZ contains nothing
13268 LDKCOption_OnionMessageContentsZ_None,
13270 * Must be last for serialization purposes
13272 LDKCOption_OnionMessageContentsZ_Sentinel,
13273 } LDKCOption_OnionMessageContentsZ_Tag;
13275 typedef struct LDKCOption_OnionMessageContentsZ {
13276 LDKCOption_OnionMessageContentsZ_Tag tag;
13279 struct LDKOnionMessageContents some;
13282 } LDKCOption_OnionMessageContentsZ;
13285 * The contents of CResult_COption_OnionMessageContentsZDecodeErrorZ
13287 typedef union LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr {
13289 * A pointer to the contents in the success state.
13290 * Reading from this pointer when `result_ok` is not set is undefined.
13292 struct LDKCOption_OnionMessageContentsZ *result;
13294 * A pointer to the contents in the error state.
13295 * Reading from this pointer when `result_ok` is set is undefined.
13297 struct LDKDecodeError *err;
13298 } LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr;
13301 * A CResult_COption_OnionMessageContentsZDecodeErrorZ represents the result of a fallible operation,
13302 * containing a crate::c_types::derived::COption_OnionMessageContentsZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
13303 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13305 typedef struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ {
13307 * The contents of this CResult_COption_OnionMessageContentsZDecodeErrorZ, accessible via either
13308 * `err` or `result` depending on the state of `result_ok`.
13310 union LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr contents;
13312 * Whether this CResult_COption_OnionMessageContentsZDecodeErrorZ represents a success state.
13315 } LDKCResult_COption_OnionMessageContentsZDecodeErrorZ;
13318 * A tuple of 3 elements. See the individual fields for the types contained.
13320 typedef struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ {
13322 * The element at position 0
13324 struct LDKOnionMessageContents a;
13326 * The element at position 1
13328 struct LDKDestination b;
13330 * The element at position 2
13332 struct LDKBlindedPath c;
13333 } LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ;
13336 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OnionMessageContentsDestinationBlindedPathZs of arbitrary size.
13337 * This corresponds to std::vector in C++
13339 typedef struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ {
13341 * The elements in the array.
13342 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13344 struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *data;
13346 * The number of elements pointed to by `data`.
13349 } LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ;
13352 * An enum which can either contain a crate::lightning::ln::wire::Type or not
13354 typedef enum LDKCOption_TypeZ_Tag {
13356 * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
13358 LDKCOption_TypeZ_Some,
13360 * When we're in this state, this COption_TypeZ contains nothing
13362 LDKCOption_TypeZ_None,
13364 * Must be last for serialization purposes
13366 LDKCOption_TypeZ_Sentinel,
13367 } LDKCOption_TypeZ_Tag;
13369 typedef struct LDKCOption_TypeZ {
13370 LDKCOption_TypeZ_Tag tag;
13373 struct LDKType some;
13376 } LDKCOption_TypeZ;
13379 * The contents of CResult_COption_TypeZDecodeErrorZ
13381 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
13383 * A pointer to the contents in the success state.
13384 * Reading from this pointer when `result_ok` is not set is undefined.
13386 struct LDKCOption_TypeZ *result;
13388 * A pointer to the contents in the error state.
13389 * Reading from this pointer when `result_ok` is set is undefined.
13391 struct LDKDecodeError *err;
13392 } LDKCResult_COption_TypeZDecodeErrorZPtr;
13395 * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
13396 * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
13397 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13399 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
13401 * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
13402 * `err` or `result` depending on the state of `result_ok`.
13404 union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
13406 * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
13409 } LDKCResult_COption_TypeZDecodeErrorZ;
13412 * An enum which can either contain a crate::lightning::ln::msgs::SocketAddress or not
13414 typedef enum LDKCOption_SocketAddressZ_Tag {
13416 * When we're in this state, this COption_SocketAddressZ contains a crate::lightning::ln::msgs::SocketAddress
13418 LDKCOption_SocketAddressZ_Some,
13420 * When we're in this state, this COption_SocketAddressZ contains nothing
13422 LDKCOption_SocketAddressZ_None,
13424 * Must be last for serialization purposes
13426 LDKCOption_SocketAddressZ_Sentinel,
13427 } LDKCOption_SocketAddressZ_Tag;
13429 typedef struct LDKCOption_SocketAddressZ {
13430 LDKCOption_SocketAddressZ_Tag tag;
13433 struct LDKSocketAddress some;
13436 } LDKCOption_SocketAddressZ;
13441 * Details of a connected peer as returned by [`PeerManager::list_peers`].
13443 typedef struct MUST_USE_STRUCT LDKPeerDetails {
13445 * A pointer to the opaque Rust object.
13446 * Nearly everywhere, inner must be non-null, however in places where
13447 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13449 LDKnativePeerDetails *inner;
13451 * Indicates that this is the only struct which contains the same pointer.
13452 * Rust functions which take ownership of an object provided via an argument require
13453 * this to be true and invalidate the object pointed to by inner.
13459 * A dynamically-allocated array of crate::lightning::ln::peer_handler::PeerDetailss of arbitrary size.
13460 * This corresponds to std::vector in C++
13462 typedef struct LDKCVec_PeerDetailsZ {
13464 * The elements in the array.
13465 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13467 struct LDKPeerDetails *data;
13469 * The number of elements pointed to by `data`.
13472 } LDKCVec_PeerDetailsZ;
13477 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
13478 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
13481 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
13483 * A pointer to the opaque Rust object.
13484 * Nearly everywhere, inner must be non-null, however in places where
13485 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13487 LDKnativePeerHandleError *inner;
13489 * Indicates that this is the only struct which contains the same pointer.
13490 * Rust functions which take ownership of an object provided via an argument require
13491 * this to be true and invalidate the object pointed to by inner.
13494 } LDKPeerHandleError;
13497 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
13499 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
13501 * A pointer to the contents in the success state.
13502 * Reading from this pointer when `result_ok` is not set is undefined.
13504 struct LDKCVec_u8Z *result;
13506 * A pointer to the contents in the error state.
13507 * Reading from this pointer when `result_ok` is set is undefined.
13509 struct LDKPeerHandleError *err;
13510 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
13513 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
13514 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
13515 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13517 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
13519 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
13520 * `err` or `result` depending on the state of `result_ok`.
13522 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
13524 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
13527 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
13530 * The contents of CResult_NonePeerHandleErrorZ
13532 typedef union LDKCResult_NonePeerHandleErrorZPtr {
13534 * Note that this value is always NULL, as there are no contents in the OK variant
13538 * A pointer to the contents in the error state.
13539 * Reading from this pointer when `result_ok` is set is undefined.
13541 struct LDKPeerHandleError *err;
13542 } LDKCResult_NonePeerHandleErrorZPtr;
13545 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
13546 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
13547 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13549 typedef struct LDKCResult_NonePeerHandleErrorZ {
13551 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
13552 * `err` or `result` depending on the state of `result_ok`.
13554 union LDKCResult_NonePeerHandleErrorZPtr contents;
13556 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
13559 } LDKCResult_NonePeerHandleErrorZ;
13562 * The contents of CResult_boolPeerHandleErrorZ
13564 typedef union LDKCResult_boolPeerHandleErrorZPtr {
13566 * A pointer to the contents in the success state.
13567 * Reading from this pointer when `result_ok` is not set is undefined.
13571 * A pointer to the contents in the error state.
13572 * Reading from this pointer when `result_ok` is set is undefined.
13574 struct LDKPeerHandleError *err;
13575 } LDKCResult_boolPeerHandleErrorZPtr;
13578 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
13579 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
13580 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13582 typedef struct LDKCResult_boolPeerHandleErrorZ {
13584 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
13585 * `err` or `result` depending on the state of `result_ok`.
13587 union LDKCResult_boolPeerHandleErrorZPtr contents;
13589 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
13592 } LDKCResult_boolPeerHandleErrorZ;
13595 * All-encompassing standard error type that processing can return
13597 typedef enum LDKGraphSyncError_Tag {
13599 * Error trying to read the update data, typically due to an erroneous data length indication
13600 * that is greater than the actual amount of data provided
13602 LDKGraphSyncError_DecodeError,
13604 * Error applying the patch to the network graph, usually the result of updates that are too
13605 * old or missing prerequisite data to the application of updates out of order
13607 LDKGraphSyncError_LightningError,
13609 * Must be last for serialization purposes
13611 LDKGraphSyncError_Sentinel,
13612 } LDKGraphSyncError_Tag;
13614 typedef struct MUST_USE_STRUCT LDKGraphSyncError {
13615 LDKGraphSyncError_Tag tag;
13618 struct LDKDecodeError decode_error;
13621 struct LDKLightningError lightning_error;
13624 } LDKGraphSyncError;
13627 * The contents of CResult_u32GraphSyncErrorZ
13629 typedef union LDKCResult_u32GraphSyncErrorZPtr {
13631 * A pointer to the contents in the success state.
13632 * Reading from this pointer when `result_ok` is not set is undefined.
13636 * A pointer to the contents in the error state.
13637 * Reading from this pointer when `result_ok` is set is undefined.
13639 struct LDKGraphSyncError *err;
13640 } LDKCResult_u32GraphSyncErrorZPtr;
13643 * A CResult_u32GraphSyncErrorZ represents the result of a fallible operation,
13644 * containing a u32 on success and a crate::lightning_rapid_gossip_sync::GraphSyncError on failure.
13645 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13647 typedef struct LDKCResult_u32GraphSyncErrorZ {
13649 * The contents of this CResult_u32GraphSyncErrorZ, accessible via either
13650 * `err` or `result` depending on the state of `result_ok`.
13652 union LDKCResult_u32GraphSyncErrorZPtr contents;
13654 * Whether this CResult_u32GraphSyncErrorZ represents a success state.
13657 } LDKCResult_u32GraphSyncErrorZ;
13660 * The contents of CResult_CVec_u8ZIOErrorZ
13662 typedef union LDKCResult_CVec_u8ZIOErrorZPtr {
13664 * A pointer to the contents in the success state.
13665 * Reading from this pointer when `result_ok` is not set is undefined.
13667 struct LDKCVec_u8Z *result;
13669 * A pointer to the contents in the error state.
13670 * Reading from this pointer when `result_ok` is set is undefined.
13672 enum LDKIOError *err;
13673 } LDKCResult_CVec_u8ZIOErrorZPtr;
13676 * A CResult_CVec_u8ZIOErrorZ represents the result of a fallible operation,
13677 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::c_types::IOError on failure.
13678 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13680 typedef struct LDKCResult_CVec_u8ZIOErrorZ {
13682 * The contents of this CResult_CVec_u8ZIOErrorZ, accessible via either
13683 * `err` or `result` depending on the state of `result_ok`.
13685 union LDKCResult_CVec_u8ZIOErrorZPtr contents;
13687 * Whether this CResult_CVec_u8ZIOErrorZ represents a success state.
13690 } LDKCResult_CVec_u8ZIOErrorZ;
13693 * A dynamically-allocated array of crate::c_types::Strs of arbitrary size.
13694 * This corresponds to std::vector in C++
13696 typedef struct LDKCVec_StrZ {
13698 * The elements in the array.
13699 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13701 struct LDKStr *data;
13703 * The number of elements pointed to by `data`.
13709 * The contents of CResult_CVec_StrZIOErrorZ
13711 typedef union LDKCResult_CVec_StrZIOErrorZPtr {
13713 * A pointer to the contents in the success state.
13714 * Reading from this pointer when `result_ok` is not set is undefined.
13716 struct LDKCVec_StrZ *result;
13718 * A pointer to the contents in the error state.
13719 * Reading from this pointer when `result_ok` is set is undefined.
13721 enum LDKIOError *err;
13722 } LDKCResult_CVec_StrZIOErrorZPtr;
13725 * A CResult_CVec_StrZIOErrorZ represents the result of a fallible operation,
13726 * containing a crate::c_types::derived::CVec_StrZ on success and a crate::c_types::IOError on failure.
13727 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13729 typedef struct LDKCResult_CVec_StrZIOErrorZ {
13731 * The contents of this CResult_CVec_StrZIOErrorZ, accessible via either
13732 * `err` or `result` depending on the state of `result_ok`.
13734 union LDKCResult_CVec_StrZIOErrorZPtr contents;
13736 * Whether this CResult_CVec_StrZIOErrorZ represents a success state.
13739 } LDKCResult_CVec_StrZIOErrorZ;
13742 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZs of arbitrary size.
13743 * This corresponds to std::vector in C++
13745 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ {
13747 * The elements in the array.
13748 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13750 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *data;
13752 * The number of elements pointed to by `data`.
13755 } LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ;
13758 * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ
13760 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr {
13762 * A pointer to the contents in the success state.
13763 * Reading from this pointer when `result_ok` is not set is undefined.
13765 struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ *result;
13767 * A pointer to the contents in the error state.
13768 * Reading from this pointer when `result_ok` is set is undefined.
13770 enum LDKIOError *err;
13771 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr;
13774 * A CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ represents the result of a fallible operation,
13775 * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ on success and a crate::c_types::IOError on failure.
13776 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13778 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ {
13780 * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ, accessible via either
13781 * `err` or `result` depending on the state of `result_ok`.
13783 union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr contents;
13785 * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ represents a success state.
13788 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ;
13791 * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ
13793 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr {
13795 * A pointer to the contents in the success state.
13796 * Reading from this pointer when `result_ok` is not set is undefined.
13798 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *result;
13800 * A pointer to the contents in the error state.
13801 * Reading from this pointer when `result_ok` is set is undefined.
13803 enum LDKIOError *err;
13804 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr;
13807 * A CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ represents the result of a fallible operation,
13808 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZ on success and a crate::c_types::IOError on failure.
13809 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13811 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ {
13813 * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ, accessible via either
13814 * `err` or `result` depending on the state of `result_ok`.
13816 union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr contents;
13818 * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ represents a success state.
13821 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ;
13824 * The contents of CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ
13826 typedef union LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZPtr {
13828 * A pointer to the contents in the success state.
13829 * Reading from this pointer when `result_ok` is not set is undefined.
13831 struct LDKUnsignedInvoiceRequest *result;
13833 * A pointer to the contents in the error state.
13834 * Reading from this pointer when `result_ok` is set is undefined.
13836 enum LDKBolt12SemanticError *err;
13837 } LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZPtr;
13840 * A CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ represents the result of a fallible operation,
13841 * containing a crate::lightning::offers::invoice_request::UnsignedInvoiceRequest on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
13842 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13844 typedef struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ {
13846 * The contents of this CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ, accessible via either
13847 * `err` or `result` depending on the state of `result_ok`.
13849 union LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZPtr contents;
13851 * Whether this CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ represents a success state.
13854 } LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ;
13857 * The contents of CResult_InvoiceRequestBolt12SemanticErrorZ
13859 typedef union LDKCResult_InvoiceRequestBolt12SemanticErrorZPtr {
13861 * A pointer to the contents in the success state.
13862 * Reading from this pointer when `result_ok` is not set is undefined.
13864 struct LDKInvoiceRequest *result;
13866 * A pointer to the contents in the error state.
13867 * Reading from this pointer when `result_ok` is set is undefined.
13869 enum LDKBolt12SemanticError *err;
13870 } LDKCResult_InvoiceRequestBolt12SemanticErrorZPtr;
13873 * A CResult_InvoiceRequestBolt12SemanticErrorZ represents the result of a fallible operation,
13874 * containing a crate::lightning::offers::invoice_request::InvoiceRequest on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
13875 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13877 typedef struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ {
13879 * The contents of this CResult_InvoiceRequestBolt12SemanticErrorZ, accessible via either
13880 * `err` or `result` depending on the state of `result_ok`.
13882 union LDKCResult_InvoiceRequestBolt12SemanticErrorZPtr contents;
13884 * Whether this CResult_InvoiceRequestBolt12SemanticErrorZ represents a success state.
13887 } LDKCResult_InvoiceRequestBolt12SemanticErrorZ;
13890 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
13892 typedef struct LDKSecretKey {
13894 * The bytes of the secret key
13900 * An enum which can either contain a crate::c_types::SecretKey or not
13902 typedef enum LDKCOption_SecretKeyZ_Tag {
13904 * When we're in this state, this COption_SecretKeyZ contains a crate::c_types::SecretKey
13906 LDKCOption_SecretKeyZ_Some,
13908 * When we're in this state, this COption_SecretKeyZ contains nothing
13910 LDKCOption_SecretKeyZ_None,
13912 * Must be last for serialization purposes
13914 LDKCOption_SecretKeyZ_Sentinel,
13915 } LDKCOption_SecretKeyZ_Tag;
13917 typedef struct LDKCOption_SecretKeyZ {
13918 LDKCOption_SecretKeyZ_Tag tag;
13921 struct LDKSecretKey some;
13924 } LDKCOption_SecretKeyZ;
13929 * Builds a [`Bolt12Invoice`] from either:
13930 * - an [`InvoiceRequest`] for the \"offer to be paid\" flow or
13931 * - a [`Refund`] for the \"offer for money\" flow.
13933 * See [module-level documentation] for usage.
13935 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
13936 * [`Refund`]: crate::offers::refund::Refund
13937 * [module-level documentation]: self
13939 typedef struct MUST_USE_STRUCT LDKInvoiceWithExplicitSigningPubkeyBuilder {
13941 * A pointer to the opaque Rust object.
13942 * Nearly everywhere, inner must be non-null, however in places where
13943 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13945 LDKnativeInvoiceWithExplicitSigningPubkeyBuilder *inner;
13947 * Indicates that this is the only struct which contains the same pointer.
13948 * Rust functions which take ownership of an object provided via an argument require
13949 * this to be true and invalidate the object pointed to by inner.
13952 } LDKInvoiceWithExplicitSigningPubkeyBuilder;
13955 * The contents of CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ
13957 typedef union LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZPtr {
13959 * A pointer to the contents in the success state.
13960 * Reading from this pointer when `result_ok` is not set is undefined.
13962 struct LDKInvoiceWithExplicitSigningPubkeyBuilder *result;
13964 * A pointer to the contents in the error state.
13965 * Reading from this pointer when `result_ok` is set is undefined.
13967 enum LDKBolt12SemanticError *err;
13968 } LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZPtr;
13971 * A CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
13972 * containing a crate::lightning::offers::invoice::InvoiceWithExplicitSigningPubkeyBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
13973 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13975 typedef struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ {
13977 * The contents of this CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ, accessible via either
13978 * `err` or `result` depending on the state of `result_ok`.
13980 union LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZPtr contents;
13982 * Whether this CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ represents a success state.
13985 } LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ;
13990 * An [`InvoiceRequest`] that has been verified by [`InvoiceRequest::verify`] and exposes different
13991 * ways to respond depending on whether the signing keys were derived.
13993 typedef struct MUST_USE_STRUCT LDKVerifiedInvoiceRequest {
13995 * A pointer to the opaque Rust object.
13996 * Nearly everywhere, inner must be non-null, however in places where
13997 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13999 LDKnativeVerifiedInvoiceRequest *inner;
14001 * Indicates that this is the only struct which contains the same pointer.
14002 * Rust functions which take ownership of an object provided via an argument require
14003 * this to be true and invalidate the object pointed to by inner.
14006 } LDKVerifiedInvoiceRequest;
14009 * The contents of CResult_VerifiedInvoiceRequestNoneZ
14011 typedef union LDKCResult_VerifiedInvoiceRequestNoneZPtr {
14013 * A pointer to the contents in the success state.
14014 * Reading from this pointer when `result_ok` is not set is undefined.
14016 struct LDKVerifiedInvoiceRequest *result;
14018 * Note that this value is always NULL, as there are no contents in the Err variant
14021 } LDKCResult_VerifiedInvoiceRequestNoneZPtr;
14024 * A CResult_VerifiedInvoiceRequestNoneZ represents the result of a fallible operation,
14025 * containing a crate::lightning::offers::invoice_request::VerifiedInvoiceRequest on success and a () on failure.
14026 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14028 typedef struct LDKCResult_VerifiedInvoiceRequestNoneZ {
14030 * The contents of this CResult_VerifiedInvoiceRequestNoneZ, accessible via either
14031 * `err` or `result` depending on the state of `result_ok`.
14033 union LDKCResult_VerifiedInvoiceRequestNoneZPtr contents;
14035 * Whether this CResult_VerifiedInvoiceRequestNoneZ represents a success state.
14038 } LDKCResult_VerifiedInvoiceRequestNoneZ;
14043 * Builds a [`Bolt12Invoice`] from either:
14044 * - an [`InvoiceRequest`] for the \"offer to be paid\" flow or
14045 * - a [`Refund`] for the \"offer for money\" flow.
14047 * See [module-level documentation] for usage.
14049 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
14050 * [`Refund`]: crate::offers::refund::Refund
14051 * [module-level documentation]: self
14053 typedef struct MUST_USE_STRUCT LDKInvoiceWithDerivedSigningPubkeyBuilder {
14055 * A pointer to the opaque Rust object.
14056 * Nearly everywhere, inner must be non-null, however in places where
14057 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14059 LDKnativeInvoiceWithDerivedSigningPubkeyBuilder *inner;
14061 * Indicates that this is the only struct which contains the same pointer.
14062 * Rust functions which take ownership of an object provided via an argument require
14063 * this to be true and invalidate the object pointed to by inner.
14066 } LDKInvoiceWithDerivedSigningPubkeyBuilder;
14069 * The contents of CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ
14071 typedef union LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZPtr {
14073 * A pointer to the contents in the success state.
14074 * Reading from this pointer when `result_ok` is not set is undefined.
14076 struct LDKInvoiceWithDerivedSigningPubkeyBuilder *result;
14078 * A pointer to the contents in the error state.
14079 * Reading from this pointer when `result_ok` is set is undefined.
14081 enum LDKBolt12SemanticError *err;
14082 } LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZPtr;
14085 * A CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
14086 * containing a crate::lightning::offers::invoice::InvoiceWithDerivedSigningPubkeyBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
14087 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14089 typedef struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ {
14091 * The contents of this CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ, accessible via either
14092 * `err` or `result` depending on the state of `result_ok`.
14094 union LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZPtr contents;
14096 * Whether this CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ represents a success state.
14099 } LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ;
14104 * Fields sent in an [`InvoiceRequest`] message to include in [`PaymentContext::Bolt12Offer`].
14106 * [`PaymentContext::Bolt12Offer`]: crate::blinded_path::payment::PaymentContext::Bolt12Offer
14108 typedef struct MUST_USE_STRUCT LDKInvoiceRequestFields {
14110 * A pointer to the opaque Rust object.
14111 * Nearly everywhere, inner must be non-null, however in places where
14112 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14114 LDKnativeInvoiceRequestFields *inner;
14116 * Indicates that this is the only struct which contains the same pointer.
14117 * Rust functions which take ownership of an object provided via an argument require
14118 * this to be true and invalidate the object pointed to by inner.
14121 } LDKInvoiceRequestFields;
14124 * The contents of CResult_InvoiceRequestFieldsDecodeErrorZ
14126 typedef union LDKCResult_InvoiceRequestFieldsDecodeErrorZPtr {
14128 * A pointer to the contents in the success state.
14129 * Reading from this pointer when `result_ok` is not set is undefined.
14131 struct LDKInvoiceRequestFields *result;
14133 * A pointer to the contents in the error state.
14134 * Reading from this pointer when `result_ok` is set is undefined.
14136 struct LDKDecodeError *err;
14137 } LDKCResult_InvoiceRequestFieldsDecodeErrorZPtr;
14140 * A CResult_InvoiceRequestFieldsDecodeErrorZ represents the result of a fallible operation,
14141 * containing a crate::lightning::offers::invoice_request::InvoiceRequestFields on success and a crate::lightning::ln::msgs::DecodeError on failure.
14142 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14144 typedef struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ {
14146 * The contents of this CResult_InvoiceRequestFieldsDecodeErrorZ, accessible via either
14147 * `err` or `result` depending on the state of `result_ok`.
14149 union LDKCResult_InvoiceRequestFieldsDecodeErrorZPtr contents;
14151 * Whether this CResult_InvoiceRequestFieldsDecodeErrorZ represents a success state.
14154 } LDKCResult_InvoiceRequestFieldsDecodeErrorZ;
14157 * A dynamically-allocated array of crate::c_types::Witnesss of arbitrary size.
14158 * This corresponds to std::vector in C++
14160 typedef struct LDKCVec_WitnessZ {
14162 * The elements in the array.
14163 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14165 struct LDKWitness *data;
14167 * The number of elements pointed to by `data`.
14170 } LDKCVec_WitnessZ;
14173 * An enum which can either contain a crate::c_types::ECDSASignature or not
14175 typedef enum LDKCOption_ECDSASignatureZ_Tag {
14177 * When we're in this state, this COption_ECDSASignatureZ contains a crate::c_types::ECDSASignature
14179 LDKCOption_ECDSASignatureZ_Some,
14181 * When we're in this state, this COption_ECDSASignatureZ contains nothing
14183 LDKCOption_ECDSASignatureZ_None,
14185 * Must be last for serialization purposes
14187 LDKCOption_ECDSASignatureZ_Sentinel,
14188 } LDKCOption_ECDSASignatureZ_Tag;
14190 typedef struct LDKCOption_ECDSASignatureZ {
14191 LDKCOption_ECDSASignatureZ_Tag tag;
14194 struct LDKECDSASignature some;
14197 } LDKCOption_ECDSASignatureZ;
14200 * An enum which can either contain a i64 or not
14202 typedef enum LDKCOption_i64Z_Tag {
14204 * When we're in this state, this COption_i64Z contains a i64
14206 LDKCOption_i64Z_Some,
14208 * When we're in this state, this COption_i64Z contains nothing
14210 LDKCOption_i64Z_None,
14212 * Must be last for serialization purposes
14214 LDKCOption_i64Z_Sentinel,
14215 } LDKCOption_i64Z_Tag;
14217 typedef struct LDKCOption_i64Z {
14218 LDKCOption_i64Z_Tag tag;
14227 * The contents of CResult_SocketAddressDecodeErrorZ
14229 typedef union LDKCResult_SocketAddressDecodeErrorZPtr {
14231 * A pointer to the contents in the success state.
14232 * Reading from this pointer when `result_ok` is not set is undefined.
14234 struct LDKSocketAddress *result;
14236 * A pointer to the contents in the error state.
14237 * Reading from this pointer when `result_ok` is set is undefined.
14239 struct LDKDecodeError *err;
14240 } LDKCResult_SocketAddressDecodeErrorZPtr;
14243 * A CResult_SocketAddressDecodeErrorZ represents the result of a fallible operation,
14244 * containing a crate::lightning::ln::msgs::SocketAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
14245 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14247 typedef struct LDKCResult_SocketAddressDecodeErrorZ {
14249 * The contents of this CResult_SocketAddressDecodeErrorZ, accessible via either
14250 * `err` or `result` depending on the state of `result_ok`.
14252 union LDKCResult_SocketAddressDecodeErrorZPtr contents;
14254 * Whether this CResult_SocketAddressDecodeErrorZ represents a success state.
14257 } LDKCResult_SocketAddressDecodeErrorZ;
14260 * The contents of CResult_SocketAddressSocketAddressParseErrorZ
14262 typedef union LDKCResult_SocketAddressSocketAddressParseErrorZPtr {
14264 * A pointer to the contents in the success state.
14265 * Reading from this pointer when `result_ok` is not set is undefined.
14267 struct LDKSocketAddress *result;
14269 * A pointer to the contents in the error state.
14270 * Reading from this pointer when `result_ok` is set is undefined.
14272 enum LDKSocketAddressParseError *err;
14273 } LDKCResult_SocketAddressSocketAddressParseErrorZPtr;
14276 * A CResult_SocketAddressSocketAddressParseErrorZ represents the result of a fallible operation,
14277 * containing a crate::lightning::ln::msgs::SocketAddress on success and a crate::lightning::ln::msgs::SocketAddressParseError on failure.
14278 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14280 typedef struct LDKCResult_SocketAddressSocketAddressParseErrorZ {
14282 * The contents of this CResult_SocketAddressSocketAddressParseErrorZ, accessible via either
14283 * `err` or `result` depending on the state of `result_ok`.
14285 union LDKCResult_SocketAddressSocketAddressParseErrorZPtr contents;
14287 * Whether this CResult_SocketAddressSocketAddressParseErrorZ represents a success state.
14290 } LDKCResult_SocketAddressSocketAddressParseErrorZ;
14295 * An [`update_add_htlc`] message to be sent to or received from a peer.
14297 * [`update_add_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#adding-an-htlc-update_add_htlc
14299 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
14301 * A pointer to the opaque Rust object.
14302 * Nearly everywhere, inner must be non-null, however in places where
14303 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14305 LDKnativeUpdateAddHTLC *inner;
14307 * Indicates that this is the only struct which contains the same pointer.
14308 * Rust functions which take ownership of an object provided via an argument require
14309 * this to be true and invalidate the object pointed to by inner.
14312 } LDKUpdateAddHTLC;
14315 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
14316 * This corresponds to std::vector in C++
14318 typedef struct LDKCVec_UpdateAddHTLCZ {
14320 * The elements in the array.
14321 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14323 struct LDKUpdateAddHTLC *data;
14325 * The number of elements pointed to by `data`.
14328 } LDKCVec_UpdateAddHTLCZ;
14333 * An [`update_fulfill_htlc`] message to be sent to or received from a peer.
14335 * [`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
14337 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
14339 * A pointer to the opaque Rust object.
14340 * Nearly everywhere, inner must be non-null, however in places where
14341 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14343 LDKnativeUpdateFulfillHTLC *inner;
14345 * Indicates that this is the only struct which contains the same pointer.
14346 * Rust functions which take ownership of an object provided via an argument require
14347 * this to be true and invalidate the object pointed to by inner.
14350 } LDKUpdateFulfillHTLC;
14353 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
14354 * This corresponds to std::vector in C++
14356 typedef struct LDKCVec_UpdateFulfillHTLCZ {
14358 * The elements in the array.
14359 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14361 struct LDKUpdateFulfillHTLC *data;
14363 * The number of elements pointed to by `data`.
14366 } LDKCVec_UpdateFulfillHTLCZ;
14371 * An [`update_fail_htlc`] message to be sent to or received from a peer.
14373 * [`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
14375 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
14377 * A pointer to the opaque Rust object.
14378 * Nearly everywhere, inner must be non-null, however in places where
14379 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14381 LDKnativeUpdateFailHTLC *inner;
14383 * Indicates that this is the only struct which contains the same pointer.
14384 * Rust functions which take ownership of an object provided via an argument require
14385 * this to be true and invalidate the object pointed to by inner.
14388 } LDKUpdateFailHTLC;
14391 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
14392 * This corresponds to std::vector in C++
14394 typedef struct LDKCVec_UpdateFailHTLCZ {
14396 * The elements in the array.
14397 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14399 struct LDKUpdateFailHTLC *data;
14401 * The number of elements pointed to by `data`.
14404 } LDKCVec_UpdateFailHTLCZ;
14409 * An [`update_fail_malformed_htlc`] message to be sent to or received from a peer.
14411 * [`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
14413 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
14415 * A pointer to the opaque Rust object.
14416 * Nearly everywhere, inner must be non-null, however in places where
14417 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14419 LDKnativeUpdateFailMalformedHTLC *inner;
14421 * Indicates that this is the only struct which contains the same pointer.
14422 * Rust functions which take ownership of an object provided via an argument require
14423 * this to be true and invalidate the object pointed to by inner.
14426 } LDKUpdateFailMalformedHTLC;
14429 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
14430 * This corresponds to std::vector in C++
14432 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
14434 * The elements in the array.
14435 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14437 struct LDKUpdateFailMalformedHTLC *data;
14439 * The number of elements pointed to by `data`.
14442 } LDKCVec_UpdateFailMalformedHTLCZ;
14445 * The contents of CResult_AcceptChannelDecodeErrorZ
14447 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
14449 * A pointer to the contents in the success state.
14450 * Reading from this pointer when `result_ok` is not set is undefined.
14452 struct LDKAcceptChannel *result;
14454 * A pointer to the contents in the error state.
14455 * Reading from this pointer when `result_ok` is set is undefined.
14457 struct LDKDecodeError *err;
14458 } LDKCResult_AcceptChannelDecodeErrorZPtr;
14461 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
14462 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
14463 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14465 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
14467 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
14468 * `err` or `result` depending on the state of `result_ok`.
14470 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
14472 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
14475 } LDKCResult_AcceptChannelDecodeErrorZ;
14478 * The contents of CResult_AcceptChannelV2DecodeErrorZ
14480 typedef union LDKCResult_AcceptChannelV2DecodeErrorZPtr {
14482 * A pointer to the contents in the success state.
14483 * Reading from this pointer when `result_ok` is not set is undefined.
14485 struct LDKAcceptChannelV2 *result;
14487 * A pointer to the contents in the error state.
14488 * Reading from this pointer when `result_ok` is set is undefined.
14490 struct LDKDecodeError *err;
14491 } LDKCResult_AcceptChannelV2DecodeErrorZPtr;
14494 * A CResult_AcceptChannelV2DecodeErrorZ represents the result of a fallible operation,
14495 * containing a crate::lightning::ln::msgs::AcceptChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
14496 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14498 typedef struct LDKCResult_AcceptChannelV2DecodeErrorZ {
14500 * The contents of this CResult_AcceptChannelV2DecodeErrorZ, accessible via either
14501 * `err` or `result` depending on the state of `result_ok`.
14503 union LDKCResult_AcceptChannelV2DecodeErrorZPtr contents;
14505 * Whether this CResult_AcceptChannelV2DecodeErrorZ represents a success state.
14508 } LDKCResult_AcceptChannelV2DecodeErrorZ;
14511 * The contents of CResult_StfuDecodeErrorZ
14513 typedef union LDKCResult_StfuDecodeErrorZPtr {
14515 * A pointer to the contents in the success state.
14516 * Reading from this pointer when `result_ok` is not set is undefined.
14518 struct LDKStfu *result;
14520 * A pointer to the contents in the error state.
14521 * Reading from this pointer when `result_ok` is set is undefined.
14523 struct LDKDecodeError *err;
14524 } LDKCResult_StfuDecodeErrorZPtr;
14527 * A CResult_StfuDecodeErrorZ represents the result of a fallible operation,
14528 * containing a crate::lightning::ln::msgs::Stfu on success and a crate::lightning::ln::msgs::DecodeError on failure.
14529 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14531 typedef struct LDKCResult_StfuDecodeErrorZ {
14533 * The contents of this CResult_StfuDecodeErrorZ, accessible via either
14534 * `err` or `result` depending on the state of `result_ok`.
14536 union LDKCResult_StfuDecodeErrorZPtr contents;
14538 * Whether this CResult_StfuDecodeErrorZ represents a success state.
14541 } LDKCResult_StfuDecodeErrorZ;
14544 * The contents of CResult_SpliceDecodeErrorZ
14546 typedef union LDKCResult_SpliceDecodeErrorZPtr {
14548 * A pointer to the contents in the success state.
14549 * Reading from this pointer when `result_ok` is not set is undefined.
14551 struct LDKSplice *result;
14553 * A pointer to the contents in the error state.
14554 * Reading from this pointer when `result_ok` is set is undefined.
14556 struct LDKDecodeError *err;
14557 } LDKCResult_SpliceDecodeErrorZPtr;
14560 * A CResult_SpliceDecodeErrorZ represents the result of a fallible operation,
14561 * containing a crate::lightning::ln::msgs::Splice on success and a crate::lightning::ln::msgs::DecodeError on failure.
14562 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14564 typedef struct LDKCResult_SpliceDecodeErrorZ {
14566 * The contents of this CResult_SpliceDecodeErrorZ, accessible via either
14567 * `err` or `result` depending on the state of `result_ok`.
14569 union LDKCResult_SpliceDecodeErrorZPtr contents;
14571 * Whether this CResult_SpliceDecodeErrorZ represents a success state.
14574 } LDKCResult_SpliceDecodeErrorZ;
14577 * The contents of CResult_SpliceAckDecodeErrorZ
14579 typedef union LDKCResult_SpliceAckDecodeErrorZPtr {
14581 * A pointer to the contents in the success state.
14582 * Reading from this pointer when `result_ok` is not set is undefined.
14584 struct LDKSpliceAck *result;
14586 * A pointer to the contents in the error state.
14587 * Reading from this pointer when `result_ok` is set is undefined.
14589 struct LDKDecodeError *err;
14590 } LDKCResult_SpliceAckDecodeErrorZPtr;
14593 * A CResult_SpliceAckDecodeErrorZ represents the result of a fallible operation,
14594 * containing a crate::lightning::ln::msgs::SpliceAck on success and a crate::lightning::ln::msgs::DecodeError on failure.
14595 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14597 typedef struct LDKCResult_SpliceAckDecodeErrorZ {
14599 * The contents of this CResult_SpliceAckDecodeErrorZ, accessible via either
14600 * `err` or `result` depending on the state of `result_ok`.
14602 union LDKCResult_SpliceAckDecodeErrorZPtr contents;
14604 * Whether this CResult_SpliceAckDecodeErrorZ represents a success state.
14607 } LDKCResult_SpliceAckDecodeErrorZ;
14610 * The contents of CResult_SpliceLockedDecodeErrorZ
14612 typedef union LDKCResult_SpliceLockedDecodeErrorZPtr {
14614 * A pointer to the contents in the success state.
14615 * Reading from this pointer when `result_ok` is not set is undefined.
14617 struct LDKSpliceLocked *result;
14619 * A pointer to the contents in the error state.
14620 * Reading from this pointer when `result_ok` is set is undefined.
14622 struct LDKDecodeError *err;
14623 } LDKCResult_SpliceLockedDecodeErrorZPtr;
14626 * A CResult_SpliceLockedDecodeErrorZ represents the result of a fallible operation,
14627 * containing a crate::lightning::ln::msgs::SpliceLocked on success and a crate::lightning::ln::msgs::DecodeError on failure.
14628 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14630 typedef struct LDKCResult_SpliceLockedDecodeErrorZ {
14632 * The contents of this CResult_SpliceLockedDecodeErrorZ, accessible via either
14633 * `err` or `result` depending on the state of `result_ok`.
14635 union LDKCResult_SpliceLockedDecodeErrorZPtr contents;
14637 * Whether this CResult_SpliceLockedDecodeErrorZ represents a success state.
14640 } LDKCResult_SpliceLockedDecodeErrorZ;
14643 * The contents of CResult_TxAddInputDecodeErrorZ
14645 typedef union LDKCResult_TxAddInputDecodeErrorZPtr {
14647 * A pointer to the contents in the success state.
14648 * Reading from this pointer when `result_ok` is not set is undefined.
14650 struct LDKTxAddInput *result;
14652 * A pointer to the contents in the error state.
14653 * Reading from this pointer when `result_ok` is set is undefined.
14655 struct LDKDecodeError *err;
14656 } LDKCResult_TxAddInputDecodeErrorZPtr;
14659 * A CResult_TxAddInputDecodeErrorZ represents the result of a fallible operation,
14660 * containing a crate::lightning::ln::msgs::TxAddInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
14661 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14663 typedef struct LDKCResult_TxAddInputDecodeErrorZ {
14665 * The contents of this CResult_TxAddInputDecodeErrorZ, accessible via either
14666 * `err` or `result` depending on the state of `result_ok`.
14668 union LDKCResult_TxAddInputDecodeErrorZPtr contents;
14670 * Whether this CResult_TxAddInputDecodeErrorZ represents a success state.
14673 } LDKCResult_TxAddInputDecodeErrorZ;
14676 * The contents of CResult_TxAddOutputDecodeErrorZ
14678 typedef union LDKCResult_TxAddOutputDecodeErrorZPtr {
14680 * A pointer to the contents in the success state.
14681 * Reading from this pointer when `result_ok` is not set is undefined.
14683 struct LDKTxAddOutput *result;
14685 * A pointer to the contents in the error state.
14686 * Reading from this pointer when `result_ok` is set is undefined.
14688 struct LDKDecodeError *err;
14689 } LDKCResult_TxAddOutputDecodeErrorZPtr;
14692 * A CResult_TxAddOutputDecodeErrorZ represents the result of a fallible operation,
14693 * containing a crate::lightning::ln::msgs::TxAddOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
14694 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14696 typedef struct LDKCResult_TxAddOutputDecodeErrorZ {
14698 * The contents of this CResult_TxAddOutputDecodeErrorZ, accessible via either
14699 * `err` or `result` depending on the state of `result_ok`.
14701 union LDKCResult_TxAddOutputDecodeErrorZPtr contents;
14703 * Whether this CResult_TxAddOutputDecodeErrorZ represents a success state.
14706 } LDKCResult_TxAddOutputDecodeErrorZ;
14709 * The contents of CResult_TxRemoveInputDecodeErrorZ
14711 typedef union LDKCResult_TxRemoveInputDecodeErrorZPtr {
14713 * A pointer to the contents in the success state.
14714 * Reading from this pointer when `result_ok` is not set is undefined.
14716 struct LDKTxRemoveInput *result;
14718 * A pointer to the contents in the error state.
14719 * Reading from this pointer when `result_ok` is set is undefined.
14721 struct LDKDecodeError *err;
14722 } LDKCResult_TxRemoveInputDecodeErrorZPtr;
14725 * A CResult_TxRemoveInputDecodeErrorZ represents the result of a fallible operation,
14726 * containing a crate::lightning::ln::msgs::TxRemoveInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
14727 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14729 typedef struct LDKCResult_TxRemoveInputDecodeErrorZ {
14731 * The contents of this CResult_TxRemoveInputDecodeErrorZ, accessible via either
14732 * `err` or `result` depending on the state of `result_ok`.
14734 union LDKCResult_TxRemoveInputDecodeErrorZPtr contents;
14736 * Whether this CResult_TxRemoveInputDecodeErrorZ represents a success state.
14739 } LDKCResult_TxRemoveInputDecodeErrorZ;
14742 * The contents of CResult_TxRemoveOutputDecodeErrorZ
14744 typedef union LDKCResult_TxRemoveOutputDecodeErrorZPtr {
14746 * A pointer to the contents in the success state.
14747 * Reading from this pointer when `result_ok` is not set is undefined.
14749 struct LDKTxRemoveOutput *result;
14751 * A pointer to the contents in the error state.
14752 * Reading from this pointer when `result_ok` is set is undefined.
14754 struct LDKDecodeError *err;
14755 } LDKCResult_TxRemoveOutputDecodeErrorZPtr;
14758 * A CResult_TxRemoveOutputDecodeErrorZ represents the result of a fallible operation,
14759 * containing a crate::lightning::ln::msgs::TxRemoveOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
14760 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14762 typedef struct LDKCResult_TxRemoveOutputDecodeErrorZ {
14764 * The contents of this CResult_TxRemoveOutputDecodeErrorZ, accessible via either
14765 * `err` or `result` depending on the state of `result_ok`.
14767 union LDKCResult_TxRemoveOutputDecodeErrorZPtr contents;
14769 * Whether this CResult_TxRemoveOutputDecodeErrorZ represents a success state.
14772 } LDKCResult_TxRemoveOutputDecodeErrorZ;
14775 * The contents of CResult_TxCompleteDecodeErrorZ
14777 typedef union LDKCResult_TxCompleteDecodeErrorZPtr {
14779 * A pointer to the contents in the success state.
14780 * Reading from this pointer when `result_ok` is not set is undefined.
14782 struct LDKTxComplete *result;
14784 * A pointer to the contents in the error state.
14785 * Reading from this pointer when `result_ok` is set is undefined.
14787 struct LDKDecodeError *err;
14788 } LDKCResult_TxCompleteDecodeErrorZPtr;
14791 * A CResult_TxCompleteDecodeErrorZ represents the result of a fallible operation,
14792 * containing a crate::lightning::ln::msgs::TxComplete on success and a crate::lightning::ln::msgs::DecodeError on failure.
14793 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14795 typedef struct LDKCResult_TxCompleteDecodeErrorZ {
14797 * The contents of this CResult_TxCompleteDecodeErrorZ, accessible via either
14798 * `err` or `result` depending on the state of `result_ok`.
14800 union LDKCResult_TxCompleteDecodeErrorZPtr contents;
14802 * Whether this CResult_TxCompleteDecodeErrorZ represents a success state.
14805 } LDKCResult_TxCompleteDecodeErrorZ;
14808 * The contents of CResult_TxSignaturesDecodeErrorZ
14810 typedef union LDKCResult_TxSignaturesDecodeErrorZPtr {
14812 * A pointer to the contents in the success state.
14813 * Reading from this pointer when `result_ok` is not set is undefined.
14815 struct LDKTxSignatures *result;
14817 * A pointer to the contents in the error state.
14818 * Reading from this pointer when `result_ok` is set is undefined.
14820 struct LDKDecodeError *err;
14821 } LDKCResult_TxSignaturesDecodeErrorZPtr;
14824 * A CResult_TxSignaturesDecodeErrorZ represents the result of a fallible operation,
14825 * containing a crate::lightning::ln::msgs::TxSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
14826 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14828 typedef struct LDKCResult_TxSignaturesDecodeErrorZ {
14830 * The contents of this CResult_TxSignaturesDecodeErrorZ, accessible via either
14831 * `err` or `result` depending on the state of `result_ok`.
14833 union LDKCResult_TxSignaturesDecodeErrorZPtr contents;
14835 * Whether this CResult_TxSignaturesDecodeErrorZ represents a success state.
14838 } LDKCResult_TxSignaturesDecodeErrorZ;
14841 * The contents of CResult_TxInitRbfDecodeErrorZ
14843 typedef union LDKCResult_TxInitRbfDecodeErrorZPtr {
14845 * A pointer to the contents in the success state.
14846 * Reading from this pointer when `result_ok` is not set is undefined.
14848 struct LDKTxInitRbf *result;
14850 * A pointer to the contents in the error state.
14851 * Reading from this pointer when `result_ok` is set is undefined.
14853 struct LDKDecodeError *err;
14854 } LDKCResult_TxInitRbfDecodeErrorZPtr;
14857 * A CResult_TxInitRbfDecodeErrorZ represents the result of a fallible operation,
14858 * containing a crate::lightning::ln::msgs::TxInitRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
14859 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14861 typedef struct LDKCResult_TxInitRbfDecodeErrorZ {
14863 * The contents of this CResult_TxInitRbfDecodeErrorZ, accessible via either
14864 * `err` or `result` depending on the state of `result_ok`.
14866 union LDKCResult_TxInitRbfDecodeErrorZPtr contents;
14868 * Whether this CResult_TxInitRbfDecodeErrorZ represents a success state.
14871 } LDKCResult_TxInitRbfDecodeErrorZ;
14874 * The contents of CResult_TxAckRbfDecodeErrorZ
14876 typedef union LDKCResult_TxAckRbfDecodeErrorZPtr {
14878 * A pointer to the contents in the success state.
14879 * Reading from this pointer when `result_ok` is not set is undefined.
14881 struct LDKTxAckRbf *result;
14883 * A pointer to the contents in the error state.
14884 * Reading from this pointer when `result_ok` is set is undefined.
14886 struct LDKDecodeError *err;
14887 } LDKCResult_TxAckRbfDecodeErrorZPtr;
14890 * A CResult_TxAckRbfDecodeErrorZ represents the result of a fallible operation,
14891 * containing a crate::lightning::ln::msgs::TxAckRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
14892 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14894 typedef struct LDKCResult_TxAckRbfDecodeErrorZ {
14896 * The contents of this CResult_TxAckRbfDecodeErrorZ, accessible via either
14897 * `err` or `result` depending on the state of `result_ok`.
14899 union LDKCResult_TxAckRbfDecodeErrorZPtr contents;
14901 * Whether this CResult_TxAckRbfDecodeErrorZ represents a success state.
14904 } LDKCResult_TxAckRbfDecodeErrorZ;
14907 * The contents of CResult_TxAbortDecodeErrorZ
14909 typedef union LDKCResult_TxAbortDecodeErrorZPtr {
14911 * A pointer to the contents in the success state.
14912 * Reading from this pointer when `result_ok` is not set is undefined.
14914 struct LDKTxAbort *result;
14916 * A pointer to the contents in the error state.
14917 * Reading from this pointer when `result_ok` is set is undefined.
14919 struct LDKDecodeError *err;
14920 } LDKCResult_TxAbortDecodeErrorZPtr;
14923 * A CResult_TxAbortDecodeErrorZ represents the result of a fallible operation,
14924 * containing a crate::lightning::ln::msgs::TxAbort on success and a crate::lightning::ln::msgs::DecodeError on failure.
14925 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14927 typedef struct LDKCResult_TxAbortDecodeErrorZ {
14929 * The contents of this CResult_TxAbortDecodeErrorZ, accessible via either
14930 * `err` or `result` depending on the state of `result_ok`.
14932 union LDKCResult_TxAbortDecodeErrorZPtr contents;
14934 * Whether this CResult_TxAbortDecodeErrorZ represents a success state.
14937 } LDKCResult_TxAbortDecodeErrorZ;
14940 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
14942 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
14944 * A pointer to the contents in the success state.
14945 * Reading from this pointer when `result_ok` is not set is undefined.
14947 struct LDKAnnouncementSignatures *result;
14949 * A pointer to the contents in the error state.
14950 * Reading from this pointer when `result_ok` is set is undefined.
14952 struct LDKDecodeError *err;
14953 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
14956 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
14957 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
14958 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14960 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
14962 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
14963 * `err` or `result` depending on the state of `result_ok`.
14965 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
14967 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
14970 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
14973 * The contents of CResult_ChannelReestablishDecodeErrorZ
14975 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
14977 * A pointer to the contents in the success state.
14978 * Reading from this pointer when `result_ok` is not set is undefined.
14980 struct LDKChannelReestablish *result;
14982 * A pointer to the contents in the error state.
14983 * Reading from this pointer when `result_ok` is set is undefined.
14985 struct LDKDecodeError *err;
14986 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
14989 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
14990 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
14991 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14993 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
14995 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
14996 * `err` or `result` depending on the state of `result_ok`.
14998 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
15000 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
15003 } LDKCResult_ChannelReestablishDecodeErrorZ;
15006 * The contents of CResult_ClosingSignedDecodeErrorZ
15008 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
15010 * A pointer to the contents in the success state.
15011 * Reading from this pointer when `result_ok` is not set is undefined.
15013 struct LDKClosingSigned *result;
15015 * A pointer to the contents in the error state.
15016 * Reading from this pointer when `result_ok` is set is undefined.
15018 struct LDKDecodeError *err;
15019 } LDKCResult_ClosingSignedDecodeErrorZPtr;
15022 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
15023 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
15024 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15026 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
15028 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
15029 * `err` or `result` depending on the state of `result_ok`.
15031 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
15033 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
15036 } LDKCResult_ClosingSignedDecodeErrorZ;
15041 * The minimum and maximum fees which the sender is willing to place on the closing transaction.
15043 * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
15046 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
15048 * A pointer to the opaque Rust object.
15049 * Nearly everywhere, inner must be non-null, however in places where
15050 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15052 LDKnativeClosingSignedFeeRange *inner;
15054 * Indicates that this is the only struct which contains the same pointer.
15055 * Rust functions which take ownership of an object provided via an argument require
15056 * this to be true and invalidate the object pointed to by inner.
15059 } LDKClosingSignedFeeRange;
15062 * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
15064 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
15066 * A pointer to the contents in the success state.
15067 * Reading from this pointer when `result_ok` is not set is undefined.
15069 struct LDKClosingSignedFeeRange *result;
15071 * A pointer to the contents in the error state.
15072 * Reading from this pointer when `result_ok` is set is undefined.
15074 struct LDKDecodeError *err;
15075 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
15078 * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
15079 * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
15080 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15082 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
15084 * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
15085 * `err` or `result` depending on the state of `result_ok`.
15087 union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
15089 * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
15092 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
15097 * A [`commitment_signed`] message to be sent to or received from a peer.
15099 * [`commitment_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#committing-updates-so-far-commitment_signed
15101 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
15103 * A pointer to the opaque Rust object.
15104 * Nearly everywhere, inner must be non-null, however in places where
15105 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15107 LDKnativeCommitmentSigned *inner;
15109 * Indicates that this is the only struct which contains the same pointer.
15110 * Rust functions which take ownership of an object provided via an argument require
15111 * this to be true and invalidate the object pointed to by inner.
15114 } LDKCommitmentSigned;
15117 * The contents of CResult_CommitmentSignedDecodeErrorZ
15119 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
15121 * A pointer to the contents in the success state.
15122 * Reading from this pointer when `result_ok` is not set is undefined.
15124 struct LDKCommitmentSigned *result;
15126 * A pointer to the contents in the error state.
15127 * Reading from this pointer when `result_ok` is set is undefined.
15129 struct LDKDecodeError *err;
15130 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
15133 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
15134 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
15135 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15137 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
15139 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
15140 * `err` or `result` depending on the state of `result_ok`.
15142 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
15144 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
15147 } LDKCResult_CommitmentSignedDecodeErrorZ;
15150 * The contents of CResult_FundingCreatedDecodeErrorZ
15152 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
15154 * A pointer to the contents in the success state.
15155 * Reading from this pointer when `result_ok` is not set is undefined.
15157 struct LDKFundingCreated *result;
15159 * A pointer to the contents in the error state.
15160 * Reading from this pointer when `result_ok` is set is undefined.
15162 struct LDKDecodeError *err;
15163 } LDKCResult_FundingCreatedDecodeErrorZPtr;
15166 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
15167 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
15168 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15170 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
15172 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
15173 * `err` or `result` depending on the state of `result_ok`.
15175 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
15177 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
15180 } LDKCResult_FundingCreatedDecodeErrorZ;
15183 * The contents of CResult_FundingSignedDecodeErrorZ
15185 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
15187 * A pointer to the contents in the success state.
15188 * Reading from this pointer when `result_ok` is not set is undefined.
15190 struct LDKFundingSigned *result;
15192 * A pointer to the contents in the error state.
15193 * Reading from this pointer when `result_ok` is set is undefined.
15195 struct LDKDecodeError *err;
15196 } LDKCResult_FundingSignedDecodeErrorZPtr;
15199 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
15200 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
15201 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15203 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
15205 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
15206 * `err` or `result` depending on the state of `result_ok`.
15208 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
15210 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
15213 } LDKCResult_FundingSignedDecodeErrorZ;
15216 * The contents of CResult_ChannelReadyDecodeErrorZ
15218 typedef union LDKCResult_ChannelReadyDecodeErrorZPtr {
15220 * A pointer to the contents in the success state.
15221 * Reading from this pointer when `result_ok` is not set is undefined.
15223 struct LDKChannelReady *result;
15225 * A pointer to the contents in the error state.
15226 * Reading from this pointer when `result_ok` is set is undefined.
15228 struct LDKDecodeError *err;
15229 } LDKCResult_ChannelReadyDecodeErrorZPtr;
15232 * A CResult_ChannelReadyDecodeErrorZ represents the result of a fallible operation,
15233 * containing a crate::lightning::ln::msgs::ChannelReady on success and a crate::lightning::ln::msgs::DecodeError on failure.
15234 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15236 typedef struct LDKCResult_ChannelReadyDecodeErrorZ {
15238 * The contents of this CResult_ChannelReadyDecodeErrorZ, accessible via either
15239 * `err` or `result` depending on the state of `result_ok`.
15241 union LDKCResult_ChannelReadyDecodeErrorZPtr contents;
15243 * Whether this CResult_ChannelReadyDecodeErrorZ represents a success state.
15246 } LDKCResult_ChannelReadyDecodeErrorZ;
15251 * An [`init`] message to be sent to or received from a peer.
15253 * [`init`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-init-message
15255 typedef struct MUST_USE_STRUCT LDKInit {
15257 * A pointer to the opaque Rust object.
15258 * Nearly everywhere, inner must be non-null, however in places where
15259 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15261 LDKnativeInit *inner;
15263 * Indicates that this is the only struct which contains the same pointer.
15264 * Rust functions which take ownership of an object provided via an argument require
15265 * this to be true and invalidate the object pointed to by inner.
15271 * The contents of CResult_InitDecodeErrorZ
15273 typedef union LDKCResult_InitDecodeErrorZPtr {
15275 * A pointer to the contents in the success state.
15276 * Reading from this pointer when `result_ok` is not set is undefined.
15278 struct LDKInit *result;
15280 * A pointer to the contents in the error state.
15281 * Reading from this pointer when `result_ok` is set is undefined.
15283 struct LDKDecodeError *err;
15284 } LDKCResult_InitDecodeErrorZPtr;
15287 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
15288 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
15289 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15291 typedef struct LDKCResult_InitDecodeErrorZ {
15293 * The contents of this CResult_InitDecodeErrorZ, accessible via either
15294 * `err` or `result` depending on the state of `result_ok`.
15296 union LDKCResult_InitDecodeErrorZPtr contents;
15298 * Whether this CResult_InitDecodeErrorZ represents a success state.
15301 } LDKCResult_InitDecodeErrorZ;
15304 * The contents of CResult_OpenChannelDecodeErrorZ
15306 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
15308 * A pointer to the contents in the success state.
15309 * Reading from this pointer when `result_ok` is not set is undefined.
15311 struct LDKOpenChannel *result;
15313 * A pointer to the contents in the error state.
15314 * Reading from this pointer when `result_ok` is set is undefined.
15316 struct LDKDecodeError *err;
15317 } LDKCResult_OpenChannelDecodeErrorZPtr;
15320 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
15321 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
15322 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15324 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
15326 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
15327 * `err` or `result` depending on the state of `result_ok`.
15329 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
15331 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
15334 } LDKCResult_OpenChannelDecodeErrorZ;
15337 * The contents of CResult_OpenChannelV2DecodeErrorZ
15339 typedef union LDKCResult_OpenChannelV2DecodeErrorZPtr {
15341 * A pointer to the contents in the success state.
15342 * Reading from this pointer when `result_ok` is not set is undefined.
15344 struct LDKOpenChannelV2 *result;
15346 * A pointer to the contents in the error state.
15347 * Reading from this pointer when `result_ok` is set is undefined.
15349 struct LDKDecodeError *err;
15350 } LDKCResult_OpenChannelV2DecodeErrorZPtr;
15353 * A CResult_OpenChannelV2DecodeErrorZ represents the result of a fallible operation,
15354 * containing a crate::lightning::ln::msgs::OpenChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
15355 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15357 typedef struct LDKCResult_OpenChannelV2DecodeErrorZ {
15359 * The contents of this CResult_OpenChannelV2DecodeErrorZ, accessible via either
15360 * `err` or `result` depending on the state of `result_ok`.
15362 union LDKCResult_OpenChannelV2DecodeErrorZPtr contents;
15364 * Whether this CResult_OpenChannelV2DecodeErrorZ represents a success state.
15367 } LDKCResult_OpenChannelV2DecodeErrorZ;
15370 * The contents of CResult_RevokeAndACKDecodeErrorZ
15372 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
15374 * A pointer to the contents in the success state.
15375 * Reading from this pointer when `result_ok` is not set is undefined.
15377 struct LDKRevokeAndACK *result;
15379 * A pointer to the contents in the error state.
15380 * Reading from this pointer when `result_ok` is set is undefined.
15382 struct LDKDecodeError *err;
15383 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
15386 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
15387 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
15388 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15390 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
15392 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
15393 * `err` or `result` depending on the state of `result_ok`.
15395 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
15397 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
15400 } LDKCResult_RevokeAndACKDecodeErrorZ;
15403 * The contents of CResult_ShutdownDecodeErrorZ
15405 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
15407 * A pointer to the contents in the success state.
15408 * Reading from this pointer when `result_ok` is not set is undefined.
15410 struct LDKShutdown *result;
15412 * A pointer to the contents in the error state.
15413 * Reading from this pointer when `result_ok` is set is undefined.
15415 struct LDKDecodeError *err;
15416 } LDKCResult_ShutdownDecodeErrorZPtr;
15419 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
15420 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
15421 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15423 typedef struct LDKCResult_ShutdownDecodeErrorZ {
15425 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
15426 * `err` or `result` depending on the state of `result_ok`.
15428 union LDKCResult_ShutdownDecodeErrorZPtr contents;
15430 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
15433 } LDKCResult_ShutdownDecodeErrorZ;
15436 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
15438 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
15440 * A pointer to the contents in the success state.
15441 * Reading from this pointer when `result_ok` is not set is undefined.
15443 struct LDKUpdateFailHTLC *result;
15445 * A pointer to the contents in the error state.
15446 * Reading from this pointer when `result_ok` is set is undefined.
15448 struct LDKDecodeError *err;
15449 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
15452 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
15453 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
15454 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15456 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
15458 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
15459 * `err` or `result` depending on the state of `result_ok`.
15461 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
15463 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
15466 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
15469 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
15471 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
15473 * A pointer to the contents in the success state.
15474 * Reading from this pointer when `result_ok` is not set is undefined.
15476 struct LDKUpdateFailMalformedHTLC *result;
15478 * A pointer to the contents in the error state.
15479 * Reading from this pointer when `result_ok` is set is undefined.
15481 struct LDKDecodeError *err;
15482 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
15485 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
15486 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
15487 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15489 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
15491 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
15492 * `err` or `result` depending on the state of `result_ok`.
15494 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
15496 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
15499 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
15504 * An [`update_fee`] message to be sent to or received from a peer
15506 * [`update_fee`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#updating-fees-update_fee
15508 typedef struct MUST_USE_STRUCT LDKUpdateFee {
15510 * A pointer to the opaque Rust object.
15511 * Nearly everywhere, inner must be non-null, however in places where
15512 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15514 LDKnativeUpdateFee *inner;
15516 * Indicates that this is the only struct which contains the same pointer.
15517 * Rust functions which take ownership of an object provided via an argument require
15518 * this to be true and invalidate the object pointed to by inner.
15524 * The contents of CResult_UpdateFeeDecodeErrorZ
15526 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
15528 * A pointer to the contents in the success state.
15529 * Reading from this pointer when `result_ok` is not set is undefined.
15531 struct LDKUpdateFee *result;
15533 * A pointer to the contents in the error state.
15534 * Reading from this pointer when `result_ok` is set is undefined.
15536 struct LDKDecodeError *err;
15537 } LDKCResult_UpdateFeeDecodeErrorZPtr;
15540 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
15541 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
15542 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15544 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
15546 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
15547 * `err` or `result` depending on the state of `result_ok`.
15549 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
15551 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
15554 } LDKCResult_UpdateFeeDecodeErrorZ;
15557 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
15559 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
15561 * A pointer to the contents in the success state.
15562 * Reading from this pointer when `result_ok` is not set is undefined.
15564 struct LDKUpdateFulfillHTLC *result;
15566 * A pointer to the contents in the error state.
15567 * Reading from this pointer when `result_ok` is set is undefined.
15569 struct LDKDecodeError *err;
15570 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
15573 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
15574 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
15575 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15577 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
15579 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
15580 * `err` or `result` depending on the state of `result_ok`.
15582 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
15584 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
15587 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
15590 * The contents of CResult_OnionPacketDecodeErrorZ
15592 typedef union LDKCResult_OnionPacketDecodeErrorZPtr {
15594 * A pointer to the contents in the success state.
15595 * Reading from this pointer when `result_ok` is not set is undefined.
15597 struct LDKOnionPacket *result;
15599 * A pointer to the contents in the error state.
15600 * Reading from this pointer when `result_ok` is set is undefined.
15602 struct LDKDecodeError *err;
15603 } LDKCResult_OnionPacketDecodeErrorZPtr;
15606 * A CResult_OnionPacketDecodeErrorZ represents the result of a fallible operation,
15607 * containing a crate::lightning::ln::msgs::OnionPacket on success and a crate::lightning::ln::msgs::DecodeError on failure.
15608 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15610 typedef struct LDKCResult_OnionPacketDecodeErrorZ {
15612 * The contents of this CResult_OnionPacketDecodeErrorZ, accessible via either
15613 * `err` or `result` depending on the state of `result_ok`.
15615 union LDKCResult_OnionPacketDecodeErrorZPtr contents;
15617 * Whether this CResult_OnionPacketDecodeErrorZ represents a success state.
15620 } LDKCResult_OnionPacketDecodeErrorZ;
15623 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
15625 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
15627 * A pointer to the contents in the success state.
15628 * Reading from this pointer when `result_ok` is not set is undefined.
15630 struct LDKUpdateAddHTLC *result;
15632 * A pointer to the contents in the error state.
15633 * Reading from this pointer when `result_ok` is set is undefined.
15635 struct LDKDecodeError *err;
15636 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
15639 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
15640 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
15641 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15643 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
15645 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
15646 * `err` or `result` depending on the state of `result_ok`.
15648 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
15650 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
15653 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
15658 * An onion message to be sent to or received from a peer.
15661 typedef struct MUST_USE_STRUCT LDKOnionMessage {
15663 * A pointer to the opaque Rust object.
15664 * Nearly everywhere, inner must be non-null, however in places where
15665 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15667 LDKnativeOnionMessage *inner;
15669 * Indicates that this is the only struct which contains the same pointer.
15670 * Rust functions which take ownership of an object provided via an argument require
15671 * this to be true and invalidate the object pointed to by inner.
15677 * The contents of CResult_OnionMessageDecodeErrorZ
15679 typedef union LDKCResult_OnionMessageDecodeErrorZPtr {
15681 * A pointer to the contents in the success state.
15682 * Reading from this pointer when `result_ok` is not set is undefined.
15684 struct LDKOnionMessage *result;
15686 * A pointer to the contents in the error state.
15687 * Reading from this pointer when `result_ok` is set is undefined.
15689 struct LDKDecodeError *err;
15690 } LDKCResult_OnionMessageDecodeErrorZPtr;
15693 * A CResult_OnionMessageDecodeErrorZ represents the result of a fallible operation,
15694 * containing a crate::lightning::ln::msgs::OnionMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
15695 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15697 typedef struct LDKCResult_OnionMessageDecodeErrorZ {
15699 * The contents of this CResult_OnionMessageDecodeErrorZ, accessible via either
15700 * `err` or `result` depending on the state of `result_ok`.
15702 union LDKCResult_OnionMessageDecodeErrorZPtr contents;
15704 * Whether this CResult_OnionMessageDecodeErrorZ represents a success state.
15707 } LDKCResult_OnionMessageDecodeErrorZ;
15710 * The contents of CResult_FinalOnionHopDataDecodeErrorZ
15712 typedef union LDKCResult_FinalOnionHopDataDecodeErrorZPtr {
15714 * A pointer to the contents in the success state.
15715 * Reading from this pointer when `result_ok` is not set is undefined.
15717 struct LDKFinalOnionHopData *result;
15719 * A pointer to the contents in the error state.
15720 * Reading from this pointer when `result_ok` is set is undefined.
15722 struct LDKDecodeError *err;
15723 } LDKCResult_FinalOnionHopDataDecodeErrorZPtr;
15726 * A CResult_FinalOnionHopDataDecodeErrorZ represents the result of a fallible operation,
15727 * containing a crate::lightning::ln::msgs::FinalOnionHopData on success and a crate::lightning::ln::msgs::DecodeError on failure.
15728 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15730 typedef struct LDKCResult_FinalOnionHopDataDecodeErrorZ {
15732 * The contents of this CResult_FinalOnionHopDataDecodeErrorZ, accessible via either
15733 * `err` or `result` depending on the state of `result_ok`.
15735 union LDKCResult_FinalOnionHopDataDecodeErrorZPtr contents;
15737 * Whether this CResult_FinalOnionHopDataDecodeErrorZ represents a success state.
15740 } LDKCResult_FinalOnionHopDataDecodeErrorZ;
15745 * A [`ping`] message to be sent to or received from a peer.
15747 * [`ping`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
15749 typedef struct MUST_USE_STRUCT LDKPing {
15751 * A pointer to the opaque Rust object.
15752 * Nearly everywhere, inner must be non-null, however in places where
15753 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15755 LDKnativePing *inner;
15757 * Indicates that this is the only struct which contains the same pointer.
15758 * Rust functions which take ownership of an object provided via an argument require
15759 * this to be true and invalidate the object pointed to by inner.
15765 * The contents of CResult_PingDecodeErrorZ
15767 typedef union LDKCResult_PingDecodeErrorZPtr {
15769 * A pointer to the contents in the success state.
15770 * Reading from this pointer when `result_ok` is not set is undefined.
15772 struct LDKPing *result;
15774 * A pointer to the contents in the error state.
15775 * Reading from this pointer when `result_ok` is set is undefined.
15777 struct LDKDecodeError *err;
15778 } LDKCResult_PingDecodeErrorZPtr;
15781 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
15782 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
15783 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15785 typedef struct LDKCResult_PingDecodeErrorZ {
15787 * The contents of this CResult_PingDecodeErrorZ, accessible via either
15788 * `err` or `result` depending on the state of `result_ok`.
15790 union LDKCResult_PingDecodeErrorZPtr contents;
15792 * Whether this CResult_PingDecodeErrorZ represents a success state.
15795 } LDKCResult_PingDecodeErrorZ;
15800 * A [`pong`] message to be sent to or received from a peer.
15802 * [`pong`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
15804 typedef struct MUST_USE_STRUCT LDKPong {
15806 * A pointer to the opaque Rust object.
15807 * Nearly everywhere, inner must be non-null, however in places where
15808 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15810 LDKnativePong *inner;
15812 * Indicates that this is the only struct which contains the same pointer.
15813 * Rust functions which take ownership of an object provided via an argument require
15814 * this to be true and invalidate the object pointed to by inner.
15820 * The contents of CResult_PongDecodeErrorZ
15822 typedef union LDKCResult_PongDecodeErrorZPtr {
15824 * A pointer to the contents in the success state.
15825 * Reading from this pointer when `result_ok` is not set is undefined.
15827 struct LDKPong *result;
15829 * A pointer to the contents in the error state.
15830 * Reading from this pointer when `result_ok` is set is undefined.
15832 struct LDKDecodeError *err;
15833 } LDKCResult_PongDecodeErrorZPtr;
15836 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
15837 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
15838 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15840 typedef struct LDKCResult_PongDecodeErrorZ {
15842 * The contents of this CResult_PongDecodeErrorZ, accessible via either
15843 * `err` or `result` depending on the state of `result_ok`.
15845 union LDKCResult_PongDecodeErrorZPtr contents;
15847 * Whether this CResult_PongDecodeErrorZ represents a success state.
15850 } LDKCResult_PongDecodeErrorZ;
15853 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
15855 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
15857 * A pointer to the contents in the success state.
15858 * Reading from this pointer when `result_ok` is not set is undefined.
15860 struct LDKUnsignedChannelAnnouncement *result;
15862 * A pointer to the contents in the error state.
15863 * Reading from this pointer when `result_ok` is set is undefined.
15865 struct LDKDecodeError *err;
15866 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
15869 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
15870 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
15871 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15873 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
15875 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
15876 * `err` or `result` depending on the state of `result_ok`.
15878 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
15880 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
15883 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
15886 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
15888 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
15890 * A pointer to the contents in the success state.
15891 * Reading from this pointer when `result_ok` is not set is undefined.
15893 struct LDKChannelAnnouncement *result;
15895 * A pointer to the contents in the error state.
15896 * Reading from this pointer when `result_ok` is set is undefined.
15898 struct LDKDecodeError *err;
15899 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
15902 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
15903 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
15904 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15906 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
15908 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
15909 * `err` or `result` depending on the state of `result_ok`.
15911 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
15913 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
15916 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
15919 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
15921 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
15923 * A pointer to the contents in the success state.
15924 * Reading from this pointer when `result_ok` is not set is undefined.
15926 struct LDKUnsignedChannelUpdate *result;
15928 * A pointer to the contents in the error state.
15929 * Reading from this pointer when `result_ok` is set is undefined.
15931 struct LDKDecodeError *err;
15932 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
15935 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
15936 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
15937 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15939 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
15941 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
15942 * `err` or `result` depending on the state of `result_ok`.
15944 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
15946 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
15949 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
15952 * The contents of CResult_ChannelUpdateDecodeErrorZ
15954 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
15956 * A pointer to the contents in the success state.
15957 * Reading from this pointer when `result_ok` is not set is undefined.
15959 struct LDKChannelUpdate *result;
15961 * A pointer to the contents in the error state.
15962 * Reading from this pointer when `result_ok` is set is undefined.
15964 struct LDKDecodeError *err;
15965 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
15968 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
15969 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
15970 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15972 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
15974 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
15975 * `err` or `result` depending on the state of `result_ok`.
15977 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
15979 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
15982 } LDKCResult_ChannelUpdateDecodeErrorZ;
15985 * The contents of CResult_ErrorMessageDecodeErrorZ
15987 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
15989 * A pointer to the contents in the success state.
15990 * Reading from this pointer when `result_ok` is not set is undefined.
15992 struct LDKErrorMessage *result;
15994 * A pointer to the contents in the error state.
15995 * Reading from this pointer when `result_ok` is set is undefined.
15997 struct LDKDecodeError *err;
15998 } LDKCResult_ErrorMessageDecodeErrorZPtr;
16001 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
16002 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
16003 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16005 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
16007 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
16008 * `err` or `result` depending on the state of `result_ok`.
16010 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
16012 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
16015 } LDKCResult_ErrorMessageDecodeErrorZ;
16018 * The contents of CResult_WarningMessageDecodeErrorZ
16020 typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
16022 * A pointer to the contents in the success state.
16023 * Reading from this pointer when `result_ok` is not set is undefined.
16025 struct LDKWarningMessage *result;
16027 * A pointer to the contents in the error state.
16028 * Reading from this pointer when `result_ok` is set is undefined.
16030 struct LDKDecodeError *err;
16031 } LDKCResult_WarningMessageDecodeErrorZPtr;
16034 * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
16035 * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
16036 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16038 typedef struct LDKCResult_WarningMessageDecodeErrorZ {
16040 * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
16041 * `err` or `result` depending on the state of `result_ok`.
16043 union LDKCResult_WarningMessageDecodeErrorZPtr contents;
16045 * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
16048 } LDKCResult_WarningMessageDecodeErrorZ;
16051 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
16053 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
16055 * A pointer to the contents in the success state.
16056 * Reading from this pointer when `result_ok` is not set is undefined.
16058 struct LDKUnsignedNodeAnnouncement *result;
16060 * A pointer to the contents in the error state.
16061 * Reading from this pointer when `result_ok` is set is undefined.
16063 struct LDKDecodeError *err;
16064 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
16067 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
16068 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
16069 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16071 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
16073 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
16074 * `err` or `result` depending on the state of `result_ok`.
16076 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
16078 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
16081 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
16084 * The contents of CResult_NodeAnnouncementDecodeErrorZ
16086 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
16088 * A pointer to the contents in the success state.
16089 * Reading from this pointer when `result_ok` is not set is undefined.
16091 struct LDKNodeAnnouncement *result;
16093 * A pointer to the contents in the error state.
16094 * Reading from this pointer when `result_ok` is set is undefined.
16096 struct LDKDecodeError *err;
16097 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
16100 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
16101 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
16102 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16104 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
16106 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
16107 * `err` or `result` depending on the state of `result_ok`.
16109 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
16111 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
16114 } LDKCResult_NodeAnnouncementDecodeErrorZ;
16117 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
16119 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
16121 * A pointer to the contents in the success state.
16122 * Reading from this pointer when `result_ok` is not set is undefined.
16124 struct LDKQueryShortChannelIds *result;
16126 * A pointer to the contents in the error state.
16127 * Reading from this pointer when `result_ok` is set is undefined.
16129 struct LDKDecodeError *err;
16130 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
16133 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
16134 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
16135 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16137 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
16139 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
16140 * `err` or `result` depending on the state of `result_ok`.
16142 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
16144 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
16147 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
16152 * A [`reply_short_channel_ids_end`] message is sent as a reply to a
16153 * message. The query recipient makes a best
16154 * effort to respond based on their local network view which may not be
16155 * a perfect view of the network.
16157 * [`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
16159 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
16161 * A pointer to the opaque Rust object.
16162 * Nearly everywhere, inner must be non-null, however in places where
16163 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16165 LDKnativeReplyShortChannelIdsEnd *inner;
16167 * Indicates that this is the only struct which contains the same pointer.
16168 * Rust functions which take ownership of an object provided via an argument require
16169 * this to be true and invalidate the object pointed to by inner.
16172 } LDKReplyShortChannelIdsEnd;
16175 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
16177 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
16179 * A pointer to the contents in the success state.
16180 * Reading from this pointer when `result_ok` is not set is undefined.
16182 struct LDKReplyShortChannelIdsEnd *result;
16184 * A pointer to the contents in the error state.
16185 * Reading from this pointer when `result_ok` is set is undefined.
16187 struct LDKDecodeError *err;
16188 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
16191 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
16192 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
16193 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16195 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
16197 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
16198 * `err` or `result` depending on the state of `result_ok`.
16200 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
16202 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
16205 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
16208 * The contents of CResult_QueryChannelRangeDecodeErrorZ
16210 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
16212 * A pointer to the contents in the success state.
16213 * Reading from this pointer when `result_ok` is not set is undefined.
16215 struct LDKQueryChannelRange *result;
16217 * A pointer to the contents in the error state.
16218 * Reading from this pointer when `result_ok` is set is undefined.
16220 struct LDKDecodeError *err;
16221 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
16224 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
16225 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
16226 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16228 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
16230 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
16231 * `err` or `result` depending on the state of `result_ok`.
16233 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
16235 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
16238 } LDKCResult_QueryChannelRangeDecodeErrorZ;
16241 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
16243 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
16245 * A pointer to the contents in the success state.
16246 * Reading from this pointer when `result_ok` is not set is undefined.
16248 struct LDKReplyChannelRange *result;
16250 * A pointer to the contents in the error state.
16251 * Reading from this pointer when `result_ok` is set is undefined.
16253 struct LDKDecodeError *err;
16254 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
16257 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
16258 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
16259 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16261 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
16263 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
16264 * `err` or `result` depending on the state of `result_ok`.
16266 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
16268 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
16271 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
16274 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
16276 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
16278 * A pointer to the contents in the success state.
16279 * Reading from this pointer when `result_ok` is not set is undefined.
16281 struct LDKGossipTimestampFilter *result;
16283 * A pointer to the contents in the error state.
16284 * Reading from this pointer when `result_ok` is set is undefined.
16286 struct LDKDecodeError *err;
16287 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
16290 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
16291 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
16292 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16294 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
16296 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
16297 * `err` or `result` depending on the state of `result_ok`.
16299 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
16301 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
16304 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
16307 * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
16308 * This corresponds to std::vector in C++
16310 typedef struct LDKCVec_PhantomRouteHintsZ {
16312 * The elements in the array.
16313 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
16315 struct LDKPhantomRouteHints *data;
16317 * The number of elements pointed to by `data`.
16320 } LDKCVec_PhantomRouteHintsZ;
16325 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
16327 * There are three ways to construct a `Bolt11Invoice`:
16328 * 1. using [`InvoiceBuilder`]
16329 * 2. using [`Bolt11Invoice::from_signed`]
16330 * 3. using `str::parse::<Bolt11Invoice>(&str)` (see [`Bolt11Invoice::from_str`])
16332 * [`Bolt11Invoice::from_str`]: crate::Bolt11Invoice#impl-FromStr
16334 typedef struct MUST_USE_STRUCT LDKBolt11Invoice {
16336 * A pointer to the opaque Rust object.
16337 * Nearly everywhere, inner must be non-null, however in places where
16338 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16340 LDKnativeBolt11Invoice *inner;
16342 * Indicates that this is the only struct which contains the same pointer.
16343 * Rust functions which take ownership of an object provided via an argument require
16344 * this to be true and invalidate the object pointed to by inner.
16347 } LDKBolt11Invoice;
16350 * When signing using a fallible method either an user-supplied `SignError` or a [`CreationError`]
16353 typedef enum LDKSignOrCreationError_Tag {
16355 * An error occurred during signing
16357 LDKSignOrCreationError_SignError,
16359 * An error occurred while building the transaction
16361 LDKSignOrCreationError_CreationError,
16363 * Must be last for serialization purposes
16365 LDKSignOrCreationError_Sentinel,
16366 } LDKSignOrCreationError_Tag;
16368 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
16369 LDKSignOrCreationError_Tag tag;
16372 enum LDKCreationError creation_error;
16375 } LDKSignOrCreationError;
16378 * The contents of CResult_Bolt11InvoiceSignOrCreationErrorZ
16380 typedef union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr {
16382 * A pointer to the contents in the success state.
16383 * Reading from this pointer when `result_ok` is not set is undefined.
16385 struct LDKBolt11Invoice *result;
16387 * A pointer to the contents in the error state.
16388 * Reading from this pointer when `result_ok` is set is undefined.
16390 struct LDKSignOrCreationError *err;
16391 } LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr;
16394 * A CResult_Bolt11InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
16395 * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
16396 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16398 typedef struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ {
16400 * The contents of this CResult_Bolt11InvoiceSignOrCreationErrorZ, accessible via either
16401 * `err` or `result` depending on the state of `result_ok`.
16403 union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr contents;
16405 * Whether this CResult_Bolt11InvoiceSignOrCreationErrorZ represents a success state.
16408 } LDKCResult_Bolt11InvoiceSignOrCreationErrorZ;
16413 * A simple future which can complete once, and calls some callback(s) when it does so.
16415 typedef struct MUST_USE_STRUCT LDKFuture {
16417 * A pointer to the opaque Rust object.
16418 * Nearly everywhere, inner must be non-null, however in places where
16419 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16421 LDKnativeFuture *inner;
16423 * Indicates that this is the only struct which contains the same pointer.
16424 * Rust functions which take ownership of an object provided via an argument require
16425 * this to be true and invalidate the object pointed to by inner.
16431 * A dynamically-allocated array of crate::lightning::util::wakers::Futures of arbitrary size.
16432 * This corresponds to std::vector in C++
16434 typedef struct LDKCVec_FutureZ {
16436 * The elements in the array.
16437 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
16439 struct LDKFuture *data;
16441 * The number of elements pointed to by `data`.
16447 * The contents of CResult_OffersMessageDecodeErrorZ
16449 typedef union LDKCResult_OffersMessageDecodeErrorZPtr {
16451 * A pointer to the contents in the success state.
16452 * Reading from this pointer when `result_ok` is not set is undefined.
16454 struct LDKOffersMessage *result;
16456 * A pointer to the contents in the error state.
16457 * Reading from this pointer when `result_ok` is set is undefined.
16459 struct LDKDecodeError *err;
16460 } LDKCResult_OffersMessageDecodeErrorZPtr;
16463 * A CResult_OffersMessageDecodeErrorZ represents the result of a fallible operation,
16464 * containing a crate::lightning::onion_message::offers::OffersMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
16465 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16467 typedef struct LDKCResult_OffersMessageDecodeErrorZ {
16469 * The contents of this CResult_OffersMessageDecodeErrorZ, accessible via either
16470 * `err` or `result` depending on the state of `result_ok`.
16472 union LDKCResult_OffersMessageDecodeErrorZPtr contents;
16474 * Whether this CResult_OffersMessageDecodeErrorZ represents a success state.
16477 } LDKCResult_OffersMessageDecodeErrorZ;
16480 * An enum which can either contain a crate::lightning::ln::chan_utils::HTLCClaim or not
16482 typedef enum LDKCOption_HTLCClaimZ_Tag {
16484 * When we're in this state, this COption_HTLCClaimZ contains a crate::lightning::ln::chan_utils::HTLCClaim
16486 LDKCOption_HTLCClaimZ_Some,
16488 * When we're in this state, this COption_HTLCClaimZ contains nothing
16490 LDKCOption_HTLCClaimZ_None,
16492 * Must be last for serialization purposes
16494 LDKCOption_HTLCClaimZ_Sentinel,
16495 } LDKCOption_HTLCClaimZ_Tag;
16497 typedef struct LDKCOption_HTLCClaimZ {
16498 LDKCOption_HTLCClaimZ_Tag tag;
16501 enum LDKHTLCClaim some;
16504 } LDKCOption_HTLCClaimZ;
16509 * Implements the per-commitment secret storage scheme from
16510 * [BOLT 3](https://github.com/lightning/bolts/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage).
16512 * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes
16515 typedef struct MUST_USE_STRUCT LDKCounterpartyCommitmentSecrets {
16517 * A pointer to the opaque Rust object.
16518 * Nearly everywhere, inner must be non-null, however in places where
16519 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16521 LDKnativeCounterpartyCommitmentSecrets *inner;
16523 * Indicates that this is the only struct which contains the same pointer.
16524 * Rust functions which take ownership of an object provided via an argument require
16525 * this to be true and invalidate the object pointed to by inner.
16528 } LDKCounterpartyCommitmentSecrets;
16531 * The contents of CResult_CounterpartyCommitmentSecretsDecodeErrorZ
16533 typedef union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr {
16535 * A pointer to the contents in the success state.
16536 * Reading from this pointer when `result_ok` is not set is undefined.
16538 struct LDKCounterpartyCommitmentSecrets *result;
16540 * A pointer to the contents in the error state.
16541 * Reading from this pointer when `result_ok` is set is undefined.
16543 struct LDKDecodeError *err;
16544 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr;
16547 * A CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents the result of a fallible operation,
16548 * containing a crate::lightning::ln::chan_utils::CounterpartyCommitmentSecrets on success and a crate::lightning::ln::msgs::DecodeError on failure.
16549 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16551 typedef struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ {
16553 * The contents of this CResult_CounterpartyCommitmentSecretsDecodeErrorZ, accessible via either
16554 * `err` or `result` depending on the state of `result_ok`.
16556 union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr contents;
16558 * Whether this CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents a success state.
16561 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ;
16566 * The set of public keys which are used in the creation of one commitment transaction.
16567 * These are derived from the channel base keys and per-commitment data.
16569 * A broadcaster key is provided from potential broadcaster of the computed transaction.
16570 * A countersignatory key is coming from a protocol participant unable to broadcast the
16573 * These keys are assumed to be good, either because the code derived them from
16574 * channel basepoints via the new function, or they were obtained via
16575 * CommitmentTransaction.trust().keys() because we trusted the source of the
16576 * pre-calculated keys.
16578 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
16580 * A pointer to the opaque Rust object.
16581 * Nearly everywhere, inner must be non-null, however in places where
16582 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16584 LDKnativeTxCreationKeys *inner;
16586 * Indicates that this is the only struct which contains the same pointer.
16587 * Rust functions which take ownership of an object provided via an argument require
16588 * this to be true and invalidate the object pointed to by inner.
16591 } LDKTxCreationKeys;
16594 * The contents of CResult_TxCreationKeysDecodeErrorZ
16596 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
16598 * A pointer to the contents in the success state.
16599 * Reading from this pointer when `result_ok` is not set is undefined.
16601 struct LDKTxCreationKeys *result;
16603 * A pointer to the contents in the error state.
16604 * Reading from this pointer when `result_ok` is set is undefined.
16606 struct LDKDecodeError *err;
16607 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
16610 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
16611 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
16612 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16614 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
16616 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
16617 * `err` or `result` depending on the state of `result_ok`.
16619 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
16621 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
16624 } LDKCResult_TxCreationKeysDecodeErrorZ;
16627 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
16629 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
16631 * A pointer to the contents in the success state.
16632 * Reading from this pointer when `result_ok` is not set is undefined.
16634 struct LDKChannelPublicKeys *result;
16636 * A pointer to the contents in the error state.
16637 * Reading from this pointer when `result_ok` is set is undefined.
16639 struct LDKDecodeError *err;
16640 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
16643 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
16644 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
16645 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16647 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
16649 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
16650 * `err` or `result` depending on the state of `result_ok`.
16652 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
16654 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
16657 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
16660 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
16662 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
16664 * A pointer to the contents in the success state.
16665 * Reading from this pointer when `result_ok` is not set is undefined.
16667 struct LDKHTLCOutputInCommitment *result;
16669 * A pointer to the contents in the error state.
16670 * Reading from this pointer when `result_ok` is set is undefined.
16672 struct LDKDecodeError *err;
16673 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
16676 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
16677 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
16678 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16680 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
16682 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
16683 * `err` or `result` depending on the state of `result_ok`.
16685 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
16687 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
16690 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
16695 * Late-bound per-channel counterparty data used to build transactions.
16697 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
16699 * A pointer to the opaque Rust object.
16700 * Nearly everywhere, inner must be non-null, however in places where
16701 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16703 LDKnativeCounterpartyChannelTransactionParameters *inner;
16705 * Indicates that this is the only struct which contains the same pointer.
16706 * Rust functions which take ownership of an object provided via an argument require
16707 * this to be true and invalidate the object pointed to by inner.
16710 } LDKCounterpartyChannelTransactionParameters;
16713 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
16715 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
16717 * A pointer to the contents in the success state.
16718 * Reading from this pointer when `result_ok` is not set is undefined.
16720 struct LDKCounterpartyChannelTransactionParameters *result;
16722 * A pointer to the contents in the error state.
16723 * Reading from this pointer when `result_ok` is set is undefined.
16725 struct LDKDecodeError *err;
16726 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
16729 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
16730 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
16731 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16733 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
16735 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
16736 * `err` or `result` depending on the state of `result_ok`.
16738 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
16740 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
16743 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
16746 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
16748 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
16750 * A pointer to the contents in the success state.
16751 * Reading from this pointer when `result_ok` is not set is undefined.
16753 struct LDKChannelTransactionParameters *result;
16755 * A pointer to the contents in the error state.
16756 * Reading from this pointer when `result_ok` is set is undefined.
16758 struct LDKDecodeError *err;
16759 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
16762 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
16763 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
16764 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16766 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
16768 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
16769 * `err` or `result` depending on the state of `result_ok`.
16771 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
16773 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
16776 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
16779 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
16781 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
16783 * A pointer to the contents in the success state.
16784 * Reading from this pointer when `result_ok` is not set is undefined.
16786 struct LDKHolderCommitmentTransaction *result;
16788 * A pointer to the contents in the error state.
16789 * Reading from this pointer when `result_ok` is set is undefined.
16791 struct LDKDecodeError *err;
16792 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
16795 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
16796 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
16797 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16799 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
16801 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
16802 * `err` or `result` depending on the state of `result_ok`.
16804 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
16806 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
16809 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
16814 * A pre-built Bitcoin commitment transaction and its txid.
16816 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
16818 * A pointer to the opaque Rust object.
16819 * Nearly everywhere, inner must be non-null, however in places where
16820 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16822 LDKnativeBuiltCommitmentTransaction *inner;
16824 * Indicates that this is the only struct which contains the same pointer.
16825 * Rust functions which take ownership of an object provided via an argument require
16826 * this to be true and invalidate the object pointed to by inner.
16829 } LDKBuiltCommitmentTransaction;
16832 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
16834 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
16836 * A pointer to the contents in the success state.
16837 * Reading from this pointer when `result_ok` is not set is undefined.
16839 struct LDKBuiltCommitmentTransaction *result;
16841 * A pointer to the contents in the error state.
16842 * Reading from this pointer when `result_ok` is set is undefined.
16844 struct LDKDecodeError *err;
16845 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
16848 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
16849 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
16850 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16852 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
16854 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
16855 * `err` or `result` depending on the state of `result_ok`.
16857 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
16859 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
16862 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
16867 * A wrapper on ClosingTransaction indicating that the built bitcoin
16868 * transaction is trusted.
16870 * See trust() and verify() functions on CommitmentTransaction.
16872 * This structure implements Deref.
16874 typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
16876 * A pointer to the opaque Rust object.
16877 * Nearly everywhere, inner must be non-null, however in places where
16878 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16880 LDKnativeTrustedClosingTransaction *inner;
16882 * Indicates that this is the only struct which contains the same pointer.
16883 * Rust functions which take ownership of an object provided via an argument require
16884 * this to be true and invalidate the object pointed to by inner.
16887 } LDKTrustedClosingTransaction;
16890 * The contents of CResult_TrustedClosingTransactionNoneZ
16892 typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
16894 * A pointer to the contents in the success state.
16895 * Reading from this pointer when `result_ok` is not set is undefined.
16897 struct LDKTrustedClosingTransaction *result;
16899 * Note that this value is always NULL, as there are no contents in the Err variant
16902 } LDKCResult_TrustedClosingTransactionNoneZPtr;
16905 * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
16906 * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
16907 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16909 typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
16911 * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
16912 * `err` or `result` depending on the state of `result_ok`.
16914 union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
16916 * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
16919 } LDKCResult_TrustedClosingTransactionNoneZ;
16922 * The contents of CResult_CommitmentTransactionDecodeErrorZ
16924 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
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 LDKCommitmentTransaction *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_CommitmentTransactionDecodeErrorZPtr;
16938 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
16939 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction 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_CommitmentTransactionDecodeErrorZ {
16944 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
16945 * `err` or `result` depending on the state of `result_ok`.
16947 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
16949 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
16952 } LDKCResult_CommitmentTransactionDecodeErrorZ;
16957 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
16958 * transaction and the transaction creation keys) are trusted.
16960 * See trust() and verify() functions on CommitmentTransaction.
16962 * This structure implements Deref.
16964 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
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 LDKnativeTrustedCommitmentTransaction *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 } LDKTrustedCommitmentTransaction;
16980 * The contents of CResult_TrustedCommitmentTransactionNoneZ
16982 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
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 LDKTrustedCommitmentTransaction *result;
16989 * Note that this value is always NULL, as there are no contents in the Err variant
16992 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
16995 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
16996 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
16997 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16999 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
17001 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
17002 * `err` or `result` depending on the state of `result_ok`.
17004 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
17006 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
17009 } LDKCResult_TrustedCommitmentTransactionNoneZ;
17012 * The contents of CResult_CVec_ECDSASignatureZNoneZ
17014 typedef union LDKCResult_CVec_ECDSASignatureZNoneZPtr {
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 LDKCVec_ECDSASignatureZ *result;
17021 * Note that this value is always NULL, as there are no contents in the Err variant
17024 } LDKCResult_CVec_ECDSASignatureZNoneZPtr;
17027 * A CResult_CVec_ECDSASignatureZNoneZ represents the result of a fallible operation,
17028 * containing a crate::c_types::derived::CVec_ECDSASignatureZ on success and a () on failure.
17029 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17031 typedef struct LDKCResult_CVec_ECDSASignatureZNoneZ {
17033 * The contents of this CResult_CVec_ECDSASignatureZNoneZ, accessible via either
17034 * `err` or `result` depending on the state of `result_ok`.
17036 union LDKCResult_CVec_ECDSASignatureZNoneZPtr contents;
17038 * Whether this CResult_CVec_ECDSASignatureZNoneZ represents a success state.
17041 } LDKCResult_CVec_ECDSASignatureZNoneZ;
17044 * An enum which can either contain a usize or not
17046 typedef enum LDKCOption_usizeZ_Tag {
17048 * When we're in this state, this COption_usizeZ contains a usize
17050 LDKCOption_usizeZ_Some,
17052 * When we're in this state, this COption_usizeZ contains nothing
17054 LDKCOption_usizeZ_None,
17056 * Must be last for serialization purposes
17058 LDKCOption_usizeZ_Sentinel,
17059 } LDKCOption_usizeZ_Tag;
17061 typedef struct LDKCOption_usizeZ {
17062 LDKCOption_usizeZ_Tag tag;
17068 } LDKCOption_usizeZ;
17071 * The contents of CResult_ShutdownScriptDecodeErrorZ
17073 typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
17075 * A pointer to the contents in the success state.
17076 * Reading from this pointer when `result_ok` is not set is undefined.
17078 struct LDKShutdownScript *result;
17080 * A pointer to the contents in the error state.
17081 * Reading from this pointer when `result_ok` is set is undefined.
17083 struct LDKDecodeError *err;
17084 } LDKCResult_ShutdownScriptDecodeErrorZPtr;
17087 * A CResult_ShutdownScriptDecodeErrorZ represents the result of a fallible operation,
17088 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::msgs::DecodeError on failure.
17089 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17091 typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
17093 * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
17094 * `err` or `result` depending on the state of `result_ok`.
17096 union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
17098 * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
17101 } LDKCResult_ShutdownScriptDecodeErrorZ;
17106 * An error occurring when converting from [`ScriptBuf`] to [`ShutdownScript`].
17108 typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
17110 * A pointer to the opaque Rust object.
17111 * Nearly everywhere, inner must be non-null, however in places where
17112 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17114 LDKnativeInvalidShutdownScript *inner;
17116 * Indicates that this is the only struct which contains the same pointer.
17117 * Rust functions which take ownership of an object provided via an argument require
17118 * this to be true and invalidate the object pointed to by inner.
17121 } LDKInvalidShutdownScript;
17124 * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
17126 typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
17128 * A pointer to the contents in the success state.
17129 * Reading from this pointer when `result_ok` is not set is undefined.
17131 struct LDKShutdownScript *result;
17133 * A pointer to the contents in the error state.
17134 * Reading from this pointer when `result_ok` is set is undefined.
17136 struct LDKInvalidShutdownScript *err;
17137 } LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
17140 * A CResult_ShutdownScriptInvalidShutdownScriptZ represents the result of a fallible operation,
17141 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::script::InvalidShutdownScript on failure.
17142 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17144 typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
17146 * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
17147 * `err` or `result` depending on the state of `result_ok`.
17149 union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
17151 * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
17154 } LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
17157 * Some information provided on receipt of payment depends on whether the payment received is a
17158 * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
17160 typedef enum LDKPaymentPurpose_Tag {
17162 * A payment for a BOLT 11 invoice.
17164 LDKPaymentPurpose_Bolt11InvoicePayment,
17166 * A payment for a BOLT 12 [`Offer`].
17168 * [`Offer`]: crate::offers::offer::Offer
17170 LDKPaymentPurpose_Bolt12OfferPayment,
17172 * A payment for a BOLT 12 [`Refund`].
17174 * [`Refund`]: crate::offers::refund::Refund
17176 LDKPaymentPurpose_Bolt12RefundPayment,
17178 * Because this is a spontaneous payment, the payer generated their own preimage rather than us
17179 * (the payee) providing a preimage.
17181 LDKPaymentPurpose_SpontaneousPayment,
17183 * Must be last for serialization purposes
17185 LDKPaymentPurpose_Sentinel,
17186 } LDKPaymentPurpose_Tag;
17188 typedef struct LDKPaymentPurpose_LDKBolt11InvoicePayment_Body {
17190 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
17191 * [`ChannelManager::create_inbound_payment`]. When handling [`Event::PaymentClaimable`],
17192 * this can be passed directly to [`ChannelManager::claim_funds`] to claim the payment. No
17193 * action is needed when seen in [`Event::PaymentClaimed`].
17195 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
17196 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
17198 struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
17200 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
17201 * number of deanonymization attacks during the routing process.
17202 * It is provided here for your reference, however its accuracy is enforced directly by
17203 * [`ChannelManager`] using the values you previously provided to
17204 * [`ChannelManager::create_inbound_payment`] or
17205 * [`ChannelManager::create_inbound_payment_for_hash`].
17207 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
17208 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
17209 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
17211 struct LDKThirtyTwoBytes payment_secret;
17212 } LDKPaymentPurpose_LDKBolt11InvoicePayment_Body;
17214 typedef struct LDKPaymentPurpose_LDKBolt12OfferPayment_Body {
17216 * The preimage to the payment hash. When handling [`Event::PaymentClaimable`], this can be
17217 * passed directly to [`ChannelManager::claim_funds`], if provided. No action is needed
17218 * when seen in [`Event::PaymentClaimed`].
17220 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
17222 struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
17224 * The secret used to authenticate the sender to the recipient, preventing a number of
17225 * de-anonymization attacks while routing a payment.
17227 * See [`PaymentPurpose::Bolt11InvoicePayment::payment_secret`] for further details.
17229 struct LDKThirtyTwoBytes payment_secret;
17231 * The context of the payment such as information about the corresponding [`Offer`] and
17232 * [`InvoiceRequest`].
17234 * [`Offer`]: crate::offers::offer::Offer
17235 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
17237 struct LDKBolt12OfferContext payment_context;
17238 } LDKPaymentPurpose_LDKBolt12OfferPayment_Body;
17240 typedef struct LDKPaymentPurpose_LDKBolt12RefundPayment_Body {
17242 * The preimage to the payment hash. When handling [`Event::PaymentClaimable`], this can be
17243 * passed directly to [`ChannelManager::claim_funds`], if provided. No action is needed
17244 * when seen in [`Event::PaymentClaimed`].
17246 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
17248 struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
17250 * The secret used to authenticate the sender to the recipient, preventing a number of
17251 * de-anonymization attacks while routing a payment.
17253 * See [`PaymentPurpose::Bolt11InvoicePayment::payment_secret`] for further details.
17255 struct LDKThirtyTwoBytes payment_secret;
17257 * The context of the payment such as information about the corresponding [`Refund`].
17259 * [`Refund`]: crate::offers::refund::Refund
17261 struct LDKBolt12RefundContext payment_context;
17262 } LDKPaymentPurpose_LDKBolt12RefundPayment_Body;
17264 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
17265 LDKPaymentPurpose_Tag tag;
17267 LDKPaymentPurpose_LDKBolt11InvoicePayment_Body bolt11_invoice_payment;
17268 LDKPaymentPurpose_LDKBolt12OfferPayment_Body bolt12_offer_payment;
17269 LDKPaymentPurpose_LDKBolt12RefundPayment_Body bolt12_refund_payment;
17271 struct LDKThirtyTwoBytes spontaneous_payment;
17274 } LDKPaymentPurpose;
17277 * The contents of CResult_PaymentPurposeDecodeErrorZ
17279 typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
17281 * A pointer to the contents in the success state.
17282 * Reading from this pointer when `result_ok` is not set is undefined.
17284 struct LDKPaymentPurpose *result;
17286 * A pointer to the contents in the error state.
17287 * Reading from this pointer when `result_ok` is set is undefined.
17289 struct LDKDecodeError *err;
17290 } LDKCResult_PaymentPurposeDecodeErrorZPtr;
17293 * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
17294 * containing a crate::lightning::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
17295 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17297 typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
17299 * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
17300 * `err` or `result` depending on the state of `result_ok`.
17302 union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
17304 * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
17307 } LDKCResult_PaymentPurposeDecodeErrorZ;
17312 * Information about an HTLC that is part of a payment that can be claimed.
17314 typedef struct MUST_USE_STRUCT LDKClaimedHTLC {
17316 * A pointer to the opaque Rust object.
17317 * Nearly everywhere, inner must be non-null, however in places where
17318 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17320 LDKnativeClaimedHTLC *inner;
17322 * Indicates that this is the only struct which contains the same pointer.
17323 * Rust functions which take ownership of an object provided via an argument require
17324 * this to be true and invalidate the object pointed to by inner.
17330 * The contents of CResult_ClaimedHTLCDecodeErrorZ
17332 typedef union LDKCResult_ClaimedHTLCDecodeErrorZPtr {
17334 * A pointer to the contents in the success state.
17335 * Reading from this pointer when `result_ok` is not set is undefined.
17337 struct LDKClaimedHTLC *result;
17339 * A pointer to the contents in the error state.
17340 * Reading from this pointer when `result_ok` is set is undefined.
17342 struct LDKDecodeError *err;
17343 } LDKCResult_ClaimedHTLCDecodeErrorZPtr;
17346 * A CResult_ClaimedHTLCDecodeErrorZ represents the result of a fallible operation,
17347 * containing a crate::lightning::events::ClaimedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
17348 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17350 typedef struct LDKCResult_ClaimedHTLCDecodeErrorZ {
17352 * The contents of this CResult_ClaimedHTLCDecodeErrorZ, accessible via either
17353 * `err` or `result` depending on the state of `result_ok`.
17355 union LDKCResult_ClaimedHTLCDecodeErrorZPtr contents;
17357 * Whether this CResult_ClaimedHTLCDecodeErrorZ represents a success state.
17360 } LDKCResult_ClaimedHTLCDecodeErrorZ;
17363 * When the payment path failure took place and extra details about it. [`PathFailure::OnPath`] may
17364 * contain a [`NetworkUpdate`] that needs to be applied to the [`NetworkGraph`].
17366 * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
17367 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
17369 typedef enum LDKPathFailure_Tag {
17371 * We failed to initially send the payment and no HTLC was committed to. Contains the relevant
17374 LDKPathFailure_InitialSend,
17376 * A hop on the path failed to forward our payment.
17378 LDKPathFailure_OnPath,
17380 * Must be last for serialization purposes
17382 LDKPathFailure_Sentinel,
17383 } LDKPathFailure_Tag;
17385 typedef struct LDKPathFailure_LDKInitialSend_Body {
17387 * The error surfaced from initial send.
17389 struct LDKAPIError err;
17390 } LDKPathFailure_LDKInitialSend_Body;
17392 typedef struct LDKPathFailure_LDKOnPath_Body {
17394 * If present, this [`NetworkUpdate`] should be applied to the [`NetworkGraph`] so that routing
17395 * decisions can take into account the update.
17397 * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
17398 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
17400 struct LDKCOption_NetworkUpdateZ network_update;
17401 } LDKPathFailure_LDKOnPath_Body;
17403 typedef struct MUST_USE_STRUCT LDKPathFailure {
17404 LDKPathFailure_Tag tag;
17406 LDKPathFailure_LDKInitialSend_Body initial_send;
17407 LDKPathFailure_LDKOnPath_Body on_path;
17412 * An enum which can either contain a crate::lightning::events::PathFailure or not
17414 typedef enum LDKCOption_PathFailureZ_Tag {
17416 * When we're in this state, this COption_PathFailureZ contains a crate::lightning::events::PathFailure
17418 LDKCOption_PathFailureZ_Some,
17420 * When we're in this state, this COption_PathFailureZ contains nothing
17422 LDKCOption_PathFailureZ_None,
17424 * Must be last for serialization purposes
17426 LDKCOption_PathFailureZ_Sentinel,
17427 } LDKCOption_PathFailureZ_Tag;
17429 typedef struct LDKCOption_PathFailureZ {
17430 LDKCOption_PathFailureZ_Tag tag;
17433 struct LDKPathFailure some;
17436 } LDKCOption_PathFailureZ;
17439 * The contents of CResult_COption_PathFailureZDecodeErrorZ
17441 typedef union LDKCResult_COption_PathFailureZDecodeErrorZPtr {
17443 * A pointer to the contents in the success state.
17444 * Reading from this pointer when `result_ok` is not set is undefined.
17446 struct LDKCOption_PathFailureZ *result;
17448 * A pointer to the contents in the error state.
17449 * Reading from this pointer when `result_ok` is set is undefined.
17451 struct LDKDecodeError *err;
17452 } LDKCResult_COption_PathFailureZDecodeErrorZPtr;
17455 * A CResult_COption_PathFailureZDecodeErrorZ represents the result of a fallible operation,
17456 * containing a crate::c_types::derived::COption_PathFailureZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
17457 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17459 typedef struct LDKCResult_COption_PathFailureZDecodeErrorZ {
17461 * The contents of this CResult_COption_PathFailureZDecodeErrorZ, accessible via either
17462 * `err` or `result` depending on the state of `result_ok`.
17464 union LDKCResult_COption_PathFailureZDecodeErrorZPtr contents;
17466 * Whether this CResult_COption_PathFailureZDecodeErrorZ represents a success state.
17469 } LDKCResult_COption_PathFailureZDecodeErrorZ;
17472 * An enum which can either contain a crate::lightning::events::ClosureReason or not
17474 typedef enum LDKCOption_ClosureReasonZ_Tag {
17476 * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::events::ClosureReason
17478 LDKCOption_ClosureReasonZ_Some,
17480 * When we're in this state, this COption_ClosureReasonZ contains nothing
17482 LDKCOption_ClosureReasonZ_None,
17484 * Must be last for serialization purposes
17486 LDKCOption_ClosureReasonZ_Sentinel,
17487 } LDKCOption_ClosureReasonZ_Tag;
17489 typedef struct LDKCOption_ClosureReasonZ {
17490 LDKCOption_ClosureReasonZ_Tag tag;
17493 struct LDKClosureReason some;
17496 } LDKCOption_ClosureReasonZ;
17499 * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
17501 typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
17503 * A pointer to the contents in the success state.
17504 * Reading from this pointer when `result_ok` is not set is undefined.
17506 struct LDKCOption_ClosureReasonZ *result;
17508 * A pointer to the contents in the error state.
17509 * Reading from this pointer when `result_ok` is set is undefined.
17511 struct LDKDecodeError *err;
17512 } LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
17515 * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
17516 * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
17517 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17519 typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
17521 * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
17522 * `err` or `result` depending on the state of `result_ok`.
17524 union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
17526 * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
17529 } LDKCResult_COption_ClosureReasonZDecodeErrorZ;
17532 * Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
17534 typedef enum LDKHTLCDestination_Tag {
17536 * We tried forwarding to a channel but failed to do so. An example of such an instance is when
17537 * there is insufficient capacity in our outbound channel.
17539 LDKHTLCDestination_NextHopChannel,
17541 * Scenario where we are unsure of the next node to forward the HTLC to.
17543 LDKHTLCDestination_UnknownNextHop,
17545 * We couldn't forward to the outgoing scid. An example would be attempting to send a duplicate
17548 LDKHTLCDestination_InvalidForward,
17550 * We couldn't decode the incoming onion to obtain the forwarding details.
17552 LDKHTLCDestination_InvalidOnion,
17554 * Failure scenario where an HTLC may have been forwarded to be intended for us,
17555 * but is invalid for some reason, so we reject it.
17557 * Some of the reasons may include:
17559 * * Excess HTLCs for a payment that we have already fully received, over-paying for the
17561 * * The counterparty node modified the HTLC in transit,
17562 * * A probing attack where an intermediary node is trying to detect if we are the ultimate
17563 * recipient for a payment.
17565 LDKHTLCDestination_FailedPayment,
17567 * Must be last for serialization purposes
17569 LDKHTLCDestination_Sentinel,
17570 } LDKHTLCDestination_Tag;
17572 typedef struct LDKHTLCDestination_LDKNextHopChannel_Body {
17574 * The `node_id` of the next node. For backwards compatibility, this field is
17575 * marked as optional, versions prior to 0.0.110 may not always be able to provide
17576 * counterparty node information.
17578 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
17580 struct LDKPublicKey node_id;
17582 * The outgoing `channel_id` between us and the next node.
17584 struct LDKChannelId channel_id;
17585 } LDKHTLCDestination_LDKNextHopChannel_Body;
17587 typedef struct LDKHTLCDestination_LDKUnknownNextHop_Body {
17589 * Short channel id we are requesting to forward an HTLC to.
17591 uint64_t requested_forward_scid;
17592 } LDKHTLCDestination_LDKUnknownNextHop_Body;
17594 typedef struct LDKHTLCDestination_LDKInvalidForward_Body {
17596 * Short channel id we are requesting to forward an HTLC to.
17598 uint64_t requested_forward_scid;
17599 } LDKHTLCDestination_LDKInvalidForward_Body;
17601 typedef struct LDKHTLCDestination_LDKFailedPayment_Body {
17603 * The payment hash of the payment we attempted to process.
17605 struct LDKThirtyTwoBytes payment_hash;
17606 } LDKHTLCDestination_LDKFailedPayment_Body;
17608 typedef struct MUST_USE_STRUCT LDKHTLCDestination {
17609 LDKHTLCDestination_Tag tag;
17611 LDKHTLCDestination_LDKNextHopChannel_Body next_hop_channel;
17612 LDKHTLCDestination_LDKUnknownNextHop_Body unknown_next_hop;
17613 LDKHTLCDestination_LDKInvalidForward_Body invalid_forward;
17614 LDKHTLCDestination_LDKFailedPayment_Body failed_payment;
17616 } LDKHTLCDestination;
17619 * An enum which can either contain a crate::lightning::events::HTLCDestination or not
17621 typedef enum LDKCOption_HTLCDestinationZ_Tag {
17623 * When we're in this state, this COption_HTLCDestinationZ contains a crate::lightning::events::HTLCDestination
17625 LDKCOption_HTLCDestinationZ_Some,
17627 * When we're in this state, this COption_HTLCDestinationZ contains nothing
17629 LDKCOption_HTLCDestinationZ_None,
17631 * Must be last for serialization purposes
17633 LDKCOption_HTLCDestinationZ_Sentinel,
17634 } LDKCOption_HTLCDestinationZ_Tag;
17636 typedef struct LDKCOption_HTLCDestinationZ {
17637 LDKCOption_HTLCDestinationZ_Tag tag;
17640 struct LDKHTLCDestination some;
17643 } LDKCOption_HTLCDestinationZ;
17646 * The contents of CResult_COption_HTLCDestinationZDecodeErrorZ
17648 typedef union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr {
17650 * A pointer to the contents in the success state.
17651 * Reading from this pointer when `result_ok` is not set is undefined.
17653 struct LDKCOption_HTLCDestinationZ *result;
17655 * A pointer to the contents in the error state.
17656 * Reading from this pointer when `result_ok` is set is undefined.
17658 struct LDKDecodeError *err;
17659 } LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr;
17662 * A CResult_COption_HTLCDestinationZDecodeErrorZ represents the result of a fallible operation,
17663 * containing a crate::c_types::derived::COption_HTLCDestinationZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
17664 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17666 typedef struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ {
17668 * The contents of this CResult_COption_HTLCDestinationZDecodeErrorZ, accessible via either
17669 * `err` or `result` depending on the state of `result_ok`.
17671 union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr contents;
17673 * Whether this CResult_COption_HTLCDestinationZDecodeErrorZ represents a success state.
17676 } LDKCResult_COption_HTLCDestinationZDecodeErrorZ;
17679 * The contents of CResult_PaymentFailureReasonDecodeErrorZ
17681 typedef union LDKCResult_PaymentFailureReasonDecodeErrorZPtr {
17683 * A pointer to the contents in the success state.
17684 * Reading from this pointer when `result_ok` is not set is undefined.
17686 enum LDKPaymentFailureReason *result;
17688 * A pointer to the contents in the error state.
17689 * Reading from this pointer when `result_ok` is set is undefined.
17691 struct LDKDecodeError *err;
17692 } LDKCResult_PaymentFailureReasonDecodeErrorZPtr;
17695 * A CResult_PaymentFailureReasonDecodeErrorZ represents the result of a fallible operation,
17696 * containing a crate::lightning::events::PaymentFailureReason on success and a crate::lightning::ln::msgs::DecodeError on failure.
17697 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17699 typedef struct LDKCResult_PaymentFailureReasonDecodeErrorZ {
17701 * The contents of this CResult_PaymentFailureReasonDecodeErrorZ, accessible via either
17702 * `err` or `result` depending on the state of `result_ok`.
17704 union LDKCResult_PaymentFailureReasonDecodeErrorZPtr contents;
17706 * Whether this CResult_PaymentFailureReasonDecodeErrorZ represents a success state.
17709 } LDKCResult_PaymentFailureReasonDecodeErrorZ;
17712 * An enum which can either contain a crate::c_types::U128 or not
17714 typedef enum LDKCOption_U128Z_Tag {
17716 * When we're in this state, this COption_U128Z contains a crate::c_types::U128
17718 LDKCOption_U128Z_Some,
17720 * When we're in this state, this COption_U128Z contains nothing
17722 LDKCOption_U128Z_None,
17724 * Must be last for serialization purposes
17726 LDKCOption_U128Z_Sentinel,
17727 } LDKCOption_U128Z_Tag;
17729 typedef struct LDKCOption_U128Z {
17730 LDKCOption_U128Z_Tag tag;
17733 struct LDKU128 some;
17736 } LDKCOption_U128Z;
17739 * A dynamically-allocated array of crate::lightning::events::ClaimedHTLCs of arbitrary size.
17740 * This corresponds to std::vector in C++
17742 typedef struct LDKCVec_ClaimedHTLCZ {
17744 * The elements in the array.
17745 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
17747 struct LDKClaimedHTLC *data;
17749 * The number of elements pointed to by `data`.
17752 } LDKCVec_ClaimedHTLCZ;
17755 * An enum which can either contain a crate::lightning::events::PaymentFailureReason or not
17757 typedef enum LDKCOption_PaymentFailureReasonZ_Tag {
17759 * When we're in this state, this COption_PaymentFailureReasonZ contains a crate::lightning::events::PaymentFailureReason
17761 LDKCOption_PaymentFailureReasonZ_Some,
17763 * When we're in this state, this COption_PaymentFailureReasonZ contains nothing
17765 LDKCOption_PaymentFailureReasonZ_None,
17767 * Must be last for serialization purposes
17769 LDKCOption_PaymentFailureReasonZ_Sentinel,
17770 } LDKCOption_PaymentFailureReasonZ_Tag;
17772 typedef struct LDKCOption_PaymentFailureReasonZ {
17773 LDKCOption_PaymentFailureReasonZ_Tag tag;
17776 enum LDKPaymentFailureReason some;
17779 } LDKCOption_PaymentFailureReasonZ;
17784 * A descriptor used to sign for a commitment transaction's anchor output.
17786 typedef struct MUST_USE_STRUCT LDKAnchorDescriptor {
17788 * A pointer to the opaque Rust object.
17789 * Nearly everywhere, inner must be non-null, however in places where
17790 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17792 LDKnativeAnchorDescriptor *inner;
17794 * Indicates that this is the only struct which contains the same pointer.
17795 * Rust functions which take ownership of an object provided via an argument require
17796 * this to be true and invalidate the object pointed to by inner.
17799 } LDKAnchorDescriptor;
17802 * Represents the different types of transactions, originating from LDK, to be bumped.
17804 typedef enum LDKBumpTransactionEvent_Tag {
17806 * Indicates that a channel featuring anchor outputs is to be closed by broadcasting the local
17807 * commitment transaction. Since commitment transactions have a static feerate pre-agreed upon,
17808 * they may need additional fees to be attached through a child transaction using the popular
17809 * [Child-Pays-For-Parent](https://bitcoinops.org/en/topics/cpfp) fee bumping technique. This
17810 * child transaction must include the anchor input described within `anchor_descriptor` along
17811 * with additional inputs to meet the target feerate. Failure to meet the target feerate
17812 * decreases the confirmation odds of the transaction package (which includes the commitment
17813 * and child anchor transactions), possibly resulting in a loss of funds. Once the transaction
17814 * is constructed, it must be fully signed for and broadcast by the consumer of the event
17815 * along with the `commitment_tx` enclosed. Note that the `commitment_tx` must always be
17816 * broadcast first, as the child anchor transaction depends on it.
17818 * The consumer should be able to sign for any of the additional inputs included within the
17819 * child anchor transaction. To sign its anchor input, an [`EcdsaChannelSigner`] should be
17820 * re-derived through [`AnchorDescriptor::derive_channel_signer`]. The anchor input signature
17821 * can be computed with [`EcdsaChannelSigner::sign_holder_anchor_input`], which can then be
17822 * provided to [`build_anchor_input_witness`] along with the `funding_pubkey` to obtain the
17823 * full witness required to spend.
17825 * It is possible to receive more than one instance of this event if a valid child anchor
17826 * transaction is never broadcast or is but not with a sufficient fee to be mined. Care should
17827 * be taken by the consumer of the event to ensure any future iterations of the child anchor
17828 * transaction adhere to the [Replace-By-Fee
17829 * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
17830 * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
17831 * these events is not user-controlled, users may ignore/drop the event if they are no longer
17832 * able to commit external confirmed funds to the child anchor transaction.
17834 * The set of `pending_htlcs` on the commitment transaction to be broadcast can be inspected to
17835 * determine whether a significant portion of the channel's funds are allocated to HTLCs,
17836 * enabling users to make their own decisions regarding the importance of the commitment
17837 * transaction's confirmation. Note that this is not required, but simply exists as an option
17838 * for users to override LDK's behavior. On commitments with no HTLCs (indicated by those with
17839 * an empty `pending_htlcs`), confirmation of the commitment transaction can be considered to
17842 * [`EcdsaChannelSigner`]: crate::sign::ecdsa::EcdsaChannelSigner
17843 * [`EcdsaChannelSigner::sign_holder_anchor_input`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_holder_anchor_input
17844 * [`build_anchor_input_witness`]: crate::ln::chan_utils::build_anchor_input_witness
17846 LDKBumpTransactionEvent_ChannelClose,
17848 * Indicates that a channel featuring anchor outputs has unilaterally closed on-chain by a
17849 * holder commitment transaction and its HTLC(s) need to be resolved on-chain. With the
17850 * zero-HTLC-transaction-fee variant of anchor outputs, the pre-signed HTLC
17851 * transactions have a zero fee, thus requiring additional inputs and/or outputs to be attached
17852 * for a timely confirmation within the chain. These additional inputs and/or outputs must be
17853 * appended to the resulting HTLC transaction to meet the target feerate. Failure to meet the
17854 * target feerate decreases the confirmation odds of the transaction, possibly resulting in a
17855 * loss of funds. Once the transaction meets the target feerate, it must be signed for and
17856 * broadcast by the consumer of the event.
17858 * The consumer should be able to sign for any of the non-HTLC inputs added to the resulting
17859 * HTLC transaction. To sign HTLC inputs, an [`EcdsaChannelSigner`] should be re-derived
17860 * through [`HTLCDescriptor::derive_channel_signer`]. Each HTLC input's signature can be
17861 * computed with [`EcdsaChannelSigner::sign_holder_htlc_transaction`], which can then be
17862 * provided to [`HTLCDescriptor::tx_input_witness`] to obtain the fully signed witness required
17865 * It is possible to receive more than one instance of this event if a valid HTLC transaction
17866 * is never broadcast or is but not with a sufficient fee to be mined. Care should be taken by
17867 * the consumer of the event to ensure any future iterations of the HTLC transaction adhere to
17868 * the [Replace-By-Fee
17869 * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
17870 * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
17871 * these events is not user-controlled, users may ignore/drop the event if either they are no
17872 * longer able to commit external confirmed funds to the HTLC transaction or the fee committed
17873 * to the HTLC transaction is greater in value than the HTLCs being claimed.
17875 * [`EcdsaChannelSigner`]: crate::sign::ecdsa::EcdsaChannelSigner
17876 * [`EcdsaChannelSigner::sign_holder_htlc_transaction`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_holder_htlc_transaction
17878 LDKBumpTransactionEvent_HTLCResolution,
17880 * Must be last for serialization purposes
17882 LDKBumpTransactionEvent_Sentinel,
17883 } LDKBumpTransactionEvent_Tag;
17885 typedef struct LDKBumpTransactionEvent_LDKChannelClose_Body {
17887 * The `channel_id` of the channel which has been closed.
17889 struct LDKChannelId channel_id;
17891 * Counterparty in the closed channel.
17893 struct LDKPublicKey counterparty_node_id;
17895 * The unique identifier for the claim of the anchor output in the commitment transaction.
17897 * The identifier must map to the set of external UTXOs assigned to the claim, such that
17898 * they can be reused when a new claim with the same identifier needs to be made, resulting
17899 * in a fee-bumping attempt.
17901 struct LDKThirtyTwoBytes claim_id;
17903 * The target feerate that the transaction package, which consists of the commitment
17904 * transaction and the to-be-crafted child anchor transaction, must meet.
17906 uint32_t package_target_feerate_sat_per_1000_weight;
17908 * The channel's commitment transaction to bump the fee of. This transaction should be
17909 * broadcast along with the anchor transaction constructed as a result of consuming this
17912 struct LDKTransaction commitment_tx;
17914 * The absolute fee in satoshis of the commitment transaction. This can be used along the
17915 * with weight of the commitment transaction to determine its feerate.
17917 uint64_t commitment_tx_fee_satoshis;
17919 * The descriptor to sign the anchor input of the anchor transaction constructed as a
17920 * result of consuming this event.
17922 struct LDKAnchorDescriptor anchor_descriptor;
17924 * The set of pending HTLCs on the commitment transaction that need to be resolved once the
17925 * commitment transaction confirms.
17927 struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs;
17928 } LDKBumpTransactionEvent_LDKChannelClose_Body;
17930 typedef struct LDKBumpTransactionEvent_LDKHTLCResolution_Body {
17932 * The `channel_id` of the channel which has been closed.
17934 struct LDKChannelId channel_id;
17936 * Counterparty in the closed channel.
17938 struct LDKPublicKey counterparty_node_id;
17940 * The unique identifier for the claim of the HTLCs in the confirmed commitment
17943 * The identifier must map to the set of external UTXOs assigned to the claim, such that
17944 * they can be reused when a new claim with the same identifier needs to be made, resulting
17945 * in a fee-bumping attempt.
17947 struct LDKThirtyTwoBytes claim_id;
17949 * The target feerate that the resulting HTLC transaction must meet.
17951 uint32_t target_feerate_sat_per_1000_weight;
17953 * The set of pending HTLCs on the confirmed commitment that need to be claimed, preferably
17954 * by the same transaction.
17956 struct LDKCVec_HTLCDescriptorZ htlc_descriptors;
17958 * The locktime required for the resulting HTLC transaction.
17960 uint32_t tx_lock_time;
17961 } LDKBumpTransactionEvent_LDKHTLCResolution_Body;
17963 typedef struct MUST_USE_STRUCT LDKBumpTransactionEvent {
17964 LDKBumpTransactionEvent_Tag tag;
17966 LDKBumpTransactionEvent_LDKChannelClose_Body channel_close;
17967 LDKBumpTransactionEvent_LDKHTLCResolution_Body htlc_resolution;
17969 } LDKBumpTransactionEvent;
17972 * An Event which you should probably take some action in response to.
17974 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
17975 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
17976 * written as it makes no sense to respond to it after reconnecting to peers).
17978 typedef enum LDKEvent_Tag {
17980 * Used to indicate that the client should generate a funding transaction with the given
17981 * parameters and then call [`ChannelManager::funding_transaction_generated`].
17982 * Generated in [`ChannelManager`] message handling.
17983 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
17984 * counterparty can steal your funds!
17986 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
17987 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
17989 LDKEvent_FundingGenerationReady,
17991 * Indicates that we've been offered a payment and it needs to be claimed via calling
17992 * [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`].
17994 * Note that if the preimage is not known, you should call
17995 * [`ChannelManager::fail_htlc_backwards`] or [`ChannelManager::fail_htlc_backwards_with_reason`]
17996 * to free up resources for this HTLC and avoid network congestion.
17998 * If [`Event::PaymentClaimable::onion_fields`] is `Some`, and includes custom TLVs with even type
17999 * numbers, you should use [`ChannelManager::fail_htlc_backwards_with_reason`] with
18000 * [`FailureCode::InvalidOnionPayload`] if you fail to understand and handle the contents, or
18001 * [`ChannelManager::claim_funds_with_known_custom_tlvs`] upon successful handling.
18002 * If you don't intend to check for custom TLVs, you can simply use
18003 * [`ChannelManager::claim_funds`], which will automatically fail back even custom TLVs.
18005 * If you fail to call [`ChannelManager::claim_funds`],
18006 * [`ChannelManager::claim_funds_with_known_custom_tlvs`],
18007 * [`ChannelManager::fail_htlc_backwards`], or
18008 * [`ChannelManager::fail_htlc_backwards_with_reason`] within the HTLC's timeout, the HTLC will
18009 * be automatically failed.
18012 * LDK will not stop an inbound payment from being paid multiple times, so multiple
18013 * `PaymentClaimable` events may be generated for the same payment. In such a case it is
18014 * polite (and required in the lightning specification) to fail the payment the second time
18015 * and give the sender their money back rather than accepting double payment.
18018 * This event used to be called `PaymentReceived` in LDK versions 0.0.112 and earlier.
18020 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
18021 * [`ChannelManager::claim_funds_with_known_custom_tlvs`]: crate::ln::channelmanager::ChannelManager::claim_funds_with_known_custom_tlvs
18022 * [`FailureCode::InvalidOnionPayload`]: crate::ln::channelmanager::FailureCode::InvalidOnionPayload
18023 * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
18024 * [`ChannelManager::fail_htlc_backwards_with_reason`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards_with_reason
18026 LDKEvent_PaymentClaimable,
18028 * Indicates a payment has been claimed and we've received money!
18030 * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
18031 * to an [`Event::PaymentClaimable`]. However, if we previously crashed during a
18032 * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
18033 * [`Event::PaymentClaimable`] event.
18036 * LDK will not stop an inbound payment from being paid multiple times, so multiple
18037 * `PaymentClaimable` events may be generated for the same payment. If you then call
18038 * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentClaimable`] you may get
18039 * multiple `PaymentClaimed` events.
18041 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
18043 LDKEvent_PaymentClaimed,
18045 * Indicates that a peer connection with a node is needed in order to send an [`OnionMessage`].
18047 * Typically, this happens when a [`MessageRouter`] is unable to find a complete path to a
18048 * [`Destination`]. Once a connection is established, any messages buffered by an
18049 * [`OnionMessageHandler`] may be sent.
18051 * This event will not be generated for onion message forwards; only for sends including
18052 * replies. Handlers should connect to the node otherwise any buffered messages may be lost.
18054 * [`OnionMessage`]: msgs::OnionMessage
18055 * [`MessageRouter`]: crate::onion_message::messenger::MessageRouter
18056 * [`Destination`]: crate::onion_message::messenger::Destination
18057 * [`OnionMessageHandler`]: crate::ln::msgs::OnionMessageHandler
18059 LDKEvent_ConnectionNeeded,
18061 * Indicates a request for an invoice failed to yield a response in a reasonable amount of time
18062 * or was explicitly abandoned by [`ChannelManager::abandon_payment`]. This may be for an
18063 * [`InvoiceRequest`] sent for an [`Offer`] or for a [`Refund`] that hasn't been redeemed.
18065 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
18066 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
18067 * [`Offer`]: crate::offers::offer::Offer
18068 * [`Refund`]: crate::offers::refund::Refund
18070 LDKEvent_InvoiceRequestFailed,
18072 * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
18073 * and we got back the payment preimage for it).
18075 * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
18076 * event. In this situation, you SHOULD treat this payment as having succeeded.
18078 LDKEvent_PaymentSent,
18080 * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
18081 * provide failure information for each path attempt in the payment, including retries.
18083 * This event is provided once there are no further pending HTLCs for the payment and the
18084 * payment is no longer retryable, due either to the [`Retry`] provided or
18085 * [`ChannelManager::abandon_payment`] having been called for the corresponding payment.
18087 * In exceedingly rare cases, it is possible that an [`Event::PaymentFailed`] is generated for
18088 * a payment after an [`Event::PaymentSent`] event for this same payment has already been
18089 * received and processed. In this case, the [`Event::PaymentFailed`] event MUST be ignored,
18090 * and the payment MUST be treated as having succeeded.
18092 * [`Retry`]: crate::ln::channelmanager::Retry
18093 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
18095 LDKEvent_PaymentFailed,
18097 * Indicates that a path for an outbound payment was successful.
18099 * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
18100 * [`Event::PaymentSent`] for obtaining the payment preimage.
18102 LDKEvent_PaymentPathSuccessful,
18104 * Indicates an outbound HTLC we sent failed, likely due to an intermediary node being unable to
18107 * Note that this does *not* indicate that all paths for an MPP payment have failed, see
18108 * [`Event::PaymentFailed`].
18110 * See [`ChannelManager::abandon_payment`] for giving up on this payment before its retries have
18113 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
18115 LDKEvent_PaymentPathFailed,
18117 * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
18119 LDKEvent_ProbeSuccessful,
18121 * Indicates that a probe payment we sent failed at an intermediary node on the path.
18123 LDKEvent_ProbeFailed,
18125 * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
18126 * a time in the future.
18128 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
18130 LDKEvent_PendingHTLCsForwardable,
18132 * Used to indicate that we've intercepted an HTLC forward. This event will only be generated if
18133 * you've encoded an intercept scid in the receiver's invoice route hints using
18134 * [`ChannelManager::get_intercept_scid`] and have set [`UserConfig::accept_intercept_htlcs`].
18136 * [`ChannelManager::forward_intercepted_htlc`] or
18137 * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to this event. See
18138 * their docs for more information.
18140 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
18141 * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
18142 * [`ChannelManager::forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
18143 * [`ChannelManager::fail_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::fail_intercepted_htlc
18145 LDKEvent_HTLCIntercepted,
18147 * Used to indicate that an output which you should know how to spend was confirmed on chain
18148 * and is now spendable.
18150 * Such an output will *never* be spent directly by LDK, and are not at risk of your
18151 * counterparty spending them due to some kind of timeout. Thus, you need to store them
18152 * somewhere and spend them when you create on-chain transactions.
18154 * You may hand them to the [`OutputSweeper`] utility which will store and (re-)generate spending
18155 * transactions for you.
18157 * [`OutputSweeper`]: crate::util::sweep::OutputSweeper
18159 LDKEvent_SpendableOutputs,
18161 * This event is generated when a payment has been successfully forwarded through us and a
18162 * forwarding fee earned.
18164 LDKEvent_PaymentForwarded,
18166 * Used to indicate that a channel with the given `channel_id` is being opened and pending
18167 * confirmation on-chain.
18169 * This event is emitted when the funding transaction has been signed and is broadcast to the
18170 * network. For 0conf channels it will be immediately followed by the corresponding
18171 * [`Event::ChannelReady`] event.
18173 LDKEvent_ChannelPending,
18175 * Used to indicate that a channel with the given `channel_id` is ready to
18176 * be used. This event is emitted either when the funding transaction has been confirmed
18177 * on-chain, or, in case of a 0conf channel, when both parties have confirmed the channel
18180 LDKEvent_ChannelReady,
18182 * Used to indicate that a channel that got past the initial handshake with the given `channel_id` is in the
18183 * process of closure. This includes previously opened channels, and channels that time out from not being funded.
18185 * Note that this event is only triggered for accepted channels: if the
18186 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true and the channel is
18187 * rejected, no `ChannelClosed` event will be sent.
18189 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18190 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
18192 LDKEvent_ChannelClosed,
18194 * Used to indicate to the user that they can abandon the funding transaction and recycle the
18195 * inputs for another purpose.
18197 * This event is not guaranteed to be generated for channels that are closed due to a restart.
18199 LDKEvent_DiscardFunding,
18201 * Indicates a request to open a new channel by a peer.
18203 * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the request,
18204 * call [`ChannelManager::force_close_without_broadcasting_txn`]. Note that a ['ChannelClosed`]
18205 * event will _not_ be triggered if the channel is rejected.
18207 * The event is only triggered when a new open channel request is received and the
18208 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
18210 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18211 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
18212 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
18214 LDKEvent_OpenChannelRequest,
18216 * Indicates that the HTLC was accepted, but could not be processed when or after attempting to
18219 * Some scenarios where this event may be sent include:
18220 * * Insufficient capacity in the outbound channel
18221 * * While waiting to forward the HTLC, the channel it is meant to be forwarded through closes
18222 * * When an unknown SCID is requested for forwarding a payment.
18223 * * Expected MPP amount has already been reached
18224 * * The HTLC has timed out
18226 * This event, however, does not get generated if an HTLC fails to meet the forwarding
18227 * requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
18229 LDKEvent_HTLCHandlingFailed,
18231 * Indicates that a transaction originating from LDK needs to have its fee bumped. This event
18232 * requires confirmed external funds to be readily available to spend.
18234 * LDK does not currently generate this event unless the
18235 * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`] config flag is set to true.
18236 * It is limited to the scope of channels with anchor outputs.
18238 * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`]: crate::util::config::ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx
18240 LDKEvent_BumpTransaction,
18242 * Must be last for serialization purposes
18247 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
18249 * The random channel_id we picked which you'll need to pass into
18250 * [`ChannelManager::funding_transaction_generated`].
18252 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
18254 struct LDKChannelId temporary_channel_id;
18256 * The counterparty's node_id, which you'll need to pass back into
18257 * [`ChannelManager::funding_transaction_generated`].
18259 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
18261 struct LDKPublicKey counterparty_node_id;
18263 * The value, in satoshis, that the output should have.
18265 uint64_t channel_value_satoshis;
18267 * The script which should be used in the transaction output.
18269 struct LDKCVec_u8Z output_script;
18271 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
18272 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
18273 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
18274 * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
18275 * serialized with LDK versions prior to 0.0.113.
18277 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
18278 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18279 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
18281 struct LDKU128 user_channel_id;
18282 } LDKEvent_LDKFundingGenerationReady_Body;
18284 typedef struct LDKEvent_LDKPaymentClaimable_Body {
18286 * The node that will receive the payment after it has been claimed.
18287 * This is useful to identify payments received via [phantom nodes].
18288 * This field will always be filled in when the event was generated by LDK versions
18289 * 0.0.113 and above.
18291 * [phantom nodes]: crate::sign::PhantomKeysManager
18293 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18295 struct LDKPublicKey receiver_node_id;
18297 * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
18298 * not stop you from registering duplicate payment hashes for inbound payments.
18300 struct LDKThirtyTwoBytes payment_hash;
18302 * The fields in the onion which were received with each HTLC. Only fields which were
18303 * identical in each HTLC involved in the payment will be included here.
18305 * Payments received on LDK versions prior to 0.0.115 will have this field unset.
18307 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18309 struct LDKRecipientOnionFields onion_fields;
18311 * The value, in thousandths of a satoshi, that this payment is claimable for. May be greater
18312 * than the invoice amount.
18314 * May be less than the invoice amount if [`ChannelConfig::accept_underpaying_htlcs`] is set
18315 * and the previous hop took an extra fee.
18318 * If [`ChannelConfig::accept_underpaying_htlcs`] is set and you claim without verifying this
18319 * field, you may lose money!
18321 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
18323 uint64_t amount_msat;
18325 * The value, in thousands of a satoshi, that was skimmed off of this payment as an extra fee
18326 * taken by our channel counterparty.
18328 * Will always be 0 unless [`ChannelConfig::accept_underpaying_htlcs`] is set.
18330 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
18332 uint64_t counterparty_skimmed_fee_msat;
18334 * Information for claiming this received payment, based on whether the purpose of the
18335 * payment is to pay an invoice or to send a spontaneous payment.
18337 struct LDKPaymentPurpose purpose;
18339 * The `channel_id` indicating over which channel we received the payment.
18341 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18343 struct LDKChannelId via_channel_id;
18345 * The `user_channel_id` indicating over which channel we received the payment.
18347 struct LDKCOption_U128Z via_user_channel_id;
18349 * The block height at which this payment will be failed back and will no longer be
18350 * eligible for claiming.
18352 * Prior to this height, a call to [`ChannelManager::claim_funds`] is guaranteed to
18353 * succeed, however you should wait for [`Event::PaymentClaimed`] to be sure.
18355 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
18357 struct LDKCOption_u32Z claim_deadline;
18358 } LDKEvent_LDKPaymentClaimable_Body;
18360 typedef struct LDKEvent_LDKPaymentClaimed_Body {
18362 * The node that received the payment.
18363 * This is useful to identify payments which were received via [phantom nodes].
18364 * This field will always be filled in when the event was generated by LDK versions
18365 * 0.0.113 and above.
18367 * [phantom nodes]: crate::sign::PhantomKeysManager
18369 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18371 struct LDKPublicKey receiver_node_id;
18373 * The payment hash of the claimed payment. Note that LDK will not stop you from
18374 * registering duplicate payment hashes for inbound payments.
18376 struct LDKThirtyTwoBytes payment_hash;
18378 * The value, in thousandths of a satoshi, that this payment is for. May be greater than the
18381 uint64_t amount_msat;
18383 * The purpose of the claimed payment, i.e. whether the payment was for an invoice or a
18384 * spontaneous payment.
18386 struct LDKPaymentPurpose purpose;
18388 * The HTLCs that comprise the claimed payment. This will be empty for events serialized prior
18389 * to LDK version 0.0.117.
18391 struct LDKCVec_ClaimedHTLCZ htlcs;
18393 * The sender-intended sum total of all the MPP parts. This will be `None` for events
18394 * serialized prior to LDK version 0.0.117.
18396 struct LDKCOption_u64Z sender_intended_total_msat;
18397 } LDKEvent_LDKPaymentClaimed_Body;
18399 typedef struct LDKEvent_LDKConnectionNeeded_Body {
18401 * The node id for the node needing a connection.
18403 struct LDKPublicKey node_id;
18405 * Sockets for connecting to the node.
18407 struct LDKCVec_SocketAddressZ addresses;
18408 } LDKEvent_LDKConnectionNeeded_Body;
18410 typedef struct LDKEvent_LDKInvoiceRequestFailed_Body {
18412 * The `payment_id` to have been associated with payment for the requested invoice.
18414 struct LDKThirtyTwoBytes payment_id;
18415 } LDKEvent_LDKInvoiceRequestFailed_Body;
18417 typedef struct LDKEvent_LDKPaymentSent_Body {
18419 * The `payment_id` passed to [`ChannelManager::send_payment`].
18421 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18423 struct LDKCOption_ThirtyTwoBytesZ payment_id;
18425 * The preimage to the hash given to ChannelManager::send_payment.
18426 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
18427 * store it somehow!
18429 struct LDKThirtyTwoBytes payment_preimage;
18431 * The hash that was given to [`ChannelManager::send_payment`].
18433 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18435 struct LDKThirtyTwoBytes payment_hash;
18437 * The total fee which was spent at intermediate hops in this payment, across all paths.
18439 * Note that, like [`Route::get_total_fees`] this does *not* include any potential
18440 * overpayment to the recipient node.
18442 * If the recipient or an intermediate node misbehaves and gives us free money, this may
18443 * overstate the amount paid, though this is unlikely.
18445 * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
18447 struct LDKCOption_u64Z fee_paid_msat;
18448 } LDKEvent_LDKPaymentSent_Body;
18450 typedef struct LDKEvent_LDKPaymentFailed_Body {
18452 * The `payment_id` passed to [`ChannelManager::send_payment`].
18454 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18456 struct LDKThirtyTwoBytes payment_id;
18458 * The hash that was given to [`ChannelManager::send_payment`].
18460 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18462 struct LDKThirtyTwoBytes payment_hash;
18464 * The reason the payment failed. This is only `None` for events generated or serialized
18465 * by versions prior to 0.0.115.
18467 struct LDKCOption_PaymentFailureReasonZ reason;
18468 } LDKEvent_LDKPaymentFailed_Body;
18470 typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
18472 * The `payment_id` passed to [`ChannelManager::send_payment`].
18474 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18476 struct LDKThirtyTwoBytes payment_id;
18478 * The hash that was given to [`ChannelManager::send_payment`].
18480 * This will be `Some` for all payments which completed on LDK 0.0.104 or later.
18482 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18484 struct LDKCOption_ThirtyTwoBytesZ payment_hash;
18486 * The payment path that was successful.
18488 * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
18490 struct LDKPath path;
18491 } LDKEvent_LDKPaymentPathSuccessful_Body;
18493 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
18495 * The `payment_id` passed to [`ChannelManager::send_payment`].
18497 * This will be `Some` for all payment paths which failed on LDK 0.0.103 or later.
18499 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18500 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
18502 struct LDKCOption_ThirtyTwoBytesZ payment_id;
18504 * The hash that was given to [`ChannelManager::send_payment`].
18506 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18508 struct LDKThirtyTwoBytes payment_hash;
18510 * Indicates the payment was rejected for some reason by the recipient. This implies that
18511 * the payment has failed, not just the route in question. If this is not set, the payment may
18512 * be retried via a different route.
18514 bool payment_failed_permanently;
18516 * Extra error details based on the failure type. May contain an update that needs to be
18517 * applied to the [`NetworkGraph`].
18519 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
18521 struct LDKPathFailure failure;
18523 * The payment path that failed.
18525 struct LDKPath path;
18527 * The channel responsible for the failed payment path.
18529 * Note that for route hints or for the first hop in a path this may be an SCID alias and
18530 * may not refer to a channel in the public network graph. These aliases may also collide
18531 * with channels in the public network graph.
18533 * If this is `Some`, then the corresponding channel should be avoided when the payment is
18534 * retried. May be `None` for older [`Event`] serializations.
18536 struct LDKCOption_u64Z short_channel_id;
18537 } LDKEvent_LDKPaymentPathFailed_Body;
18539 typedef struct LDKEvent_LDKProbeSuccessful_Body {
18541 * The id returned by [`ChannelManager::send_probe`].
18543 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
18545 struct LDKThirtyTwoBytes payment_id;
18547 * The hash generated by [`ChannelManager::send_probe`].
18549 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
18551 struct LDKThirtyTwoBytes payment_hash;
18553 * The payment path that was successful.
18555 struct LDKPath path;
18556 } LDKEvent_LDKProbeSuccessful_Body;
18558 typedef struct LDKEvent_LDKProbeFailed_Body {
18560 * The id returned by [`ChannelManager::send_probe`].
18562 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
18564 struct LDKThirtyTwoBytes payment_id;
18566 * The hash generated by [`ChannelManager::send_probe`].
18568 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
18570 struct LDKThirtyTwoBytes payment_hash;
18572 * The payment path that failed.
18574 struct LDKPath path;
18576 * The channel responsible for the failed probe.
18578 * Note that for route hints or for the first hop in a path this may be an SCID alias and
18579 * may not refer to a channel in the public network graph. These aliases may also collide
18580 * with channels in the public network graph.
18582 struct LDKCOption_u64Z short_channel_id;
18583 } LDKEvent_LDKProbeFailed_Body;
18585 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
18587 * The minimum amount of time that should be waited prior to calling
18588 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
18589 * you should wait a random amount of time in roughly the range (now + time_forwardable,
18590 * now + 5*time_forwardable).
18592 uint64_t time_forwardable;
18593 } LDKEvent_LDKPendingHTLCsForwardable_Body;
18595 typedef struct LDKEvent_LDKHTLCIntercepted_Body {
18597 * An id to help LDK identify which HTLC is being forwarded or failed.
18599 struct LDKThirtyTwoBytes intercept_id;
18601 * The fake scid that was programmed as the next hop's scid, generated using
18602 * [`ChannelManager::get_intercept_scid`].
18604 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
18606 uint64_t requested_next_hop_scid;
18608 * The payment hash used for this HTLC.
18610 struct LDKThirtyTwoBytes payment_hash;
18612 * How many msats were received on the inbound edge of this HTLC.
18614 uint64_t inbound_amount_msat;
18616 * How many msats the payer intended to route to the next node. Depending on the reason you are
18617 * intercepting this payment, you might take a fee by forwarding less than this amount.
18618 * Forwarding less than this amount may break compatibility with LDK versions prior to 0.0.116.
18620 * Note that LDK will NOT check that expected fees were factored into this value. You MUST
18621 * check that whatever fee you want has been included here or subtract it as required. Further,
18622 * LDK will not stop you from forwarding more than you received.
18624 uint64_t expected_outbound_amount_msat;
18625 } LDKEvent_LDKHTLCIntercepted_Body;
18627 typedef struct LDKEvent_LDKSpendableOutputs_Body {
18629 * The outputs which you should store as spendable by you.
18631 struct LDKCVec_SpendableOutputDescriptorZ outputs;
18633 * The `channel_id` indicating which channel the spendable outputs belong to.
18635 * This will always be `Some` for events generated by LDK versions 0.0.117 and above.
18637 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18639 struct LDKChannelId channel_id;
18640 } LDKEvent_LDKSpendableOutputs_Body;
18642 typedef struct LDKEvent_LDKPaymentForwarded_Body {
18644 * The channel id of the incoming channel between the previous node and us.
18646 * This is only `None` for events generated or serialized by versions prior to 0.0.107.
18648 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18650 struct LDKChannelId prev_channel_id;
18652 * The channel id of the outgoing channel between the next node and us.
18654 * This is only `None` for events generated or serialized by versions prior to 0.0.107.
18656 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18658 struct LDKChannelId next_channel_id;
18660 * The `user_channel_id` of the incoming channel between the previous node and us.
18662 * This is only `None` for events generated or serialized by versions prior to 0.0.122.
18664 struct LDKCOption_U128Z prev_user_channel_id;
18666 * The `user_channel_id` of the outgoing channel between the next node and us.
18668 * This will be `None` if the payment was settled via an on-chain transaction. See the
18669 * caveat described for the `total_fee_earned_msat` field. Moreover it will be `None` for
18670 * events generated or serialized by versions prior to 0.0.122.
18672 struct LDKCOption_U128Z next_user_channel_id;
18674 * The total fee, in milli-satoshis, which was earned as a result of the payment.
18676 * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
18677 * was pending, the amount the next hop claimed will have been rounded down to the nearest
18678 * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
18679 * claimed the full value in millisatoshis from the source. In this case,
18680 * `claim_from_onchain_tx` will be set.
18682 * If the channel which sent us the payment has been force-closed, we will claim the funds
18683 * via an on-chain transaction. In that case we do not yet know the on-chain transaction
18684 * fees which we will spend and will instead set this to `None`. It is possible duplicate
18685 * `PaymentForwarded` events are generated for the same payment iff `total_fee_earned_msat` is
18688 struct LDKCOption_u64Z total_fee_earned_msat;
18690 * The share of the total fee, in milli-satoshis, which was withheld in addition to the
18693 * This will only be `Some` if we forwarded an intercepted HTLC with less than the
18694 * expected amount. This means our counterparty accepted to receive less than the invoice
18695 * amount, e.g., by claiming the payment featuring a corresponding
18696 * [`PaymentClaimable::counterparty_skimmed_fee_msat`].
18698 * Will also always be `None` for events serialized with LDK prior to version 0.0.122.
18700 * The caveat described above the `total_fee_earned_msat` field applies here as well.
18702 * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: Self::PaymentClaimable::counterparty_skimmed_fee_msat
18704 struct LDKCOption_u64Z skimmed_fee_msat;
18706 * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
18709 bool claim_from_onchain_tx;
18711 * The final amount forwarded, in milli-satoshis, after the fee is deducted.
18713 * The caveat described above the `total_fee_earned_msat` field applies here as well.
18715 struct LDKCOption_u64Z outbound_amount_forwarded_msat;
18716 } LDKEvent_LDKPaymentForwarded_Body;
18718 typedef struct LDKEvent_LDKChannelPending_Body {
18720 * The `channel_id` of the channel that is pending confirmation.
18722 struct LDKChannelId channel_id;
18724 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
18725 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
18726 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
18727 * `user_channel_id` will be randomized for an inbound channel.
18729 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
18730 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18731 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
18733 struct LDKU128 user_channel_id;
18735 * The `temporary_channel_id` this channel used to be known by during channel establishment.
18737 * Will be `None` for channels created prior to LDK version 0.0.115.
18739 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18741 struct LDKChannelId former_temporary_channel_id;
18743 * The `node_id` of the channel counterparty.
18745 struct LDKPublicKey counterparty_node_id;
18747 * The outpoint of the channel's funding transaction.
18749 struct LDKOutPoint funding_txo;
18751 * The features that this channel will operate with.
18753 * Will be `None` for channels created prior to LDK version 0.0.122.
18755 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18757 struct LDKChannelTypeFeatures channel_type;
18758 } LDKEvent_LDKChannelPending_Body;
18760 typedef struct LDKEvent_LDKChannelReady_Body {
18762 * The `channel_id` of the channel that is ready.
18764 struct LDKChannelId channel_id;
18766 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
18767 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
18768 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
18769 * `user_channel_id` will be randomized for an inbound channel.
18771 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
18772 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18773 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
18775 struct LDKU128 user_channel_id;
18777 * The `node_id` of the channel counterparty.
18779 struct LDKPublicKey counterparty_node_id;
18781 * The features that this channel will operate with.
18783 struct LDKChannelTypeFeatures channel_type;
18784 } LDKEvent_LDKChannelReady_Body;
18786 typedef struct LDKEvent_LDKChannelClosed_Body {
18788 * The `channel_id` of the channel which has been closed. Note that on-chain transactions
18789 * resolving the channel are likely still awaiting confirmation.
18791 struct LDKChannelId channel_id;
18793 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
18794 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
18795 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
18796 * `user_channel_id` will be randomized for inbound channels.
18797 * This may be zero for inbound channels serialized prior to 0.0.113 and will always be
18798 * zero for objects serialized with LDK versions prior to 0.0.102.
18800 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
18801 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18802 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
18804 struct LDKU128 user_channel_id;
18806 * The reason the channel was closed.
18808 struct LDKClosureReason reason;
18810 * Counterparty in the closed channel.
18812 * This field will be `None` for objects serialized prior to LDK 0.0.117.
18814 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18816 struct LDKPublicKey counterparty_node_id;
18818 * Channel capacity of the closing channel (sats).
18820 * This field will be `None` for objects serialized prior to LDK 0.0.117.
18822 struct LDKCOption_u64Z channel_capacity_sats;
18824 * The original channel funding TXO; this helps checking for the existence and confirmation
18825 * status of the closing tx.
18826 * Note that for instances serialized in v0.0.119 or prior this will be missing (None).
18828 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18830 struct LDKOutPoint channel_funding_txo;
18831 } LDKEvent_LDKChannelClosed_Body;
18833 typedef struct LDKEvent_LDKDiscardFunding_Body {
18835 * The channel_id of the channel which has been closed.
18837 struct LDKChannelId channel_id;
18839 * The full transaction received from the user
18841 struct LDKTransaction transaction;
18842 } LDKEvent_LDKDiscardFunding_Body;
18844 typedef struct LDKEvent_LDKOpenChannelRequest_Body {
18846 * The temporary channel ID of the channel requested to be opened.
18848 * When responding to the request, the `temporary_channel_id` should be passed
18849 * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
18850 * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
18852 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18853 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
18855 struct LDKChannelId temporary_channel_id;
18857 * The node_id of the counterparty requesting to open the channel.
18859 * When responding to the request, the `counterparty_node_id` should be passed
18860 * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
18861 * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
18864 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18865 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
18867 struct LDKPublicKey counterparty_node_id;
18869 * The channel value of the requested channel.
18871 uint64_t funding_satoshis;
18873 * Our starting balance in the channel if the request is accepted, in milli-satoshi.
18875 uint64_t push_msat;
18877 * The features that this channel will operate with. If you reject the channel, a
18878 * well-behaved counterparty may automatically re-attempt the channel with a new set of
18881 * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
18882 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
18885 * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
18886 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
18887 * 0.0.107. Channels setting this type also need to get manually accepted via
18888 * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
18889 * or will be rejected otherwise.
18891 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
18893 struct LDKChannelTypeFeatures channel_type;
18894 } LDKEvent_LDKOpenChannelRequest_Body;
18896 typedef struct LDKEvent_LDKHTLCHandlingFailed_Body {
18898 * The channel over which the HTLC was received.
18900 struct LDKChannelId prev_channel_id;
18902 * Destination of the HTLC that failed to be processed.
18904 struct LDKHTLCDestination failed_next_destination;
18905 } LDKEvent_LDKHTLCHandlingFailed_Body;
18907 typedef struct MUST_USE_STRUCT LDKEvent {
18910 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
18911 LDKEvent_LDKPaymentClaimable_Body payment_claimable;
18912 LDKEvent_LDKPaymentClaimed_Body payment_claimed;
18913 LDKEvent_LDKConnectionNeeded_Body connection_needed;
18914 LDKEvent_LDKInvoiceRequestFailed_Body invoice_request_failed;
18915 LDKEvent_LDKPaymentSent_Body payment_sent;
18916 LDKEvent_LDKPaymentFailed_Body payment_failed;
18917 LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
18918 LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
18919 LDKEvent_LDKProbeSuccessful_Body probe_successful;
18920 LDKEvent_LDKProbeFailed_Body probe_failed;
18921 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
18922 LDKEvent_LDKHTLCIntercepted_Body htlc_intercepted;
18923 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
18924 LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
18925 LDKEvent_LDKChannelPending_Body channel_pending;
18926 LDKEvent_LDKChannelReady_Body channel_ready;
18927 LDKEvent_LDKChannelClosed_Body channel_closed;
18928 LDKEvent_LDKDiscardFunding_Body discard_funding;
18929 LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
18930 LDKEvent_LDKHTLCHandlingFailed_Body htlc_handling_failed;
18932 struct LDKBumpTransactionEvent bump_transaction;
18938 * An enum which can either contain a crate::lightning::events::Event or not
18940 typedef enum LDKCOption_EventZ_Tag {
18942 * When we're in this state, this COption_EventZ contains a crate::lightning::events::Event
18944 LDKCOption_EventZ_Some,
18946 * When we're in this state, this COption_EventZ contains nothing
18948 LDKCOption_EventZ_None,
18950 * Must be last for serialization purposes
18952 LDKCOption_EventZ_Sentinel,
18953 } LDKCOption_EventZ_Tag;
18955 typedef struct LDKCOption_EventZ {
18956 LDKCOption_EventZ_Tag tag;
18959 struct LDKEvent some;
18962 } LDKCOption_EventZ;
18965 * The contents of CResult_COption_EventZDecodeErrorZ
18967 typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
18969 * A pointer to the contents in the success state.
18970 * Reading from this pointer when `result_ok` is not set is undefined.
18972 struct LDKCOption_EventZ *result;
18974 * A pointer to the contents in the error state.
18975 * Reading from this pointer when `result_ok` is set is undefined.
18977 struct LDKDecodeError *err;
18978 } LDKCResult_COption_EventZDecodeErrorZPtr;
18981 * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
18982 * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
18983 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18985 typedef struct LDKCResult_COption_EventZDecodeErrorZ {
18987 * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
18988 * `err` or `result` depending on the state of `result_ok`.
18990 union LDKCResult_COption_EventZDecodeErrorZPtr contents;
18992 * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
18995 } LDKCResult_COption_EventZDecodeErrorZ;
18998 * Sub-errors which don't have specific information in them use this type.
19000 typedef struct LDKError {
19002 * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
19008 * Errors that indicate what is wrong with the invoice. They have some granularity for debug
19009 * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
19011 typedef enum LDKBolt11ParseError_Tag {
19012 LDKBolt11ParseError_Bech32Error,
19013 LDKBolt11ParseError_ParseAmountError,
19014 LDKBolt11ParseError_MalformedSignature,
19015 LDKBolt11ParseError_BadPrefix,
19016 LDKBolt11ParseError_UnknownCurrency,
19017 LDKBolt11ParseError_UnknownSiPrefix,
19018 LDKBolt11ParseError_MalformedHRP,
19019 LDKBolt11ParseError_TooShortDataPart,
19020 LDKBolt11ParseError_UnexpectedEndOfTaggedFields,
19021 LDKBolt11ParseError_DescriptionDecodeError,
19022 LDKBolt11ParseError_PaddingError,
19023 LDKBolt11ParseError_IntegerOverflowError,
19024 LDKBolt11ParseError_InvalidSegWitProgramLength,
19025 LDKBolt11ParseError_InvalidPubKeyHashLength,
19026 LDKBolt11ParseError_InvalidScriptHashLength,
19027 LDKBolt11ParseError_InvalidRecoveryId,
19028 LDKBolt11ParseError_InvalidSliceLength,
19030 * Not an error, but used internally to signal that a part of the invoice should be ignored
19031 * according to BOLT11
19033 LDKBolt11ParseError_Skip,
19035 * Must be last for serialization purposes
19037 LDKBolt11ParseError_Sentinel,
19038 } LDKBolt11ParseError_Tag;
19040 typedef struct MUST_USE_STRUCT LDKBolt11ParseError {
19041 LDKBolt11ParseError_Tag tag;
19044 struct LDKBech32Error bech32_error;
19047 struct LDKError parse_amount_error;
19050 enum LDKSecp256k1Error malformed_signature;
19053 struct LDKError description_decode_error;
19056 struct LDKStr invalid_slice_length;
19059 } LDKBolt11ParseError;
19062 * The contents of CResult_SiPrefixBolt11ParseErrorZ
19064 typedef union LDKCResult_SiPrefixBolt11ParseErrorZPtr {
19066 * A pointer to the contents in the success state.
19067 * Reading from this pointer when `result_ok` is not set is undefined.
19069 enum LDKSiPrefix *result;
19071 * A pointer to the contents in the error state.
19072 * Reading from this pointer when `result_ok` is set is undefined.
19074 struct LDKBolt11ParseError *err;
19075 } LDKCResult_SiPrefixBolt11ParseErrorZPtr;
19078 * A CResult_SiPrefixBolt11ParseErrorZ represents the result of a fallible operation,
19079 * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::Bolt11ParseError on failure.
19080 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19082 typedef struct LDKCResult_SiPrefixBolt11ParseErrorZ {
19084 * The contents of this CResult_SiPrefixBolt11ParseErrorZ, accessible via either
19085 * `err` or `result` depending on the state of `result_ok`.
19087 union LDKCResult_SiPrefixBolt11ParseErrorZPtr contents;
19089 * Whether this CResult_SiPrefixBolt11ParseErrorZ represents a success state.
19092 } LDKCResult_SiPrefixBolt11ParseErrorZ;
19095 * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
19096 * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
19097 * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
19099 typedef enum LDKParseOrSemanticError_Tag {
19101 * The invoice couldn't be decoded
19103 LDKParseOrSemanticError_ParseError,
19105 * The invoice could be decoded but violates the BOLT11 standard
19107 LDKParseOrSemanticError_SemanticError,
19109 * Must be last for serialization purposes
19111 LDKParseOrSemanticError_Sentinel,
19112 } LDKParseOrSemanticError_Tag;
19114 typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
19115 LDKParseOrSemanticError_Tag tag;
19118 struct LDKBolt11ParseError parse_error;
19121 enum LDKBolt11SemanticError semantic_error;
19124 } LDKParseOrSemanticError;
19127 * The contents of CResult_Bolt11InvoiceParseOrSemanticErrorZ
19129 typedef union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr {
19131 * A pointer to the contents in the success state.
19132 * Reading from this pointer when `result_ok` is not set is undefined.
19134 struct LDKBolt11Invoice *result;
19136 * A pointer to the contents in the error state.
19137 * Reading from this pointer when `result_ok` is set is undefined.
19139 struct LDKParseOrSemanticError *err;
19140 } LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr;
19143 * A CResult_Bolt11InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
19144 * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
19145 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19147 typedef struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ {
19149 * The contents of this CResult_Bolt11InvoiceParseOrSemanticErrorZ, accessible via either
19150 * `err` or `result` depending on the state of `result_ok`.
19152 union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr contents;
19154 * Whether this CResult_Bolt11InvoiceParseOrSemanticErrorZ represents a success state.
19157 } LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ;
19162 * Represents a signed [`RawBolt11Invoice`] with cached hash. The signature is not checked and may be
19166 * The hash has to be either from the deserialized invoice or from the serialized [`RawBolt11Invoice`].
19168 typedef struct MUST_USE_STRUCT LDKSignedRawBolt11Invoice {
19170 * A pointer to the opaque Rust object.
19171 * Nearly everywhere, inner must be non-null, however in places where
19172 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19174 LDKnativeSignedRawBolt11Invoice *inner;
19176 * Indicates that this is the only struct which contains the same pointer.
19177 * Rust functions which take ownership of an object provided via an argument require
19178 * this to be true and invalidate the object pointed to by inner.
19181 } LDKSignedRawBolt11Invoice;
19184 * The contents of CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ
19186 typedef union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr {
19188 * A pointer to the contents in the success state.
19189 * Reading from this pointer when `result_ok` is not set is undefined.
19191 struct LDKSignedRawBolt11Invoice *result;
19193 * A pointer to the contents in the error state.
19194 * Reading from this pointer when `result_ok` is set is undefined.
19196 struct LDKBolt11ParseError *err;
19197 } LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr;
19200 * A CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents the result of a fallible operation,
19201 * containing a crate::lightning_invoice::SignedRawBolt11Invoice on success and a crate::lightning_invoice::Bolt11ParseError on failure.
19202 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19204 typedef struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ {
19206 * The contents of this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ, accessible via either
19207 * `err` or `result` depending on the state of `result_ok`.
19209 union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr contents;
19211 * Whether this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents a success state.
19214 } LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ;
19219 * Represents an syntactically correct [`Bolt11Invoice`] for a payment on the lightning network,
19220 * but without the signature information.
19221 * Decoding and encoding should not lead to information loss but may lead to different hashes.
19223 * For methods without docs see the corresponding methods in [`Bolt11Invoice`].
19225 typedef struct MUST_USE_STRUCT LDKRawBolt11Invoice {
19227 * A pointer to the opaque Rust object.
19228 * Nearly everywhere, inner must be non-null, however in places where
19229 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19231 LDKnativeRawBolt11Invoice *inner;
19233 * Indicates that this is the only struct which contains the same pointer.
19234 * Rust functions which take ownership of an object provided via an argument require
19235 * this to be true and invalidate the object pointed to by inner.
19238 } LDKRawBolt11Invoice;
19243 * Recoverable signature
19245 typedef struct MUST_USE_STRUCT LDKBolt11InvoiceSignature {
19247 * A pointer to the opaque Rust object.
19248 * Nearly everywhere, inner must be non-null, however in places where
19249 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19251 LDKnativeBolt11InvoiceSignature *inner;
19253 * Indicates that this is the only struct which contains the same pointer.
19254 * Rust functions which take ownership of an object provided via an argument require
19255 * this to be true and invalidate the object pointed to by inner.
19258 } LDKBolt11InvoiceSignature;
19261 * A tuple of 3 elements. See the individual fields for the types contained.
19263 typedef struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ {
19265 * The element at position 0
19267 struct LDKRawBolt11Invoice a;
19269 * The element at position 1
19271 struct LDKThirtyTwoBytes b;
19273 * The element at position 2
19275 struct LDKBolt11InvoiceSignature c;
19276 } LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ;
19283 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
19285 * A pointer to the opaque Rust object.
19286 * Nearly everywhere, inner must be non-null, however in places where
19287 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19289 LDKnativePayeePubKey *inner;
19291 * Indicates that this is the only struct which contains the same pointer.
19292 * Rust functions which take ownership of an object provided via an argument require
19293 * this to be true and invalidate the object pointed to by inner.
19299 * The contents of CResult_PayeePubKeySecp256k1ErrorZ
19301 typedef union LDKCResult_PayeePubKeySecp256k1ErrorZPtr {
19303 * A pointer to the contents in the success state.
19304 * Reading from this pointer when `result_ok` is not set is undefined.
19306 struct LDKPayeePubKey *result;
19308 * A pointer to the contents in the error state.
19309 * Reading from this pointer when `result_ok` is set is undefined.
19311 enum LDKSecp256k1Error *err;
19312 } LDKCResult_PayeePubKeySecp256k1ErrorZPtr;
19315 * A CResult_PayeePubKeySecp256k1ErrorZ represents the result of a fallible operation,
19316 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
19317 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19319 typedef struct LDKCResult_PayeePubKeySecp256k1ErrorZ {
19321 * The contents of this CResult_PayeePubKeySecp256k1ErrorZ, accessible via either
19322 * `err` or `result` depending on the state of `result_ok`.
19324 union LDKCResult_PayeePubKeySecp256k1ErrorZPtr contents;
19326 * Whether this CResult_PayeePubKeySecp256k1ErrorZ represents a success state.
19329 } LDKCResult_PayeePubKeySecp256k1ErrorZ;
19334 * Private routing information
19337 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
19340 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
19342 * A pointer to the opaque Rust object.
19343 * Nearly everywhere, inner must be non-null, however in places where
19344 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19346 LDKnativePrivateRoute *inner;
19348 * Indicates that this is the only struct which contains the same pointer.
19349 * Rust functions which take ownership of an object provided via an argument require
19350 * this to be true and invalidate the object pointed to by inner.
19356 * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
19357 * This corresponds to std::vector in C++
19359 typedef struct LDKCVec_PrivateRouteZ {
19361 * The elements in the array.
19362 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
19364 struct LDKPrivateRoute *data;
19366 * The number of elements pointed to by `data`.
19369 } LDKCVec_PrivateRouteZ;
19374 * A timestamp that refers to a date after 1 January 1970.
19378 * The Unix timestamp representing the stored time has to be positive and no greater than
19379 * [`MAX_TIMESTAMP`].
19381 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
19383 * A pointer to the opaque Rust object.
19384 * Nearly everywhere, inner must be non-null, however in places where
19385 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19387 LDKnativePositiveTimestamp *inner;
19389 * Indicates that this is the only struct which contains the same pointer.
19390 * Rust functions which take ownership of an object provided via an argument require
19391 * this to be true and invalidate the object pointed to by inner.
19394 } LDKPositiveTimestamp;
19397 * The contents of CResult_PositiveTimestampCreationErrorZ
19399 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
19401 * A pointer to the contents in the success state.
19402 * Reading from this pointer when `result_ok` is not set is undefined.
19404 struct LDKPositiveTimestamp *result;
19406 * A pointer to the contents in the error state.
19407 * Reading from this pointer when `result_ok` is set is undefined.
19409 enum LDKCreationError *err;
19410 } LDKCResult_PositiveTimestampCreationErrorZPtr;
19413 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
19414 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
19415 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19417 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
19419 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
19420 * `err` or `result` depending on the state of `result_ok`.
19422 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
19424 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
19427 } LDKCResult_PositiveTimestampCreationErrorZ;
19430 * The contents of CResult_NoneBolt11SemanticErrorZ
19432 typedef union LDKCResult_NoneBolt11SemanticErrorZPtr {
19434 * Note that this value is always NULL, as there are no contents in the OK variant
19438 * A pointer to the contents in the error state.
19439 * Reading from this pointer when `result_ok` is set is undefined.
19441 enum LDKBolt11SemanticError *err;
19442 } LDKCResult_NoneBolt11SemanticErrorZPtr;
19445 * A CResult_NoneBolt11SemanticErrorZ represents the result of a fallible operation,
19446 * containing a () on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
19447 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19449 typedef struct LDKCResult_NoneBolt11SemanticErrorZ {
19451 * The contents of this CResult_NoneBolt11SemanticErrorZ, accessible via either
19452 * `err` or `result` depending on the state of `result_ok`.
19454 union LDKCResult_NoneBolt11SemanticErrorZPtr contents;
19456 * Whether this CResult_NoneBolt11SemanticErrorZ represents a success state.
19459 } LDKCResult_NoneBolt11SemanticErrorZ;
19462 * The contents of CResult_Bolt11InvoiceBolt11SemanticErrorZ
19464 typedef union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr {
19466 * A pointer to the contents in the success state.
19467 * Reading from this pointer when `result_ok` is not set is undefined.
19469 struct LDKBolt11Invoice *result;
19471 * A pointer to the contents in the error state.
19472 * Reading from this pointer when `result_ok` is set is undefined.
19474 enum LDKBolt11SemanticError *err;
19475 } LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr;
19478 * A CResult_Bolt11InvoiceBolt11SemanticErrorZ represents the result of a fallible operation,
19479 * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
19480 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19482 typedef struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ {
19484 * The contents of this CResult_Bolt11InvoiceBolt11SemanticErrorZ, accessible via either
19485 * `err` or `result` depending on the state of `result_ok`.
19487 union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr contents;
19489 * Whether this CResult_Bolt11InvoiceBolt11SemanticErrorZ represents a success state.
19492 } LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ;
19497 * Description string
19500 * The description can be at most 639 __bytes__ long
19502 typedef struct MUST_USE_STRUCT LDKDescription {
19504 * A pointer to the opaque Rust object.
19505 * Nearly everywhere, inner must be non-null, however in places where
19506 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19508 LDKnativeDescription *inner;
19510 * Indicates that this is the only struct which contains the same pointer.
19511 * Rust functions which take ownership of an object provided via an argument require
19512 * this to be true and invalidate the object pointed to by inner.
19518 * The contents of CResult_DescriptionCreationErrorZ
19520 typedef union LDKCResult_DescriptionCreationErrorZPtr {
19522 * A pointer to the contents in the success state.
19523 * Reading from this pointer when `result_ok` is not set is undefined.
19525 struct LDKDescription *result;
19527 * A pointer to the contents in the error state.
19528 * Reading from this pointer when `result_ok` is set is undefined.
19530 enum LDKCreationError *err;
19531 } LDKCResult_DescriptionCreationErrorZPtr;
19534 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
19535 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
19536 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19538 typedef struct LDKCResult_DescriptionCreationErrorZ {
19540 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
19541 * `err` or `result` depending on the state of `result_ok`.
19543 union LDKCResult_DescriptionCreationErrorZPtr contents;
19545 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
19548 } LDKCResult_DescriptionCreationErrorZ;
19551 * The contents of CResult_PrivateRouteCreationErrorZ
19553 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
19555 * A pointer to the contents in the success state.
19556 * Reading from this pointer when `result_ok` is not set is undefined.
19558 struct LDKPrivateRoute *result;
19560 * A pointer to the contents in the error state.
19561 * Reading from this pointer when `result_ok` is set is undefined.
19563 enum LDKCreationError *err;
19564 } LDKCResult_PrivateRouteCreationErrorZPtr;
19567 * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
19568 * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
19569 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19571 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
19573 * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
19574 * `err` or `result` depending on the state of `result_ok`.
19576 union LDKCResult_PrivateRouteCreationErrorZPtr contents;
19578 * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
19581 } LDKCResult_PrivateRouteCreationErrorZ;
19584 * The contents of CResult_OutPointDecodeErrorZ
19586 typedef union LDKCResult_OutPointDecodeErrorZPtr {
19588 * A pointer to the contents in the success state.
19589 * Reading from this pointer when `result_ok` is not set is undefined.
19591 struct LDKOutPoint *result;
19593 * A pointer to the contents in the error state.
19594 * Reading from this pointer when `result_ok` is set is undefined.
19596 struct LDKDecodeError *err;
19597 } LDKCResult_OutPointDecodeErrorZPtr;
19600 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
19601 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
19602 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19604 typedef struct LDKCResult_OutPointDecodeErrorZ {
19606 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
19607 * `err` or `result` depending on the state of `result_ok`.
19609 union LDKCResult_OutPointDecodeErrorZPtr contents;
19611 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
19614 } LDKCResult_OutPointDecodeErrorZ;
19619 * Lightning TLV uses a custom variable-length integer called `BigSize`. It is similar to Bitcoin's
19620 * variable-length integers except that it is serialized in big-endian instead of little-endian.
19622 * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
19623 * encoded in several different ways, which we must check for at deserialization-time. Thus, if
19624 * you're looking for an example of a variable-length integer to use for your own project, move
19625 * along, this is a rather poor design.
19627 typedef struct MUST_USE_STRUCT LDKBigSize {
19629 * A pointer to the opaque Rust object.
19630 * Nearly everywhere, inner must be non-null, however in places where
19631 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19633 LDKnativeBigSize *inner;
19635 * Indicates that this is the only struct which contains the same pointer.
19636 * Rust functions which take ownership of an object provided via an argument require
19637 * this to be true and invalidate the object pointed to by inner.
19643 * The contents of CResult_BigSizeDecodeErrorZ
19645 typedef union LDKCResult_BigSizeDecodeErrorZPtr {
19647 * A pointer to the contents in the success state.
19648 * Reading from this pointer when `result_ok` is not set is undefined.
19650 struct LDKBigSize *result;
19652 * A pointer to the contents in the error state.
19653 * Reading from this pointer when `result_ok` is set is undefined.
19655 struct LDKDecodeError *err;
19656 } LDKCResult_BigSizeDecodeErrorZPtr;
19659 * A CResult_BigSizeDecodeErrorZ represents the result of a fallible operation,
19660 * containing a crate::lightning::util::ser::BigSize on success and a crate::lightning::ln::msgs::DecodeError on failure.
19661 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19663 typedef struct LDKCResult_BigSizeDecodeErrorZ {
19665 * The contents of this CResult_BigSizeDecodeErrorZ, accessible via either
19666 * `err` or `result` depending on the state of `result_ok`.
19668 union LDKCResult_BigSizeDecodeErrorZPtr contents;
19670 * Whether this CResult_BigSizeDecodeErrorZ represents a success state.
19673 } LDKCResult_BigSizeDecodeErrorZ;
19676 * The contents of CResult_HostnameDecodeErrorZ
19678 typedef union LDKCResult_HostnameDecodeErrorZPtr {
19680 * A pointer to the contents in the success state.
19681 * Reading from this pointer when `result_ok` is not set is undefined.
19683 struct LDKHostname *result;
19685 * A pointer to the contents in the error state.
19686 * Reading from this pointer when `result_ok` is set is undefined.
19688 struct LDKDecodeError *err;
19689 } LDKCResult_HostnameDecodeErrorZPtr;
19692 * A CResult_HostnameDecodeErrorZ represents the result of a fallible operation,
19693 * containing a crate::lightning::util::ser::Hostname on success and a crate::lightning::ln::msgs::DecodeError on failure.
19694 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19696 typedef struct LDKCResult_HostnameDecodeErrorZ {
19698 * The contents of this CResult_HostnameDecodeErrorZ, accessible via either
19699 * `err` or `result` depending on the state of `result_ok`.
19701 union LDKCResult_HostnameDecodeErrorZPtr contents;
19703 * Whether this CResult_HostnameDecodeErrorZ represents a success state.
19706 } LDKCResult_HostnameDecodeErrorZ;
19711 * A wrapper for a `Transaction` which can only be constructed with [`TransactionU16LenLimited::new`]
19712 * if the `Transaction`'s consensus-serialized length is <= u16::MAX.
19714 * Use [`TransactionU16LenLimited::into_transaction`] to convert into the contained `Transaction`.
19716 typedef struct MUST_USE_STRUCT LDKTransactionU16LenLimited {
19718 * A pointer to the opaque Rust object.
19719 * Nearly everywhere, inner must be non-null, however in places where
19720 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19722 LDKnativeTransactionU16LenLimited *inner;
19724 * Indicates that this is the only struct which contains the same pointer.
19725 * Rust functions which take ownership of an object provided via an argument require
19726 * this to be true and invalidate the object pointed to by inner.
19729 } LDKTransactionU16LenLimited;
19732 * The contents of CResult_TransactionU16LenLimitedNoneZ
19734 typedef union LDKCResult_TransactionU16LenLimitedNoneZPtr {
19736 * A pointer to the contents in the success state.
19737 * Reading from this pointer when `result_ok` is not set is undefined.
19739 struct LDKTransactionU16LenLimited *result;
19741 * Note that this value is always NULL, as there are no contents in the Err variant
19744 } LDKCResult_TransactionU16LenLimitedNoneZPtr;
19747 * A CResult_TransactionU16LenLimitedNoneZ represents the result of a fallible operation,
19748 * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a () on failure.
19749 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19751 typedef struct LDKCResult_TransactionU16LenLimitedNoneZ {
19753 * The contents of this CResult_TransactionU16LenLimitedNoneZ, accessible via either
19754 * `err` or `result` depending on the state of `result_ok`.
19756 union LDKCResult_TransactionU16LenLimitedNoneZPtr contents;
19758 * Whether this CResult_TransactionU16LenLimitedNoneZ represents a success state.
19761 } LDKCResult_TransactionU16LenLimitedNoneZ;
19764 * The contents of CResult_TransactionU16LenLimitedDecodeErrorZ
19766 typedef union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr {
19768 * A pointer to the contents in the success state.
19769 * Reading from this pointer when `result_ok` is not set is undefined.
19771 struct LDKTransactionU16LenLimited *result;
19773 * A pointer to the contents in the error state.
19774 * Reading from this pointer when `result_ok` is set is undefined.
19776 struct LDKDecodeError *err;
19777 } LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr;
19780 * A CResult_TransactionU16LenLimitedDecodeErrorZ represents the result of a fallible operation,
19781 * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a crate::lightning::ln::msgs::DecodeError on failure.
19782 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19784 typedef struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ {
19786 * The contents of this CResult_TransactionU16LenLimitedDecodeErrorZ, accessible via either
19787 * `err` or `result` depending on the state of `result_ok`.
19789 union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr contents;
19791 * Whether this CResult_TransactionU16LenLimitedDecodeErrorZ represents a success state.
19794 } LDKCResult_TransactionU16LenLimitedDecodeErrorZ;
19797 * The contents of CResult_UntrustedStringDecodeErrorZ
19799 typedef union LDKCResult_UntrustedStringDecodeErrorZPtr {
19801 * A pointer to the contents in the success state.
19802 * Reading from this pointer when `result_ok` is not set is undefined.
19804 struct LDKUntrustedString *result;
19806 * A pointer to the contents in the error state.
19807 * Reading from this pointer when `result_ok` is set is undefined.
19809 struct LDKDecodeError *err;
19810 } LDKCResult_UntrustedStringDecodeErrorZPtr;
19813 * A CResult_UntrustedStringDecodeErrorZ represents the result of a fallible operation,
19814 * containing a crate::lightning::util::string::UntrustedString on success and a crate::lightning::ln::msgs::DecodeError on failure.
19815 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19817 typedef struct LDKCResult_UntrustedStringDecodeErrorZ {
19819 * The contents of this CResult_UntrustedStringDecodeErrorZ, accessible via either
19820 * `err` or `result` depending on the state of `result_ok`.
19822 union LDKCResult_UntrustedStringDecodeErrorZPtr contents;
19824 * Whether this CResult_UntrustedStringDecodeErrorZ represents a success state.
19827 } LDKCResult_UntrustedStringDecodeErrorZ;
19830 * The contents of CResult_ChannelIdDecodeErrorZ
19832 typedef union LDKCResult_ChannelIdDecodeErrorZPtr {
19834 * A pointer to the contents in the success state.
19835 * Reading from this pointer when `result_ok` is not set is undefined.
19837 struct LDKChannelId *result;
19839 * A pointer to the contents in the error state.
19840 * Reading from this pointer when `result_ok` is set is undefined.
19842 struct LDKDecodeError *err;
19843 } LDKCResult_ChannelIdDecodeErrorZPtr;
19846 * A CResult_ChannelIdDecodeErrorZ represents the result of a fallible operation,
19847 * containing a crate::lightning::ln::types::ChannelId on success and a crate::lightning::ln::msgs::DecodeError on failure.
19848 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19850 typedef struct LDKCResult_ChannelIdDecodeErrorZ {
19852 * The contents of this CResult_ChannelIdDecodeErrorZ, accessible via either
19853 * `err` or `result` depending on the state of `result_ok`.
19855 union LDKCResult_ChannelIdDecodeErrorZPtr contents;
19857 * Whether this CResult_ChannelIdDecodeErrorZ represents a success state.
19860 } LDKCResult_ChannelIdDecodeErrorZ;
19863 * A tuple of 2 elements. See the individual fields for the types contained.
19865 typedef struct LDKC2Tuple__u832u16Z {
19867 * The element at position 0
19869 struct LDKThirtyTwoBytes a;
19871 * The element at position 1
19874 } LDKC2Tuple__u832u16Z;
19879 * Parameters for relaying over a given [`BlindedHop`].
19881 * [`BlindedHop`]: crate::blinded_path::BlindedHop
19883 typedef struct MUST_USE_STRUCT LDKPaymentRelay {
19885 * A pointer to the opaque Rust object.
19886 * Nearly everywhere, inner must be non-null, however in places where
19887 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19889 LDKnativePaymentRelay *inner;
19891 * Indicates that this is the only struct which contains the same pointer.
19892 * Rust functions which take ownership of an object provided via an argument require
19893 * this to be true and invalidate the object pointed to by inner.
19899 * The contents of CResult_PaymentRelayDecodeErrorZ
19901 typedef union LDKCResult_PaymentRelayDecodeErrorZPtr {
19903 * A pointer to the contents in the success state.
19904 * Reading from this pointer when `result_ok` is not set is undefined.
19906 struct LDKPaymentRelay *result;
19908 * A pointer to the contents in the error state.
19909 * Reading from this pointer when `result_ok` is set is undefined.
19911 struct LDKDecodeError *err;
19912 } LDKCResult_PaymentRelayDecodeErrorZPtr;
19915 * A CResult_PaymentRelayDecodeErrorZ represents the result of a fallible operation,
19916 * containing a crate::lightning::blinded_path::payment::PaymentRelay on success and a crate::lightning::ln::msgs::DecodeError on failure.
19917 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19919 typedef struct LDKCResult_PaymentRelayDecodeErrorZ {
19921 * The contents of this CResult_PaymentRelayDecodeErrorZ, accessible via either
19922 * `err` or `result` depending on the state of `result_ok`.
19924 union LDKCResult_PaymentRelayDecodeErrorZPtr contents;
19926 * Whether this CResult_PaymentRelayDecodeErrorZ represents a success state.
19929 } LDKCResult_PaymentRelayDecodeErrorZ;
19934 * Constraints for relaying over a given [`BlindedHop`].
19936 * [`BlindedHop`]: crate::blinded_path::BlindedHop
19938 typedef struct MUST_USE_STRUCT LDKPaymentConstraints {
19940 * A pointer to the opaque Rust object.
19941 * Nearly everywhere, inner must be non-null, however in places where
19942 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19944 LDKnativePaymentConstraints *inner;
19946 * Indicates that this is the only struct which contains the same pointer.
19947 * Rust functions which take ownership of an object provided via an argument require
19948 * this to be true and invalidate the object pointed to by inner.
19951 } LDKPaymentConstraints;
19954 * The contents of CResult_PaymentConstraintsDecodeErrorZ
19956 typedef union LDKCResult_PaymentConstraintsDecodeErrorZPtr {
19958 * A pointer to the contents in the success state.
19959 * Reading from this pointer when `result_ok` is not set is undefined.
19961 struct LDKPaymentConstraints *result;
19963 * A pointer to the contents in the error state.
19964 * Reading from this pointer when `result_ok` is set is undefined.
19966 struct LDKDecodeError *err;
19967 } LDKCResult_PaymentConstraintsDecodeErrorZPtr;
19970 * A CResult_PaymentConstraintsDecodeErrorZ represents the result of a fallible operation,
19971 * containing a crate::lightning::blinded_path::payment::PaymentConstraints on success and a crate::lightning::ln::msgs::DecodeError on failure.
19972 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19974 typedef struct LDKCResult_PaymentConstraintsDecodeErrorZ {
19976 * The contents of this CResult_PaymentConstraintsDecodeErrorZ, accessible via either
19977 * `err` or `result` depending on the state of `result_ok`.
19979 union LDKCResult_PaymentConstraintsDecodeErrorZPtr contents;
19981 * Whether this CResult_PaymentConstraintsDecodeErrorZ represents a success state.
19984 } LDKCResult_PaymentConstraintsDecodeErrorZ;
19987 * The contents of CResult_PaymentContextDecodeErrorZ
19989 typedef union LDKCResult_PaymentContextDecodeErrorZPtr {
19991 * A pointer to the contents in the success state.
19992 * Reading from this pointer when `result_ok` is not set is undefined.
19994 struct LDKPaymentContext *result;
19996 * A pointer to the contents in the error state.
19997 * Reading from this pointer when `result_ok` is set is undefined.
19999 struct LDKDecodeError *err;
20000 } LDKCResult_PaymentContextDecodeErrorZPtr;
20003 * A CResult_PaymentContextDecodeErrorZ represents the result of a fallible operation,
20004 * containing a crate::lightning::blinded_path::payment::PaymentContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
20005 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20007 typedef struct LDKCResult_PaymentContextDecodeErrorZ {
20009 * The contents of this CResult_PaymentContextDecodeErrorZ, accessible via either
20010 * `err` or `result` depending on the state of `result_ok`.
20012 union LDKCResult_PaymentContextDecodeErrorZPtr contents;
20014 * Whether this CResult_PaymentContextDecodeErrorZ represents a success state.
20017 } LDKCResult_PaymentContextDecodeErrorZ;
20020 * The contents of CResult_UnknownPaymentContextDecodeErrorZ
20022 typedef union LDKCResult_UnknownPaymentContextDecodeErrorZPtr {
20024 * A pointer to the contents in the success state.
20025 * Reading from this pointer when `result_ok` is not set is undefined.
20027 struct LDKUnknownPaymentContext *result;
20029 * A pointer to the contents in the error state.
20030 * Reading from this pointer when `result_ok` is set is undefined.
20032 struct LDKDecodeError *err;
20033 } LDKCResult_UnknownPaymentContextDecodeErrorZPtr;
20036 * A CResult_UnknownPaymentContextDecodeErrorZ represents the result of a fallible operation,
20037 * containing a crate::lightning::blinded_path::payment::UnknownPaymentContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
20038 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20040 typedef struct LDKCResult_UnknownPaymentContextDecodeErrorZ {
20042 * The contents of this CResult_UnknownPaymentContextDecodeErrorZ, accessible via either
20043 * `err` or `result` depending on the state of `result_ok`.
20045 union LDKCResult_UnknownPaymentContextDecodeErrorZPtr contents;
20047 * Whether this CResult_UnknownPaymentContextDecodeErrorZ represents a success state.
20050 } LDKCResult_UnknownPaymentContextDecodeErrorZ;
20053 * The contents of CResult_Bolt12OfferContextDecodeErrorZ
20055 typedef union LDKCResult_Bolt12OfferContextDecodeErrorZPtr {
20057 * A pointer to the contents in the success state.
20058 * Reading from this pointer when `result_ok` is not set is undefined.
20060 struct LDKBolt12OfferContext *result;
20062 * A pointer to the contents in the error state.
20063 * Reading from this pointer when `result_ok` is set is undefined.
20065 struct LDKDecodeError *err;
20066 } LDKCResult_Bolt12OfferContextDecodeErrorZPtr;
20069 * A CResult_Bolt12OfferContextDecodeErrorZ represents the result of a fallible operation,
20070 * containing a crate::lightning::blinded_path::payment::Bolt12OfferContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
20071 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20073 typedef struct LDKCResult_Bolt12OfferContextDecodeErrorZ {
20075 * The contents of this CResult_Bolt12OfferContextDecodeErrorZ, accessible via either
20076 * `err` or `result` depending on the state of `result_ok`.
20078 union LDKCResult_Bolt12OfferContextDecodeErrorZPtr contents;
20080 * Whether this CResult_Bolt12OfferContextDecodeErrorZ represents a success state.
20083 } LDKCResult_Bolt12OfferContextDecodeErrorZ;
20086 * The contents of CResult_Bolt12RefundContextDecodeErrorZ
20088 typedef union LDKCResult_Bolt12RefundContextDecodeErrorZPtr {
20090 * A pointer to the contents in the success state.
20091 * Reading from this pointer when `result_ok` is not set is undefined.
20093 struct LDKBolt12RefundContext *result;
20095 * A pointer to the contents in the error state.
20096 * Reading from this pointer when `result_ok` is set is undefined.
20098 struct LDKDecodeError *err;
20099 } LDKCResult_Bolt12RefundContextDecodeErrorZPtr;
20102 * A CResult_Bolt12RefundContextDecodeErrorZ represents the result of a fallible operation,
20103 * containing a crate::lightning::blinded_path::payment::Bolt12RefundContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
20104 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20106 typedef struct LDKCResult_Bolt12RefundContextDecodeErrorZ {
20108 * The contents of this CResult_Bolt12RefundContextDecodeErrorZ, accessible via either
20109 * `err` or `result` depending on the state of `result_ok`.
20111 union LDKCResult_Bolt12RefundContextDecodeErrorZPtr contents;
20113 * Whether this CResult_Bolt12RefundContextDecodeErrorZ represents a success state.
20116 } LDKCResult_Bolt12RefundContextDecodeErrorZ;
20119 * The contents of CResult_StrSecp256k1ErrorZ
20121 typedef union LDKCResult_StrSecp256k1ErrorZPtr {
20123 * A pointer to the contents in the success state.
20124 * Reading from this pointer when `result_ok` is not set is undefined.
20126 struct LDKStr *result;
20128 * A pointer to the contents in the error state.
20129 * Reading from this pointer when `result_ok` is set is undefined.
20131 enum LDKSecp256k1Error *err;
20132 } LDKCResult_StrSecp256k1ErrorZPtr;
20135 * A CResult_StrSecp256k1ErrorZ represents the result of a fallible operation,
20136 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
20137 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20139 typedef struct LDKCResult_StrSecp256k1ErrorZ {
20141 * The contents of this CResult_StrSecp256k1ErrorZ, accessible via either
20142 * `err` or `result` depending on the state of `result_ok`.
20144 union LDKCResult_StrSecp256k1ErrorZPtr contents;
20146 * Whether this CResult_StrSecp256k1ErrorZ represents a success state.
20149 } LDKCResult_StrSecp256k1ErrorZ;
20152 * A tuple of 3 elements. See the individual fields for the types contained.
20154 typedef struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ {
20156 * The element at position 0
20158 struct LDKThirtyTwoBytes a;
20160 * The element at position 1
20162 struct LDKRecipientOnionFields b;
20164 * The element at position 2
20166 struct LDKRouteParameters c;
20167 } LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ;
20170 * The contents of CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ
20172 typedef union LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr {
20174 * A pointer to the contents in the success state.
20175 * Reading from this pointer when `result_ok` is not set is undefined.
20177 struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *result;
20179 * Note that this value is always NULL, as there are no contents in the Err variant
20182 } LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr;
20185 * A CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ represents the result of a fallible operation,
20186 * containing a crate::c_types::derived::C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ on success and a () on failure.
20187 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20189 typedef struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ {
20191 * The contents of this CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ, accessible via either
20192 * `err` or `result` depending on the state of `result_ok`.
20194 union LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr contents;
20196 * Whether this CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ represents a success state.
20199 } LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ;
20202 * A tuple of 3 elements. See the individual fields for the types contained.
20204 typedef struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ {
20206 * The element at position 0
20208 struct LDKPublicKey a;
20210 * The element at position 1
20212 struct LDKOnionMessage b;
20214 * The element at position 2
20216 struct LDKCOption_CVec_SocketAddressZZ c;
20217 } LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ;
20220 * Errors that may occur when [sending an onion message].
20222 * [sending an onion message]: OnionMessenger::send_onion_message
20224 typedef enum LDKSendError_Tag {
20226 * Errored computing onion message packet keys.
20228 LDKSendError_Secp256k1,
20230 * Because implementations such as Eclair will drop onion messages where the message packet
20231 * exceeds 32834 bytes, we refuse to send messages where the packet exceeds this size.
20233 LDKSendError_TooBigPacket,
20235 * The provided [`Destination`] was an invalid [`BlindedPath`] due to not having any blinded
20238 LDKSendError_TooFewBlindedHops,
20240 * The first hop is not a peer and doesn't have a known [`SocketAddress`].
20242 LDKSendError_InvalidFirstHop,
20244 * A path from the sender to the destination could not be found by the [`MessageRouter`].
20246 LDKSendError_PathNotFound,
20248 * Onion message contents must have a TLV type >= 64.
20250 LDKSendError_InvalidMessage,
20252 * Our next-hop peer's buffer was full or our total outbound buffer was full.
20254 LDKSendError_BufferFull,
20256 * Failed to retrieve our node id from the provided [`NodeSigner`].
20258 * [`NodeSigner`]: crate::sign::NodeSigner
20260 LDKSendError_GetNodeIdFailed,
20262 * The provided [`Destination`] has a blinded path with an unresolved introduction node. An
20263 * attempt to resolve it in the [`MessageRouter`] when finding an [`OnionMessagePath`] likely
20266 LDKSendError_UnresolvedIntroductionNode,
20268 * We attempted to send to a blinded path where we are the introduction node, and failed to
20269 * advance the blinded path to make the second hop the new introduction node. Either
20270 * [`NodeSigner::ecdh`] failed, we failed to tweak the current blinding point to get the
20271 * new blinding point, or we were attempting to send to ourselves.
20273 LDKSendError_BlindedPathAdvanceFailed,
20275 * Must be last for serialization purposes
20277 LDKSendError_Sentinel,
20278 } LDKSendError_Tag;
20280 typedef struct MUST_USE_STRUCT LDKSendError {
20281 LDKSendError_Tag tag;
20284 enum LDKSecp256k1Error secp256k1;
20287 struct LDKPublicKey invalid_first_hop;
20293 * The contents of CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ
20295 typedef union LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr {
20297 * A pointer to the contents in the success state.
20298 * Reading from this pointer when `result_ok` is not set is undefined.
20300 struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *result;
20302 * A pointer to the contents in the error state.
20303 * Reading from this pointer when `result_ok` is set is undefined.
20305 struct LDKSendError *err;
20306 } LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr;
20309 * A CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ represents the result of a fallible operation,
20310 * containing a crate::c_types::derived::C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ on success and a crate::lightning::onion_message::messenger::SendError on failure.
20311 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20313 typedef struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ {
20315 * The contents of this CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ, accessible via either
20316 * `err` or `result` depending on the state of `result_ok`.
20318 union LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr contents;
20320 * Whether this CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ represents a success state.
20323 } LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ;
20326 * The next hop to forward an onion message along its path.
20328 * Note that payment blinded paths always specify their next hop using an explicit node id.
20330 typedef enum LDKNextMessageHop_Tag {
20332 * The node id of the next hop.
20334 LDKNextMessageHop_NodeId,
20336 * The short channel id leading to the next hop.
20338 LDKNextMessageHop_ShortChannelId,
20340 * Must be last for serialization purposes
20342 LDKNextMessageHop_Sentinel,
20343 } LDKNextMessageHop_Tag;
20345 typedef struct MUST_USE_STRUCT LDKNextMessageHop {
20346 LDKNextMessageHop_Tag tag;
20349 struct LDKPublicKey node_id;
20352 uint64_t short_channel_id;
20355 } LDKNextMessageHop;
20358 * The contents of an [`OnionMessage`] as read from the wire.
20360 * [`OnionMessage`]: crate::ln::msgs::OnionMessage
20362 typedef enum LDKParsedOnionMessageContents_Tag {
20364 * A message related to BOLT 12 Offers.
20366 LDKParsedOnionMessageContents_Offers,
20368 * A custom onion message specified by the user.
20370 LDKParsedOnionMessageContents_Custom,
20372 * Must be last for serialization purposes
20374 LDKParsedOnionMessageContents_Sentinel,
20375 } LDKParsedOnionMessageContents_Tag;
20377 typedef struct MUST_USE_STRUCT LDKParsedOnionMessageContents {
20378 LDKParsedOnionMessageContents_Tag tag;
20381 struct LDKOffersMessage offers;
20384 struct LDKOnionMessageContents custom;
20387 } LDKParsedOnionMessageContents;
20390 * A processed incoming onion message, containing either a Forward (another onion message)
20391 * or a Receive payload with decrypted contents.
20393 typedef enum LDKPeeledOnion_Tag {
20395 * Forwarded onion, with the next node id and a new onion
20397 LDKPeeledOnion_Forward,
20399 * Received onion message, with decrypted contents, path_id, and reply path
20401 LDKPeeledOnion_Receive,
20403 * Must be last for serialization purposes
20405 LDKPeeledOnion_Sentinel,
20406 } LDKPeeledOnion_Tag;
20408 typedef struct LDKPeeledOnion_LDKForward_Body {
20409 struct LDKNextMessageHop _0;
20410 struct LDKOnionMessage _1;
20411 } LDKPeeledOnion_LDKForward_Body;
20413 typedef struct LDKPeeledOnion_LDKReceive_Body {
20414 struct LDKParsedOnionMessageContents _0;
20417 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
20419 struct LDKThirtyTwoBytes _1;
20422 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
20424 struct LDKBlindedPath _2;
20425 } LDKPeeledOnion_LDKReceive_Body;
20427 typedef struct MUST_USE_STRUCT LDKPeeledOnion {
20428 LDKPeeledOnion_Tag tag;
20430 LDKPeeledOnion_LDKForward_Body forward;
20431 LDKPeeledOnion_LDKReceive_Body receive;
20436 * The contents of CResult_PeeledOnionNoneZ
20438 typedef union LDKCResult_PeeledOnionNoneZPtr {
20440 * A pointer to the contents in the success state.
20441 * Reading from this pointer when `result_ok` is not set is undefined.
20443 struct LDKPeeledOnion *result;
20445 * Note that this value is always NULL, as there are no contents in the Err variant
20448 } LDKCResult_PeeledOnionNoneZPtr;
20451 * A CResult_PeeledOnionNoneZ represents the result of a fallible operation,
20452 * containing a crate::lightning::onion_message::messenger::PeeledOnion on success and a () on failure.
20453 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20455 typedef struct LDKCResult_PeeledOnionNoneZ {
20457 * The contents of this CResult_PeeledOnionNoneZ, accessible via either
20458 * `err` or `result` depending on the state of `result_ok`.
20460 union LDKCResult_PeeledOnionNoneZPtr contents;
20462 * Whether this CResult_PeeledOnionNoneZ represents a success state.
20465 } LDKCResult_PeeledOnionNoneZ;
20468 * Result of successfully [sending an onion message].
20470 * [sending an onion message]: OnionMessenger::send_onion_message
20472 typedef enum LDKSendSuccess_Tag {
20474 * The message was buffered and will be sent once it is processed by
20475 * [`OnionMessageHandler::next_onion_message_for_peer`].
20477 LDKSendSuccess_Buffered,
20479 * The message was buffered and will be sent once the node is connected as a peer and it is
20480 * processed by [`OnionMessageHandler::next_onion_message_for_peer`].
20482 LDKSendSuccess_BufferedAwaitingConnection,
20484 * Must be last for serialization purposes
20486 LDKSendSuccess_Sentinel,
20487 } LDKSendSuccess_Tag;
20489 typedef struct MUST_USE_STRUCT LDKSendSuccess {
20490 LDKSendSuccess_Tag tag;
20493 struct LDKPublicKey buffered_awaiting_connection;
20499 * The contents of CResult_SendSuccessSendErrorZ
20501 typedef union LDKCResult_SendSuccessSendErrorZPtr {
20503 * A pointer to the contents in the success state.
20504 * Reading from this pointer when `result_ok` is not set is undefined.
20506 struct LDKSendSuccess *result;
20508 * A pointer to the contents in the error state.
20509 * Reading from this pointer when `result_ok` is set is undefined.
20511 struct LDKSendError *err;
20512 } LDKCResult_SendSuccessSendErrorZPtr;
20515 * A CResult_SendSuccessSendErrorZ represents the result of a fallible operation,
20516 * containing a crate::lightning::onion_message::messenger::SendSuccess on success and a crate::lightning::onion_message::messenger::SendError on failure.
20517 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20519 typedef struct LDKCResult_SendSuccessSendErrorZ {
20521 * The contents of this CResult_SendSuccessSendErrorZ, accessible via either
20522 * `err` or `result` depending on the state of `result_ok`.
20524 union LDKCResult_SendSuccessSendErrorZPtr contents;
20526 * Whether this CResult_SendSuccessSendErrorZ represents a success state.
20529 } LDKCResult_SendSuccessSendErrorZ;
20532 * The contents of CResult_BlindedPathNoneZ
20534 typedef union LDKCResult_BlindedPathNoneZPtr {
20536 * A pointer to the contents in the success state.
20537 * Reading from this pointer when `result_ok` is not set is undefined.
20539 struct LDKBlindedPath *result;
20541 * Note that this value is always NULL, as there are no contents in the Err variant
20544 } LDKCResult_BlindedPathNoneZPtr;
20547 * A CResult_BlindedPathNoneZ represents the result of a fallible operation,
20548 * containing a crate::lightning::blinded_path::BlindedPath on success and a () on failure.
20549 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20551 typedef struct LDKCResult_BlindedPathNoneZ {
20553 * The contents of this CResult_BlindedPathNoneZ, accessible via either
20554 * `err` or `result` depending on the state of `result_ok`.
20556 union LDKCResult_BlindedPathNoneZPtr contents;
20558 * Whether this CResult_BlindedPathNoneZ represents a success state.
20561 } LDKCResult_BlindedPathNoneZ;
20564 * The contents of CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ
20566 typedef union LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr {
20568 * A pointer to the contents in the success state.
20569 * Reading from this pointer when `result_ok` is not set is undefined.
20571 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *result;
20573 * Note that this value is always NULL, as there are no contents in the Err variant
20576 } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr;
20579 * A CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ represents the result of a fallible operation,
20580 * containing a crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZ on success and a () on failure.
20581 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20583 typedef struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ {
20585 * The contents of this CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ, accessible via either
20586 * `err` or `result` depending on the state of `result_ok`.
20588 union LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr contents;
20590 * Whether this CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ represents a success state.
20593 } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ;
20598 * An intermediate node, its outbound channel, and relay parameters.
20600 typedef struct MUST_USE_STRUCT LDKForwardNode {
20602 * A pointer to the opaque Rust object.
20603 * Nearly everywhere, inner must be non-null, however in places where
20604 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20606 LDKnativeForwardNode *inner;
20608 * Indicates that this is the only struct which contains the same pointer.
20609 * Rust functions which take ownership of an object provided via an argument require
20610 * this to be true and invalidate the object pointed to by inner.
20616 * A dynamically-allocated array of crate::lightning::blinded_path::payment::ForwardNodes of arbitrary size.
20617 * This corresponds to std::vector in C++
20619 typedef struct LDKCVec_ForwardNodeZ {
20621 * The elements in the array.
20622 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
20624 struct LDKForwardNode *data;
20626 * The number of elements pointed to by `data`.
20629 } LDKCVec_ForwardNodeZ;
20632 * The contents of CResult_BlindedPathDecodeErrorZ
20634 typedef union LDKCResult_BlindedPathDecodeErrorZPtr {
20636 * A pointer to the contents in the success state.
20637 * Reading from this pointer when `result_ok` is not set is undefined.
20639 struct LDKBlindedPath *result;
20641 * A pointer to the contents in the error state.
20642 * Reading from this pointer when `result_ok` is set is undefined.
20644 struct LDKDecodeError *err;
20645 } LDKCResult_BlindedPathDecodeErrorZPtr;
20648 * A CResult_BlindedPathDecodeErrorZ represents the result of a fallible operation,
20649 * containing a crate::lightning::blinded_path::BlindedPath on success and a crate::lightning::ln::msgs::DecodeError on failure.
20650 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20652 typedef struct LDKCResult_BlindedPathDecodeErrorZ {
20654 * The contents of this CResult_BlindedPathDecodeErrorZ, accessible via either
20655 * `err` or `result` depending on the state of `result_ok`.
20657 union LDKCResult_BlindedPathDecodeErrorZPtr contents;
20659 * Whether this CResult_BlindedPathDecodeErrorZ represents a success state.
20662 } LDKCResult_BlindedPathDecodeErrorZ;
20665 * The contents of CResult_BlindedHopDecodeErrorZ
20667 typedef union LDKCResult_BlindedHopDecodeErrorZPtr {
20669 * A pointer to the contents in the success state.
20670 * Reading from this pointer when `result_ok` is not set is undefined.
20672 struct LDKBlindedHop *result;
20674 * A pointer to the contents in the error state.
20675 * Reading from this pointer when `result_ok` is set is undefined.
20677 struct LDKDecodeError *err;
20678 } LDKCResult_BlindedHopDecodeErrorZPtr;
20681 * A CResult_BlindedHopDecodeErrorZ represents the result of a fallible operation,
20682 * containing a crate::lightning::blinded_path::BlindedHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
20683 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20685 typedef struct LDKCResult_BlindedHopDecodeErrorZ {
20687 * The contents of this CResult_BlindedHopDecodeErrorZ, accessible via either
20688 * `err` or `result` depending on the state of `result_ok`.
20690 union LDKCResult_BlindedHopDecodeErrorZPtr contents;
20692 * Whether this CResult_BlindedHopDecodeErrorZ represents a success state.
20695 } LDKCResult_BlindedHopDecodeErrorZ;
20698 * The contents of CResult_InvoiceErrorDecodeErrorZ
20700 typedef union LDKCResult_InvoiceErrorDecodeErrorZPtr {
20702 * A pointer to the contents in the success state.
20703 * Reading from this pointer when `result_ok` is not set is undefined.
20705 struct LDKInvoiceError *result;
20707 * A pointer to the contents in the error state.
20708 * Reading from this pointer when `result_ok` is set is undefined.
20710 struct LDKDecodeError *err;
20711 } LDKCResult_InvoiceErrorDecodeErrorZPtr;
20714 * A CResult_InvoiceErrorDecodeErrorZ represents the result of a fallible operation,
20715 * containing a crate::lightning::offers::invoice_error::InvoiceError on success and a crate::lightning::ln::msgs::DecodeError on failure.
20716 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20718 typedef struct LDKCResult_InvoiceErrorDecodeErrorZ {
20720 * The contents of this CResult_InvoiceErrorDecodeErrorZ, accessible via either
20721 * `err` or `result` depending on the state of `result_ok`.
20723 union LDKCResult_InvoiceErrorDecodeErrorZPtr contents;
20725 * Whether this CResult_InvoiceErrorDecodeErrorZ represents a success state.
20728 } LDKCResult_InvoiceErrorDecodeErrorZ;
20733 * The state of a spendable output currently tracked by an [`OutputSweeper`].
20735 typedef struct MUST_USE_STRUCT LDKTrackedSpendableOutput {
20737 * A pointer to the opaque Rust object.
20738 * Nearly everywhere, inner must be non-null, however in places where
20739 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20741 LDKnativeTrackedSpendableOutput *inner;
20743 * Indicates that this is the only struct which contains the same pointer.
20744 * Rust functions which take ownership of an object provided via an argument require
20745 * this to be true and invalidate the object pointed to by inner.
20748 } LDKTrackedSpendableOutput;
20751 * The contents of CResult_TrackedSpendableOutputDecodeErrorZ
20753 typedef union LDKCResult_TrackedSpendableOutputDecodeErrorZPtr {
20755 * A pointer to the contents in the success state.
20756 * Reading from this pointer when `result_ok` is not set is undefined.
20758 struct LDKTrackedSpendableOutput *result;
20760 * A pointer to the contents in the error state.
20761 * Reading from this pointer when `result_ok` is set is undefined.
20763 struct LDKDecodeError *err;
20764 } LDKCResult_TrackedSpendableOutputDecodeErrorZPtr;
20767 * A CResult_TrackedSpendableOutputDecodeErrorZ represents the result of a fallible operation,
20768 * containing a crate::lightning::util::sweep::TrackedSpendableOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
20769 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20771 typedef struct LDKCResult_TrackedSpendableOutputDecodeErrorZ {
20773 * The contents of this CResult_TrackedSpendableOutputDecodeErrorZ, accessible via either
20774 * `err` or `result` depending on the state of `result_ok`.
20776 union LDKCResult_TrackedSpendableOutputDecodeErrorZPtr contents;
20778 * Whether this CResult_TrackedSpendableOutputDecodeErrorZ represents a success state.
20781 } LDKCResult_TrackedSpendableOutputDecodeErrorZ;
20784 * The current status of the output spend.
20786 typedef enum LDKOutputSpendStatus_Tag {
20788 * The output is tracked but an initial spending transaction hasn't been generated and
20791 LDKOutputSpendStatus_PendingInitialBroadcast,
20793 * A transaction spending the output has been broadcasted but is pending its first confirmation on-chain.
20795 LDKOutputSpendStatus_PendingFirstConfirmation,
20797 * A transaction spending the output has been confirmed on-chain but will be tracked until it
20798 * reaches [`ANTI_REORG_DELAY`] confirmations.
20800 LDKOutputSpendStatus_PendingThresholdConfirmations,
20802 * Must be last for serialization purposes
20804 LDKOutputSpendStatus_Sentinel,
20805 } LDKOutputSpendStatus_Tag;
20807 typedef struct LDKOutputSpendStatus_LDKPendingInitialBroadcast_Body {
20809 * The height at which we will first generate and broadcast a spending transaction.
20811 struct LDKCOption_u32Z delayed_until_height;
20812 } LDKOutputSpendStatus_LDKPendingInitialBroadcast_Body;
20814 typedef struct LDKOutputSpendStatus_LDKPendingFirstConfirmation_Body {
20816 * The hash of the chain tip when we first broadcast a transaction spending this output.
20818 struct LDKThirtyTwoBytes first_broadcast_hash;
20820 * The best height when we last broadcast a transaction spending this output.
20822 uint32_t latest_broadcast_height;
20824 * The transaction spending this output we last broadcasted.
20826 struct LDKTransaction latest_spending_tx;
20827 } LDKOutputSpendStatus_LDKPendingFirstConfirmation_Body;
20829 typedef struct LDKOutputSpendStatus_LDKPendingThresholdConfirmations_Body {
20831 * The hash of the chain tip when we first broadcast a transaction spending this output.
20833 struct LDKThirtyTwoBytes first_broadcast_hash;
20835 * The best height when we last broadcast a transaction spending this output.
20837 uint32_t latest_broadcast_height;
20839 * The transaction spending this output we saw confirmed on-chain.
20841 struct LDKTransaction latest_spending_tx;
20843 * The height at which the spending transaction was confirmed.
20845 uint32_t confirmation_height;
20847 * The hash of the block in which the spending transaction was confirmed.
20849 struct LDKThirtyTwoBytes confirmation_hash;
20850 } LDKOutputSpendStatus_LDKPendingThresholdConfirmations_Body;
20852 typedef struct MUST_USE_STRUCT LDKOutputSpendStatus {
20853 LDKOutputSpendStatus_Tag tag;
20855 LDKOutputSpendStatus_LDKPendingInitialBroadcast_Body pending_initial_broadcast;
20856 LDKOutputSpendStatus_LDKPendingFirstConfirmation_Body pending_first_confirmation;
20857 LDKOutputSpendStatus_LDKPendingThresholdConfirmations_Body pending_threshold_confirmations;
20859 } LDKOutputSpendStatus;
20862 * The contents of CResult_OutputSpendStatusDecodeErrorZ
20864 typedef union LDKCResult_OutputSpendStatusDecodeErrorZPtr {
20866 * A pointer to the contents in the success state.
20867 * Reading from this pointer when `result_ok` is not set is undefined.
20869 struct LDKOutputSpendStatus *result;
20871 * A pointer to the contents in the error state.
20872 * Reading from this pointer when `result_ok` is set is undefined.
20874 struct LDKDecodeError *err;
20875 } LDKCResult_OutputSpendStatusDecodeErrorZPtr;
20878 * A CResult_OutputSpendStatusDecodeErrorZ represents the result of a fallible operation,
20879 * containing a crate::lightning::util::sweep::OutputSpendStatus on success and a crate::lightning::ln::msgs::DecodeError on failure.
20880 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20882 typedef struct LDKCResult_OutputSpendStatusDecodeErrorZ {
20884 * The contents of this CResult_OutputSpendStatusDecodeErrorZ, accessible via either
20885 * `err` or `result` depending on the state of `result_ok`.
20887 union LDKCResult_OutputSpendStatusDecodeErrorZPtr contents;
20889 * Whether this CResult_OutputSpendStatusDecodeErrorZ represents a success state.
20892 } LDKCResult_OutputSpendStatusDecodeErrorZ;
20897 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
20899 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
20900 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
20901 * [`Confirm::transactions_confirmed`].
20903 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
20904 * may have been spent there. See [`Filter::register_output`] for details.
20906 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
20907 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
20909 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
20911 * A pointer to the opaque Rust object.
20912 * Nearly everywhere, inner must be non-null, however in places where
20913 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20915 LDKnativeWatchedOutput *inner;
20917 * Indicates that this is the only struct which contains the same pointer.
20918 * Rust functions which take ownership of an object provided via an argument require
20919 * this to be true and invalidate the object pointed to by inner.
20922 } LDKWatchedOutput;
20925 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
20928 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
20929 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
20930 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
20931 * receiving full blocks from a chain source, any further filtering is unnecessary.
20933 * After an output has been registered, subsequent block retrievals from the chain source must not
20934 * exclude any transactions matching the new criteria nor any in-block descendants of such
20937 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
20938 * should not block on I/O. Implementations should instead queue the newly monitored data to be
20939 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
20940 * invocation that has called the `Filter` must return [`InProgress`].
20942 * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
20943 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
20944 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
20946 typedef struct LDKFilter {
20948 * An opaque pointer which is passed to your function implementations as an argument.
20949 * This has no meaning in the LDK, and can be NULL or any other value.
20953 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
20954 * a spending condition.
20956 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
20958 * Registers interest in spends of a transaction output.
20960 * Note that this method might be called during processing of a new block. You therefore need
20961 * to ensure that also dependent output spents within an already connected block are correctly
20962 * handled, e.g., by re-scanning the block in question whenever new outputs have been
20963 * registered mid-processing.
20965 void (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
20967 * Frees any resources associated with this object given its this_arg pointer.
20968 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
20970 void (*free)(void *this_arg);
20974 * An enum which can either contain a crate::lightning::chain::Filter or not
20976 typedef enum LDKCOption_FilterZ_Tag {
20978 * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
20980 LDKCOption_FilterZ_Some,
20982 * When we're in this state, this COption_FilterZ contains nothing
20984 LDKCOption_FilterZ_None,
20986 * Must be last for serialization purposes
20988 LDKCOption_FilterZ_Sentinel,
20989 } LDKCOption_FilterZ_Tag;
20991 typedef struct LDKCOption_FilterZ {
20992 LDKCOption_FilterZ_Tag tag;
20995 struct LDKFilter some;
20998 } LDKCOption_FilterZ;
21001 * A dynamically-allocated array of crate::lightning::util::sweep::TrackedSpendableOutputs of arbitrary size.
21002 * This corresponds to std::vector in C++
21004 typedef struct LDKCVec_TrackedSpendableOutputZ {
21006 * The elements in the array.
21007 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
21009 struct LDKTrackedSpendableOutput *data;
21011 * The number of elements pointed to by `data`.
21014 } LDKCVec_TrackedSpendableOutputZ;
21017 * A helper trait that describes an on-chain wallet capable of returning a (change) destination
21020 typedef struct LDKChangeDestinationSource {
21022 * An opaque pointer which is passed to your function implementations as an argument.
21023 * This has no meaning in the LDK, and can be NULL or any other value.
21027 * Returns a script pubkey which can be used as a change destination for
21028 * [`OutputSpender::spend_spendable_outputs`].
21030 * This method should return a different value each time it is called, to avoid linking
21031 * on-chain funds controlled to the same user.
21033 struct LDKCResult_CVec_u8ZNoneZ (*get_change_destination_script)(const void *this_arg);
21035 * Frees any resources associated with this object given its this_arg pointer.
21036 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21038 void (*free)(void *this_arg);
21039 } LDKChangeDestinationSource;
21042 * Provides an interface that allows storage and retrieval of persisted values that are associated
21045 * In order to avoid collisions the key space is segmented based on the given `primary_namespace`s
21046 * and `secondary_namespace`s. Implementations of this trait are free to handle them in different
21047 * ways, as long as per-namespace key uniqueness is asserted.
21049 * Keys and namespaces are required to be valid ASCII strings in the range of
21050 * [`KVSTORE_NAMESPACE_KEY_ALPHABET`] and no longer than [`KVSTORE_NAMESPACE_KEY_MAX_LEN`]. Empty
21051 * primary namespaces and secondary namespaces (`\"\"`) are assumed to be a valid, however, if
21052 * `primary_namespace` is empty, `secondary_namespace` is required to be empty, too. This means
21053 * that concerns should always be separated by primary namespace first, before secondary
21054 * namespaces are used. While the number of primary namespaces will be relatively small and is
21055 * determined at compile time, there may be many secondary namespaces per primary namespace. Note
21056 * that per-namespace uniqueness needs to also hold for keys *and* namespaces in any given
21057 * namespace, i.e., conflicts between keys and equally named
21058 * primary namespaces/secondary namespaces must be avoided.
21060 * **Note:** Users migrating custom persistence backends from the pre-v0.0.117 `KVStorePersister`
21061 * interface can use a concatenation of `[{primary_namespace}/[{secondary_namespace}/]]{key}` to
21062 * recover a `key` compatible with the data model previously assumed by `KVStorePersister::persist`.
21064 typedef struct LDKKVStore {
21066 * An opaque pointer which is passed to your function implementations as an argument.
21067 * This has no meaning in the LDK, and can be NULL or any other value.
21071 * Returns the data stored for the given `primary_namespace`, `secondary_namespace`, and
21074 * Returns an [`ErrorKind::NotFound`] if the given `key` could not be found in the given
21075 * `primary_namespace` and `secondary_namespace`.
21077 * [`ErrorKind::NotFound`]: io::ErrorKind::NotFound
21079 struct LDKCResult_CVec_u8ZIOErrorZ (*read)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key);
21081 * Persists the given data under the given `key`.
21083 * Will create the given `primary_namespace` and `secondary_namespace` if not already present
21086 struct LDKCResult_NoneIOErrorZ (*write)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, struct LDKu8slice buf);
21088 * Removes any data that had previously been persisted under the given `key`.
21090 * If the `lazy` flag is set to `true`, the backend implementation might choose to lazily
21091 * remove the given `key` at some point in time after the method returns, e.g., as part of an
21092 * eventual batch deletion of multiple keys. As a consequence, subsequent calls to
21093 * [`KVStore::list`] might include the removed key until the changes are actually persisted.
21095 * Note that while setting the `lazy` flag reduces the I/O burden of multiple subsequent
21096 * `remove` calls, it also influences the atomicity guarantees as lazy `remove`s could
21097 * potentially get lost on crash after the method returns. Therefore, this flag should only be
21098 * set for `remove` operations that can be safely replayed at a later time.
21100 * Returns successfully if no data will be stored for the given `primary_namespace`,
21101 * `secondary_namespace`, and `key`, independently of whether it was present before its
21102 * invokation or not.
21104 struct LDKCResult_NoneIOErrorZ (*remove)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, bool lazy);
21106 * Returns a list of keys that are stored under the given `secondary_namespace` in
21107 * `primary_namespace`.
21109 * Returns the keys in arbitrary order, so users requiring a particular order need to sort the
21110 * returned keys. Returns an empty list if `primary_namespace` or `secondary_namespace` is unknown.
21112 struct LDKCResult_CVec_StrZIOErrorZ (*list)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace);
21114 * Frees any resources associated with this object given its this_arg pointer.
21115 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21117 void (*free)(void *this_arg);
21121 * A trait that describes a wallet capable of creating a spending [`Transaction`] from a set of
21122 * [`SpendableOutputDescriptor`]s.
21124 typedef struct LDKOutputSpender {
21126 * An opaque pointer which is passed to your function implementations as an argument.
21127 * This has no meaning in the LDK, and can be NULL or any other value.
21131 * Creates a [`Transaction`] which spends the given descriptors to the given outputs, plus an
21132 * output to the given change destination (if sufficient change value remains). The
21133 * transaction will have a feerate, at least, of the given value.
21135 * The `locktime` argument is used to set the transaction's locktime. If `None`, the
21136 * transaction will have a locktime of 0. It it recommended to set this to the current block
21137 * height to avoid fee sniping, unless you have some specific reason to use a different
21140 * Returns `Err(())` if the output value is greater than the input value minus required fee,
21141 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
21142 * does not match the one we can spend.
21144 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);
21146 * Frees any resources associated with this object given its this_arg pointer.
21147 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21149 void (*free)(void *this_arg);
21150 } LDKOutputSpender;
21155 * A utility that keeps track of [`SpendableOutputDescriptor`]s, persists them in a given
21156 * [`KVStore`] and regularly retries sweeping them based on a callback given to the constructor
21159 * Users should call [`Self::track_spendable_outputs`] for any [`SpendableOutputDescriptor`]s received via [`Event::SpendableOutputs`].
21161 * This needs to be notified of chain state changes either via its [`Listen`] or [`Confirm`]
21162 * implementation and hence has to be connected with the utilized chain data sources.
21164 * If chain data is provided via the [`Confirm`] interface or via filtered blocks, users are
21165 * required to give their chain data sources (i.e., [`Filter`] implementation) to the respective
21168 * [`Event::SpendableOutputs`]: crate::events::Event::SpendableOutputs
21170 typedef struct MUST_USE_STRUCT LDKOutputSweeper {
21172 * A pointer to the opaque Rust object.
21173 * Nearly everywhere, inner must be non-null, however in places where
21174 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21176 LDKnativeOutputSweeper *inner;
21178 * Indicates that this is the only struct which contains the same pointer.
21179 * Rust functions which take ownership of an object provided via an argument require
21180 * this to be true and invalidate the object pointed to by inner.
21183 } LDKOutputSweeper;
21186 * The contents of CResult_OutputSweeperDecodeErrorZ
21188 typedef union LDKCResult_OutputSweeperDecodeErrorZPtr {
21190 * A pointer to the contents in the success state.
21191 * Reading from this pointer when `result_ok` is not set is undefined.
21193 struct LDKOutputSweeper *result;
21195 * A pointer to the contents in the error state.
21196 * Reading from this pointer when `result_ok` is set is undefined.
21198 struct LDKDecodeError *err;
21199 } LDKCResult_OutputSweeperDecodeErrorZPtr;
21202 * A CResult_OutputSweeperDecodeErrorZ represents the result of a fallible operation,
21203 * containing a crate::lightning::util::sweep::OutputSweeper on success and a crate::lightning::ln::msgs::DecodeError on failure.
21204 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21206 typedef struct LDKCResult_OutputSweeperDecodeErrorZ {
21208 * The contents of this CResult_OutputSweeperDecodeErrorZ, accessible via either
21209 * `err` or `result` depending on the state of `result_ok`.
21211 union LDKCResult_OutputSweeperDecodeErrorZPtr contents;
21213 * Whether this CResult_OutputSweeperDecodeErrorZ represents a success state.
21216 } LDKCResult_OutputSweeperDecodeErrorZ;
21219 * A tuple of 2 elements. See the individual fields for the types contained.
21221 typedef struct LDKC2Tuple_BestBlockOutputSweeperZ {
21223 * The element at position 0
21225 struct LDKBestBlock a;
21227 * The element at position 1
21229 struct LDKOutputSweeper b;
21230 } LDKC2Tuple_BestBlockOutputSweeperZ;
21233 * The contents of CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ
21235 typedef union LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZPtr {
21237 * A pointer to the contents in the success state.
21238 * Reading from this pointer when `result_ok` is not set is undefined.
21240 struct LDKC2Tuple_BestBlockOutputSweeperZ *result;
21242 * A pointer to the contents in the error state.
21243 * Reading from this pointer when `result_ok` is set is undefined.
21245 struct LDKDecodeError *err;
21246 } LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZPtr;
21249 * A CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ represents the result of a fallible operation,
21250 * containing a crate::c_types::derived::C2Tuple_BestBlockOutputSweeperZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
21251 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21253 typedef struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ {
21255 * The contents of this CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ, accessible via either
21256 * `err` or `result` depending on the state of `result_ok`.
21258 union LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZPtr contents;
21260 * Whether this CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ represents a success state.
21263 } LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ;
21268 * Base key used in conjunction with a `per_commitment_point` to generate a [`DelayedPaymentKey`].
21270 * The delayed payment key is used to pay the commitment state broadcaster their
21271 * non-HTLC-encumbered funds after a delay to give their counterparty a chance to punish if the
21272 * state broadcasted was previously revoked.
21274 typedef struct MUST_USE_STRUCT LDKDelayedPaymentBasepoint {
21276 * A pointer to the opaque Rust object.
21277 * Nearly everywhere, inner must be non-null, however in places where
21278 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21280 LDKnativeDelayedPaymentBasepoint *inner;
21282 * Indicates that this is the only struct which contains the same pointer.
21283 * Rust functions which take ownership of an object provided via an argument require
21284 * this to be true and invalidate the object pointed to by inner.
21287 } LDKDelayedPaymentBasepoint;
21290 * The contents of CResult_DelayedPaymentBasepointDecodeErrorZ
21292 typedef union LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr {
21294 * A pointer to the contents in the success state.
21295 * Reading from this pointer when `result_ok` is not set is undefined.
21297 struct LDKDelayedPaymentBasepoint *result;
21299 * A pointer to the contents in the error state.
21300 * Reading from this pointer when `result_ok` is set is undefined.
21302 struct LDKDecodeError *err;
21303 } LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr;
21306 * A CResult_DelayedPaymentBasepointDecodeErrorZ represents the result of a fallible operation,
21307 * containing a crate::lightning::ln::channel_keys::DelayedPaymentBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
21308 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21310 typedef struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ {
21312 * The contents of this CResult_DelayedPaymentBasepointDecodeErrorZ, accessible via either
21313 * `err` or `result` depending on the state of `result_ok`.
21315 union LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr contents;
21317 * Whether this CResult_DelayedPaymentBasepointDecodeErrorZ represents a success state.
21320 } LDKCResult_DelayedPaymentBasepointDecodeErrorZ;
21325 * A derived key built from a [`DelayedPaymentBasepoint`] and `per_commitment_point`.
21327 * The delayed payment key is used to pay the commitment state broadcaster their
21328 * non-HTLC-encumbered funds after a delay. This delay gives their counterparty a chance to
21329 * punish and claim all the channel funds if the state broadcasted was previously revoked.
21331 * [See the BOLT specs]
21332 * (https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation)
21333 * for more information on key derivation details.
21335 typedef struct MUST_USE_STRUCT LDKDelayedPaymentKey {
21337 * A pointer to the opaque Rust object.
21338 * Nearly everywhere, inner must be non-null, however in places where
21339 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21341 LDKnativeDelayedPaymentKey *inner;
21343 * Indicates that this is the only struct which contains the same pointer.
21344 * Rust functions which take ownership of an object provided via an argument require
21345 * this to be true and invalidate the object pointed to by inner.
21348 } LDKDelayedPaymentKey;
21351 * The contents of CResult_DelayedPaymentKeyDecodeErrorZ
21353 typedef union LDKCResult_DelayedPaymentKeyDecodeErrorZPtr {
21355 * A pointer to the contents in the success state.
21356 * Reading from this pointer when `result_ok` is not set is undefined.
21358 struct LDKDelayedPaymentKey *result;
21360 * A pointer to the contents in the error state.
21361 * Reading from this pointer when `result_ok` is set is undefined.
21363 struct LDKDecodeError *err;
21364 } LDKCResult_DelayedPaymentKeyDecodeErrorZPtr;
21367 * A CResult_DelayedPaymentKeyDecodeErrorZ represents the result of a fallible operation,
21368 * containing a crate::lightning::ln::channel_keys::DelayedPaymentKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
21369 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21371 typedef struct LDKCResult_DelayedPaymentKeyDecodeErrorZ {
21373 * The contents of this CResult_DelayedPaymentKeyDecodeErrorZ, accessible via either
21374 * `err` or `result` depending on the state of `result_ok`.
21376 union LDKCResult_DelayedPaymentKeyDecodeErrorZPtr contents;
21378 * Whether this CResult_DelayedPaymentKeyDecodeErrorZ represents a success state.
21381 } LDKCResult_DelayedPaymentKeyDecodeErrorZ;
21386 * Base key used in conjunction with a `per_commitment_point` to generate an [`HtlcKey`].
21388 * HTLC keys are used to ensure only the recipient of an HTLC can claim it on-chain with the HTLC
21389 * preimage and that only the sender of an HTLC can claim it on-chain after it has timed out.
21390 * Thus, both channel counterparties' HTLC keys will appears in each HTLC output's script.
21392 typedef struct MUST_USE_STRUCT LDKHtlcBasepoint {
21394 * A pointer to the opaque Rust object.
21395 * Nearly everywhere, inner must be non-null, however in places where
21396 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21398 LDKnativeHtlcBasepoint *inner;
21400 * Indicates that this is the only struct which contains the same pointer.
21401 * Rust functions which take ownership of an object provided via an argument require
21402 * this to be true and invalidate the object pointed to by inner.
21405 } LDKHtlcBasepoint;
21408 * The contents of CResult_HtlcBasepointDecodeErrorZ
21410 typedef union LDKCResult_HtlcBasepointDecodeErrorZPtr {
21412 * A pointer to the contents in the success state.
21413 * Reading from this pointer when `result_ok` is not set is undefined.
21415 struct LDKHtlcBasepoint *result;
21417 * A pointer to the contents in the error state.
21418 * Reading from this pointer when `result_ok` is set is undefined.
21420 struct LDKDecodeError *err;
21421 } LDKCResult_HtlcBasepointDecodeErrorZPtr;
21424 * A CResult_HtlcBasepointDecodeErrorZ represents the result of a fallible operation,
21425 * containing a crate::lightning::ln::channel_keys::HtlcBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
21426 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21428 typedef struct LDKCResult_HtlcBasepointDecodeErrorZ {
21430 * The contents of this CResult_HtlcBasepointDecodeErrorZ, accessible via either
21431 * `err` or `result` depending on the state of `result_ok`.
21433 union LDKCResult_HtlcBasepointDecodeErrorZPtr contents;
21435 * Whether this CResult_HtlcBasepointDecodeErrorZ represents a success state.
21438 } LDKCResult_HtlcBasepointDecodeErrorZ;
21443 * A derived key built from a [`HtlcBasepoint`] and `per_commitment_point`.
21445 * HTLC keys are used to ensure only the recipient of an HTLC can claim it on-chain with the HTLC
21446 * preimage and that only the sender of an HTLC can claim it on-chain after it has timed out.
21447 * Thus, both channel counterparties' HTLC keys will appears in each HTLC output's script.
21449 * [See the BOLT specs]
21450 * (https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation)
21451 * for more information on key derivation details.
21453 typedef struct MUST_USE_STRUCT LDKHtlcKey {
21455 * A pointer to the opaque Rust object.
21456 * Nearly everywhere, inner must be non-null, however in places where
21457 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21459 LDKnativeHtlcKey *inner;
21461 * Indicates that this is the only struct which contains the same pointer.
21462 * Rust functions which take ownership of an object provided via an argument require
21463 * this to be true and invalidate the object pointed to by inner.
21469 * The contents of CResult_HtlcKeyDecodeErrorZ
21471 typedef union LDKCResult_HtlcKeyDecodeErrorZPtr {
21473 * A pointer to the contents in the success state.
21474 * Reading from this pointer when `result_ok` is not set is undefined.
21476 struct LDKHtlcKey *result;
21478 * A pointer to the contents in the error state.
21479 * Reading from this pointer when `result_ok` is set is undefined.
21481 struct LDKDecodeError *err;
21482 } LDKCResult_HtlcKeyDecodeErrorZPtr;
21485 * A CResult_HtlcKeyDecodeErrorZ represents the result of a fallible operation,
21486 * containing a crate::lightning::ln::channel_keys::HtlcKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
21487 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21489 typedef struct LDKCResult_HtlcKeyDecodeErrorZ {
21491 * The contents of this CResult_HtlcKeyDecodeErrorZ, accessible via either
21492 * `err` or `result` depending on the state of `result_ok`.
21494 union LDKCResult_HtlcKeyDecodeErrorZPtr contents;
21496 * Whether this CResult_HtlcKeyDecodeErrorZ represents a success state.
21499 } LDKCResult_HtlcKeyDecodeErrorZ;
21504 * 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.
21505 * A watcher can be given a [RevocationBasepoint] to generate per commitment [RevocationKey] to create justice transactions.
21507 typedef struct MUST_USE_STRUCT LDKRevocationBasepoint {
21509 * A pointer to the opaque Rust object.
21510 * Nearly everywhere, inner must be non-null, however in places where
21511 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21513 LDKnativeRevocationBasepoint *inner;
21515 * Indicates that this is the only struct which contains the same pointer.
21516 * Rust functions which take ownership of an object provided via an argument require
21517 * this to be true and invalidate the object pointed to by inner.
21520 } LDKRevocationBasepoint;
21523 * The contents of CResult_RevocationBasepointDecodeErrorZ
21525 typedef union LDKCResult_RevocationBasepointDecodeErrorZPtr {
21527 * A pointer to the contents in the success state.
21528 * Reading from this pointer when `result_ok` is not set is undefined.
21530 struct LDKRevocationBasepoint *result;
21532 * A pointer to the contents in the error state.
21533 * Reading from this pointer when `result_ok` is set is undefined.
21535 struct LDKDecodeError *err;
21536 } LDKCResult_RevocationBasepointDecodeErrorZPtr;
21539 * A CResult_RevocationBasepointDecodeErrorZ represents the result of a fallible operation,
21540 * containing a crate::lightning::ln::channel_keys::RevocationBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
21541 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21543 typedef struct LDKCResult_RevocationBasepointDecodeErrorZ {
21545 * The contents of this CResult_RevocationBasepointDecodeErrorZ, accessible via either
21546 * `err` or `result` depending on the state of `result_ok`.
21548 union LDKCResult_RevocationBasepointDecodeErrorZPtr contents;
21550 * Whether this CResult_RevocationBasepointDecodeErrorZ represents a success state.
21553 } LDKCResult_RevocationBasepointDecodeErrorZ;
21558 * The revocation key is used to allow a channel party to revoke their state - giving their
21559 * counterparty the required material to claim all of their funds if they broadcast that state.
21561 * Each commitment transaction has a revocation key based on the basepoint and
21562 * per_commitment_point which is used in both commitment and HTLC transactions.
21564 * See [the BOLT spec for derivation details]
21565 * (https://github.com/lightning/bolts/blob/master/03-transactions.md#revocationpubkey-derivation)
21567 typedef struct MUST_USE_STRUCT LDKRevocationKey {
21569 * A pointer to the opaque Rust object.
21570 * Nearly everywhere, inner must be non-null, however in places where
21571 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21573 LDKnativeRevocationKey *inner;
21575 * Indicates that this is the only struct which contains the same pointer.
21576 * Rust functions which take ownership of an object provided via an argument require
21577 * this to be true and invalidate the object pointed to by inner.
21580 } LDKRevocationKey;
21583 * The contents of CResult_RevocationKeyDecodeErrorZ
21585 typedef union LDKCResult_RevocationKeyDecodeErrorZPtr {
21587 * A pointer to the contents in the success state.
21588 * Reading from this pointer when `result_ok` is not set is undefined.
21590 struct LDKRevocationKey *result;
21592 * A pointer to the contents in the error state.
21593 * Reading from this pointer when `result_ok` is set is undefined.
21595 struct LDKDecodeError *err;
21596 } LDKCResult_RevocationKeyDecodeErrorZPtr;
21599 * A CResult_RevocationKeyDecodeErrorZ represents the result of a fallible operation,
21600 * containing a crate::lightning::ln::channel_keys::RevocationKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
21601 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21603 typedef struct LDKCResult_RevocationKeyDecodeErrorZ {
21605 * The contents of this CResult_RevocationKeyDecodeErrorZ, accessible via either
21606 * `err` or `result` depending on the state of `result_ok`.
21608 union LDKCResult_RevocationKeyDecodeErrorZPtr contents;
21610 * Whether this CResult_RevocationKeyDecodeErrorZ represents a success state.
21613 } LDKCResult_RevocationKeyDecodeErrorZ;
21618 * A read-only reference to a current ChannelMonitor.
21620 * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
21623 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
21625 * A pointer to the opaque Rust object.
21626 * Nearly everywhere, inner must be non-null, however in places where
21627 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21629 LDKnativeLockedChannelMonitor *inner;
21631 * Indicates that this is the only struct which contains the same pointer.
21632 * Rust functions which take ownership of an object provided via an argument require
21633 * this to be true and invalidate the object pointed to by inner.
21636 } LDKLockedChannelMonitor;
21639 * The contents of CResult_LockedChannelMonitorNoneZ
21641 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
21643 * A pointer to the contents in the success state.
21644 * Reading from this pointer when `result_ok` is not set is undefined.
21646 struct LDKLockedChannelMonitor *result;
21648 * Note that this value is always NULL, as there are no contents in the Err variant
21651 } LDKCResult_LockedChannelMonitorNoneZPtr;
21654 * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
21655 * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
21656 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21658 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
21660 * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
21661 * `err` or `result` depending on the state of `result_ok`.
21663 union LDKCResult_LockedChannelMonitorNoneZPtr contents;
21665 * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
21668 } LDKCResult_LockedChannelMonitorNoneZ;
21671 * A tuple of 2 elements. See the individual fields for the types contained.
21673 typedef struct LDKC2Tuple_OutPointChannelIdZ {
21675 * The element at position 0
21677 struct LDKOutPoint a;
21679 * The element at position 1
21681 struct LDKChannelId b;
21682 } LDKC2Tuple_OutPointChannelIdZ;
21685 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointChannelIdZs of arbitrary size.
21686 * This corresponds to std::vector in C++
21688 typedef struct LDKCVec_C2Tuple_OutPointChannelIdZZ {
21690 * The elements in the array.
21691 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
21693 struct LDKC2Tuple_OutPointChannelIdZ *data;
21695 * The number of elements pointed to by `data`.
21698 } LDKCVec_C2Tuple_OutPointChannelIdZZ;
21703 * An opaque identifier describing a specific [`Persist`] method call.
21705 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
21707 * A pointer to the opaque Rust object.
21708 * Nearly everywhere, inner must be non-null, however in places where
21709 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21711 LDKnativeMonitorUpdateId *inner;
21713 * Indicates that this is the only struct which contains the same pointer.
21714 * Rust functions which take ownership of an object provided via an argument require
21715 * this to be true and invalidate the object pointed to by inner.
21718 } LDKMonitorUpdateId;
21721 * A dynamically-allocated array of crate::lightning::chain::chainmonitor::MonitorUpdateIds of arbitrary size.
21722 * This corresponds to std::vector in C++
21724 typedef struct LDKCVec_MonitorUpdateIdZ {
21726 * The elements in the array.
21727 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
21729 struct LDKMonitorUpdateId *data;
21731 * The number of elements pointed to by `data`.
21734 } LDKCVec_MonitorUpdateIdZ;
21737 * A tuple of 2 elements. See the individual fields for the types contained.
21739 typedef struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ {
21741 * The element at position 0
21743 struct LDKOutPoint a;
21745 * The element at position 1
21747 struct LDKCVec_MonitorUpdateIdZ b;
21748 } LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ;
21751 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointCVec_MonitorUpdateIdZZs of arbitrary size.
21752 * This corresponds to std::vector in C++
21754 typedef struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ {
21756 * The elements in the array.
21757 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
21759 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *data;
21761 * The number of elements pointed to by `data`.
21764 } LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ;
21767 * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk.
21769 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
21771 typedef struct LDKPersister {
21773 * An opaque pointer which is passed to your function implementations as an argument.
21774 * This has no meaning in the LDK, and can be NULL or any other value.
21778 * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
21780 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
21782 struct LDKCResult_NoneIOErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
21784 * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
21786 struct LDKCResult_NoneIOErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
21788 * Persist the given [`WriteableScore`] to disk, returning an error if persistence failed.
21790 struct LDKCResult_NoneIOErrorZ (*persist_scorer)(const void *this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer);
21792 * Frees any resources associated with this object given its this_arg pointer.
21793 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21795 void (*free)(void *this_arg);
21801 * Implements [`Persist`] in a way that writes and reads both [`ChannelMonitor`]s and
21802 * [`ChannelMonitorUpdate`]s.
21806 * The main benefit this provides over the [`KVStore`]'s [`Persist`] implementation is decreased
21807 * I/O bandwidth and storage churn, at the expense of more IOPS (including listing, reading, and
21808 * deleting) and complexity. This is because it writes channel monitor differential updates,
21809 * whereas the other (default) implementation rewrites the entire monitor on each update. For
21810 * routing nodes, updates can happen many times per second to a channel, and monitors can be tens
21811 * of megabytes (or more). Updates can be as small as a few hundred bytes.
21813 * Note that monitors written with `MonitorUpdatingPersister` are _not_ backward-compatible with
21814 * the default [`KVStore`]'s [`Persist`] implementation. They have a prepended byte sequence,
21815 * [`MONITOR_UPDATING_PERSISTER_PREPEND_SENTINEL`], applied to prevent deserialization with other
21816 * persisters. This is because monitors written by this struct _may_ have unapplied updates. In
21817 * order to downgrade, you must ensure that all updates are applied to the monitor, and remove the
21820 * # Storing monitors
21822 * Monitors are stored by implementing the [`Persist`] trait, which has two functions:
21824 * - [`Persist::persist_new_channel`], which persists whole [`ChannelMonitor`]s.
21825 * - [`Persist::update_persisted_channel`], which persists only a [`ChannelMonitorUpdate`]
21827 * Whole [`ChannelMonitor`]s are stored in the [`CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE`],
21828 * using the familiar encoding of an [`OutPoint`] (for example, `[SOME-64-CHAR-HEX-STRING]_1`).
21830 * Each [`ChannelMonitorUpdate`] is stored in a dynamic secondary namespace, as follows:
21832 * - primary namespace: [`CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE`]
21833 * - secondary namespace: [the monitor's encoded outpoint name]
21835 * Under that secondary namespace, each update is stored with a number string, like `21`, which
21836 * represents its `update_id` value.
21838 * For example, consider this channel, named for its transaction ID and index, or [`OutPoint`]:
21840 * - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
21843 * Full channel monitors would be stored at a single key:
21845 * `[CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
21847 * Updates would be stored as follows (with `/` delimiting primary_namespace/secondary_namespace/key):
21850 * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/1
21851 * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/2
21852 * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/3
21856 * # Reading channel state from storage
21858 * Channel state can be reconstructed by calling
21859 * [`MonitorUpdatingPersister::read_all_channel_monitors_with_updates`]. Alternatively, users can
21860 * list channel monitors themselves and load channels individually using
21861 * [`MonitorUpdatingPersister::read_channel_monitor_with_updates`].
21863 * ## EXTREMELY IMPORTANT
21865 * It is extremely important that your [`KVStore::read`] implementation uses the
21866 * [`io::ErrorKind::NotFound`] variant correctly: that is, when a file is not found, and _only_ in
21867 * that circumstance (not when there is really a permissions error, for example). This is because
21868 * neither channel monitor reading function lists updates. Instead, either reads the monitor, and
21869 * using its stored `update_id`, synthesizes update storage keys, and tries them in sequence until
21870 * one is not found. All _other_ errors will be bubbled up in the function's [`Result`].
21872 * # Pruning stale channel updates
21874 * Stale updates are pruned when the consolidation threshold is reached according to `maximum_pending_updates`.
21875 * Monitor updates in the range between the latest `update_id` and `update_id - maximum_pending_updates`
21877 * The `lazy` flag is used on the [`KVStore::remove`] method, so there are no guarantees that the deletions
21878 * will complete. However, stale updates are not a problem for data integrity, since updates are
21879 * only read that are higher than the stored [`ChannelMonitor`]'s `update_id`.
21881 * If you have many stale updates stored (such as after a crash with pending lazy deletes), and
21882 * would like to get rid of them, consider using the
21883 * [`MonitorUpdatingPersister::cleanup_stale_updates`] function.
21885 typedef struct MUST_USE_STRUCT LDKMonitorUpdatingPersister {
21887 * A pointer to the opaque Rust object.
21888 * Nearly everywhere, inner must be non-null, however in places where
21889 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21891 LDKnativeMonitorUpdatingPersister *inner;
21893 * Indicates that this is the only struct which contains the same pointer.
21894 * Rust functions which take ownership of an object provided via an argument require
21895 * this to be true and invalidate the object pointed to by inner.
21898 } LDKMonitorUpdatingPersister;
21901 * `Persist` defines behavior for persisting channel monitors: this could mean
21902 * writing once to disk, and/or uploading to one or more backup services.
21904 * Persistence can happen in one of two ways - synchronously completing before the trait method
21905 * calls return or asynchronously in the background.
21907 * # For those implementing synchronous persistence
21909 * * If persistence completes fully (including any relevant `fsync()` calls), the implementation
21910 * should return [`ChannelMonitorUpdateStatus::Completed`], indicating normal channel operation
21913 * * If persistence fails for some reason, implementations should consider returning
21914 * [`ChannelMonitorUpdateStatus::InProgress`] and retry all pending persistence operations in
21915 * the background with [`ChainMonitor::list_pending_monitor_updates`] and
21916 * [`ChainMonitor::get_monitor`].
21918 * Once a full [`ChannelMonitor`] has been persisted, all pending updates for that channel can
21919 * be marked as complete via [`ChainMonitor::channel_monitor_updated`].
21921 * If at some point no further progress can be made towards persisting the pending updates, the
21922 * node should simply shut down.
21924 * * If the persistence has failed and cannot be retried further (e.g. because of an outage),
21925 * [`ChannelMonitorUpdateStatus::UnrecoverableError`] can be used, though this will result in
21926 * an immediate panic and future operations in LDK generally failing.
21928 * # For those implementing asynchronous persistence
21930 * All calls should generally spawn a background task and immediately return
21931 * [`ChannelMonitorUpdateStatus::InProgress`]. Once the update completes,
21932 * [`ChainMonitor::channel_monitor_updated`] should be called with the corresponding
21933 * [`MonitorUpdateId`].
21935 * Note that unlike the direct [`chain::Watch`] interface,
21936 * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
21938 * If at some point no further progress can be made towards persisting a pending update, the node
21939 * should simply shut down. Until then, the background task should either loop indefinitely, or
21940 * persistence should be regularly retried with [`ChainMonitor::list_pending_monitor_updates`]
21941 * and [`ChainMonitor::get_monitor`] (note that if a full monitor is persisted all pending
21942 * monitor updates may be marked completed).
21944 * # Using remote watchtowers
21946 * Watchtowers may be updated as a part of an implementation of this trait, utilizing the async
21947 * update process described above while the watchtower is being updated. The following methods are
21948 * provided for bulding transactions for a watchtower:
21949 * [`ChannelMonitor::initial_counterparty_commitment_tx`],
21950 * [`ChannelMonitor::counterparty_commitment_txs_from_update`],
21951 * [`ChannelMonitor::sign_to_local_justice_tx`], [`TrustedCommitmentTransaction::revokeable_output_index`],
21952 * [`TrustedCommitmentTransaction::build_to_local_justice_tx`].
21954 * [`TrustedCommitmentTransaction::revokeable_output_index`]: crate::ln::chan_utils::TrustedCommitmentTransaction::revokeable_output_index
21955 * [`TrustedCommitmentTransaction::build_to_local_justice_tx`]: crate::ln::chan_utils::TrustedCommitmentTransaction::build_to_local_justice_tx
21957 typedef struct LDKPersist {
21959 * An opaque pointer which is passed to your function implementations as an argument.
21960 * This has no meaning in the LDK, and can be NULL or any other value.
21964 * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
21965 * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
21967 * The data can be stored any way you want, but the identifier provided by LDK is the
21968 * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
21969 * and the stored channel data). Note that you **must** persist every new monitor to disk.
21971 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
21972 * if you return [`ChannelMonitorUpdateStatus::InProgress`].
21974 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
21975 * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
21977 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
21978 * [`Writeable::write`]: crate::util::ser::Writeable::write
21980 enum LDKChannelMonitorUpdateStatus (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_funding_outpoint, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
21982 * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
21985 * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
21986 * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
21989 * During blockchain synchronization operations, and in some rare cases, this may be called with
21990 * no [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
21991 * Note that after the full [`ChannelMonitor`] is persisted any previous
21992 * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
21993 * applied to the persisted [`ChannelMonitor`] as they were already applied.
21995 * If an implementer chooses to persist the updates only, they need to make
21996 * sure that all the updates are applied to the `ChannelMonitors` *before*
21997 * the set of channel monitors is given to the `ChannelManager`
21998 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
21999 * applying a monitor update to a monitor. If full `ChannelMonitors` are
22000 * persisted, then there is no need to persist individual updates.
22002 * Note that there could be a performance tradeoff between persisting complete
22003 * channel monitors on every update vs. persisting only updates and applying
22004 * them in batches. The size of each monitor grows `O(number of state updates)`
22005 * whereas updates are small and `O(1)`.
22007 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
22008 * if you return [`ChannelMonitorUpdateStatus::InProgress`].
22010 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
22011 * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
22012 * [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
22014 * [`Writeable::write`]: crate::util::ser::Writeable::write
22016 * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
22018 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);
22020 * Prevents the channel monitor from being loaded on startup.
22022 * Archiving the data in a backup location (rather than deleting it fully) is useful for
22023 * hedging against data loss in case of unexpected failure.
22025 void (*archive_persisted_channel)(const void *this_arg, struct LDKOutPoint channel_funding_outpoint);
22027 * Frees any resources associated with this object given its this_arg pointer.
22028 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22030 void (*free)(void *this_arg);
22036 * A string that displays only printable characters, replacing control characters with
22037 * [`core::char::REPLACEMENT_CHARACTER`].
22039 typedef struct MUST_USE_STRUCT LDKPrintableString {
22041 * A pointer to the opaque Rust object.
22042 * Nearly everywhere, inner must be non-null, however in places where
22043 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22045 LDKnativePrintableString *inner;
22047 * Indicates that this is the only struct which contains the same pointer.
22048 * Rust functions which take ownership of an object provided via an argument require
22049 * this to be true and invalidate the object pointed to by inner.
22052 } LDKPrintableString;
22055 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
22058 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
22059 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
22060 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
22063 * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
22064 * entire header chain and only blocks with matching transaction data using BIP 157 filters or
22065 * other similar filtering.
22067 typedef struct LDKListen {
22069 * An opaque pointer which is passed to your function implementations as an argument.
22070 * This has no meaning in the LDK, and can be NULL or any other value.
22074 * Notifies the listener that a block was added at the given height, with the transaction data
22075 * possibly filtered.
22077 void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
22079 * Notifies the listener that a block was added at the given height.
22081 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
22083 * Notifies the listener that a block was removed at the given height.
22085 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
22087 * Frees any resources associated with this object given its this_arg pointer.
22088 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22090 void (*free)(void *this_arg);
22094 * The `Confirm` trait is used to notify LDK when relevant transactions have been confirmed on
22095 * chain or unconfirmed during a chain reorganization.
22097 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
22098 * [`Listen`]. For instance, an Electrum-based transaction sync implementation may implement
22099 * [`Filter`] to subscribe to relevant transactions and unspent outputs it should monitor for
22100 * on-chain activity. Then, it needs to notify LDK via this interface upon observing any changes
22101 * with reference to the confirmation status of the monitored objects.
22104 * The intended use is as follows:
22105 * - Call [`transactions_confirmed`] to notify LDK whenever any of the registered transactions or
22106 * outputs are, respectively, confirmed or spent on chain.
22107 * - Call [`transaction_unconfirmed`] to notify LDK whenever any transaction returned by
22108 * [`get_relevant_txids`] is no longer confirmed in the block with the given block hash.
22109 * - Call [`best_block_updated`] to notify LDK whenever a new chain tip becomes available.
22113 * Clients must call these methods in chain order. Specifically:
22114 * - Transactions which are confirmed in a particular block must be given before transactions
22115 * confirmed in a later block.
22116 * - Dependent transactions within the same block must be given in topological order, possibly in
22118 * - All unconfirmed transactions must be given after the original confirmations and before *any*
22119 * reconfirmations, i.e., [`transactions_confirmed`] and [`transaction_unconfirmed`] calls should
22120 * never be interleaved, but always conduced *en bloc*.
22121 * - Any reconfirmed transactions need to be explicitly unconfirmed before they are reconfirmed
22122 * in regard to the new block.
22124 * See individual method documentation for further details.
22126 * [`transactions_confirmed`]: Self::transactions_confirmed
22127 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
22128 * [`best_block_updated`]: Self::best_block_updated
22129 * [`get_relevant_txids`]: Self::get_relevant_txids
22131 typedef struct LDKConfirm {
22133 * An opaque pointer which is passed to your function implementations as an argument.
22134 * This has no meaning in the LDK, and can be NULL or any other value.
22138 * Notifies LDK of transactions confirmed in a block with a given header and height.
22140 * Must be called for any transactions registered by [`Filter::register_tx`] or any
22141 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
22142 * appearing in the same block do not need to be included in the same call; instead, multiple
22143 * calls with additional transactions may be made so long as they are made in [chain order].
22145 * May be called before or after [`best_block_updated`] for the corresponding block. However,
22146 * in the event of a chain reorganization, it must not be called with a `header` that is no
22147 * longer in the chain as of the last call to [`best_block_updated`].
22149 * [chain order]: Confirm#order
22150 * [`best_block_updated`]: Self::best_block_updated
22152 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
22154 * Notifies LDK of a transaction that is no longer confirmed as result of a chain reorganization.
22156 * Must be called for any transaction returned by [`get_relevant_txids`] if it has been
22157 * reorganized out of the best chain or if it is no longer confirmed in the block with the
22158 * given block hash. Once called, the given transaction will not be returned
22159 * by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`].
22161 * [`get_relevant_txids`]: Self::get_relevant_txids
22162 * [`transactions_confirmed`]: Self::transactions_confirmed
22164 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
22166 * Notifies LDK of an update to the best header connected at the given height.
22168 * Must be called whenever a new chain tip becomes available. May be skipped for intermediary
22171 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
22173 * Returns transactions that must be monitored for reorganization out of the chain along
22174 * with the height and the hash of the block as part of which it had been previously confirmed.
22176 * Note that the returned `Option<BlockHash>` might be `None` for channels created with LDK
22177 * 0.0.112 and prior, in which case you need to manually track previous confirmations.
22179 * Will include any transactions passed to [`transactions_confirmed`] that have insufficient
22180 * confirmations to be safe from a chain reorganization. Will not include any transactions
22181 * passed to [`transaction_unconfirmed`], unless later reconfirmed.
22183 * Must be called to determine the subset of transactions that must be monitored for
22184 * reorganization. Will be idempotent between calls but may change as a result of calls to the
22185 * other interface methods. Thus, this is useful to determine which transactions must be
22186 * given to [`transaction_unconfirmed`].
22188 * If any of the returned transactions are confirmed in a block other than the one with the
22189 * given hash at the given height, they need to be unconfirmed and reconfirmed via
22190 * [`transaction_unconfirmed`] and [`transactions_confirmed`], respectively.
22192 * [`transactions_confirmed`]: Self::transactions_confirmed
22193 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
22195 struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ (*get_relevant_txids)(const void *this_arg);
22197 * Frees any resources associated with this object given its this_arg pointer.
22198 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22200 void (*free)(void *this_arg);
22204 * A `enum` signalling to the [`OutputSweeper`] that it should delay spending an output until a
22205 * future block height is reached.
22207 typedef enum LDKSpendingDelay_Tag {
22209 * A relative delay indicating we shouldn't spend the output before `cur_height + num_blocks`
22212 LDKSpendingDelay_Relative,
22214 * An absolute delay indicating we shouldn't spend the output before `height` is reached.
22216 LDKSpendingDelay_Absolute,
22218 * Must be last for serialization purposes
22220 LDKSpendingDelay_Sentinel,
22221 } LDKSpendingDelay_Tag;
22223 typedef struct LDKSpendingDelay_LDKRelative_Body {
22225 * The number of blocks until we'll generate and broadcast the spending transaction.
22227 uint32_t num_blocks;
22228 } LDKSpendingDelay_LDKRelative_Body;
22230 typedef struct LDKSpendingDelay_LDKAbsolute_Body {
22232 * The height at which we'll generate and broadcast the spending transaction.
22235 } LDKSpendingDelay_LDKAbsolute_Body;
22237 typedef struct MUST_USE_STRUCT LDKSpendingDelay {
22238 LDKSpendingDelay_Tag tag;
22240 LDKSpendingDelay_LDKRelative_Body relative;
22241 LDKSpendingDelay_LDKAbsolute_Body absolute;
22243 } LDKSpendingDelay;
22246 * A callback which is called when a [`Future`] completes.
22248 * Note that this MUST NOT call back into LDK directly, it must instead schedule actions to be
22249 * taken later. Rust users should use the [`std::future::Future`] implementation for [`Future`]
22252 * Note that the [`std::future::Future`] implementation may only work for runtimes which schedule
22253 * futures when they receive a wake, rather than immediately executing them.
22255 typedef struct LDKFutureCallback {
22257 * An opaque pointer which is passed to your function implementations as an argument.
22258 * This has no meaning in the LDK, and can be NULL or any other value.
22262 * The method which is called.
22264 void (*call)(const void *this_arg);
22266 * Frees any resources associated with this object given its this_arg pointer.
22267 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22269 void (*free)(void *this_arg);
22270 } LDKFutureCallback;
22275 * A struct which can be used to select across many [`Future`]s at once without relying on a full
22278 typedef struct MUST_USE_STRUCT LDKSleeper {
22280 * A pointer to the opaque Rust object.
22281 * Nearly everywhere, inner must be non-null, however in places where
22282 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22284 LDKnativeSleeper *inner;
22286 * Indicates that this is the only struct which contains the same pointer.
22287 * Rust functions which take ownership of an object provided via an argument require
22288 * this to be true and invalidate the object pointed to by inner.
22296 * Configuration we set when applicable.
22298 * Default::default() provides sane defaults.
22300 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
22302 * A pointer to the opaque Rust object.
22303 * Nearly everywhere, inner must be non-null, however in places where
22304 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22306 LDKnativeChannelHandshakeConfig *inner;
22308 * Indicates that this is the only struct which contains the same pointer.
22309 * Rust functions which take ownership of an object provided via an argument require
22310 * this to be true and invalidate the object pointed to by inner.
22313 } LDKChannelHandshakeConfig;
22318 * Optional channel limits which are applied during channel creation.
22320 * These limits are only applied to our counterparty's limits, not our own.
22322 * Use 0/`<type>::max_value()` as appropriate to skip checking.
22324 * Provides sane defaults for most configurations.
22326 * Most additional limits are disabled except those with which specify a default in individual
22327 * field documentation. Note that this may result in barely-usable channels, but since they
22328 * are applied mostly only to incoming channels that's not much of a problem.
22330 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
22332 * A pointer to the opaque Rust object.
22333 * Nearly everywhere, inner must be non-null, however in places where
22334 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22336 LDKnativeChannelHandshakeLimits *inner;
22338 * Indicates that this is the only struct which contains the same pointer.
22339 * Rust functions which take ownership of an object provided via an argument require
22340 * this to be true and invalidate the object pointed to by inner.
22343 } LDKChannelHandshakeLimits;
22348 * A parallel struct to [`ChannelConfig`] to define partial updates.
22350 typedef struct MUST_USE_STRUCT LDKChannelConfigUpdate {
22352 * A pointer to the opaque Rust object.
22353 * Nearly everywhere, inner must be non-null, however in places where
22354 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22356 LDKnativeChannelConfigUpdate *inner;
22358 * Indicates that this is the only struct which contains the same pointer.
22359 * Rust functions which take ownership of an object provided via an argument require
22360 * this to be true and invalidate the object pointed to by inner.
22363 } LDKChannelConfigUpdate;
22368 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
22370 * Default::default() provides sane defaults for most configurations
22371 * (but currently with 0 relay fees!)
22373 typedef struct MUST_USE_STRUCT LDKUserConfig {
22375 * A pointer to the opaque Rust object.
22376 * Nearly everywhere, inner must be non-null, however in places where
22377 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22379 LDKnativeUserConfig *inner;
22381 * Indicates that this is the only struct which contains the same pointer.
22382 * Rust functions which take ownership of an object provided via an argument require
22383 * this to be true and invalidate the object pointed to by inner.
22391 * An implementation of [`chain::Watch`] for monitoring channels.
22393 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
22394 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
22395 * or used independently to monitor channels remotely. See the [module-level documentation] for
22398 * Note that `ChainMonitor` should regularly trigger rebroadcasts/fee bumps of pending claims from
22399 * a force-closed channel. This is crucial in preventing certain classes of pinning attacks,
22400 * detecting substantial mempool feerate changes between blocks, and ensuring reliability if
22401 * broadcasting fails. We recommend invoking this every 30 seconds, or lower if running in an
22402 * environment with spotty connections, like on mobile.
22404 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
22405 * [module-level documentation]: crate::chain::chainmonitor
22406 * [`rebroadcast_pending_claims`]: Self::rebroadcast_pending_claims
22408 typedef struct MUST_USE_STRUCT LDKChainMonitor {
22410 * A pointer to the opaque Rust object.
22411 * Nearly everywhere, inner must be non-null, however in places where
22412 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22414 LDKnativeChainMonitor *inner;
22416 * Indicates that this is the only struct which contains the same pointer.
22417 * Rust functions which take ownership of an object provided via an argument require
22418 * this to be true and invalidate the object pointed to by inner.
22424 * A trait implemented for objects handling events from [`EventsProvider`].
22426 * An async variation also exists for implementations of [`EventsProvider`] that support async
22427 * event handling. The async event handler should satisfy the generic bounds: `F:
22428 * core::future::Future, H: Fn(Event) -> F`.
22430 typedef struct LDKEventHandler {
22432 * An opaque pointer which is passed to your function implementations as an argument.
22433 * This has no meaning in the LDK, and can be NULL or any other value.
22437 * Handles the given [`Event`].
22439 * See [`EventsProvider`] for details that must be considered when implementing this method.
22441 void (*handle_event)(const void *this_arg, struct LDKEvent event);
22443 * Frees any resources associated with this object given its this_arg pointer.
22444 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22446 void (*free)(void *this_arg);
22450 * A trait indicating an object may generate events.
22452 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
22454 * Implementations of this trait may also feature an async version of event handling, as shown with
22455 * [`ChannelManager::process_pending_events_async`] and
22456 * [`ChainMonitor::process_pending_events_async`].
22460 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
22461 * event since the last invocation.
22463 * In order to ensure no [`Event`]s are lost, implementors of this trait will persist [`Event`]s
22464 * and replay any unhandled events on startup. An [`Event`] is considered handled when
22465 * [`process_pending_events`] returns, thus handlers MUST fully handle [`Event`]s and persist any
22466 * relevant changes to disk *before* returning.
22468 * Further, because an application may crash between an [`Event`] being handled and the
22469 * implementor of this trait being re-serialized, [`Event`] handling must be idempotent - in
22470 * effect, [`Event`]s may be replayed.
22472 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
22473 * consult the provider's documentation on the implication of processing events and how a handler
22474 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
22475 * [`ChainMonitor::process_pending_events`]).
22477 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
22480 * [`process_pending_events`]: Self::process_pending_events
22481 * [`handle_event`]: EventHandler::handle_event
22482 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
22483 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
22484 * [`ChannelManager::process_pending_events_async`]: crate::ln::channelmanager::ChannelManager::process_pending_events_async
22485 * [`ChainMonitor::process_pending_events_async`]: crate::chain::chainmonitor::ChainMonitor::process_pending_events_async
22487 typedef struct LDKEventsProvider {
22489 * An opaque pointer which is passed to your function implementations as an argument.
22490 * This has no meaning in the LDK, and can be NULL or any other value.
22494 * Processes any events generated since the last call using the given event handler.
22496 * See the trait-level documentation for requirements.
22498 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
22500 * Frees any resources associated with this object given its this_arg pointer.
22501 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22503 void (*free)(void *this_arg);
22504 } LDKEventsProvider;
22507 * This enum is used to specify which error data to send to peers when failing back an HTLC
22508 * using [`ChannelManager::fail_htlc_backwards_with_reason`].
22510 * For more info on failure codes, see <https://github.com/lightning/bolts/blob/master/04-onion-routing.md#failure-messages>.
22512 typedef enum LDKFailureCode_Tag {
22514 * We had a temporary error processing the payment. Useful if no other error codes fit
22515 * and you want to indicate that the payer may want to retry.
22517 LDKFailureCode_TemporaryNodeFailure,
22519 * We have a required feature which was not in this onion. For example, you may require
22520 * some additional metadata that was not provided with this payment.
22522 LDKFailureCode_RequiredNodeFeatureMissing,
22524 * You may wish to use this when a `payment_preimage` is unknown, or the CLTV expiry of
22525 * the HTLC is too close to the current block height for safe handling.
22526 * Using this failure code in [`ChannelManager::fail_htlc_backwards_with_reason`] is
22527 * equivalent to calling [`ChannelManager::fail_htlc_backwards`].
22529 LDKFailureCode_IncorrectOrUnknownPaymentDetails,
22531 * We failed to process the payload after the onion was decrypted. You may wish to
22532 * use this when receiving custom HTLC TLVs with even type numbers that you don't recognize.
22534 * If available, the tuple data may include the type number and byte offset in the
22535 * decrypted byte stream where the failure occurred.
22537 LDKFailureCode_InvalidOnionPayload,
22539 * Must be last for serialization purposes
22541 LDKFailureCode_Sentinel,
22542 } LDKFailureCode_Tag;
22544 typedef struct MUST_USE_STRUCT LDKFailureCode {
22545 LDKFailureCode_Tag tag;
22548 struct LDKCOption_C2Tuple_u64u16ZZ invalid_onion_payload;
22556 * Chain-related parameters used to construct a new `ChannelManager`.
22558 * Typically, the block-specific parameters are derived from the best block hash for the network,
22559 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
22560 * are not needed when deserializing a previously constructed `ChannelManager`.
22562 typedef struct MUST_USE_STRUCT LDKChainParameters {
22564 * A pointer to the opaque Rust object.
22565 * Nearly everywhere, inner must be non-null, however in places where
22566 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22568 LDKnativeChainParameters *inner;
22570 * Indicates that this is the only struct which contains the same pointer.
22571 * Rust functions which take ownership of an object provided via an argument require
22572 * this to be true and invalidate the object pointed to by inner.
22575 } LDKChainParameters;
22578 * A trait indicating an object may generate message send events
22580 typedef struct LDKMessageSendEventsProvider {
22582 * An opaque pointer which is passed to your function implementations as an argument.
22583 * This has no meaning in the LDK, and can be NULL or any other value.
22587 * Gets the list of pending events which were generated by previous actions, clearing the list
22590 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
22592 * Frees any resources associated with this object given its this_arg pointer.
22593 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22595 void (*free)(void *this_arg);
22596 } LDKMessageSendEventsProvider;
22599 * A trait to describe an object which can receive channel messages.
22601 * Messages MAY be called in parallel when they originate from different `their_node_ids`, however
22602 * they MUST NOT be called in parallel when the two calls have the same `their_node_id`.
22604 typedef struct LDKChannelMessageHandler {
22606 * An opaque pointer which is passed to your function implementations as an argument.
22607 * This has no meaning in the LDK, and can be NULL or any other value.
22611 * Handle an incoming `open_channel` message from the given peer.
22613 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannel *NONNULL_PTR msg);
22615 * Handle an incoming `open_channel2` message from the given peer.
22617 void (*handle_open_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannelV2 *NONNULL_PTR msg);
22619 * Handle an incoming `accept_channel` message from the given peer.
22621 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannel *NONNULL_PTR msg);
22623 * Handle an incoming `accept_channel2` message from the given peer.
22625 void (*handle_accept_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannelV2 *NONNULL_PTR msg);
22627 * Handle an incoming `funding_created` message from the given peer.
22629 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
22631 * Handle an incoming `funding_signed` message from the given peer.
22633 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
22635 * Handle an incoming `channel_ready` message from the given peer.
22637 void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
22639 * Handle an incoming `shutdown` message from the given peer.
22641 void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg);
22643 * Handle an incoming `closing_signed` message from the given peer.
22645 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
22647 * Handle an incoming `stfu` message from the given peer.
22649 void (*handle_stfu)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKStfu *NONNULL_PTR msg);
22651 * Handle an incoming `tx_add_input message` from the given peer.
22653 void (*handle_tx_add_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddInput *NONNULL_PTR msg);
22655 * Handle an incoming `tx_add_output` message from the given peer.
22657 void (*handle_tx_add_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddOutput *NONNULL_PTR msg);
22659 * Handle an incoming `tx_remove_input` message from the given peer.
22661 void (*handle_tx_remove_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveInput *NONNULL_PTR msg);
22663 * Handle an incoming `tx_remove_output` message from the given peer.
22665 void (*handle_tx_remove_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveOutput *NONNULL_PTR msg);
22667 * Handle an incoming `tx_complete message` from the given peer.
22669 void (*handle_tx_complete)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxComplete *NONNULL_PTR msg);
22671 * Handle an incoming `tx_signatures` message from the given peer.
22673 void (*handle_tx_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxSignatures *NONNULL_PTR msg);
22675 * Handle an incoming `tx_init_rbf` message from the given peer.
22677 void (*handle_tx_init_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxInitRbf *NONNULL_PTR msg);
22679 * Handle an incoming `tx_ack_rbf` message from the given peer.
22681 void (*handle_tx_ack_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAckRbf *NONNULL_PTR msg);
22683 * Handle an incoming `tx_abort message` from the given peer.
22685 void (*handle_tx_abort)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAbort *NONNULL_PTR msg);
22687 * Handle an incoming `update_add_htlc` message from the given peer.
22689 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
22691 * Handle an incoming `update_fulfill_htlc` message from the given peer.
22693 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
22695 * Handle an incoming `update_fail_htlc` message from the given peer.
22697 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
22699 * Handle an incoming `update_fail_malformed_htlc` message from the given peer.
22701 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
22703 * Handle an incoming `commitment_signed` message from the given peer.
22705 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
22707 * Handle an incoming `revoke_and_ack` message from the given peer.
22709 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
22711 * Handle an incoming `update_fee` message from the given peer.
22713 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
22715 * Handle an incoming `announcement_signatures` message from the given peer.
22717 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
22719 * Indicates a connection to the peer failed/an existing connection was lost.
22721 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
22723 * Handle a peer reconnecting, possibly generating `channel_reestablish` message(s).
22725 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
22726 * with us. Implementors should be somewhat conservative about doing so, however, as other
22727 * message handlers may still wish to communicate with this peer.
22729 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg, bool inbound);
22731 * Handle an incoming `channel_reestablish` message from the given peer.
22733 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
22735 * Handle an incoming `channel_update` message from the given peer.
22737 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
22739 * Handle an incoming `error` message from the given peer.
22741 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
22743 * Gets the node feature flags which this handler itself supports. All available handlers are
22744 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
22745 * which are broadcasted in our [`NodeAnnouncement`] message.
22747 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
22749 * Gets the init feature flags which should be sent to the given peer. All available handlers
22750 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
22751 * which are sent in our [`Init`] message.
22753 * Note that this method is called before [`Self::peer_connected`].
22755 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
22757 * Gets the chain hashes for this `ChannelMessageHandler` indicating which chains it supports.
22759 * If it's `None`, then no particular network chain hash compatibility will be enforced when
22760 * connecting to peers.
22762 struct LDKCOption_CVec_ThirtyTwoBytesZZ (*get_chain_hashes)(const void *this_arg);
22764 * Implementation of MessageSendEventsProvider for this object.
22766 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
22768 * Frees any resources associated with this object given its this_arg pointer.
22769 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22771 void (*free)(void *this_arg);
22772 } LDKChannelMessageHandler;
22775 * A handler for an [`OnionMessage`] containing a BOLT 12 Offers message as its payload.
22777 * [`OnionMessage`]: crate::ln::msgs::OnionMessage
22779 typedef struct LDKOffersMessageHandler {
22781 * An opaque pointer which is passed to your function implementations as an argument.
22782 * This has no meaning in the LDK, and can be NULL or any other value.
22786 * Handles the given message by either responding with an [`Bolt12Invoice`], sending a payment,
22787 * or replying with an error.
22789 * The returned [`OffersMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
22791 * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
22793 struct LDKCOption_OffersMessageZ (*handle_message)(const void *this_arg, struct LDKOffersMessage message);
22795 * Releases any [`OffersMessage`]s that need to be sent.
22797 * Typically, this is used for messages initiating a payment flow rather than in response to
22798 * another message. The latter should use the return value of [`Self::handle_message`].
22800 struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ (*release_pending_messages)(const void *this_arg);
22802 * Frees any resources associated with this object given its this_arg pointer.
22803 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22805 void (*free)(void *this_arg);
22806 } LDKOffersMessageHandler;
22809 * An interface for looking up the node id of a channel counterparty for the purpose of forwarding
22810 * an [`OnionMessage`].
22812 * [`OnionMessage`]: crate::ln::msgs::OnionMessage
22814 typedef struct LDKNodeIdLookUp {
22816 * An opaque pointer which is passed to your function implementations as an argument.
22817 * This has no meaning in the LDK, and can be NULL or any other value.
22821 * Returns the node id of the forwarding node's channel counterparty with `short_channel_id`.
22823 * Here, the forwarding node is referring to the node of the [`OnionMessenger`] parameterized
22824 * by the [`NodeIdLookUp`] and the counterparty to one of that node's peers.
22826 * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
22828 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22830 struct LDKPublicKey (*next_node_id)(const void *this_arg, uint64_t short_channel_id);
22832 * Frees any resources associated with this object given its this_arg pointer.
22833 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22835 void (*free)(void *this_arg);
22841 * Arguments for the creation of a ChannelManager that are not deserialized.
22843 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
22845 * 1) Deserialize all stored [`ChannelMonitor`]s.
22846 * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
22847 * `<(BlockHash, ChannelManager)>::read(reader, args)`
22848 * This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
22849 * [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
22850 * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
22851 * same way you would handle a [`chain::Filter`] call using
22852 * [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
22853 * 4) Reconnect blocks on your [`ChannelMonitor`]s.
22854 * 5) Disconnect/connect blocks on the [`ChannelManager`].
22855 * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
22856 * Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
22857 * will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
22859 * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
22860 * [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
22862 * Note that the ordering of #4-7 is not of importance, however all four must occur before you
22863 * call any other methods on the newly-deserialized [`ChannelManager`].
22865 * Note that because some channels may be closed during deserialization, it is critical that you
22866 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
22867 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
22868 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
22869 * not force-close the same channels but consider them live), you may end up revoking a state for
22870 * which you've already broadcasted the transaction.
22872 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
22874 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
22876 * A pointer to the opaque Rust object.
22877 * Nearly everywhere, inner must be non-null, however in places where
22878 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22880 LDKnativeChannelManagerReadArgs *inner;
22882 * Indicates that this is the only struct which contains the same pointer.
22883 * Rust functions which take ownership of an object provided via an argument require
22884 * this to be true and invalidate the object pointed to by inner.
22887 } LDKChannelManagerReadArgs;
22892 * A set of keys that were HKDF-expanded from an initial call to
22893 * [`NodeSigner::get_inbound_payment_key_material`].
22895 * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
22897 typedef struct MUST_USE_STRUCT LDKExpandedKey {
22899 * A pointer to the opaque Rust object.
22900 * Nearly everywhere, inner must be non-null, however in places where
22901 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22903 LDKnativeExpandedKey *inner;
22905 * Indicates that this is the only struct which contains the same pointer.
22906 * Rust functions which take ownership of an object provided via an argument require
22907 * this to be true and invalidate the object pointed to by inner.
22915 * Contains fields that are both common to [`open_channel`] and `open_channel2` messages.
22917 * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message
22919 typedef struct MUST_USE_STRUCT LDKCommonOpenChannelFields {
22921 * A pointer to the opaque Rust object.
22922 * Nearly everywhere, inner must be non-null, however in places where
22923 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22925 LDKnativeCommonOpenChannelFields *inner;
22927 * Indicates that this is the only struct which contains the same pointer.
22928 * Rust functions which take ownership of an object provided via an argument require
22929 * this to be true and invalidate the object pointed to by inner.
22932 } LDKCommonOpenChannelFields;
22937 * Contains fields that are both common to [`accept_channel`] and `accept_channel2` messages.
22939 * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message
22941 typedef struct MUST_USE_STRUCT LDKCommonAcceptChannelFields {
22943 * A pointer to the opaque Rust object.
22944 * Nearly everywhere, inner must be non-null, however in places where
22945 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22947 LDKnativeCommonAcceptChannelFields *inner;
22949 * Indicates that this is the only struct which contains the same pointer.
22950 * Rust functions which take ownership of an object provided via an argument require
22951 * this to be true and invalidate the object pointed to by inner.
22954 } LDKCommonAcceptChannelFields;
22959 * Packet of hop data for next peer
22961 typedef struct MUST_USE_STRUCT LDKPacket {
22963 * A pointer to the opaque Rust object.
22964 * Nearly everywhere, inner must be non-null, however in places where
22965 * the Rust equivalent takes an Option, it may be set to null to indicate None.
22967 LDKnativePacket *inner;
22969 * Indicates that this is the only struct which contains the same pointer.
22970 * Rust functions which take ownership of an object provided via an argument require
22971 * this to be true and invalidate the object pointed to by inner.
22977 * A trait to describe an object which can receive routing messages.
22979 * # Implementor DoS Warnings
22981 * For messages enabled with the `gossip_queries` feature there are potential DoS vectors when
22982 * handling inbound queries. Implementors using an on-disk network graph should be aware of
22983 * repeated disk I/O for queries accessing different parts of the network graph.
22985 typedef struct LDKRoutingMessageHandler {
22987 * An opaque pointer which is passed to your function implementations as an argument.
22988 * This has no meaning in the LDK, and can be NULL or any other value.
22992 * Handle an incoming `node_announcement` message, returning `true` if it should be forwarded on,
22993 * `false` or returning an `Err` otherwise.
22995 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
22997 * Handle a `channel_announcement` message, returning `true` if it should be forwarded on, `false`
22998 * or returning an `Err` otherwise.
23000 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
23002 * Handle an incoming `channel_update` message, returning true if it should be forwarded on,
23003 * `false` or returning an `Err` otherwise.
23005 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
23007 * Gets channel announcements and updates required to dump our routing table to a remote node,
23008 * starting at the `short_channel_id` indicated by `starting_point` and including announcements
23009 * for a single channel.
23011 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcement)(const void *this_arg, uint64_t starting_point);
23013 * Gets a node announcement required to dump our routing table to a remote node, starting at
23014 * the node *after* the provided pubkey and including up to one announcement immediately
23015 * higher (as defined by `<PublicKey as Ord>::cmp`) than `starting_point`.
23016 * If `None` is provided for `starting_point`, we start at the first node.
23018 * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
23019 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23021 struct LDKNodeAnnouncement (*get_next_node_announcement)(const void *this_arg, struct LDKNodeId starting_point);
23023 * Called when a connection is established with a peer. This can be used to
23024 * perform routing table synchronization using a strategy defined by the
23027 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
23028 * with us. Implementors should be somewhat conservative about doing so, however, as other
23029 * message handlers may still wish to communicate with this peer.
23031 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
23033 * Handles the reply of a query we initiated to learn about channels
23034 * for a given range of blocks. We can expect to receive one or more
23035 * replies to a single query.
23037 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
23039 * Handles the reply of a query we initiated asking for routing gossip
23040 * messages for a list of channels. We should receive this message when
23041 * a node has completed its best effort to send us the pertaining routing
23044 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
23046 * Handles when a peer asks us to send a list of `short_channel_id`s
23047 * for the requested range of blocks.
23049 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
23051 * Handles when a peer asks us to send routing gossip messages for a
23052 * list of `short_channel_id`s.
23054 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
23056 * Indicates that there are a large number of [`ChannelAnnouncement`] (or other) messages
23057 * pending some async action. While there is no guarantee of the rate of future messages, the
23058 * caller should seek to reduce the rate of new gossip messages handled, especially
23059 * [`ChannelAnnouncement`]s.
23061 bool (*processing_queue_high)(const void *this_arg);
23063 * Gets the node feature flags which this handler itself supports. All available handlers are
23064 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
23065 * which are broadcasted in our [`NodeAnnouncement`] message.
23067 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
23069 * Gets the init feature flags which should be sent to the given peer. All available handlers
23070 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
23071 * which are sent in our [`Init`] message.
23073 * Note that this method is called before [`Self::peer_connected`].
23075 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
23077 * Implementation of MessageSendEventsProvider for this object.
23079 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
23081 * Frees any resources associated with this object given its this_arg pointer.
23082 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23084 void (*free)(void *this_arg);
23085 } LDKRoutingMessageHandler;
23088 * A handler for received [`OnionMessage`]s and for providing generated ones to send.
23090 typedef struct LDKOnionMessageHandler {
23092 * An opaque pointer which is passed to your function implementations as an argument.
23093 * This has no meaning in the LDK, and can be NULL or any other value.
23097 * Because much of the lightning network does not yet support forwarding onion messages, we
23098 * may need to directly connect to a node which will forward a message for us. In such a case,
23099 * this method will return the set of nodes which need connection by node_id and the
23100 * corresponding socket addresses where they may accept incoming connections.
23102 * Thus, this method should be polled regularly to detect messages await such a direct
23105 struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ (*get_and_clear_connections_needed)(const void *this_arg);
23107 * Handle an incoming `onion_message` message from the given peer.
23109 void (*handle_onion_message)(const void *this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg);
23111 * Returns the next pending onion message for the peer with the given node id.
23113 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23115 struct LDKOnionMessage (*next_onion_message_for_peer)(const void *this_arg, struct LDKPublicKey peer_node_id);
23117 * Called when a connection is established with a peer. Can be used to track which peers
23118 * advertise onion message support and are online.
23120 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
23121 * with us. Implementors should be somewhat conservative about doing so, however, as other
23122 * message handlers may still wish to communicate with this peer.
23124 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
23126 * Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
23127 * drop and refuse to forward onion messages to this peer.
23129 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
23131 * Performs actions that should happen roughly every ten seconds after startup. Allows handlers
23132 * to drop any buffered onion messages intended for prospective peers.
23134 void (*timer_tick_occurred)(const void *this_arg);
23136 * Gets the node feature flags which this handler itself supports. All available handlers are
23137 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
23138 * which are broadcasted in our [`NodeAnnouncement`] message.
23140 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
23142 * Gets the init feature flags which should be sent to the given peer. All available handlers
23143 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
23144 * which are sent in our [`Init`] message.
23146 * Note that this method is called before [`Self::peer_connected`].
23148 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
23150 * Frees any resources associated with this object given its this_arg pointer.
23151 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23153 void (*free)(void *this_arg);
23154 } LDKOnionMessageHandler;
23159 * BOLT 4 onion packet including hop data for the next peer.
23161 typedef struct MUST_USE_STRUCT LDKTrampolineOnionPacket {
23163 * A pointer to the opaque Rust object.
23164 * Nearly everywhere, inner must be non-null, however in places where
23165 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23167 LDKnativeTrampolineOnionPacket *inner;
23169 * Indicates that this is the only struct which contains the same pointer.
23170 * Rust functions which take ownership of an object provided via an argument require
23171 * this to be true and invalidate the object pointed to by inner.
23174 } LDKTrampolineOnionPacket;
23177 * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
23180 typedef struct LDKCustomMessageReader {
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 * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
23188 * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
23189 * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
23190 * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
23192 struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
23194 * Frees any resources associated with this object given its this_arg pointer.
23195 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23197 void (*free)(void *this_arg);
23198 } LDKCustomMessageReader;
23201 * A handler provided to [`PeerManager`] for reading and handling custom messages.
23203 * [BOLT 1] specifies a custom message type range for use with experimental or application-specific
23204 * messages. `CustomMessageHandler` allows for user-defined handling of such types. See the
23205 * [`lightning_custom_message`] crate for tools useful in composing more than one custom handler.
23207 * [BOLT 1]: https://github.com/lightning/bolts/blob/master/01-messaging.md
23208 * [`lightning_custom_message`]: https://docs.rs/lightning_custom_message/latest/lightning_custom_message
23210 typedef struct LDKCustomMessageHandler {
23212 * An opaque pointer which is passed to your function implementations as an argument.
23213 * This has no meaning in the LDK, and can be NULL or any other value.
23217 * Handles the given message sent from `sender_node_id`, possibly producing messages for
23218 * [`CustomMessageHandler::get_and_clear_pending_msg`] to return and thus for [`PeerManager`]
23221 struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
23223 * Returns the list of pending messages that were generated by the handler, clearing the list
23224 * in the process. Each message is paired with the node id of the intended recipient. If no
23225 * connection to the node exists, then the message is simply not sent.
23227 struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
23229 * Gets the node feature flags which this handler itself supports. All available handlers are
23230 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
23231 * which are broadcasted in our [`NodeAnnouncement`] message.
23233 * [`NodeAnnouncement`]: crate::ln::msgs::NodeAnnouncement
23235 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
23237 * Gets the init feature flags which should be sent to the given peer. All available handlers
23238 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
23239 * which are sent in our [`Init`] message.
23241 * [`Init`]: crate::ln::msgs::Init
23243 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
23245 * Implementation of CustomMessageReader for this object.
23247 struct LDKCustomMessageReader CustomMessageReader;
23249 * Frees any resources associated with this object given its this_arg pointer.
23250 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23252 void (*free)(void *this_arg);
23253 } LDKCustomMessageHandler;
23258 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
23259 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
23261 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
23263 * A pointer to the opaque Rust object.
23264 * Nearly everywhere, inner must be non-null, however in places where
23265 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23267 LDKnativeIgnoringMessageHandler *inner;
23269 * Indicates that this is the only struct which contains the same pointer.
23270 * Rust functions which take ownership of an object provided via an argument require
23271 * this to be true and invalidate the object pointed to by inner.
23274 } LDKIgnoringMessageHandler;
23277 * Handler for custom onion messages. If you are using [`SimpleArcOnionMessenger`],
23278 * [`SimpleRefOnionMessenger`], or prefer to ignore inbound custom onion messages,
23279 * [`IgnoringMessageHandler`] must be provided to [`OnionMessenger::new`]. Otherwise, a custom
23280 * implementation of this trait must be provided, with [`CustomMessage`] specifying the supported
23283 * See [`OnionMessenger`] for example usage.
23285 * [`IgnoringMessageHandler`]: crate::ln::peer_handler::IgnoringMessageHandler
23286 * [`CustomMessage`]: Self::CustomMessage
23288 typedef struct LDKCustomOnionMessageHandler {
23290 * An opaque pointer which is passed to your function implementations as an argument.
23291 * This has no meaning in the LDK, and can be NULL or any other value.
23295 * Called with the custom message that was received, returning a response to send, if any.
23297 * The returned [`Self::CustomMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
23299 struct LDKCOption_OnionMessageContentsZ (*handle_custom_message)(const void *this_arg, struct LDKOnionMessageContents msg);
23301 * Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
23302 * message type is unknown.
23304 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ (*read_custom_message)(const void *this_arg, uint64_t message_type, struct LDKu8slice buffer);
23306 * Releases any [`Self::CustomMessage`]s that need to be sent.
23308 * Typically, this is used for messages initiating a message flow rather than in response to
23309 * another message. The latter should use the return value of [`Self::handle_custom_message`].
23311 struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ (*release_pending_custom_messages)(const void *this_arg);
23313 * Frees any resources associated with this object given its this_arg pointer.
23314 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23316 void (*free)(void *this_arg);
23317 } LDKCustomOnionMessageHandler;
23322 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
23323 * You can provide one of these as the route_handler in a MessageHandler.
23325 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
23327 * A pointer to the opaque Rust object.
23328 * Nearly everywhere, inner must be non-null, however in places where
23329 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23331 LDKnativeErroringMessageHandler *inner;
23333 * Indicates that this is the only struct which contains the same pointer.
23334 * Rust functions which take ownership of an object provided via an argument require
23335 * this to be true and invalidate the object pointed to by inner.
23338 } LDKErroringMessageHandler;
23343 * Provides references to trait impls which handle different types of messages.
23345 typedef struct MUST_USE_STRUCT LDKMessageHandler {
23347 * A pointer to the opaque Rust object.
23348 * Nearly everywhere, inner must be non-null, however in places where
23349 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23351 LDKnativeMessageHandler *inner;
23353 * Indicates that this is the only struct which contains the same pointer.
23354 * Rust functions which take ownership of an object provided via an argument require
23355 * this to be true and invalidate the object pointed to by inner.
23358 } LDKMessageHandler;
23361 * Provides an object which can be used to send data to and which uniquely identifies a connection
23362 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
23363 * implement Hash to meet the PeerManager API.
23365 * For efficiency, [`Clone`] should be relatively cheap for this type.
23367 * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
23368 * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
23369 * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
23370 * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
23371 * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
23372 * to simply use another value which is guaranteed to be globally unique instead.
23374 typedef struct LDKSocketDescriptor {
23376 * An opaque pointer which is passed to your function implementations as an argument.
23377 * This has no meaning in the LDK, and can be NULL or any other value.
23381 * Attempts to send some data from the given slice to the peer.
23383 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
23384 * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
23385 * called and further write attempts may occur until that time.
23387 * If the returned size is smaller than `data.len()`, a
23388 * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
23389 * written. Additionally, until a `send_data` event completes fully, no further
23390 * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
23391 * prevent denial-of-service issues, you should not read or buffer any data from the socket
23394 * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
23395 * (indicating that read events should be paused to prevent DoS in the send buffer),
23396 * `resume_read` may be set indicating that read events on this descriptor should resume. A
23397 * `resume_read` of false carries no meaning, and should not cause any action.
23399 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
23401 * Disconnect the socket pointed to by this SocketDescriptor.
23403 * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
23404 * call (doing so is a noop).
23406 void (*disconnect_socket)(void *this_arg);
23408 * Checks if two objects are equal given this object's this_arg pointer and another object.
23410 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
23412 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
23413 * This is used, for example, for inclusion of this object in a hash map.
23415 uint64_t (*hash)(const void *this_arg);
23417 * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
23418 * The new SocketDescriptor is provided, and should be mutated as needed to perform a
23419 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
23421 void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
23423 * Frees any resources associated with this object given its this_arg pointer.
23424 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23426 void (*free)(void *this_arg);
23427 } LDKSocketDescriptor;
23432 * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
23433 * socket events into messages which it passes on to its [`MessageHandler`].
23435 * Locks are taken internally, so you must never assume that reentrancy from a
23436 * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
23438 * Calls to [`read_event`] will decode relevant messages and pass them to the
23439 * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
23440 * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
23441 * [`PeerManager`] functions related to the same connection must occur only in serial, making new
23442 * calls only after previous ones have returned.
23444 * Rather than using a plain [`PeerManager`], it is preferable to use either a [`SimpleArcPeerManager`]
23445 * a [`SimpleRefPeerManager`], for conciseness. See their documentation for more details, but
23446 * essentially you should default to using a [`SimpleRefPeerManager`], and use a
23447 * [`SimpleArcPeerManager`] when you require a `PeerManager` with a static lifetime, such as when
23448 * you're using lightning-net-tokio.
23450 * [`read_event`]: PeerManager::read_event
23452 typedef struct MUST_USE_STRUCT LDKPeerManager {
23454 * A pointer to the opaque Rust object.
23455 * Nearly everywhere, inner must be non-null, however in places where
23456 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23458 LDKnativePeerManager *inner;
23460 * Indicates that this is the only struct which contains the same pointer.
23461 * Rust functions which take ownership of an object provided via an argument require
23462 * this to be true and invalidate the object pointed to by inner.
23470 * Static channel fields used to build transactions given per-commitment fields, organized by
23471 * broadcaster/countersignatory.
23473 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
23474 * as_holder_broadcastable and as_counterparty_broadcastable functions.
23476 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
23478 * A pointer to the opaque Rust object.
23479 * Nearly everywhere, inner must be non-null, however in places where
23480 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23482 LDKnativeDirectedChannelTransactionParameters *inner;
23484 * Indicates that this is the only struct which contains the same pointer.
23485 * Rust functions which take ownership of an object provided via an argument require
23486 * this to be true and invalidate the object pointed to by inner.
23489 } LDKDirectedChannelTransactionParameters;
23494 * Features used within an `offer`.
23496 typedef struct MUST_USE_STRUCT LDKOfferFeatures {
23498 * A pointer to the opaque Rust object.
23499 * Nearly everywhere, inner must be non-null, however in places where
23500 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23502 LDKnativeOfferFeatures *inner;
23504 * Indicates that this is the only struct which contains the same pointer.
23505 * Rust functions which take ownership of an object provided via an argument require
23506 * this to be true and invalidate the object pointed to by inner.
23509 } LDKOfferFeatures;
23514 * Features used within an `invoice_request`.
23516 typedef struct MUST_USE_STRUCT LDKInvoiceRequestFeatures {
23518 * A pointer to the opaque Rust object.
23519 * Nearly everywhere, inner must be non-null, however in places where
23520 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23522 LDKnativeInvoiceRequestFeatures *inner;
23524 * Indicates that this is the only struct which contains the same pointer.
23525 * Rust functions which take ownership of an object provided via an argument require
23526 * this to be true and invalidate the object pointed to by inner.
23529 } LDKInvoiceRequestFeatures;
23532 * Represents a tweaked X-only public key as required for BIP 340 (Taproot).
23534 typedef struct LDKTweakedPublicKey {
23536 * The bytes of the public key X coordinate
23538 uint8_t x_coordinate[32];
23539 } LDKTweakedPublicKey;
23542 * A function for signing an [`UnsignedBolt12Invoice`].
23544 typedef struct LDKSignBolt12InvoiceFn {
23546 * An opaque pointer which is passed to your function implementations as an argument.
23547 * This has no meaning in the LDK, and can be NULL or any other value.
23551 * Signs a [`TaggedHash`] computed over the merkle root of `message`'s TLV stream.
23553 struct LDKCResult_SchnorrSignatureNoneZ (*sign_invoice)(const void *this_arg, const struct LDKUnsignedBolt12Invoice *NONNULL_PTR message);
23555 * Frees any resources associated with this object given its this_arg pointer.
23556 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23558 void (*free)(void *this_arg);
23559 } LDKSignBolt12InvoiceFn;
23564 * A hash for use in a specific context by tweaking with a context-dependent tag as per [BIP 340]
23565 * and computed over the merkle root of a TLV stream to sign as defined in [BOLT 12].
23567 * [BIP 340]: https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki
23568 * [BOLT 12]: https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md#signature-calculation
23570 typedef struct MUST_USE_STRUCT LDKTaggedHash {
23572 * A pointer to the opaque Rust object.
23573 * Nearly everywhere, inner must be non-null, however in places where
23574 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23576 LDKnativeTaggedHash *inner;
23578 * Indicates that this is the only struct which contains the same pointer.
23579 * Rust functions which take ownership of an object provided via an argument require
23580 * this to be true and invalidate the object pointed to by inner.
23588 * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
23590 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
23591 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
23593 typedef struct MUST_USE_STRUCT LDKErroneousField {
23595 * A pointer to the opaque Rust object.
23596 * Nearly everywhere, inner must be non-null, however in places where
23597 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23599 LDKnativeErroneousField *inner;
23601 * Indicates that this is the only struct which contains the same pointer.
23602 * Rust functions which take ownership of an object provided via an argument require
23603 * this to be true and invalidate the object pointed to by inner.
23606 } LDKErroneousField;
23609 * A function for signing an [`UnsignedInvoiceRequest`].
23611 typedef struct LDKSignInvoiceRequestFn {
23613 * An opaque pointer which is passed to your function implementations as an argument.
23614 * This has no meaning in the LDK, and can be NULL or any other value.
23618 * Signs a [`TaggedHash`] computed over the merkle root of `message`'s TLV stream.
23620 struct LDKCResult_SchnorrSignatureNoneZ (*sign_invoice_request)(const void *this_arg, const struct LDKUnsignedInvoiceRequest *NONNULL_PTR message);
23622 * Frees any resources associated with this object given its this_arg pointer.
23623 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23625 void (*free)(void *this_arg);
23626 } LDKSignInvoiceRequestFn;
23629 * Error when signing messages.
23631 typedef enum LDKSignError_Tag {
23633 * User-defined error when signing the message.
23635 LDKSignError_Signing,
23637 * Error when verifying the produced signature using the given pubkey.
23639 LDKSignError_Verification,
23641 * Must be last for serialization purposes
23643 LDKSignError_Sentinel,
23644 } LDKSignError_Tag;
23646 typedef struct MUST_USE_STRUCT LDKSignError {
23647 LDKSignError_Tag tag;
23650 enum LDKSecp256k1Error verification;
23658 * Receives and validates network updates from peers,
23659 * stores authentic and relevant data as a network graph.
23660 * This network graph is then used for routing payments.
23661 * Provides interface to help with initial routing sync by
23662 * serving historical announcements.
23664 typedef struct MUST_USE_STRUCT LDKP2PGossipSync {
23666 * A pointer to the opaque Rust object.
23667 * Nearly everywhere, inner must be non-null, however in places where
23668 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23670 LDKnativeP2PGossipSync *inner;
23672 * Indicates that this is the only struct which contains the same pointer.
23673 * Rust functions which take ownership of an object provided via an argument require
23674 * this to be true and invalidate the object pointed to by inner.
23677 } LDKP2PGossipSync;
23682 * A read-only view of [`NetworkGraph`].
23684 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
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 LDKnativeReadOnlyNetworkGraph *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.
23697 } LDKReadOnlyNetworkGraph;
23702 * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
23703 * source node to a target node.
23705 typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
23707 * A pointer to the opaque Rust object.
23708 * Nearly everywhere, inner must be non-null, however in places where
23709 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23711 LDKnativeDirectedChannelInfo *inner;
23713 * Indicates that this is the only struct which contains the same pointer.
23714 * Rust functions which take ownership of an object provided via an argument require
23715 * this to be true and invalidate the object pointed to by inner.
23718 } LDKDirectedChannelInfo;
23721 * The effective capacity of a channel for routing purposes.
23723 * While this may be smaller than the actual channel capacity, amounts greater than
23724 * [`Self::as_msat`] should not be routed through the channel.
23726 typedef enum LDKEffectiveCapacity_Tag {
23728 * The available liquidity in the channel known from being a channel counterparty, and thus a
23731 LDKEffectiveCapacity_ExactLiquidity,
23733 * The maximum HTLC amount in one direction as advertised on the gossip network.
23735 LDKEffectiveCapacity_AdvertisedMaxHTLC,
23737 * The total capacity of the channel as determined by the funding transaction.
23739 LDKEffectiveCapacity_Total,
23741 * A capacity sufficient to route any payment, typically used for private channels provided by
23744 LDKEffectiveCapacity_Infinite,
23746 * The maximum HTLC amount as provided by an invoice route hint.
23748 LDKEffectiveCapacity_HintMaxHTLC,
23750 * A capacity that is unknown possibly because either the chain state is unavailable to know
23751 * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
23753 LDKEffectiveCapacity_Unknown,
23755 * Must be last for serialization purposes
23757 LDKEffectiveCapacity_Sentinel,
23758 } LDKEffectiveCapacity_Tag;
23760 typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
23762 * Either the inbound or outbound liquidity depending on the direction, denominated in
23765 uint64_t liquidity_msat;
23766 } LDKEffectiveCapacity_LDKExactLiquidity_Body;
23768 typedef struct LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body {
23770 * The maximum HTLC amount denominated in millisatoshi.
23772 uint64_t amount_msat;
23773 } LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body;
23775 typedef struct LDKEffectiveCapacity_LDKTotal_Body {
23777 * The funding amount denominated in millisatoshi.
23779 uint64_t capacity_msat;
23781 * The maximum HTLC amount denominated in millisatoshi.
23783 uint64_t htlc_maximum_msat;
23784 } LDKEffectiveCapacity_LDKTotal_Body;
23786 typedef struct LDKEffectiveCapacity_LDKHintMaxHTLC_Body {
23788 * The maximum HTLC amount denominated in millisatoshi.
23790 uint64_t amount_msat;
23791 } LDKEffectiveCapacity_LDKHintMaxHTLC_Body;
23793 typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
23794 LDKEffectiveCapacity_Tag tag;
23796 LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
23797 LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body advertised_max_htlc;
23798 LDKEffectiveCapacity_LDKTotal_Body total;
23799 LDKEffectiveCapacity_LDKHintMaxHTLC_Body hint_max_htlc;
23801 } LDKEffectiveCapacity;
23806 * A [`Router`] implemented using [`find_route`].
23808 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
23810 * A pointer to the opaque Rust object.
23811 * Nearly everywhere, inner must be non-null, however in places where
23812 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23814 LDKnativeDefaultRouter *inner;
23816 * Indicates that this is the only struct which contains the same pointer.
23817 * Rust functions which take ownership of an object provided via an argument require
23818 * this to be true and invalidate the object pointed to by inner.
23821 } LDKDefaultRouter;
23826 * [`ScoreLookUp`] implementation that factors in in-flight HTLC liquidity.
23828 * Useful for custom [`Router`] implementations to wrap their [`ScoreLookUp`] on-the-fly when calling
23831 * [`ScoreLookUp`]: crate::routing::scoring::ScoreLookUp
23833 typedef struct MUST_USE_STRUCT LDKScorerAccountingForInFlightHtlcs {
23835 * A pointer to the opaque Rust object.
23836 * Nearly everywhere, inner must be non-null, however in places where
23837 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23839 LDKnativeScorerAccountingForInFlightHtlcs *inner;
23841 * Indicates that this is the only struct which contains the same pointer.
23842 * Rust functions which take ownership of an object provided via an argument require
23843 * this to be true and invalidate the object pointed to by inner.
23846 } LDKScorerAccountingForInFlightHtlcs;
23849 * The recipient of a payment, differing based on whether they've hidden their identity with route
23852 typedef enum LDKPayee_Tag {
23854 * The recipient provided blinded paths and payinfo to reach them. The blinded paths themselves
23855 * will be included in the final [`Route`].
23859 * The recipient included these route hints in their BOLT11 invoice.
23863 * Must be last for serialization purposes
23868 typedef struct LDKPayee_LDKBlinded_Body {
23870 * Aggregated routing info and blinded paths, for routing to the payee without knowing their
23873 struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints;
23875 * Features supported by the payee.
23877 * May be set from the payee's invoice. May be `None` if the invoice does not contain any
23880 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
23882 struct LDKBolt12InvoiceFeatures features;
23883 } LDKPayee_LDKBlinded_Body;
23885 typedef struct LDKPayee_LDKClear_Body {
23887 * The node id of the payee.
23889 struct LDKPublicKey node_id;
23891 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
23893 struct LDKCVec_RouteHintZ route_hints;
23895 * Features supported by the payee.
23897 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
23898 * does not contain any features.
23900 * [`for_keysend`]: PaymentParameters::for_keysend
23902 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
23904 struct LDKBolt11InvoiceFeatures features;
23906 * The minimum CLTV delta at the end of the route. This value must not be zero.
23908 uint32_t final_cltv_expiry_delta;
23909 } LDKPayee_LDKClear_Body;
23911 typedef struct MUST_USE_STRUCT LDKPayee {
23914 LDKPayee_LDKBlinded_Body blinded;
23915 LDKPayee_LDKClear_Body clear;
23920 * A trait which can both lookup and update routing channel penalty scores.
23922 * This is used in places where both bounds are required and implemented for all types which
23923 * implement [`ScoreLookUp`] and [`ScoreUpdate`].
23925 * Bindings users may need to manually implement this for their custom scoring implementations.
23927 typedef struct LDKScore {
23929 * An opaque pointer which is passed to your function implementations as an argument.
23930 * This has no meaning in the LDK, and can be NULL or any other value.
23934 * Implementation of ScoreLookUp for this object.
23936 struct LDKScoreLookUp ScoreLookUp;
23938 * Implementation of ScoreUpdate for this object.
23940 struct LDKScoreUpdate ScoreUpdate;
23942 * Serialize the object into a byte array
23944 struct LDKCVec_u8Z (*write)(const void *this_arg);
23946 * Frees any resources associated with this object given its this_arg pointer.
23947 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23949 void (*free)(void *this_arg);
23955 * A concrete implementation of [`LockableScore`] which supports multi-threading.
23957 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
23959 * A pointer to the opaque Rust object.
23960 * Nearly everywhere, inner must be non-null, however in places where
23961 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23963 LDKnativeMultiThreadedLockableScore *inner;
23965 * Indicates that this is the only struct which contains the same pointer.
23966 * Rust functions which take ownership of an object provided via an argument require
23967 * this to be true and invalidate the object pointed to by inner.
23970 } LDKMultiThreadedLockableScore;
23975 * A locked `MultiThreadedLockableScore`.
23977 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockRead {
23979 * A pointer to the opaque Rust object.
23980 * Nearly everywhere, inner must be non-null, however in places where
23981 * the Rust equivalent takes an Option, it may be set to null to indicate None.
23983 LDKnativeMultiThreadedScoreLockRead *inner;
23985 * Indicates that this is the only struct which contains the same pointer.
23986 * Rust functions which take ownership of an object provided via an argument require
23987 * this to be true and invalidate the object pointed to by inner.
23990 } LDKMultiThreadedScoreLockRead;
23995 * A locked `MultiThreadedLockableScore`.
23997 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockWrite {
23999 * A pointer to the opaque Rust object.
24000 * Nearly everywhere, inner must be non-null, however in places where
24001 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24003 LDKnativeMultiThreadedScoreLockWrite *inner;
24005 * Indicates that this is the only struct which contains the same pointer.
24006 * Rust functions which take ownership of an object provided via an argument require
24007 * this to be true and invalidate the object pointed to by inner.
24010 } LDKMultiThreadedScoreLockWrite;
24015 * Parameters for configuring [`ProbabilisticScorer`].
24017 * Used to configure decay parameters that are static throughout the lifetime of the scorer.
24018 * these decay parameters affect the score of the channel penalty and are not changed on a
24019 * per-route penalty cost call.
24021 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringDecayParameters {
24023 * A pointer to the opaque Rust object.
24024 * Nearly everywhere, inner must be non-null, however in places where
24025 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24027 LDKnativeProbabilisticScoringDecayParameters *inner;
24029 * Indicates that this is the only struct which contains the same pointer.
24030 * Rust functions which take ownership of an object provided via an argument require
24031 * this to be true and invalidate the object pointed to by inner.
24034 } LDKProbabilisticScoringDecayParameters;
24039 * Simple implementation of [`EntropySource`], [`NodeSigner`], and [`SignerProvider`] that takes a
24040 * 32-byte seed for use as a BIP 32 extended key and derives keys from that.
24042 * Your `node_id` is seed/0'.
24043 * Unilateral closes may use seed/1'.
24044 * Cooperative closes may use seed/2'.
24045 * The two close keys may be needed to claim on-chain funds!
24047 * This struct cannot be used for nodes that wish to support receiving phantom payments;
24048 * [`PhantomKeysManager`] must be used instead.
24050 * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
24051 * previously issued invoices and attempts to pay previous invoices will fail.
24053 typedef struct MUST_USE_STRUCT LDKKeysManager {
24055 * A pointer to the opaque Rust object.
24056 * Nearly everywhere, inner must be non-null, however in places where
24057 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24059 LDKnativeKeysManager *inner;
24061 * Indicates that this is the only struct which contains the same pointer.
24062 * Rust functions which take ownership of an object provided via an argument require
24063 * this to be true and invalidate the object pointed to by inner.
24071 * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
24074 * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
24075 * paid to one of multiple nodes. This works because we encode the invoice route hints such that
24076 * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
24077 * itself without ever needing to forward to this fake node.
24079 * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
24080 * provide some fault tolerance, because payers will automatically retry paying other provided
24081 * nodes in the case that one node goes down.
24083 * Note that multi-path payments are not supported in phantom invoices for security reasons.
24084 * Switching between this struct and [`KeysManager`] will invalidate any previously issued
24085 * invoices and attempts to pay previous invoices will fail.
24087 typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
24089 * A pointer to the opaque Rust object.
24090 * Nearly everywhere, inner must be non-null, however in places where
24091 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24093 LDKnativePhantomKeysManager *inner;
24095 * Indicates that this is the only struct which contains the same pointer.
24096 * Rust functions which take ownership of an object provided via an argument require
24097 * this to be true and invalidate the object pointed to by inner.
24100 } LDKPhantomKeysManager;
24105 * An implementation of [`EntropySource`] using ChaCha20.
24107 typedef struct MUST_USE_STRUCT LDKRandomBytes {
24109 * A pointer to the opaque Rust object.
24110 * Nearly everywhere, inner must be non-null, however in places where
24111 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24113 LDKnativeRandomBytes *inner;
24115 * Indicates that this is the only struct which contains the same pointer.
24116 * Rust functions which take ownership of an object provided via an argument require
24117 * this to be true and invalidate the object pointed to by inner.
24125 * A sender, receiver and forwarder of [`OnionMessage`]s.
24127 * # Handling Messages
24129 * `OnionMessenger` implements [`OnionMessageHandler`], making it responsible for either forwarding
24130 * messages to peers or delegating to the appropriate handler for the message type. Currently, the
24131 * available handlers are:
24132 * * [`OffersMessageHandler`], for responding to [`InvoiceRequest`]s and paying [`Bolt12Invoice`]s
24133 * * [`CustomOnionMessageHandler`], for handling user-defined message types
24135 * # Sending Messages
24137 * [`OnionMessage`]s are sent initially using [`OnionMessenger::send_onion_message`]. When handling
24138 * a message, the matched handler may return a response message which `OnionMessenger` will send
24144 * # extern crate bitcoin;
24145 * # use bitcoin::hashes::_export::_core::time::Duration;
24146 * # use bitcoin::hashes::hex::FromHex;
24147 * # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey, self};
24148 * # use lightning::blinded_path::{BlindedPath, EmptyNodeIdLookUp};
24149 * # use lightning::sign::{EntropySource, KeysManager};
24150 * # use lightning::ln::peer_handler::IgnoringMessageHandler;
24151 * # use lightning::onion_message::messenger::{Destination, MessageRouter, OnionMessagePath, OnionMessenger};
24152 * # use lightning::onion_message::packet::OnionMessageContents;
24153 * # use lightning::util::logger::{Logger, Record};
24154 * # use lightning::util::ser::{Writeable, Writer};
24155 * # use lightning::io;
24156 * # use std::sync::Arc;
24157 * # struct FakeLogger;
24158 * # impl Logger for FakeLogger {
24159 * # fn log(&self, record: Record) { println!(\"{:?}\" , record); }
24161 * # struct FakeMessageRouter {}
24162 * # impl MessageRouter for FakeMessageRouter {
24163 * # fn find_path(&self, sender: PublicKey, peers: Vec<PublicKey>, destination: Destination) -> Result<OnionMessagePath, ()> {
24164 * # let secp_ctx = Secp256k1::new();
24165 * # let node_secret = SecretKey::from_slice(&<Vec<u8>>::from_hex(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
24166 * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
24167 * # let hop_node_id2 = hop_node_id1;
24168 * # Ok(OnionMessagePath {
24169 * # intermediate_nodes: vec![hop_node_id1, hop_node_id2],
24171 * # first_node_addresses: None,
24174 * # fn create_blinded_paths<T: secp256k1::Signing + secp256k1::Verification>(
24175 * # &self, _recipient: PublicKey, _peers: Vec<PublicKey>, _secp_ctx: &Secp256k1<T>
24176 * # ) -> Result<Vec<BlindedPath>, ()> {
24180 * # let seed = [42u8; 32];
24181 * # let time = Duration::from_secs(123456);
24182 * # let keys_manager = KeysManager::new(&seed, time.as_secs(), time.subsec_nanos());
24183 * # let logger = Arc::new(FakeLogger {});
24184 * # let node_secret = SecretKey::from_slice(&<Vec<u8>>::from_hex(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
24185 * # let secp_ctx = Secp256k1::new();
24186 * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
24187 * # let (hop_node_id3, hop_node_id4) = (hop_node_id1, hop_node_id1);
24188 * # let destination_node_id = hop_node_id1;
24189 * # let node_id_lookup = EmptyNodeIdLookUp {};
24190 * # let message_router = Arc::new(FakeMessageRouter {});
24191 * # let custom_message_handler = IgnoringMessageHandler {};
24192 * # let offers_message_handler = IgnoringMessageHandler {};
24193 * // Create the onion messenger. This must use the same `keys_manager` as is passed to your
24194 * // ChannelManager.
24195 * let onion_messenger = OnionMessenger::new(
24196 * &keys_manager, &keys_manager, logger, &node_id_lookup, message_router,
24197 * &offers_message_handler, &custom_message_handler
24200 * # #[derive(Debug, Clone)]
24201 * # struct YourCustomMessage {}
24202 * impl Writeable for YourCustomMessage {
24203 * \tfn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
24205 * \t\t// Write your custom onion message to `w`
24208 * impl OnionMessageContents for YourCustomMessage {
24209 * \tfn tlv_type(&self) -> u64 {
24210 * \t\t# let your_custom_message_type = 42;
24211 * \t\tyour_custom_message_type
24214 * // Send a custom onion message to a node id.
24215 * let destination = Destination::Node(destination_node_id);
24216 * let reply_path = None;
24217 * # let message = YourCustomMessage {};
24218 * onion_messenger.send_onion_message(message, destination, reply_path);
24220 * // Create a blinded path to yourself, for someone to send an onion message to.
24221 * # let your_node_id = hop_node_id1;
24222 * let hops = [hop_node_id3, hop_node_id4, your_node_id];
24223 * let blinded_path = BlindedPath::new_for_message(&hops, &keys_manager, &secp_ctx).unwrap();
24225 * // Send a custom onion message to a blinded path.
24226 * let destination = Destination::BlindedPath(blinded_path);
24227 * let reply_path = None;
24228 * # let message = YourCustomMessage {};
24229 * onion_messenger.send_onion_message(message, destination, reply_path);
24232 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
24233 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
24235 typedef struct MUST_USE_STRUCT LDKOnionMessenger {
24237 * A pointer to the opaque Rust object.
24238 * Nearly everywhere, inner must be non-null, however in places where
24239 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24241 LDKnativeOnionMessenger *inner;
24243 * Indicates that this is the only struct which contains the same pointer.
24244 * Rust functions which take ownership of an object provided via an argument require
24245 * this to be true and invalidate the object pointed to by inner.
24248 } LDKOnionMessenger;
24253 * A [`MessageRouter`] that can only route to a directly connected [`Destination`].
24255 typedef struct MUST_USE_STRUCT LDKDefaultMessageRouter {
24257 * A pointer to the opaque Rust object.
24258 * Nearly everywhere, inner must be non-null, however in places where
24259 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24261 LDKnativeDefaultMessageRouter *inner;
24263 * Indicates that this is the only struct which contains the same pointer.
24264 * Rust functions which take ownership of an object provided via an argument require
24265 * this to be true and invalidate the object pointed to by inner.
24268 } LDKDefaultMessageRouter;
24271 * The unblinded node in a [`BlindedPath`].
24273 typedef enum LDKIntroductionNode_Tag {
24275 * The node id of the introduction node.
24277 LDKIntroductionNode_NodeId,
24279 * The short channel id of the channel leading to the introduction node. The [`Direction`]
24280 * identifies which side of the channel is the introduction node.
24282 LDKIntroductionNode_DirectedShortChannelId,
24284 * Must be last for serialization purposes
24286 LDKIntroductionNode_Sentinel,
24287 } LDKIntroductionNode_Tag;
24289 typedef struct LDKIntroductionNode_LDKDirectedShortChannelId_Body {
24290 enum LDKDirection _0;
24292 } LDKIntroductionNode_LDKDirectedShortChannelId_Body;
24294 typedef struct MUST_USE_STRUCT LDKIntroductionNode {
24295 LDKIntroductionNode_Tag tag;
24298 struct LDKPublicKey node_id;
24300 LDKIntroductionNode_LDKDirectedShortChannelId_Body directed_short_channel_id;
24302 } LDKIntroductionNode;
24307 * A [`NodeIdLookUp`] that always returns `None`.
24309 typedef struct MUST_USE_STRUCT LDKEmptyNodeIdLookUp {
24311 * A pointer to the opaque Rust object.
24312 * Nearly everywhere, inner must be non-null, however in places where
24313 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24315 LDKnativeEmptyNodeIdLookUp *inner;
24317 * Indicates that this is the only struct which contains the same pointer.
24318 * Rust functions which take ownership of an object provided via an argument require
24319 * this to be true and invalidate the object pointed to by inner.
24322 } LDKEmptyNodeIdLookUp;
24327 * Data to construct a [`BlindedHop`] for forwarding a payment.
24329 typedef struct MUST_USE_STRUCT LDKForwardTlvs {
24331 * A pointer to the opaque Rust object.
24332 * Nearly everywhere, inner must be non-null, however in places where
24333 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24335 LDKnativeForwardTlvs *inner;
24337 * Indicates that this is the only struct which contains the same pointer.
24338 * Rust functions which take ownership of an object provided via an argument require
24339 * this to be true and invalidate the object pointed to by inner.
24345 * An abstraction over a bitcoin wallet that can perform coin selection over a set of UTXOs and can
24346 * sign for them. The coin selection method aims to mimic Bitcoin Core's `fundrawtransaction` RPC,
24347 * which most wallets should be able to satisfy. Otherwise, consider implementing [`WalletSource`],
24348 * which can provide a default implementation of this trait when used with [`Wallet`].
24350 typedef struct LDKCoinSelectionSource {
24352 * An opaque pointer which is passed to your function implementations as an argument.
24353 * This has no meaning in the LDK, and can be NULL or any other value.
24357 * Performs coin selection of a set of UTXOs, with at least 1 confirmation each, that are
24358 * available to spend. Implementations are free to pick their coin selection algorithm of
24359 * choice, as long as the following requirements are met:
24361 * 1. `must_spend` contains a set of [`Input`]s that must be included in the transaction
24362 * throughout coin selection, but must not be returned as part of the result.
24363 * 2. `must_pay_to` contains a set of [`TxOut`]s that must be included in the transaction
24364 * throughout coin selection. In some cases, like when funding an anchor transaction, this
24365 * set is empty. Implementations should ensure they handle this correctly on their end,
24366 * e.g., Bitcoin Core's `fundrawtransaction` RPC requires at least one output to be
24367 * provided, in which case a zero-value empty OP_RETURN output can be used instead.
24368 * 3. Enough inputs must be selected/contributed for the resulting transaction (including the
24369 * inputs and outputs noted above) to meet `target_feerate_sat_per_1000_weight`.
24371 * Implementations must take note that [`Input::satisfaction_weight`] only tracks the weight of
24372 * the input's `script_sig` and `witness`. Some wallets, like Bitcoin Core's, may require
24373 * providing the full input weight. Failing to do so may lead to underestimating fee bumps and
24374 * delaying block inclusion.
24376 * The `claim_id` must map to the set of external UTXOs assigned to the claim, such that they
24377 * can be re-used within new fee-bumped iterations of the original claiming transaction,
24378 * ensuring that claims don't double spend each other. If a specific `claim_id` has never had a
24379 * transaction associated with it, and all of the available UTXOs have already been assigned to
24380 * other claims, implementations must be willing to double spend their UTXOs. The choice of
24381 * which UTXOs to double spend is left to the implementation, but it must strive to keep the
24382 * set of other claims being double spent to a minimum.
24384 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);
24386 * Signs and provides the full witness for all inputs within the transaction known to the
24387 * trait (i.e., any provided via [`CoinSelectionSource::select_confirmed_utxos`]).
24389 * If your wallet does not support signing PSBTs you can call `psbt.extract_tx()` to get the
24390 * unsigned transaction and then sign it with your wallet.
24392 struct LDKCResult_TransactionNoneZ (*sign_psbt)(const void *this_arg, struct LDKCVec_u8Z psbt);
24394 * Frees any resources associated with this object given its this_arg pointer.
24395 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
24397 void (*free)(void *this_arg);
24398 } LDKCoinSelectionSource;
24401 * An alternative to [`CoinSelectionSource`] that can be implemented and used along [`Wallet`] to
24402 * provide a default implementation to [`CoinSelectionSource`].
24404 typedef struct LDKWalletSource {
24406 * An opaque pointer which is passed to your function implementations as an argument.
24407 * This has no meaning in the LDK, and can be NULL or any other value.
24411 * Returns all UTXOs, with at least 1 confirmation each, that are available to spend.
24413 struct LDKCResult_CVec_UtxoZNoneZ (*list_confirmed_utxos)(const void *this_arg);
24415 * Returns a script to use for change above dust resulting from a successful coin selection
24418 struct LDKCResult_CVec_u8ZNoneZ (*get_change_script)(const void *this_arg);
24420 * Signs and provides the full [`TxIn::script_sig`] and [`TxIn::witness`] for all inputs within
24421 * the transaction known to the wallet (i.e., any provided via
24422 * [`WalletSource::list_confirmed_utxos`]).
24424 * If your wallet does not support signing PSBTs you can call `psbt.extract_tx()` to get the
24425 * unsigned transaction and then sign it with your wallet.
24427 struct LDKCResult_TransactionNoneZ (*sign_psbt)(const void *this_arg, struct LDKCVec_u8Z psbt);
24429 * Frees any resources associated with this object given its this_arg pointer.
24430 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
24432 void (*free)(void *this_arg);
24438 * A wrapper over [`WalletSource`] that implements [`CoinSelection`] by preferring UTXOs that would
24439 * avoid conflicting double spends. If not enough UTXOs are available to do so, conflicting double
24440 * spends may happen.
24442 typedef struct MUST_USE_STRUCT LDKWallet {
24444 * A pointer to the opaque Rust object.
24445 * Nearly everywhere, inner must be non-null, however in places where
24446 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24448 LDKnativeWallet *inner;
24450 * Indicates that this is the only struct which contains the same pointer.
24451 * Rust functions which take ownership of an object provided via an argument require
24452 * this to be true and invalidate the object pointed to by inner.
24460 * A handler for [`Event::BumpTransaction`] events that sources confirmed UTXOs from a
24461 * [`CoinSelectionSource`] to fee bump transactions via Child-Pays-For-Parent (CPFP) or
24462 * Replace-By-Fee (RBF).
24464 * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
24466 typedef struct MUST_USE_STRUCT LDKBumpTransactionEventHandler {
24468 * A pointer to the opaque Rust object.
24469 * Nearly everywhere, inner must be non-null, however in places where
24470 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24472 LDKnativeBumpTransactionEventHandler *inner;
24474 * Indicates that this is the only struct which contains the same pointer.
24475 * Rust functions which take ownership of an object provided via an argument require
24476 * this to be true and invalidate the object pointed to by inner.
24479 } LDKBumpTransactionEventHandler;
24484 * A [`KVStore`] implementation that writes to and reads from the file system.
24486 typedef struct MUST_USE_STRUCT LDKFilesystemStore {
24488 * A pointer to the opaque Rust object.
24489 * Nearly everywhere, inner must be non-null, however in places where
24490 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24492 LDKnativeFilesystemStore *inner;
24494 * Indicates that this is the only struct which contains the same pointer.
24495 * Rust functions which take ownership of an object provided via an argument require
24496 * this to be true and invalidate the object pointed to by inner.
24499 } LDKFilesystemStore;
24504 * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
24505 * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
24506 * responsibilities are:
24507 * * Processing [`Event`]s with a user-provided [`EventHandler`].
24508 * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
24509 * writing it to disk/backups by invoking the callback given to it at startup.
24510 * [`ChannelManager`] persistence should be done in the background.
24511 * * Calling [`ChannelManager::timer_tick_occurred`], [`ChainMonitor::rebroadcast_pending_claims`]
24512 * and [`PeerManager::timer_tick_occurred`] at the appropriate intervals.
24513 * * Calling [`NetworkGraph::remove_stale_channels_and_tracking`] (if a [`GossipSync`] with a
24514 * [`NetworkGraph`] is provided to [`BackgroundProcessor::start`]).
24516 * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
24517 * upon as doing so may result in high latency.
24521 * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
24522 * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
24523 * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
24524 * unilateral chain closure fees are at risk.
24526 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
24527 * [`ChannelManager::timer_tick_occurred`]: lightning::ln::channelmanager::ChannelManager::timer_tick_occurred
24528 * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
24529 * [`Event`]: lightning::events::Event
24530 * [`PeerManager::timer_tick_occurred`]: lightning::ln::peer_handler::PeerManager::timer_tick_occurred
24531 * [`PeerManager::process_events`]: lightning::ln::peer_handler::PeerManager::process_events
24532 *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
24534 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
24536 * A pointer to the opaque Rust object.
24537 * Nearly everywhere, inner must be non-null, however in places where
24538 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24540 LDKnativeBackgroundProcessor *inner;
24542 * Indicates that this is the only struct which contains the same pointer.
24543 * Rust functions which take ownership of an object provided via an argument require
24544 * this to be true and invalidate the object pointed to by inner.
24547 } LDKBackgroundProcessor;
24552 * The main Rapid Gossip Sync object.
24554 * See [crate-level documentation] for usage.
24556 * [crate-level documentation]: crate
24558 typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
24560 * A pointer to the opaque Rust object.
24561 * Nearly everywhere, inner must be non-null, however in places where
24562 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24564 LDKnativeRapidGossipSync *inner;
24566 * Indicates that this is the only struct which contains the same pointer.
24567 * Rust functions which take ownership of an object provided via an argument require
24568 * this to be true and invalidate the object pointed to by inner.
24571 } LDKRapidGossipSync;
24574 * Either [`P2PGossipSync`] or [`RapidGossipSync`].
24576 typedef enum LDKGossipSync_Tag {
24578 * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
24582 * Rapid gossip sync from a trusted server.
24584 LDKGossipSync_Rapid,
24588 LDKGossipSync_None,
24590 * Must be last for serialization purposes
24592 LDKGossipSync_Sentinel,
24593 } LDKGossipSync_Tag;
24595 typedef struct MUST_USE_STRUCT LDKGossipSync {
24596 LDKGossipSync_Tag tag;
24600 * Note that this field is expected to be a reference.
24602 struct LDKP2PGossipSync p2p;
24606 * Note that this field is expected to be a reference.
24608 struct LDKRapidGossipSync rapid;
24616 * Data of the [`RawBolt11Invoice`] that is encoded in the data part
24618 typedef struct MUST_USE_STRUCT LDKRawDataPart {
24620 * A pointer to the opaque Rust object.
24621 * Nearly everywhere, inner must be non-null, however in places where
24622 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24624 LDKnativeRawDataPart *inner;
24626 * Indicates that this is the only struct which contains the same pointer.
24627 * Rust functions which take ownership of an object provided via an argument require
24628 * this to be true and invalidate the object pointed to by inner.
24638 typedef struct MUST_USE_STRUCT LDKSha256 {
24640 * A pointer to the opaque Rust object.
24641 * Nearly everywhere, inner must be non-null, however in places where
24642 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24644 LDKnativeSha256 *inner;
24646 * Indicates that this is the only struct which contains the same pointer.
24647 * Rust functions which take ownership of an object provided via an argument require
24648 * this to be true and invalidate the object pointed to by inner.
24656 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
24659 typedef struct MUST_USE_STRUCT LDKExpiryTime {
24661 * A pointer to the opaque Rust object.
24662 * Nearly everywhere, inner must be non-null, however in places where
24663 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24665 LDKnativeExpiryTime *inner;
24667 * Indicates that this is the only struct which contains the same pointer.
24668 * Rust functions which take ownership of an object provided via an argument require
24669 * this to be true and invalidate the object pointed to by inner.
24677 * `min_final_cltv_expiry_delta` to use for the last HTLC in the route
24679 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiryDelta {
24681 * A pointer to the opaque Rust object.
24682 * Nearly everywhere, inner must be non-null, however in places where
24683 * the Rust equivalent takes an Option, it may be set to null to indicate None.
24685 LDKnativeMinFinalCltvExpiryDelta *inner;
24687 * Indicates that this is the only struct which contains the same pointer.
24688 * Rust functions which take ownership of an object provided via an argument require
24689 * this to be true and invalidate the object pointed to by inner.
24692 } LDKMinFinalCltvExpiryDelta;
24695 * A 20-byte byte array.
24697 typedef struct LDKTwentyBytes {
24705 * Fallback address in case no LN payment is possible
24707 typedef enum LDKFallback_Tag {
24708 LDKFallback_SegWitProgram,
24709 LDKFallback_PubKeyHash,
24710 LDKFallback_ScriptHash,
24712 * Must be last for serialization purposes
24714 LDKFallback_Sentinel,
24717 typedef struct LDKFallback_LDKSegWitProgram_Body {
24718 struct LDKWitnessVersion version;
24719 struct LDKCVec_u8Z program;
24720 } LDKFallback_LDKSegWitProgram_Body;
24722 typedef struct MUST_USE_STRUCT LDKFallback {
24723 LDKFallback_Tag tag;
24725 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
24727 struct LDKTwentyBytes pub_key_hash;
24730 struct LDKTwentyBytes script_hash;
24735 extern const uintptr_t MAX_BUF_SIZE;
24737 extern const uintptr_t KVSTORE_NAMESPACE_KEY_MAX_LEN;
24739 extern const uint64_t MAX_SCID_BLOCK;
24741 extern const uint64_t MAX_SCID_TX_INDEX;
24743 extern const uint64_t MAX_SCID_VOUT_INDEX;
24745 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
24747 extern const uint32_t FEERATE_FLOOR_SATS_PER_KW;
24749 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
24751 extern const uint32_t ANTI_REORG_DELAY;
24753 extern const uint16_t BREAKDOWN_TIMEOUT;
24755 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
24757 extern const uint16_t MIN_FINAL_CLTV_EXPIRY_DELTA;
24759 extern const uint16_t MAX_HTLCS;
24761 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT;
24763 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT_ANCHORS;
24765 extern const uintptr_t MAX_ACCEPTED_HTLC_SCRIPT_WEIGHT;
24767 extern const uint64_t ANCHOR_INPUT_WITNESS_WEIGHT;
24769 extern const uint64_t HTLC_TIMEOUT_INPUT_ANCHOR_WITNESS_WEIGHT;
24771 extern const uint64_t HTLC_SUCCESS_INPUT_ANCHOR_WITNESS_WEIGHT;
24773 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
24775 extern const uintptr_t PAYER_NOTE_LIMIT;
24777 extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
24779 extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
24781 extern const uint8_t DEFAULT_MAX_PATH_COUNT;
24783 extern const uint64_t MAX_TIMESTAMP;
24785 extern const uint64_t DEFAULT_EXPIRY_TIME;
24787 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA;
24789 extern const uint8_t TAG_PAYMENT_HASH;
24791 extern const uint8_t TAG_DESCRIPTION;
24793 extern const uint8_t TAG_PAYEE_PUB_KEY;
24795 extern const uint8_t TAG_DESCRIPTION_HASH;
24797 extern const uint8_t TAG_EXPIRY_TIME;
24799 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY_DELTA;
24801 extern const uint8_t TAG_FALLBACK;
24803 extern const uint8_t TAG_PRIVATE_ROUTE;
24805 extern const uint8_t TAG_PAYMENT_SECRET;
24807 extern const uint8_t TAG_PAYMENT_METADATA;
24809 extern const uint8_t TAG_FEATURES;
24811 struct LDKStr _ldk_get_compiled_version(void);
24813 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
24816 * Gets the 128-bit integer, as 16 little-endian bytes
24818 struct LDKSixteenBytes U128_le_bytes(struct LDKU128 val);
24821 * Constructs a new U128 from 16 little-endian bytes
24823 struct LDKU128 U128_new(struct LDKSixteenBytes le_bytes);
24826 * Constructs a new WitnessProgram given a version and program bytes.
24828 * The program MUST be at least 2 bytes and no longer than 40 bytes long.
24829 * Further, if the version is 0, the program MUST be either exactly 20 or exactly 32 bytes long.
24831 struct LDKWitnessProgram WitnessProgram_new(struct LDKWitnessVersion version, struct LDKCVec_u8Z program);
24834 * Gets the `WitnessVersion` of the given `WitnessProgram`
24836 struct LDKWitnessVersion WitnessProgram_get_version(const struct LDKWitnessProgram *NONNULL_PTR prog);
24839 * Gets the witness program bytes of the given `WitnessProgram`
24841 struct LDKu8slice WitnessProgram_get_program(const struct LDKWitnessProgram *NONNULL_PTR prog);
24844 * Creates a new WitnessProgram which has the same data as `orig`
24846 struct LDKWitnessProgram WitnessProgram_clone(const struct LDKWitnessProgram *NONNULL_PTR orig);
24849 * Releases any memory held by the given `WitnessProgram` (which is currently none)
24851 void WitnessProgram_free(struct LDKWitnessProgram o);
24854 * Convenience function for constructing a new BigEndianScalar
24856 struct LDKBigEndianScalar BigEndianScalar_new(struct LDKThirtyTwoBytes big_endian_bytes);
24859 * Creates a new Bech32Error which has the same data as `orig`
24861 struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
24864 * Releases any memory held by the given `Bech32Error` (which is currently none)
24866 void Bech32Error_free(struct LDKBech32Error o);
24869 * Frees the data buffer, if data_is_owned is set and datalen > 0.
24871 void Transaction_free(struct LDKTransaction _res);
24874 * Creates a new Witness which has the same data as `orig` but with a new buffer.
24876 struct LDKWitness Witness_clone(const struct LDKWitness *NONNULL_PTR orig);
24879 * Frees the data pointed to by data
24881 void Witness_free(struct LDKWitness _res);
24884 * Convenience function for constructing a new TxIn
24886 struct LDKTxIn TxIn_new(struct LDKWitness witness, struct LDKCVec_u8Z script_sig, uint32_t sequence, struct LDKThirtyTwoBytes previous_txid, uint32_t previous_vout);
24889 * Gets the `witness` in the given `TxIn`.
24891 struct LDKWitness TxIn_get_witness(const struct LDKTxIn *NONNULL_PTR txin);
24894 * Gets the `script_sig` in the given `TxIn`.
24896 struct LDKu8slice TxIn_get_script_sig(const struct LDKTxIn *NONNULL_PTR txin);
24899 * Gets the `sequence` in the given `TxIn`.
24901 uint32_t TxIn_get_sequence(const struct LDKTxIn *NONNULL_PTR txin);
24904 * Gets the previous outpoint txid in the given `TxIn`.
24906 struct LDKThirtyTwoBytes TxIn_get_previous_txid(const struct LDKTxIn *NONNULL_PTR txin);
24909 * Gets the previout outpoint index in the given `TxIn`.
24911 uint32_t TxIn_get_previous_vout(const struct LDKTxIn *NONNULL_PTR txin);
24914 * Frees the witness and script_sig in a TxIn
24916 void TxIn_free(struct LDKTxIn _res);
24919 * Convenience function for constructing a new TxOut
24921 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
24924 * Gets the `script_pubkey` in the given `TxOut`.
24926 struct LDKu8slice TxOut_get_script_pubkey(const struct LDKTxOut *NONNULL_PTR txout);
24929 * Gets the value in the given `TxOut`.
24931 uint64_t TxOut_get_value(const struct LDKTxOut *NONNULL_PTR txout);
24934 * Frees the data pointed to by script_pubkey.
24936 void TxOut_free(struct LDKTxOut _res);
24939 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
24941 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
24944 * Frees the data buffer, if chars_is_owned is set and len > 0.
24946 void Str_free(struct LDKStr _res);
24948 #if defined(LDK_DEBUG_BUILD)
24950 * This function exists for memory safety testing purposes. It should never be used in production
24953 const void *__unmangle_inner_ptr(const void *ptr);
24957 * Frees the buffer pointed to by `data` if `datalen` is non-0.
24959 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
24962 * Creates a new CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ in the success state.
24964 struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(struct LDKRefundMaybeWithDerivedMetadataBuilder o);
24967 * Creates a new CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ in the error state.
24969 struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
24972 * Checks if the given object is currently in the success state
24974 bool CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
24977 * Frees any resources used by the CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.
24979 void CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ _res);
24982 * Creates a new CResult_RefundBolt12SemanticErrorZ in the success state.
24984 struct LDKCResult_RefundBolt12SemanticErrorZ CResult_RefundBolt12SemanticErrorZ_ok(struct LDKRefund o);
24987 * Creates a new CResult_RefundBolt12SemanticErrorZ in the error state.
24989 struct LDKCResult_RefundBolt12SemanticErrorZ CResult_RefundBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
24992 * Checks if the given object is currently in the success state
24994 bool CResult_RefundBolt12SemanticErrorZ_is_ok(const struct LDKCResult_RefundBolt12SemanticErrorZ *NONNULL_PTR o);
24997 * Frees any resources used by the CResult_RefundBolt12SemanticErrorZ.
24999 void CResult_RefundBolt12SemanticErrorZ_free(struct LDKCResult_RefundBolt12SemanticErrorZ _res);
25002 * Creates a new CResult_RefundBolt12SemanticErrorZ which has the same data as `orig`
25003 * but with all dynamically-allocated buffers duplicated in new buffers.
25005 struct LDKCResult_RefundBolt12SemanticErrorZ CResult_RefundBolt12SemanticErrorZ_clone(const struct LDKCResult_RefundBolt12SemanticErrorZ *NONNULL_PTR orig);
25008 * Constructs a new COption_u64Z containing a u64
25010 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
25013 * Constructs a new COption_u64Z containing nothing
25015 struct LDKCOption_u64Z COption_u64Z_none(void);
25018 * Frees any resources associated with the u64, if we are in the Some state
25020 void COption_u64Z_free(struct LDKCOption_u64Z _res);
25023 * Creates a new COption_u64Z which has the same data as `orig`
25024 * but with all dynamically-allocated buffers duplicated in new buffers.
25026 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
25029 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25031 void CVec_BlindedPathZ_free(struct LDKCVec_BlindedPathZ _res);
25034 * Creates a new CResult_RefundBolt12ParseErrorZ in the success state.
25036 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_ok(struct LDKRefund o);
25039 * Creates a new CResult_RefundBolt12ParseErrorZ in the error state.
25041 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
25044 * Checks if the given object is currently in the success state
25046 bool CResult_RefundBolt12ParseErrorZ_is_ok(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR o);
25049 * Frees any resources used by the CResult_RefundBolt12ParseErrorZ.
25051 void CResult_RefundBolt12ParseErrorZ_free(struct LDKCResult_RefundBolt12ParseErrorZ _res);
25054 * Creates a new CResult_RefundBolt12ParseErrorZ which has the same data as `orig`
25055 * but with all dynamically-allocated buffers duplicated in new buffers.
25057 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_clone(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR orig);
25060 * Creates a new CResult_RetryDecodeErrorZ in the success state.
25062 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_ok(struct LDKRetry o);
25065 * Creates a new CResult_RetryDecodeErrorZ in the error state.
25067 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_err(struct LDKDecodeError e);
25070 * Checks if the given object is currently in the success state
25072 bool CResult_RetryDecodeErrorZ_is_ok(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR o);
25075 * Frees any resources used by the CResult_RetryDecodeErrorZ.
25077 void CResult_RetryDecodeErrorZ_free(struct LDKCResult_RetryDecodeErrorZ _res);
25080 * Creates a new CResult_RetryDecodeErrorZ which has the same data as `orig`
25081 * but with all dynamically-allocated buffers duplicated in new buffers.
25083 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_clone(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR orig);
25086 * Creates a new CResult_NoneAPIErrorZ in the success state.
25088 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
25091 * Creates a new CResult_NoneAPIErrorZ in the error state.
25093 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
25096 * Checks if the given object is currently in the success state
25098 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
25101 * Frees any resources used by the CResult_NoneAPIErrorZ.
25103 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
25106 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
25107 * but with all dynamically-allocated buffers duplicated in new buffers.
25109 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
25112 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25114 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
25117 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25119 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
25122 * Constructs a new COption_ThirtyTwoBytesZ containing a crate::c_types::ThirtyTwoBytes
25124 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_some(struct LDKThirtyTwoBytes o);
25127 * Constructs a new COption_ThirtyTwoBytesZ containing nothing
25129 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_none(void);
25132 * Frees any resources associated with the crate::c_types::ThirtyTwoBytes, if we are in the Some state
25134 void COption_ThirtyTwoBytesZ_free(struct LDKCOption_ThirtyTwoBytesZ _res);
25137 * Creates a new COption_ThirtyTwoBytesZ which has the same data as `orig`
25138 * but with all dynamically-allocated buffers duplicated in new buffers.
25140 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_clone(const struct LDKCOption_ThirtyTwoBytesZ *NONNULL_PTR orig);
25143 * Constructs a new COption_CVec_u8ZZ containing a crate::c_types::derived::CVec_u8Z
25145 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_some(struct LDKCVec_u8Z o);
25148 * Constructs a new COption_CVec_u8ZZ containing nothing
25150 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_none(void);
25153 * Frees any resources associated with the crate::c_types::derived::CVec_u8Z, if we are in the Some state
25155 void COption_CVec_u8ZZ_free(struct LDKCOption_CVec_u8ZZ _res);
25158 * Creates a new COption_CVec_u8ZZ which has the same data as `orig`
25159 * but with all dynamically-allocated buffers duplicated in new buffers.
25161 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_clone(const struct LDKCOption_CVec_u8ZZ *NONNULL_PTR orig);
25164 * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the success state.
25166 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_ok(struct LDKRecipientOnionFields o);
25169 * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the error state.
25171 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_err(struct LDKDecodeError e);
25174 * Checks if the given object is currently in the success state
25176 bool CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR o);
25179 * Frees any resources used by the CResult_RecipientOnionFieldsDecodeErrorZ.
25181 void CResult_RecipientOnionFieldsDecodeErrorZ_free(struct LDKCResult_RecipientOnionFieldsDecodeErrorZ _res);
25184 * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ which has the same data as `orig`
25185 * but with all dynamically-allocated buffers duplicated in new buffers.
25187 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_clone(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR orig);
25190 * Creates a new tuple which has the same data as `orig`
25191 * but with all dynamically-allocated buffers duplicated in new buffers.
25193 struct LDKC2Tuple_u64CVec_u8ZZ C2Tuple_u64CVec_u8ZZ_clone(const struct LDKC2Tuple_u64CVec_u8ZZ *NONNULL_PTR orig);
25196 * Creates a new C2Tuple_u64CVec_u8ZZ from the contained elements.
25198 struct LDKC2Tuple_u64CVec_u8ZZ C2Tuple_u64CVec_u8ZZ_new(uint64_t a, struct LDKCVec_u8Z b);
25201 * Frees any resources used by the C2Tuple_u64CVec_u8ZZ.
25203 void C2Tuple_u64CVec_u8ZZ_free(struct LDKC2Tuple_u64CVec_u8ZZ _res);
25206 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25208 void CVec_C2Tuple_u64CVec_u8ZZZ_free(struct LDKCVec_C2Tuple_u64CVec_u8ZZZ _res);
25211 * Creates a new CResult_RecipientOnionFieldsNoneZ in the success state.
25213 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_ok(struct LDKRecipientOnionFields o);
25216 * Creates a new CResult_RecipientOnionFieldsNoneZ in the error state.
25218 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_err(void);
25221 * Checks if the given object is currently in the success state
25223 bool CResult_RecipientOnionFieldsNoneZ_is_ok(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR o);
25226 * Frees any resources used by the CResult_RecipientOnionFieldsNoneZ.
25228 void CResult_RecipientOnionFieldsNoneZ_free(struct LDKCResult_RecipientOnionFieldsNoneZ _res);
25231 * Creates a new CResult_RecipientOnionFieldsNoneZ which has the same data as `orig`
25232 * but with all dynamically-allocated buffers duplicated in new buffers.
25234 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_clone(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR orig);
25237 * Creates a new CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ in the success state.
25239 struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_ok(struct LDKUnsignedBolt12Invoice o);
25242 * Creates a new CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ in the error state.
25244 struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
25247 * Checks if the given object is currently in the success state
25249 bool CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_is_ok(const struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR o);
25252 * Frees any resources used by the CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ.
25254 void CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_free(struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ _res);
25257 * Creates a new CResult_Bolt12InvoiceBolt12SemanticErrorZ in the success state.
25259 struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ CResult_Bolt12InvoiceBolt12SemanticErrorZ_ok(struct LDKBolt12Invoice o);
25262 * Creates a new CResult_Bolt12InvoiceBolt12SemanticErrorZ in the error state.
25264 struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ CResult_Bolt12InvoiceBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
25267 * Checks if the given object is currently in the success state
25269 bool CResult_Bolt12InvoiceBolt12SemanticErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR o);
25272 * Frees any resources used by the CResult_Bolt12InvoiceBolt12SemanticErrorZ.
25274 void CResult_Bolt12InvoiceBolt12SemanticErrorZ_free(struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ _res);
25277 * Creates a new CResult_Bolt12InvoiceBolt12SemanticErrorZ which has the same data as `orig`
25278 * but with all dynamically-allocated buffers duplicated in new buffers.
25280 struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone(const struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR orig);
25283 * Creates a new CResult_SchnorrSignatureNoneZ in the success state.
25285 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_ok(struct LDKSchnorrSignature o);
25288 * Creates a new CResult_SchnorrSignatureNoneZ in the error state.
25290 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_err(void);
25293 * Checks if the given object is currently in the success state
25295 bool CResult_SchnorrSignatureNoneZ_is_ok(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR o);
25298 * Frees any resources used by the CResult_SchnorrSignatureNoneZ.
25300 void CResult_SchnorrSignatureNoneZ_free(struct LDKCResult_SchnorrSignatureNoneZ _res);
25303 * Creates a new CResult_SchnorrSignatureNoneZ which has the same data as `orig`
25304 * but with all dynamically-allocated buffers duplicated in new buffers.
25306 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_clone(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR orig);
25309 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25311 void CVec_ThirtyTwoBytesZ_free(struct LDKCVec_ThirtyTwoBytesZ _res);
25314 * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing a crate::c_types::derived::CVec_ThirtyTwoBytesZ
25316 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_some(struct LDKCVec_ThirtyTwoBytesZ o);
25319 * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing nothing
25321 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_none(void);
25324 * Frees any resources associated with the crate::c_types::derived::CVec_ThirtyTwoBytesZ, if we are in the Some state
25326 void COption_CVec_ThirtyTwoBytesZZ_free(struct LDKCOption_CVec_ThirtyTwoBytesZZ _res);
25329 * Creates a new COption_CVec_ThirtyTwoBytesZZ which has the same data as `orig`
25330 * but with all dynamically-allocated buffers duplicated in new buffers.
25332 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_clone(const struct LDKCOption_CVec_ThirtyTwoBytesZZ *NONNULL_PTR orig);
25335 * Constructs a new COption_AmountZ containing a crate::lightning::offers::offer::Amount
25337 struct LDKCOption_AmountZ COption_AmountZ_some(struct LDKAmount o);
25340 * Constructs a new COption_AmountZ containing nothing
25342 struct LDKCOption_AmountZ COption_AmountZ_none(void);
25345 * Frees any resources associated with the crate::lightning::offers::offer::Amount, if we are in the Some state
25347 void COption_AmountZ_free(struct LDKCOption_AmountZ _res);
25350 * Creates a new COption_AmountZ which has the same data as `orig`
25351 * but with all dynamically-allocated buffers duplicated in new buffers.
25353 struct LDKCOption_AmountZ COption_AmountZ_clone(const struct LDKCOption_AmountZ *NONNULL_PTR orig);
25356 * Constructs a new COption_QuantityZ containing a crate::lightning::offers::offer::Quantity
25358 struct LDKCOption_QuantityZ COption_QuantityZ_some(struct LDKQuantity o);
25361 * Constructs a new COption_QuantityZ containing nothing
25363 struct LDKCOption_QuantityZ COption_QuantityZ_none(void);
25366 * Frees any resources associated with the crate::lightning::offers::offer::Quantity, if we are in the Some state
25368 void COption_QuantityZ_free(struct LDKCOption_QuantityZ _res);
25371 * Creates a new COption_QuantityZ which has the same data as `orig`
25372 * but with all dynamically-allocated buffers duplicated in new buffers.
25374 struct LDKCOption_QuantityZ COption_QuantityZ_clone(const struct LDKCOption_QuantityZ *NONNULL_PTR orig);
25377 * Creates a new CResult_ThirtyTwoBytesNoneZ in the success state.
25379 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_ok(struct LDKThirtyTwoBytes o);
25382 * Creates a new CResult_ThirtyTwoBytesNoneZ in the error state.
25384 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_err(void);
25387 * Checks if the given object is currently in the success state
25389 bool CResult_ThirtyTwoBytesNoneZ_is_ok(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR o);
25392 * Frees any resources used by the CResult_ThirtyTwoBytesNoneZ.
25394 void CResult_ThirtyTwoBytesNoneZ_free(struct LDKCResult_ThirtyTwoBytesNoneZ _res);
25397 * Creates a new CResult_ThirtyTwoBytesNoneZ which has the same data as `orig`
25398 * but with all dynamically-allocated buffers duplicated in new buffers.
25400 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_clone(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR orig);
25403 * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the success state.
25405 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_ok(struct LDKBlindedPayInfo o);
25408 * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the error state.
25410 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_err(struct LDKDecodeError e);
25413 * Checks if the given object is currently in the success state
25415 bool CResult_BlindedPayInfoDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR o);
25418 * Frees any resources used by the CResult_BlindedPayInfoDecodeErrorZ.
25420 void CResult_BlindedPayInfoDecodeErrorZ_free(struct LDKCResult_BlindedPayInfoDecodeErrorZ _res);
25423 * Creates a new CResult_BlindedPayInfoDecodeErrorZ which has the same data as `orig`
25424 * but with all dynamically-allocated buffers duplicated in new buffers.
25426 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_clone(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR orig);
25429 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
25431 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
25434 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
25436 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
25439 * Checks if the given object is currently in the success state
25441 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
25444 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
25446 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
25449 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
25450 * but with all dynamically-allocated buffers duplicated in new buffers.
25452 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
25455 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
25457 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
25460 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
25462 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
25465 * Checks if the given object is currently in the success state
25467 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
25470 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
25472 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
25475 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
25476 * but with all dynamically-allocated buffers duplicated in new buffers.
25478 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
25481 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
25483 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
25486 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
25488 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
25491 * Checks if the given object is currently in the success state
25493 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
25496 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
25498 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
25501 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
25502 * but with all dynamically-allocated buffers duplicated in new buffers.
25504 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
25507 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25509 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
25512 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25514 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
25517 * Constructs a new COption_u32Z containing a u32
25519 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
25522 * Constructs a new COption_u32Z containing nothing
25524 struct LDKCOption_u32Z COption_u32Z_none(void);
25527 * Frees any resources associated with the u32, if we are in the Some state
25529 void COption_u32Z_free(struct LDKCOption_u32Z _res);
25532 * Creates a new COption_u32Z which has the same data as `orig`
25533 * but with all dynamically-allocated buffers duplicated in new buffers.
25535 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
25538 * Creates a new tuple which has the same data as `orig`
25539 * but with all dynamically-allocated buffers duplicated in new buffers.
25541 struct LDKC2Tuple_CVec_u8Zu64Z C2Tuple_CVec_u8Zu64Z_clone(const struct LDKC2Tuple_CVec_u8Zu64Z *NONNULL_PTR orig);
25544 * Creates a new C2Tuple_CVec_u8Zu64Z from the contained elements.
25546 struct LDKC2Tuple_CVec_u8Zu64Z C2Tuple_CVec_u8Zu64Z_new(struct LDKCVec_u8Z a, uint64_t b);
25549 * Frees any resources used by the C2Tuple_CVec_u8Zu64Z.
25551 void C2Tuple_CVec_u8Zu64Z_free(struct LDKC2Tuple_CVec_u8Zu64Z _res);
25554 * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ in the success state.
25556 struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ CResult_C2Tuple_CVec_u8Zu64ZNoneZ_ok(struct LDKC2Tuple_CVec_u8Zu64Z o);
25559 * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ in the error state.
25561 struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ CResult_C2Tuple_CVec_u8Zu64ZNoneZ_err(void);
25564 * Checks if the given object is currently in the success state
25566 bool CResult_C2Tuple_CVec_u8Zu64ZNoneZ_is_ok(const struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ *NONNULL_PTR o);
25569 * Frees any resources used by the CResult_C2Tuple_CVec_u8Zu64ZNoneZ.
25571 void CResult_C2Tuple_CVec_u8Zu64ZNoneZ_free(struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ _res);
25574 * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ which has the same data as `orig`
25575 * but with all dynamically-allocated buffers duplicated in new buffers.
25577 struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ CResult_C2Tuple_CVec_u8Zu64ZNoneZ_clone(const struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ *NONNULL_PTR orig);
25580 * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the success state.
25582 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_ok(struct LDKChannelDerivationParameters o);
25585 * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the error state.
25587 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_err(struct LDKDecodeError e);
25590 * Checks if the given object is currently in the success state
25592 bool CResult_ChannelDerivationParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR o);
25595 * Frees any resources used by the CResult_ChannelDerivationParametersDecodeErrorZ.
25597 void CResult_ChannelDerivationParametersDecodeErrorZ_free(struct LDKCResult_ChannelDerivationParametersDecodeErrorZ _res);
25600 * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ which has the same data as `orig`
25601 * but with all dynamically-allocated buffers duplicated in new buffers.
25603 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR orig);
25606 * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the success state.
25608 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_ok(struct LDKHTLCDescriptor o);
25611 * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the error state.
25613 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
25616 * Checks if the given object is currently in the success state
25618 bool CResult_HTLCDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR o);
25621 * Frees any resources used by the CResult_HTLCDescriptorDecodeErrorZ.
25623 void CResult_HTLCDescriptorDecodeErrorZ_free(struct LDKCResult_HTLCDescriptorDecodeErrorZ _res);
25626 * Creates a new CResult_HTLCDescriptorDecodeErrorZ which has the same data as `orig`
25627 * but with all dynamically-allocated buffers duplicated in new buffers.
25629 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_clone(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR orig);
25632 * Creates a new CResult_NoneNoneZ in the success state.
25634 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
25637 * Creates a new CResult_NoneNoneZ in the error state.
25639 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
25642 * Checks if the given object is currently in the success state
25644 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
25647 * Frees any resources used by the CResult_NoneNoneZ.
25649 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
25652 * Creates a new CResult_NoneNoneZ which has the same data as `orig`
25653 * but with all dynamically-allocated buffers duplicated in new buffers.
25655 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
25658 * Creates a new CResult_PublicKeyNoneZ in the success state.
25660 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_ok(struct LDKPublicKey o);
25663 * Creates a new CResult_PublicKeyNoneZ in the error state.
25665 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_err(void);
25668 * Checks if the given object is currently in the success state
25670 bool CResult_PublicKeyNoneZ_is_ok(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR o);
25673 * Frees any resources used by the CResult_PublicKeyNoneZ.
25675 void CResult_PublicKeyNoneZ_free(struct LDKCResult_PublicKeyNoneZ _res);
25678 * Creates a new CResult_PublicKeyNoneZ which has the same data as `orig`
25679 * but with all dynamically-allocated buffers duplicated in new buffers.
25681 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_clone(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR orig);
25684 * Constructs a new COption_BigEndianScalarZ containing a crate::c_types::BigEndianScalar
25686 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_some(struct LDKBigEndianScalar o);
25689 * Constructs a new COption_BigEndianScalarZ containing nothing
25691 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_none(void);
25694 * Frees any resources associated with the crate::c_types::BigEndianScalar, if we are in the Some state
25696 void COption_BigEndianScalarZ_free(struct LDKCOption_BigEndianScalarZ _res);
25699 * Creates a new COption_BigEndianScalarZ which has the same data as `orig`
25700 * but with all dynamically-allocated buffers duplicated in new buffers.
25702 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_clone(const struct LDKCOption_BigEndianScalarZ *NONNULL_PTR orig);
25705 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25707 void CVec_U5Z_free(struct LDKCVec_U5Z _res);
25710 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
25712 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
25715 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
25717 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
25720 * Checks if the given object is currently in the success state
25722 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
25725 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
25727 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
25730 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
25731 * but with all dynamically-allocated buffers duplicated in new buffers.
25733 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
25736 * Creates a new CResult_ECDSASignatureNoneZ in the success state.
25738 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_ok(struct LDKECDSASignature o);
25741 * Creates a new CResult_ECDSASignatureNoneZ in the error state.
25743 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_err(void);
25746 * Checks if the given object is currently in the success state
25748 bool CResult_ECDSASignatureNoneZ_is_ok(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR o);
25751 * Frees any resources used by the CResult_ECDSASignatureNoneZ.
25753 void CResult_ECDSASignatureNoneZ_free(struct LDKCResult_ECDSASignatureNoneZ _res);
25756 * Creates a new CResult_ECDSASignatureNoneZ which has the same data as `orig`
25757 * but with all dynamically-allocated buffers duplicated in new buffers.
25759 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_clone(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR orig);
25762 * Creates a new CResult_TransactionNoneZ in the success state.
25764 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
25767 * Creates a new CResult_TransactionNoneZ in the error state.
25769 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
25772 * Checks if the given object is currently in the success state
25774 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
25777 * Frees any resources used by the CResult_TransactionNoneZ.
25779 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
25782 * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
25783 * but with all dynamically-allocated buffers duplicated in new buffers.
25785 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
25788 * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the success state.
25790 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(struct LDKWriteableEcdsaChannelSigner o);
25793 * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the error state.
25795 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(struct LDKDecodeError e);
25798 * Checks if the given object is currently in the success state
25800 bool CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR o);
25803 * Frees any resources used by the CResult_WriteableEcdsaChannelSignerDecodeErrorZ.
25805 void CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res);
25808 * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ which has the same data as `orig`
25809 * but with all dynamically-allocated buffers duplicated in new buffers.
25811 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR orig);
25814 * Creates a new CResult_CVec_u8ZNoneZ in the success state.
25816 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_ok(struct LDKCVec_u8Z o);
25819 * Creates a new CResult_CVec_u8ZNoneZ in the error state.
25821 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_err(void);
25824 * Checks if the given object is currently in the success state
25826 bool CResult_CVec_u8ZNoneZ_is_ok(const struct LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR o);
25829 * Frees any resources used by the CResult_CVec_u8ZNoneZ.
25831 void CResult_CVec_u8ZNoneZ_free(struct LDKCResult_CVec_u8ZNoneZ _res);
25834 * Creates a new CResult_CVec_u8ZNoneZ which has the same data as `orig`
25835 * but with all dynamically-allocated buffers duplicated in new buffers.
25837 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_clone(const struct LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR orig);
25840 * Creates a new CResult_ShutdownScriptNoneZ in the success state.
25842 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_ok(struct LDKShutdownScript o);
25845 * Creates a new CResult_ShutdownScriptNoneZ in the error state.
25847 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_err(void);
25850 * Checks if the given object is currently in the success state
25852 bool CResult_ShutdownScriptNoneZ_is_ok(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR o);
25855 * Frees any resources used by the CResult_ShutdownScriptNoneZ.
25857 void CResult_ShutdownScriptNoneZ_free(struct LDKCResult_ShutdownScriptNoneZ _res);
25860 * Creates a new CResult_ShutdownScriptNoneZ which has the same data as `orig`
25861 * but with all dynamically-allocated buffers duplicated in new buffers.
25863 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_clone(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR orig);
25866 * Constructs a new COption_u16Z containing a u16
25868 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
25871 * Constructs a new COption_u16Z containing nothing
25873 struct LDKCOption_u16Z COption_u16Z_none(void);
25876 * Frees any resources associated with the u16, if we are in the Some state
25878 void COption_u16Z_free(struct LDKCOption_u16Z _res);
25881 * Creates a new COption_u16Z which has the same data as `orig`
25882 * but with all dynamically-allocated buffers duplicated in new buffers.
25884 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
25887 * Constructs a new COption_boolZ containing a bool
25889 struct LDKCOption_boolZ COption_boolZ_some(bool o);
25892 * Constructs a new COption_boolZ containing nothing
25894 struct LDKCOption_boolZ COption_boolZ_none(void);
25897 * Frees any resources associated with the bool, if we are in the Some state
25899 void COption_boolZ_free(struct LDKCOption_boolZ _res);
25902 * Creates a new COption_boolZ which has the same data as `orig`
25903 * but with all dynamically-allocated buffers duplicated in new buffers.
25905 struct LDKCOption_boolZ COption_boolZ_clone(const struct LDKCOption_boolZ *NONNULL_PTR orig);
25908 * Creates a new CResult_WitnessNoneZ in the success state.
25910 struct LDKCResult_WitnessNoneZ CResult_WitnessNoneZ_ok(struct LDKWitness o);
25913 * Creates a new CResult_WitnessNoneZ in the error state.
25915 struct LDKCResult_WitnessNoneZ CResult_WitnessNoneZ_err(void);
25918 * Checks if the given object is currently in the success state
25920 bool CResult_WitnessNoneZ_is_ok(const struct LDKCResult_WitnessNoneZ *NONNULL_PTR o);
25923 * Frees any resources used by the CResult_WitnessNoneZ.
25925 void CResult_WitnessNoneZ_free(struct LDKCResult_WitnessNoneZ _res);
25928 * Creates a new CResult_WitnessNoneZ which has the same data as `orig`
25929 * but with all dynamically-allocated buffers duplicated in new buffers.
25931 struct LDKCResult_WitnessNoneZ CResult_WitnessNoneZ_clone(const struct LDKCResult_WitnessNoneZ *NONNULL_PTR orig);
25934 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25936 void CVec_ECDSASignatureZ_free(struct LDKCVec_ECDSASignatureZ _res);
25939 * Creates a new tuple which has the same data as `orig`
25940 * but with all dynamically-allocated buffers duplicated in new buffers.
25942 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone(const struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *NONNULL_PTR orig);
25945 * Creates a new C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ from the contained elements.
25947 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_new(struct LDKECDSASignature a, struct LDKCVec_ECDSASignatureZ b);
25950 * Frees any resources used by the C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ.
25952 void C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_free(struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ _res);
25955 * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the success state.
25957 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_ok(struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ o);
25960 * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the error state.
25962 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_err(void);
25965 * Checks if the given object is currently in the success state
25967 bool CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR o);
25970 * Frees any resources used by the CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ.
25972 void CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_free(struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ _res);
25975 * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ which has the same data as `orig`
25976 * but with all dynamically-allocated buffers duplicated in new buffers.
25978 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR orig);
25981 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
25983 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
25986 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
25988 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
25991 * Checks if the given object is currently in the success state
25993 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
25996 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
25998 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
26001 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
26002 * but with all dynamically-allocated buffers duplicated in new buffers.
26004 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
26007 * Constructs a new COption_WriteableScoreZ containing a crate::lightning::routing::scoring::WriteableScore
26009 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_some(struct LDKWriteableScore o);
26012 * Constructs a new COption_WriteableScoreZ containing nothing
26014 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_none(void);
26017 * Frees any resources associated with the crate::lightning::routing::scoring::WriteableScore, if we are in the Some state
26019 void COption_WriteableScoreZ_free(struct LDKCOption_WriteableScoreZ _res);
26022 * Creates a new CResult_NoneIOErrorZ in the success state.
26024 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_ok(void);
26027 * Creates a new CResult_NoneIOErrorZ in the error state.
26029 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_err(enum LDKIOError e);
26032 * Checks if the given object is currently in the success state
26034 bool CResult_NoneIOErrorZ_is_ok(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR o);
26037 * Frees any resources used by the CResult_NoneIOErrorZ.
26039 void CResult_NoneIOErrorZ_free(struct LDKCResult_NoneIOErrorZ _res);
26042 * Creates a new CResult_NoneIOErrorZ which has the same data as `orig`
26043 * but with all dynamically-allocated buffers duplicated in new buffers.
26045 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_clone(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR orig);
26048 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26050 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
26053 * Creates a new CResult_RouteLightningErrorZ in the success state.
26055 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
26058 * Creates a new CResult_RouteLightningErrorZ in the error state.
26060 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
26063 * Checks if the given object is currently in the success state
26065 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
26068 * Frees any resources used by the CResult_RouteLightningErrorZ.
26070 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
26073 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
26074 * but with all dynamically-allocated buffers duplicated in new buffers.
26076 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
26079 * Creates a new tuple which has the same data as `orig`
26080 * but with all dynamically-allocated buffers duplicated in new buffers.
26082 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_clone(const struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR orig);
26085 * Creates a new C2Tuple_BlindedPayInfoBlindedPathZ from the contained elements.
26087 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_new(struct LDKBlindedPayInfo a, struct LDKBlindedPath b);
26090 * Frees any resources used by the C2Tuple_BlindedPayInfoBlindedPathZ.
26092 void C2Tuple_BlindedPayInfoBlindedPathZ_free(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ _res);
26095 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26097 void CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res);
26100 * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ in the success state.
26102 struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ o);
26105 * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ in the error state.
26107 struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err(void);
26110 * Checks if the given object is currently in the success state
26112 bool CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR o);
26115 * Frees any resources used by the CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.
26117 void CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free(struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ _res);
26120 * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ which has the same data as `orig`
26121 * but with all dynamically-allocated buffers duplicated in new buffers.
26123 struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(const struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR orig);
26126 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26128 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
26131 * Creates a new CResult_OnionMessagePathNoneZ in the success state.
26133 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_ok(struct LDKOnionMessagePath o);
26136 * Creates a new CResult_OnionMessagePathNoneZ in the error state.
26138 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_err(void);
26141 * Checks if the given object is currently in the success state
26143 bool CResult_OnionMessagePathNoneZ_is_ok(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR o);
26146 * Frees any resources used by the CResult_OnionMessagePathNoneZ.
26148 void CResult_OnionMessagePathNoneZ_free(struct LDKCResult_OnionMessagePathNoneZ _res);
26151 * Creates a new CResult_OnionMessagePathNoneZ which has the same data as `orig`
26152 * but with all dynamically-allocated buffers duplicated in new buffers.
26154 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_clone(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR orig);
26157 * Creates a new CResult_CVec_BlindedPathZNoneZ in the success state.
26159 struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_ok(struct LDKCVec_BlindedPathZ o);
26162 * Creates a new CResult_CVec_BlindedPathZNoneZ in the error state.
26164 struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_err(void);
26167 * Checks if the given object is currently in the success state
26169 bool CResult_CVec_BlindedPathZNoneZ_is_ok(const struct LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR o);
26172 * Frees any resources used by the CResult_CVec_BlindedPathZNoneZ.
26174 void CResult_CVec_BlindedPathZNoneZ_free(struct LDKCResult_CVec_BlindedPathZNoneZ _res);
26177 * Creates a new CResult_CVec_BlindedPathZNoneZ which has the same data as `orig`
26178 * but with all dynamically-allocated buffers duplicated in new buffers.
26180 struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_clone(const struct LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR orig);
26183 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the success state.
26185 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_ok(struct LDKInFlightHtlcs o);
26188 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the error state.
26190 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_err(struct LDKDecodeError e);
26193 * Checks if the given object is currently in the success state
26195 bool CResult_InFlightHtlcsDecodeErrorZ_is_ok(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR o);
26198 * Frees any resources used by the CResult_InFlightHtlcsDecodeErrorZ.
26200 void CResult_InFlightHtlcsDecodeErrorZ_free(struct LDKCResult_InFlightHtlcsDecodeErrorZ _res);
26203 * Creates a new CResult_InFlightHtlcsDecodeErrorZ which has the same data as `orig`
26204 * but with all dynamically-allocated buffers duplicated in new buffers.
26206 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_clone(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR orig);
26209 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
26211 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
26214 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
26216 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
26219 * Checks if the given object is currently in the success state
26221 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
26224 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
26226 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
26229 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
26230 * but with all dynamically-allocated buffers duplicated in new buffers.
26232 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
26235 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26237 void CVec_BlindedHopZ_free(struct LDKCVec_BlindedHopZ _res);
26240 * Creates a new CResult_BlindedTailDecodeErrorZ in the success state.
26242 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_ok(struct LDKBlindedTail o);
26245 * Creates a new CResult_BlindedTailDecodeErrorZ in the error state.
26247 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_err(struct LDKDecodeError e);
26250 * Checks if the given object is currently in the success state
26252 bool CResult_BlindedTailDecodeErrorZ_is_ok(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR o);
26255 * Frees any resources used by the CResult_BlindedTailDecodeErrorZ.
26257 void CResult_BlindedTailDecodeErrorZ_free(struct LDKCResult_BlindedTailDecodeErrorZ _res);
26260 * Creates a new CResult_BlindedTailDecodeErrorZ which has the same data as `orig`
26261 * but with all dynamically-allocated buffers duplicated in new buffers.
26263 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_clone(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR orig);
26266 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26268 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
26271 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26273 void CVec_PathZ_free(struct LDKCVec_PathZ _res);
26276 * Creates a new CResult_RouteDecodeErrorZ in the success state.
26278 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
26281 * Creates a new CResult_RouteDecodeErrorZ in the error state.
26283 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
26286 * Checks if the given object is currently in the success state
26288 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
26291 * Frees any resources used by the CResult_RouteDecodeErrorZ.
26293 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
26296 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
26297 * but with all dynamically-allocated buffers duplicated in new buffers.
26299 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
26302 * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
26304 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
26307 * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
26309 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
26312 * Checks if the given object is currently in the success state
26314 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
26317 * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
26319 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
26322 * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
26323 * but with all dynamically-allocated buffers duplicated in new buffers.
26325 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
26328 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26330 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
26333 * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
26335 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
26338 * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
26340 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
26343 * Checks if the given object is currently in the success state
26345 bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
26348 * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
26350 void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
26353 * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
26354 * but with all dynamically-allocated buffers duplicated in new buffers.
26356 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
26359 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26361 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
26364 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26366 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
26369 * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
26371 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
26374 * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
26376 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
26379 * Checks if the given object is currently in the success state
26381 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
26384 * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
26386 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
26389 * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
26390 * but with all dynamically-allocated buffers duplicated in new buffers.
26392 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
26395 * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
26397 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
26400 * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
26402 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
26405 * Checks if the given object is currently in the success state
26407 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
26410 * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
26412 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
26415 * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
26416 * but with all dynamically-allocated buffers duplicated in new buffers.
26418 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
26421 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
26423 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
26426 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
26428 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
26431 * Checks if the given object is currently in the success state
26433 bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
26436 * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
26438 void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
26441 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ which has the same data as `orig`
26442 * but with all dynamically-allocated buffers duplicated in new buffers.
26444 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig);
26447 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26449 void CVec_NodeIdZ_free(struct LDKCVec_NodeIdZ _res);
26452 * Creates a new tuple which has the same data as `orig`
26453 * but with all dynamically-allocated buffers duplicated in new buffers.
26455 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);
26458 * Creates a new C2Tuple_u64u64Z from the contained elements.
26460 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
26463 * Frees any resources used by the C2Tuple_u64u64Z.
26465 void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);
26468 * Constructs a new COption_C2Tuple_u64u64ZZ containing a crate::c_types::derived::C2Tuple_u64u64Z
26470 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_some(struct LDKC2Tuple_u64u64Z o);
26473 * Constructs a new COption_C2Tuple_u64u64ZZ containing nothing
26475 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_none(void);
26478 * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u64Z, if we are in the Some state
26480 void COption_C2Tuple_u64u64ZZ_free(struct LDKCOption_C2Tuple_u64u64ZZ _res);
26483 * Creates a new COption_C2Tuple_u64u64ZZ which has the same data as `orig`
26484 * but with all dynamically-allocated buffers duplicated in new buffers.
26486 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_clone(const struct LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR orig);
26489 * Creates a new C2Tuple_Z from the contained elements.
26491 struct LDKC2Tuple_Z C2Tuple_Z_new(struct LDKThirtyTwoU16s a, struct LDKThirtyTwoU16s b);
26494 * Frees any resources used by the C2Tuple_Z.
26496 void C2Tuple_Z_free(struct LDKC2Tuple_Z _res);
26499 * Creates a new C2Tuple__u1632_u1632Z from the contained elements.
26501 struct LDKC2Tuple__u1632_u1632Z C2Tuple__u1632_u1632Z_new(struct LDKThirtyTwoU16s a, struct LDKThirtyTwoU16s b);
26504 * Frees any resources used by the C2Tuple__u1632_u1632Z.
26506 void C2Tuple__u1632_u1632Z_free(struct LDKC2Tuple__u1632_u1632Z _res);
26509 * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing a crate::c_types::derived::C2Tuple__u1632_u1632Z
26511 struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_some(struct LDKC2Tuple__u1632_u1632Z o);
26514 * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing nothing
26516 struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_none(void);
26519 * Frees any resources associated with the crate::c_types::derived::C2Tuple__u1632_u1632Z, if we are in the Some state
26521 void COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_free(struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ _res);
26524 * Constructs a new COption_f64Z containing a f64
26526 struct LDKCOption_f64Z COption_f64Z_some(double o);
26529 * Constructs a new COption_f64Z containing nothing
26531 struct LDKCOption_f64Z COption_f64Z_none(void);
26534 * Frees any resources associated with the f64, if we are in the Some state
26536 void COption_f64Z_free(struct LDKCOption_f64Z _res);
26539 * Creates a new COption_f64Z which has the same data as `orig`
26540 * but with all dynamically-allocated buffers duplicated in new buffers.
26542 struct LDKCOption_f64Z COption_f64Z_clone(const struct LDKCOption_f64Z *NONNULL_PTR orig);
26545 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
26547 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
26550 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
26552 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
26555 * Checks if the given object is currently in the success state
26557 bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
26560 * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
26562 void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
26565 * Creates a new CResult_BestBlockDecodeErrorZ in the success state.
26567 struct LDKCResult_BestBlockDecodeErrorZ CResult_BestBlockDecodeErrorZ_ok(struct LDKBestBlock o);
26570 * Creates a new CResult_BestBlockDecodeErrorZ in the error state.
26572 struct LDKCResult_BestBlockDecodeErrorZ CResult_BestBlockDecodeErrorZ_err(struct LDKDecodeError e);
26575 * Checks if the given object is currently in the success state
26577 bool CResult_BestBlockDecodeErrorZ_is_ok(const struct LDKCResult_BestBlockDecodeErrorZ *NONNULL_PTR o);
26580 * Frees any resources used by the CResult_BestBlockDecodeErrorZ.
26582 void CResult_BestBlockDecodeErrorZ_free(struct LDKCResult_BestBlockDecodeErrorZ _res);
26585 * Creates a new CResult_BestBlockDecodeErrorZ which has the same data as `orig`
26586 * but with all dynamically-allocated buffers duplicated in new buffers.
26588 struct LDKCResult_BestBlockDecodeErrorZ CResult_BestBlockDecodeErrorZ_clone(const struct LDKCResult_BestBlockDecodeErrorZ *NONNULL_PTR orig);
26591 * Creates a new tuple which has the same data as `orig`
26592 * but with all dynamically-allocated buffers duplicated in new buffers.
26594 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
26597 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
26599 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
26602 * Frees any resources used by the C2Tuple_usizeTransactionZ.
26604 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
26607 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26609 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
26612 * Creates a new tuple which has the same data as `orig`
26613 * but with all dynamically-allocated buffers duplicated in new buffers.
26615 struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_clone(const struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ *NONNULL_PTR orig);
26618 * Creates a new C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ from the contained elements.
26620 struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_new(struct LDKThirtyTwoBytes a, uint32_t b, struct LDKCOption_ThirtyTwoBytesZ c);
26623 * Frees any resources used by the C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ.
26625 void C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_free(struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ _res);
26628 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26630 void CVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ_free(struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ _res);
26633 * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ in the success state.
26635 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_ok(enum LDKChannelMonitorUpdateStatus o);
26638 * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ in the error state.
26640 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_err(void);
26643 * Checks if the given object is currently in the success state
26645 bool CResult_ChannelMonitorUpdateStatusNoneZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR o);
26648 * Frees any resources used by the CResult_ChannelMonitorUpdateStatusNoneZ.
26650 void CResult_ChannelMonitorUpdateStatusNoneZ_free(struct LDKCResult_ChannelMonitorUpdateStatusNoneZ _res);
26653 * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ which has the same data as `orig`
26654 * but with all dynamically-allocated buffers duplicated in new buffers.
26656 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_clone(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR orig);
26659 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26661 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
26664 * Creates a new tuple which has the same data as `orig`
26665 * but with all dynamically-allocated buffers duplicated in new buffers.
26667 struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig);
26670 * Creates a new C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ from the contained elements.
26672 struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKChannelId b, struct LDKCVec_MonitorEventZ c, struct LDKPublicKey d);
26675 * Frees any resources used by the C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ.
26677 void C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_free(struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ _res);
26680 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26682 void CVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ _res);
26685 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
26687 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
26690 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
26692 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
26695 * Checks if the given object is currently in the success state
26697 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
26700 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
26702 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
26705 * Creates a new CResult_InitFeaturesDecodeErrorZ which has the same data as `orig`
26706 * but with all dynamically-allocated buffers duplicated in new buffers.
26708 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig);
26711 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
26713 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
26716 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
26718 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
26721 * Checks if the given object is currently in the success state
26723 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
26726 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
26728 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
26731 * Creates a new CResult_ChannelFeaturesDecodeErrorZ which has the same data as `orig`
26732 * but with all dynamically-allocated buffers duplicated in new buffers.
26734 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig);
26737 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
26739 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
26742 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
26744 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
26747 * Checks if the given object is currently in the success state
26749 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
26752 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
26754 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
26757 * Creates a new CResult_NodeFeaturesDecodeErrorZ which has the same data as `orig`
26758 * but with all dynamically-allocated buffers duplicated in new buffers.
26760 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig);
26763 * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the success state.
26765 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt11InvoiceFeatures o);
26768 * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the error state.
26770 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
26773 * Checks if the given object is currently in the success state
26775 bool CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
26778 * Frees any resources used by the CResult_Bolt11InvoiceFeaturesDecodeErrorZ.
26780 void CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ _res);
26783 * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
26784 * but with all dynamically-allocated buffers duplicated in new buffers.
26786 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
26789 * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the success state.
26791 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt12InvoiceFeatures o);
26794 * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the error state.
26796 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
26799 * Checks if the given object is currently in the success state
26801 bool CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
26804 * Frees any resources used by the CResult_Bolt12InvoiceFeaturesDecodeErrorZ.
26806 void CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ _res);
26809 * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
26810 * but with all dynamically-allocated buffers duplicated in new buffers.
26812 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
26815 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the success state.
26817 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_ok(struct LDKBlindedHopFeatures o);
26820 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the error state.
26822 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
26825 * Checks if the given object is currently in the success state
26827 bool CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR o);
26830 * Frees any resources used by the CResult_BlindedHopFeaturesDecodeErrorZ.
26832 void CResult_BlindedHopFeaturesDecodeErrorZ_free(struct LDKCResult_BlindedHopFeaturesDecodeErrorZ _res);
26835 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ which has the same data as `orig`
26836 * but with all dynamically-allocated buffers duplicated in new buffers.
26838 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_clone(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR orig);
26841 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
26843 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
26846 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
26848 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
26851 * Checks if the given object is currently in the success state
26853 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
26856 * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
26858 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
26861 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ which has the same data as `orig`
26862 * but with all dynamically-allocated buffers duplicated in new buffers.
26864 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig);
26867 * Creates a new CResult_OfferIdDecodeErrorZ in the success state.
26869 struct LDKCResult_OfferIdDecodeErrorZ CResult_OfferIdDecodeErrorZ_ok(struct LDKOfferId o);
26872 * Creates a new CResult_OfferIdDecodeErrorZ in the error state.
26874 struct LDKCResult_OfferIdDecodeErrorZ CResult_OfferIdDecodeErrorZ_err(struct LDKDecodeError e);
26877 * Checks if the given object is currently in the success state
26879 bool CResult_OfferIdDecodeErrorZ_is_ok(const struct LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR o);
26882 * Frees any resources used by the CResult_OfferIdDecodeErrorZ.
26884 void CResult_OfferIdDecodeErrorZ_free(struct LDKCResult_OfferIdDecodeErrorZ _res);
26887 * Creates a new CResult_OfferIdDecodeErrorZ which has the same data as `orig`
26888 * but with all dynamically-allocated buffers duplicated in new buffers.
26890 struct LDKCResult_OfferIdDecodeErrorZ CResult_OfferIdDecodeErrorZ_clone(const struct LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR orig);
26893 * Creates a new CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ in the success state.
26895 struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceRequestWithDerivedPayerIdBuilder o);
26898 * Creates a new CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ in the error state.
26900 struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
26903 * Checks if the given object is currently in the success state
26905 bool CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
26908 * Frees any resources used by the CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ.
26910 void CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ _res);
26913 * Creates a new CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ in the success state.
26915 struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceRequestWithExplicitPayerIdBuilder o);
26918 * Creates a new CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ in the error state.
26920 struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
26923 * Checks if the given object is currently in the success state
26925 bool CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
26928 * Frees any resources used by the CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ.
26930 void CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ _res);
26933 * Creates a new CResult_OfferBolt12ParseErrorZ in the success state.
26935 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_ok(struct LDKOffer o);
26938 * Creates a new CResult_OfferBolt12ParseErrorZ in the error state.
26940 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
26943 * Checks if the given object is currently in the success state
26945 bool CResult_OfferBolt12ParseErrorZ_is_ok(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR o);
26948 * Frees any resources used by the CResult_OfferBolt12ParseErrorZ.
26950 void CResult_OfferBolt12ParseErrorZ_free(struct LDKCResult_OfferBolt12ParseErrorZ _res);
26953 * Creates a new CResult_OfferBolt12ParseErrorZ which has the same data as `orig`
26954 * but with all dynamically-allocated buffers duplicated in new buffers.
26956 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_clone(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR orig);
26959 * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
26961 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
26964 * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
26966 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
26969 * Checks if the given object is currently in the success state
26971 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
26974 * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
26976 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
26979 * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
26980 * but with all dynamically-allocated buffers duplicated in new buffers.
26982 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
26985 * Creates a new CResult_PublicKeySecp256k1ErrorZ in the success state.
26987 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_ok(struct LDKPublicKey o);
26990 * Creates a new CResult_PublicKeySecp256k1ErrorZ in the error state.
26992 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
26995 * Checks if the given object is currently in the success state
26997 bool CResult_PublicKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR o);
27000 * Frees any resources used by the CResult_PublicKeySecp256k1ErrorZ.
27002 void CResult_PublicKeySecp256k1ErrorZ_free(struct LDKCResult_PublicKeySecp256k1ErrorZ _res);
27005 * Creates a new CResult_PublicKeySecp256k1ErrorZ which has the same data as `orig`
27006 * but with all dynamically-allocated buffers duplicated in new buffers.
27008 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_clone(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR orig);
27011 * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate
27013 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
27016 * Constructs a new COption_NetworkUpdateZ containing nothing
27018 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
27021 * Frees any resources associated with the crate::lightning::routing::gossip::NetworkUpdate, if we are in the Some state
27023 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
27026 * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
27027 * but with all dynamically-allocated buffers duplicated in new buffers.
27029 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
27032 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
27034 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
27037 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
27039 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
27042 * Checks if the given object is currently in the success state
27044 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
27047 * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
27049 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
27052 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
27053 * but with all dynamically-allocated buffers duplicated in new buffers.
27055 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
27058 * Constructs a new COption_UtxoLookupZ containing a crate::lightning::routing::utxo::UtxoLookup
27060 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_some(struct LDKUtxoLookup o);
27063 * Constructs a new COption_UtxoLookupZ containing nothing
27065 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_none(void);
27068 * Frees any resources associated with the crate::lightning::routing::utxo::UtxoLookup, if we are in the Some state
27070 void COption_UtxoLookupZ_free(struct LDKCOption_UtxoLookupZ _res);
27073 * Creates a new CResult_NoneLightningErrorZ in the success state.
27075 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
27078 * Creates a new CResult_NoneLightningErrorZ in the error state.
27080 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
27083 * Checks if the given object is currently in the success state
27085 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
27088 * Frees any resources used by the CResult_NoneLightningErrorZ.
27090 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
27093 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
27094 * but with all dynamically-allocated buffers duplicated in new buffers.
27096 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
27099 * Creates a new CResult_boolLightningErrorZ in the success state.
27101 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
27104 * Creates a new CResult_boolLightningErrorZ in the error state.
27106 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
27109 * Checks if the given object is currently in the success state
27111 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
27114 * Frees any resources used by the CResult_boolLightningErrorZ.
27116 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
27119 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
27120 * but with all dynamically-allocated buffers duplicated in new buffers.
27122 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
27125 * Creates a new tuple which has the same data as `orig`
27126 * but with all dynamically-allocated buffers duplicated in new buffers.
27128 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
27131 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
27133 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
27136 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
27138 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
27141 * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
27143 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o);
27146 * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing nothing
27148 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none(void);
27151 * Frees any resources associated with the crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ, if we are in the Some state
27153 void COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
27156 * Creates a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ which has the same data as `orig`
27157 * but with all dynamically-allocated buffers duplicated in new buffers.
27159 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR orig);
27162 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27164 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
27167 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
27169 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
27172 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
27174 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
27177 * Checks if the given object is currently in the success state
27179 bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
27182 * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
27184 void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
27187 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
27188 * but with all dynamically-allocated buffers duplicated in new buffers.
27190 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
27193 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
27195 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
27198 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
27200 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
27203 * Checks if the given object is currently in the success state
27205 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
27208 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
27210 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
27213 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
27214 * but with all dynamically-allocated buffers duplicated in new buffers.
27216 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
27219 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
27221 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
27224 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
27226 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
27229 * Checks if the given object is currently in the success state
27231 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
27234 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
27236 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
27239 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
27240 * but with all dynamically-allocated buffers duplicated in new buffers.
27242 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
27245 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27247 void CVec_SocketAddressZ_free(struct LDKCVec_SocketAddressZ _res);
27250 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
27252 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
27255 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
27257 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
27260 * Checks if the given object is currently in the success state
27262 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
27265 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
27267 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
27270 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
27271 * but with all dynamically-allocated buffers duplicated in new buffers.
27273 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
27276 * Creates a new CResult_NodeAliasDecodeErrorZ in the success state.
27278 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_ok(struct LDKNodeAlias o);
27281 * Creates a new CResult_NodeAliasDecodeErrorZ in the error state.
27283 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_err(struct LDKDecodeError e);
27286 * Checks if the given object is currently in the success state
27288 bool CResult_NodeAliasDecodeErrorZ_is_ok(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR o);
27291 * Frees any resources used by the CResult_NodeAliasDecodeErrorZ.
27293 void CResult_NodeAliasDecodeErrorZ_free(struct LDKCResult_NodeAliasDecodeErrorZ _res);
27296 * Creates a new CResult_NodeAliasDecodeErrorZ which has the same data as `orig`
27297 * but with all dynamically-allocated buffers duplicated in new buffers.
27299 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig);
27302 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
27304 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
27307 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
27309 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
27312 * Checks if the given object is currently in the success state
27314 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
27317 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
27319 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
27322 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
27323 * but with all dynamically-allocated buffers duplicated in new buffers.
27325 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
27328 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
27330 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
27333 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
27335 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
27338 * Checks if the given object is currently in the success state
27340 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
27343 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
27345 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
27348 * Constructs a new COption_CVec_SocketAddressZZ containing a crate::c_types::derived::CVec_SocketAddressZ
27350 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_some(struct LDKCVec_SocketAddressZ o);
27353 * Constructs a new COption_CVec_SocketAddressZZ containing nothing
27355 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_none(void);
27358 * Frees any resources associated with the crate::c_types::derived::CVec_SocketAddressZ, if we are in the Some state
27360 void COption_CVec_SocketAddressZZ_free(struct LDKCOption_CVec_SocketAddressZZ _res);
27363 * Creates a new COption_CVec_SocketAddressZZ which has the same data as `orig`
27364 * but with all dynamically-allocated buffers duplicated in new buffers.
27366 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_clone(const struct LDKCOption_CVec_SocketAddressZZ *NONNULL_PTR orig);
27369 * Creates a new CResult_u64ShortChannelIdErrorZ in the success state.
27371 struct LDKCResult_u64ShortChannelIdErrorZ CResult_u64ShortChannelIdErrorZ_ok(uint64_t o);
27374 * Creates a new CResult_u64ShortChannelIdErrorZ in the error state.
27376 struct LDKCResult_u64ShortChannelIdErrorZ CResult_u64ShortChannelIdErrorZ_err(enum LDKShortChannelIdError e);
27379 * Checks if the given object is currently in the success state
27381 bool CResult_u64ShortChannelIdErrorZ_is_ok(const struct LDKCResult_u64ShortChannelIdErrorZ *NONNULL_PTR o);
27384 * Frees any resources used by the CResult_u64ShortChannelIdErrorZ.
27386 void CResult_u64ShortChannelIdErrorZ_free(struct LDKCResult_u64ShortChannelIdErrorZ _res);
27389 * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ in the success state.
27391 struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ CResult_PendingHTLCInfoInboundHTLCErrZ_ok(struct LDKPendingHTLCInfo o);
27394 * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ in the error state.
27396 struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ CResult_PendingHTLCInfoInboundHTLCErrZ_err(struct LDKInboundHTLCErr e);
27399 * Checks if the given object is currently in the success state
27401 bool CResult_PendingHTLCInfoInboundHTLCErrZ_is_ok(const struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ *NONNULL_PTR o);
27404 * Frees any resources used by the CResult_PendingHTLCInfoInboundHTLCErrZ.
27406 void CResult_PendingHTLCInfoInboundHTLCErrZ_free(struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ _res);
27409 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27411 void CVec_HTLCOutputInCommitmentZ_free(struct LDKCVec_HTLCOutputInCommitmentZ _res);
27414 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27416 void CVec_HTLCDescriptorZ_free(struct LDKCVec_HTLCDescriptorZ _res);
27419 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27421 void CVec_UtxoZ_free(struct LDKCVec_UtxoZ _res);
27424 * Constructs a new COption_TxOutZ containing a crate::c_types::TxOut
27426 struct LDKCOption_TxOutZ COption_TxOutZ_some(struct LDKTxOut o);
27429 * Constructs a new COption_TxOutZ containing nothing
27431 struct LDKCOption_TxOutZ COption_TxOutZ_none(void);
27434 * Frees any resources associated with the crate::c_types::TxOut, if we are in the Some state
27436 void COption_TxOutZ_free(struct LDKCOption_TxOutZ _res);
27439 * Creates a new COption_TxOutZ which has the same data as `orig`
27440 * but with all dynamically-allocated buffers duplicated in new buffers.
27442 struct LDKCOption_TxOutZ COption_TxOutZ_clone(const struct LDKCOption_TxOutZ *NONNULL_PTR orig);
27445 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27447 void CVec_InputZ_free(struct LDKCVec_InputZ _res);
27450 * Creates a new CResult_CoinSelectionNoneZ in the success state.
27452 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_ok(struct LDKCoinSelection o);
27455 * Creates a new CResult_CoinSelectionNoneZ in the error state.
27457 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_err(void);
27460 * Checks if the given object is currently in the success state
27462 bool CResult_CoinSelectionNoneZ_is_ok(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR o);
27465 * Frees any resources used by the CResult_CoinSelectionNoneZ.
27467 void CResult_CoinSelectionNoneZ_free(struct LDKCResult_CoinSelectionNoneZ _res);
27470 * Creates a new CResult_CoinSelectionNoneZ which has the same data as `orig`
27471 * but with all dynamically-allocated buffers duplicated in new buffers.
27473 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_clone(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR orig);
27476 * Creates a new CResult_CVec_UtxoZNoneZ in the success state.
27478 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_ok(struct LDKCVec_UtxoZ o);
27481 * Creates a new CResult_CVec_UtxoZNoneZ in the error state.
27483 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_err(void);
27486 * Checks if the given object is currently in the success state
27488 bool CResult_CVec_UtxoZNoneZ_is_ok(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR o);
27491 * Frees any resources used by the CResult_CVec_UtxoZNoneZ.
27493 void CResult_CVec_UtxoZNoneZ_free(struct LDKCResult_CVec_UtxoZNoneZ _res);
27496 * Creates a new CResult_CVec_UtxoZNoneZ which has the same data as `orig`
27497 * but with all dynamically-allocated buffers duplicated in new buffers.
27499 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_clone(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR orig);
27502 * Constructs a new COption_PaymentContextZ containing a crate::lightning::blinded_path::payment::PaymentContext
27504 struct LDKCOption_PaymentContextZ COption_PaymentContextZ_some(struct LDKPaymentContext o);
27507 * Constructs a new COption_PaymentContextZ containing nothing
27509 struct LDKCOption_PaymentContextZ COption_PaymentContextZ_none(void);
27512 * Frees any resources associated with the crate::lightning::blinded_path::payment::PaymentContext, if we are in the Some state
27514 void COption_PaymentContextZ_free(struct LDKCOption_PaymentContextZ _res);
27517 * Creates a new COption_PaymentContextZ which has the same data as `orig`
27518 * but with all dynamically-allocated buffers duplicated in new buffers.
27520 struct LDKCOption_PaymentContextZ COption_PaymentContextZ_clone(const struct LDKCOption_PaymentContextZ *NONNULL_PTR orig);
27523 * Creates a new tuple which has the same data as `orig`
27524 * but with all dynamically-allocated buffers duplicated in new buffers.
27526 struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_clone(const struct LDKC2Tuple_u64u16Z *NONNULL_PTR orig);
27529 * Creates a new C2Tuple_u64u16Z from the contained elements.
27531 struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_new(uint64_t a, uint16_t b);
27534 * Frees any resources used by the C2Tuple_u64u16Z.
27536 void C2Tuple_u64u16Z_free(struct LDKC2Tuple_u64u16Z _res);
27539 * Constructs a new COption_C2Tuple_u64u16ZZ containing a crate::c_types::derived::C2Tuple_u64u16Z
27541 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_some(struct LDKC2Tuple_u64u16Z o);
27544 * Constructs a new COption_C2Tuple_u64u16ZZ containing nothing
27546 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_none(void);
27549 * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u16Z, if we are in the Some state
27551 void COption_C2Tuple_u64u16ZZ_free(struct LDKCOption_C2Tuple_u64u16ZZ _res);
27554 * Creates a new COption_C2Tuple_u64u16ZZ which has the same data as `orig`
27555 * but with all dynamically-allocated buffers duplicated in new buffers.
27557 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_clone(const struct LDKCOption_C2Tuple_u64u16ZZ *NONNULL_PTR orig);
27560 * Constructs a new COption_ChannelShutdownStateZ containing a crate::lightning::ln::channelmanager::ChannelShutdownState
27562 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_some(enum LDKChannelShutdownState o);
27565 * Constructs a new COption_ChannelShutdownStateZ containing nothing
27567 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_none(void);
27570 * Frees any resources associated with the crate::lightning::ln::channelmanager::ChannelShutdownState, if we are in the Some state
27572 void COption_ChannelShutdownStateZ_free(struct LDKCOption_ChannelShutdownStateZ _res);
27575 * Creates a new COption_ChannelShutdownStateZ which has the same data as `orig`
27576 * but with all dynamically-allocated buffers duplicated in new buffers.
27578 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_clone(const struct LDKCOption_ChannelShutdownStateZ *NONNULL_PTR orig);
27581 * Creates a new CResult_ChannelIdAPIErrorZ in the success state.
27583 struct LDKCResult_ChannelIdAPIErrorZ CResult_ChannelIdAPIErrorZ_ok(struct LDKChannelId o);
27586 * Creates a new CResult_ChannelIdAPIErrorZ in the error state.
27588 struct LDKCResult_ChannelIdAPIErrorZ CResult_ChannelIdAPIErrorZ_err(struct LDKAPIError e);
27591 * Checks if the given object is currently in the success state
27593 bool CResult_ChannelIdAPIErrorZ_is_ok(const struct LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR o);
27596 * Frees any resources used by the CResult_ChannelIdAPIErrorZ.
27598 void CResult_ChannelIdAPIErrorZ_free(struct LDKCResult_ChannelIdAPIErrorZ _res);
27601 * Creates a new CResult_ChannelIdAPIErrorZ which has the same data as `orig`
27602 * but with all dynamically-allocated buffers duplicated in new buffers.
27604 struct LDKCResult_ChannelIdAPIErrorZ CResult_ChannelIdAPIErrorZ_clone(const struct LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR orig);
27607 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27609 void CVec_RecentPaymentDetailsZ_free(struct LDKCVec_RecentPaymentDetailsZ _res);
27612 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
27614 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
27617 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
27619 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
27622 * Checks if the given object is currently in the success state
27624 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
27627 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
27629 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
27632 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
27633 * but with all dynamically-allocated buffers duplicated in new buffers.
27635 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
27638 * Creates a new CResult_NoneRetryableSendFailureZ in the success state.
27640 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_ok(void);
27643 * Creates a new CResult_NoneRetryableSendFailureZ in the error state.
27645 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
27648 * Checks if the given object is currently in the success state
27650 bool CResult_NoneRetryableSendFailureZ_is_ok(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR o);
27653 * Frees any resources used by the CResult_NoneRetryableSendFailureZ.
27655 void CResult_NoneRetryableSendFailureZ_free(struct LDKCResult_NoneRetryableSendFailureZ _res);
27658 * Creates a new CResult_NoneRetryableSendFailureZ which has the same data as `orig`
27659 * but with all dynamically-allocated buffers duplicated in new buffers.
27661 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_clone(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR orig);
27664 * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the success state.
27666 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
27669 * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the error state.
27671 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
27674 * Checks if the given object is currently in the success state
27676 bool CResult_ThirtyTwoBytesPaymentSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR o);
27679 * Frees any resources used by the CResult_ThirtyTwoBytesPaymentSendFailureZ.
27681 void CResult_ThirtyTwoBytesPaymentSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ _res);
27684 * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ which has the same data as `orig`
27685 * but with all dynamically-allocated buffers duplicated in new buffers.
27687 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR orig);
27690 * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ in the success state.
27692 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_ok(struct LDKThirtyTwoBytes o);
27695 * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ in the error state.
27697 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
27700 * Checks if the given object is currently in the success state
27702 bool CResult_ThirtyTwoBytesRetryableSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR o);
27705 * Frees any resources used by the CResult_ThirtyTwoBytesRetryableSendFailureZ.
27707 void CResult_ThirtyTwoBytesRetryableSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ _res);
27710 * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ which has the same data as `orig`
27711 * but with all dynamically-allocated buffers duplicated in new buffers.
27713 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR orig);
27716 * Creates a new tuple which has the same data as `orig`
27717 * but with all dynamically-allocated buffers duplicated in new buffers.
27719 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *NONNULL_PTR orig);
27722 * Creates a new C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ from the contained elements.
27724 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
27727 * Frees any resources used by the C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ.
27729 void C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_free(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ _res);
27732 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the success state.
27734 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o);
27737 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the error state.
27739 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
27742 * Checks if the given object is currently in the success state
27744 bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR o);
27747 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.
27749 void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ _res);
27752 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ which has the same data as `orig`
27753 * but with all dynamically-allocated buffers duplicated in new buffers.
27755 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR orig);
27758 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27760 void CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ _res);
27763 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the success state.
27765 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ o);
27768 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the error state.
27770 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_err(struct LDKProbeSendFailure e);
27773 * Checks if the given object is currently in the success state
27775 bool CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR o);
27778 * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.
27780 void CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ _res);
27783 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ which has the same data as `orig`
27784 * but with all dynamically-allocated buffers duplicated in new buffers.
27786 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR orig);
27789 * Creates a new tuple which has the same data as `orig`
27790 * but with all dynamically-allocated buffers duplicated in new buffers.
27792 struct LDKC2Tuple_ChannelIdPublicKeyZ C2Tuple_ChannelIdPublicKeyZ_clone(const struct LDKC2Tuple_ChannelIdPublicKeyZ *NONNULL_PTR orig);
27795 * Creates a new C2Tuple_ChannelIdPublicKeyZ from the contained elements.
27797 struct LDKC2Tuple_ChannelIdPublicKeyZ C2Tuple_ChannelIdPublicKeyZ_new(struct LDKChannelId a, struct LDKPublicKey b);
27800 * Frees any resources used by the C2Tuple_ChannelIdPublicKeyZ.
27802 void C2Tuple_ChannelIdPublicKeyZ_free(struct LDKC2Tuple_ChannelIdPublicKeyZ _res);
27805 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27807 void CVec_C2Tuple_ChannelIdPublicKeyZZ_free(struct LDKCVec_C2Tuple_ChannelIdPublicKeyZZ _res);
27810 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27812 void CVec_ChannelIdZ_free(struct LDKCVec_ChannelIdZ _res);
27815 * Constructs a new COption_StrZ containing a crate::c_types::Str
27817 struct LDKCOption_StrZ COption_StrZ_some(struct LDKStr o);
27820 * Constructs a new COption_StrZ containing nothing
27822 struct LDKCOption_StrZ COption_StrZ_none(void);
27825 * Frees any resources associated with the crate::c_types::Str, if we are in the Some state
27827 void COption_StrZ_free(struct LDKCOption_StrZ _res);
27830 * Creates a new COption_StrZ which has the same data as `orig`
27831 * but with all dynamically-allocated buffers duplicated in new buffers.
27833 struct LDKCOption_StrZ COption_StrZ_clone(const struct LDKCOption_StrZ *NONNULL_PTR orig);
27836 * Creates a new CResult_NoneBolt12SemanticErrorZ in the success state.
27838 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_ok(void);
27841 * Creates a new CResult_NoneBolt12SemanticErrorZ in the error state.
27843 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
27846 * Checks if the given object is currently in the success state
27848 bool CResult_NoneBolt12SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR o);
27851 * Frees any resources used by the CResult_NoneBolt12SemanticErrorZ.
27853 void CResult_NoneBolt12SemanticErrorZ_free(struct LDKCResult_NoneBolt12SemanticErrorZ _res);
27856 * Creates a new CResult_NoneBolt12SemanticErrorZ which has the same data as `orig`
27857 * but with all dynamically-allocated buffers duplicated in new buffers.
27859 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_clone(const struct LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR orig);
27862 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the success state.
27864 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o);
27867 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the error state.
27869 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_err(void);
27872 * Checks if the given object is currently in the success state
27874 bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR o);
27877 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ.
27879 void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ _res);
27882 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ which has the same data as `orig`
27883 * but with all dynamically-allocated buffers duplicated in new buffers.
27885 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR orig);
27888 * Creates a new CResult_ThirtyTwoBytesAPIErrorZ in the success state.
27890 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
27893 * Creates a new CResult_ThirtyTwoBytesAPIErrorZ in the error state.
27895 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_err(struct LDKAPIError e);
27898 * Checks if the given object is currently in the success state
27900 bool CResult_ThirtyTwoBytesAPIErrorZ_is_ok(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR o);
27903 * Frees any resources used by the CResult_ThirtyTwoBytesAPIErrorZ.
27905 void CResult_ThirtyTwoBytesAPIErrorZ_free(struct LDKCResult_ThirtyTwoBytesAPIErrorZ _res);
27908 * Creates a new CResult_ThirtyTwoBytesAPIErrorZ which has the same data as `orig`
27909 * but with all dynamically-allocated buffers duplicated in new buffers.
27911 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_clone(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR orig);
27914 * Constructs a new COption_OffersMessageZ containing a crate::lightning::onion_message::offers::OffersMessage
27916 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_some(struct LDKOffersMessage o);
27919 * Constructs a new COption_OffersMessageZ containing nothing
27921 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_none(void);
27924 * Frees any resources associated with the crate::lightning::onion_message::offers::OffersMessage, if we are in the Some state
27926 void COption_OffersMessageZ_free(struct LDKCOption_OffersMessageZ _res);
27929 * Creates a new COption_OffersMessageZ which has the same data as `orig`
27930 * but with all dynamically-allocated buffers duplicated in new buffers.
27932 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_clone(const struct LDKCOption_OffersMessageZ *NONNULL_PTR orig);
27935 * Creates a new tuple which has the same data as `orig`
27936 * but with all dynamically-allocated buffers duplicated in new buffers.
27938 struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ C3Tuple_OffersMessageDestinationBlindedPathZ_clone(const struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR orig);
27941 * Creates a new C3Tuple_OffersMessageDestinationBlindedPathZ from the contained elements.
27943 struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ C3Tuple_OffersMessageDestinationBlindedPathZ_new(struct LDKOffersMessage a, struct LDKDestination b, struct LDKBlindedPath c);
27946 * Frees any resources used by the C3Tuple_OffersMessageDestinationBlindedPathZ.
27948 void C3Tuple_OffersMessageDestinationBlindedPathZ_free(struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ _res);
27951 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27953 void CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ _res);
27956 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
27958 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
27961 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
27963 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
27966 * Checks if the given object is currently in the success state
27968 bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
27971 * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
27973 void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
27976 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
27977 * but with all dynamically-allocated buffers duplicated in new buffers.
27979 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
27982 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
27984 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
27987 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
27989 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
27992 * Checks if the given object is currently in the success state
27994 bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
27997 * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
27999 void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
28002 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
28003 * but with all dynamically-allocated buffers duplicated in new buffers.
28005 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
28008 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
28010 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
28013 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
28015 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
28018 * Checks if the given object is currently in the success state
28020 bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
28023 * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
28025 void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
28028 * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
28029 * but with all dynamically-allocated buffers duplicated in new buffers.
28031 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
28034 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
28036 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
28039 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
28041 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
28044 * Checks if the given object is currently in the success state
28046 bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
28049 * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
28051 void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
28054 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ which has the same data as `orig`
28055 * but with all dynamically-allocated buffers duplicated in new buffers.
28057 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig);
28060 * Creates a new CResult_BlindedForwardDecodeErrorZ in the success state.
28062 struct LDKCResult_BlindedForwardDecodeErrorZ CResult_BlindedForwardDecodeErrorZ_ok(struct LDKBlindedForward o);
28065 * Creates a new CResult_BlindedForwardDecodeErrorZ in the error state.
28067 struct LDKCResult_BlindedForwardDecodeErrorZ CResult_BlindedForwardDecodeErrorZ_err(struct LDKDecodeError e);
28070 * Checks if the given object is currently in the success state
28072 bool CResult_BlindedForwardDecodeErrorZ_is_ok(const struct LDKCResult_BlindedForwardDecodeErrorZ *NONNULL_PTR o);
28075 * Frees any resources used by the CResult_BlindedForwardDecodeErrorZ.
28077 void CResult_BlindedForwardDecodeErrorZ_free(struct LDKCResult_BlindedForwardDecodeErrorZ _res);
28080 * Creates a new CResult_BlindedForwardDecodeErrorZ which has the same data as `orig`
28081 * but with all dynamically-allocated buffers duplicated in new buffers.
28083 struct LDKCResult_BlindedForwardDecodeErrorZ CResult_BlindedForwardDecodeErrorZ_clone(const struct LDKCResult_BlindedForwardDecodeErrorZ *NONNULL_PTR orig);
28086 * Creates a new CResult_PendingHTLCRoutingDecodeErrorZ in the success state.
28088 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ CResult_PendingHTLCRoutingDecodeErrorZ_ok(struct LDKPendingHTLCRouting o);
28091 * Creates a new CResult_PendingHTLCRoutingDecodeErrorZ in the error state.
28093 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ CResult_PendingHTLCRoutingDecodeErrorZ_err(struct LDKDecodeError e);
28096 * Checks if the given object is currently in the success state
28098 bool CResult_PendingHTLCRoutingDecodeErrorZ_is_ok(const struct LDKCResult_PendingHTLCRoutingDecodeErrorZ *NONNULL_PTR o);
28101 * Frees any resources used by the CResult_PendingHTLCRoutingDecodeErrorZ.
28103 void CResult_PendingHTLCRoutingDecodeErrorZ_free(struct LDKCResult_PendingHTLCRoutingDecodeErrorZ _res);
28106 * Creates a new CResult_PendingHTLCRoutingDecodeErrorZ which has the same data as `orig`
28107 * but with all dynamically-allocated buffers duplicated in new buffers.
28109 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ CResult_PendingHTLCRoutingDecodeErrorZ_clone(const struct LDKCResult_PendingHTLCRoutingDecodeErrorZ *NONNULL_PTR orig);
28112 * Creates a new CResult_PendingHTLCInfoDecodeErrorZ in the success state.
28114 struct LDKCResult_PendingHTLCInfoDecodeErrorZ CResult_PendingHTLCInfoDecodeErrorZ_ok(struct LDKPendingHTLCInfo o);
28117 * Creates a new CResult_PendingHTLCInfoDecodeErrorZ in the error state.
28119 struct LDKCResult_PendingHTLCInfoDecodeErrorZ CResult_PendingHTLCInfoDecodeErrorZ_err(struct LDKDecodeError e);
28122 * Checks if the given object is currently in the success state
28124 bool CResult_PendingHTLCInfoDecodeErrorZ_is_ok(const struct LDKCResult_PendingHTLCInfoDecodeErrorZ *NONNULL_PTR o);
28127 * Frees any resources used by the CResult_PendingHTLCInfoDecodeErrorZ.
28129 void CResult_PendingHTLCInfoDecodeErrorZ_free(struct LDKCResult_PendingHTLCInfoDecodeErrorZ _res);
28132 * Creates a new CResult_PendingHTLCInfoDecodeErrorZ which has the same data as `orig`
28133 * but with all dynamically-allocated buffers duplicated in new buffers.
28135 struct LDKCResult_PendingHTLCInfoDecodeErrorZ CResult_PendingHTLCInfoDecodeErrorZ_clone(const struct LDKCResult_PendingHTLCInfoDecodeErrorZ *NONNULL_PTR orig);
28138 * Creates a new CResult_BlindedFailureDecodeErrorZ in the success state.
28140 struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_ok(enum LDKBlindedFailure o);
28143 * Creates a new CResult_BlindedFailureDecodeErrorZ in the error state.
28145 struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_err(struct LDKDecodeError e);
28148 * Checks if the given object is currently in the success state
28150 bool CResult_BlindedFailureDecodeErrorZ_is_ok(const struct LDKCResult_BlindedFailureDecodeErrorZ *NONNULL_PTR o);
28153 * Frees any resources used by the CResult_BlindedFailureDecodeErrorZ.
28155 void CResult_BlindedFailureDecodeErrorZ_free(struct LDKCResult_BlindedFailureDecodeErrorZ _res);
28158 * Creates a new CResult_BlindedFailureDecodeErrorZ which has the same data as `orig`
28159 * but with all dynamically-allocated buffers duplicated in new buffers.
28161 struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_clone(const struct LDKCResult_BlindedFailureDecodeErrorZ *NONNULL_PTR orig);
28164 * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the success state.
28166 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_ok(enum LDKChannelShutdownState o);
28169 * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the error state.
28171 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_err(struct LDKDecodeError e);
28174 * Checks if the given object is currently in the success state
28176 bool CResult_ChannelShutdownStateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR o);
28179 * Frees any resources used by the CResult_ChannelShutdownStateDecodeErrorZ.
28181 void CResult_ChannelShutdownStateDecodeErrorZ_free(struct LDKCResult_ChannelShutdownStateDecodeErrorZ _res);
28184 * Creates a new CResult_ChannelShutdownStateDecodeErrorZ which has the same data as `orig`
28185 * but with all dynamically-allocated buffers duplicated in new buffers.
28187 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_clone(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR orig);
28190 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28192 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
28195 * Creates a new C2Tuple_ThirtyTwoBytesChannelManagerZ from the contained elements.
28197 struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ C2Tuple_ThirtyTwoBytesChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
28200 * Frees any resources used by the C2Tuple_ThirtyTwoBytesChannelManagerZ.
28202 void C2Tuple_ThirtyTwoBytesChannelManagerZ_free(struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ _res);
28205 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the success state.
28207 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ o);
28210 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the error state.
28212 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
28215 * Checks if the given object is currently in the success state
28217 bool CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ *NONNULL_PTR o);
28220 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.
28222 void CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ _res);
28225 * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the success state.
28227 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_ok(struct LDKMaxDustHTLCExposure o);
28230 * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the error state.
28232 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_err(struct LDKDecodeError e);
28235 * Checks if the given object is currently in the success state
28237 bool CResult_MaxDustHTLCExposureDecodeErrorZ_is_ok(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR o);
28240 * Frees any resources used by the CResult_MaxDustHTLCExposureDecodeErrorZ.
28242 void CResult_MaxDustHTLCExposureDecodeErrorZ_free(struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ _res);
28245 * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ which has the same data as `orig`
28246 * but with all dynamically-allocated buffers duplicated in new buffers.
28248 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_clone(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR orig);
28251 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
28253 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
28256 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
28258 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
28261 * Checks if the given object is currently in the success state
28263 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
28266 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
28268 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
28271 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
28272 * but with all dynamically-allocated buffers duplicated in new buffers.
28274 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
28277 * Constructs a new COption_MaxDustHTLCExposureZ containing a crate::lightning::util::config::MaxDustHTLCExposure
28279 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_some(struct LDKMaxDustHTLCExposure o);
28282 * Constructs a new COption_MaxDustHTLCExposureZ containing nothing
28284 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_none(void);
28287 * Frees any resources associated with the crate::lightning::util::config::MaxDustHTLCExposure, if we are in the Some state
28289 void COption_MaxDustHTLCExposureZ_free(struct LDKCOption_MaxDustHTLCExposureZ _res);
28292 * Creates a new COption_MaxDustHTLCExposureZ which has the same data as `orig`
28293 * but with all dynamically-allocated buffers duplicated in new buffers.
28295 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_clone(const struct LDKCOption_MaxDustHTLCExposureZ *NONNULL_PTR orig);
28298 * Constructs a new COption_APIErrorZ containing a crate::lightning::util::errors::APIError
28300 struct LDKCOption_APIErrorZ COption_APIErrorZ_some(struct LDKAPIError o);
28303 * Constructs a new COption_APIErrorZ containing nothing
28305 struct LDKCOption_APIErrorZ COption_APIErrorZ_none(void);
28308 * Frees any resources associated with the crate::lightning::util::errors::APIError, if we are in the Some state
28310 void COption_APIErrorZ_free(struct LDKCOption_APIErrorZ _res);
28313 * Creates a new COption_APIErrorZ which has the same data as `orig`
28314 * but with all dynamically-allocated buffers duplicated in new buffers.
28316 struct LDKCOption_APIErrorZ COption_APIErrorZ_clone(const struct LDKCOption_APIErrorZ *NONNULL_PTR orig);
28319 * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the success state.
28321 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_ok(struct LDKCOption_APIErrorZ o);
28324 * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the error state.
28326 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_err(struct LDKDecodeError e);
28329 * Checks if the given object is currently in the success state
28331 bool CResult_COption_APIErrorZDecodeErrorZ_is_ok(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR o);
28334 * Frees any resources used by the CResult_COption_APIErrorZDecodeErrorZ.
28336 void CResult_COption_APIErrorZDecodeErrorZ_free(struct LDKCResult_COption_APIErrorZDecodeErrorZ _res);
28339 * Creates a new CResult_COption_APIErrorZDecodeErrorZ which has the same data as `orig`
28340 * but with all dynamically-allocated buffers duplicated in new buffers.
28342 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_clone(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR orig);
28345 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
28347 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
28350 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
28352 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
28355 * Checks if the given object is currently in the success state
28357 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
28360 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
28362 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
28365 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
28366 * but with all dynamically-allocated buffers duplicated in new buffers.
28368 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
28371 * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
28373 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
28376 * Constructs a new COption_MonitorEventZ containing nothing
28378 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
28381 * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
28383 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
28386 * Creates a new COption_MonitorEventZ which has the same data as `orig`
28387 * but with all dynamically-allocated buffers duplicated in new buffers.
28389 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
28392 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
28394 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
28397 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
28399 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
28402 * Checks if the given object is currently in the success state
28404 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
28407 * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
28409 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
28412 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
28413 * but with all dynamically-allocated buffers duplicated in new buffers.
28415 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
28418 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
28420 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
28423 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
28425 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
28428 * Checks if the given object is currently in the success state
28430 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
28433 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
28435 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
28438 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
28439 * but with all dynamically-allocated buffers duplicated in new buffers.
28441 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
28444 * Creates a new tuple which has the same data as `orig`
28445 * but with all dynamically-allocated buffers duplicated in new buffers.
28447 struct LDKC2Tuple_OutPointCVec_u8ZZ C2Tuple_OutPointCVec_u8ZZ_clone(const struct LDKC2Tuple_OutPointCVec_u8ZZ *NONNULL_PTR orig);
28450 * Creates a new C2Tuple_OutPointCVec_u8ZZ from the contained elements.
28452 struct LDKC2Tuple_OutPointCVec_u8ZZ C2Tuple_OutPointCVec_u8ZZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
28455 * Frees any resources used by the C2Tuple_OutPointCVec_u8ZZ.
28457 void C2Tuple_OutPointCVec_u8ZZ_free(struct LDKC2Tuple_OutPointCVec_u8ZZ _res);
28460 * Creates a new tuple which has the same data as `orig`
28461 * but with all dynamically-allocated buffers duplicated in new buffers.
28463 struct LDKC2Tuple_u32CVec_u8ZZ C2Tuple_u32CVec_u8ZZ_clone(const struct LDKC2Tuple_u32CVec_u8ZZ *NONNULL_PTR orig);
28466 * Creates a new C2Tuple_u32CVec_u8ZZ from the contained elements.
28468 struct LDKC2Tuple_u32CVec_u8ZZ C2Tuple_u32CVec_u8ZZ_new(uint32_t a, struct LDKCVec_u8Z b);
28471 * Frees any resources used by the C2Tuple_u32CVec_u8ZZ.
28473 void C2Tuple_u32CVec_u8ZZ_free(struct LDKC2Tuple_u32CVec_u8ZZ _res);
28476 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28478 void CVec_C2Tuple_u32CVec_u8ZZZ_free(struct LDKCVec_C2Tuple_u32CVec_u8ZZZ _res);
28481 * Creates a new tuple which has the same data as `orig`
28482 * but with all dynamically-allocated buffers duplicated in new buffers.
28484 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *NONNULL_PTR orig);
28487 * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ from the contained elements.
28489 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32CVec_u8ZZZ b);
28492 * Frees any resources used by the C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ.
28494 void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ _res);
28497 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28499 void CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ _res);
28502 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28504 void CVec_CommitmentTransactionZ_free(struct LDKCVec_CommitmentTransactionZ _res);
28507 * Creates a new tuple which has the same data as `orig`
28508 * but with all dynamically-allocated buffers duplicated in new buffers.
28510 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
28513 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
28515 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
28518 * Frees any resources used by the C2Tuple_u32TxOutZ.
28520 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
28523 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28525 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
28528 * Creates a new tuple which has the same data as `orig`
28529 * but with all dynamically-allocated buffers duplicated in new buffers.
28531 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
28534 * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ from the contained elements.
28536 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
28539 * Frees any resources used by the C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ.
28541 void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ _res);
28544 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28546 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
28549 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28551 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
28554 * Creates a new tuple which has the same data as `orig`
28555 * but with all dynamically-allocated buffers duplicated in new buffers.
28557 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *NONNULL_PTR orig);
28560 * Creates a new C2Tuple_ThirtyTwoBytesChannelMonitorZ from the contained elements.
28562 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
28565 * Frees any resources used by the C2Tuple_ThirtyTwoBytesChannelMonitorZ.
28567 void C2Tuple_ThirtyTwoBytesChannelMonitorZ_free(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ _res);
28570 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the success state.
28572 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ o);
28575 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the error state.
28577 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
28580 * Checks if the given object is currently in the success state
28582 bool CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
28585 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.
28587 void CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ _res);
28590 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ which has the same data as `orig`
28591 * but with all dynamically-allocated buffers duplicated in new buffers.
28593 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ *NONNULL_PTR orig);
28596 * Creates a new tuple which has the same data as `orig`
28597 * but with all dynamically-allocated buffers duplicated in new buffers.
28599 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_clone(const struct LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR orig);
28602 * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
28604 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
28607 * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
28609 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
28612 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28614 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
28617 * Creates a new tuple which has the same data as `orig`
28618 * but with all dynamically-allocated buffers duplicated in new buffers.
28620 struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(const struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR orig);
28623 * Creates a new C2Tuple_PublicKeyCVec_SocketAddressZZ from the contained elements.
28625 struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ C2Tuple_PublicKeyCVec_SocketAddressZZ_new(struct LDKPublicKey a, struct LDKCVec_SocketAddressZ b);
28628 * Frees any resources used by the C2Tuple_PublicKeyCVec_SocketAddressZZ.
28630 void C2Tuple_PublicKeyCVec_SocketAddressZZ_free(struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ _res);
28633 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28635 void CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_free(struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ _res);
28638 * Constructs a new COption_OnionMessageContentsZ containing a crate::lightning::onion_message::packet::OnionMessageContents
28640 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_some(struct LDKOnionMessageContents o);
28643 * Constructs a new COption_OnionMessageContentsZ containing nothing
28645 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_none(void);
28648 * Frees any resources associated with the crate::lightning::onion_message::packet::OnionMessageContents, if we are in the Some state
28650 void COption_OnionMessageContentsZ_free(struct LDKCOption_OnionMessageContentsZ _res);
28653 * Creates a new COption_OnionMessageContentsZ which has the same data as `orig`
28654 * but with all dynamically-allocated buffers duplicated in new buffers.
28656 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_clone(const struct LDKCOption_OnionMessageContentsZ *NONNULL_PTR orig);
28659 * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ in the success state.
28661 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_ok(struct LDKCOption_OnionMessageContentsZ o);
28664 * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ in the error state.
28666 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_err(struct LDKDecodeError e);
28669 * Checks if the given object is currently in the success state
28671 bool CResult_COption_OnionMessageContentsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR o);
28674 * Frees any resources used by the CResult_COption_OnionMessageContentsZDecodeErrorZ.
28676 void CResult_COption_OnionMessageContentsZDecodeErrorZ_free(struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ _res);
28679 * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ which has the same data as `orig`
28680 * but with all dynamically-allocated buffers duplicated in new buffers.
28682 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_clone(const struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR orig);
28685 * Creates a new tuple which has the same data as `orig`
28686 * but with all dynamically-allocated buffers duplicated in new buffers.
28688 struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(const struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR orig);
28691 * Creates a new C3Tuple_OnionMessageContentsDestinationBlindedPathZ from the contained elements.
28693 struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(struct LDKOnionMessageContents a, struct LDKDestination b, struct LDKBlindedPath c);
28696 * Frees any resources used by the C3Tuple_OnionMessageContentsDestinationBlindedPathZ.
28698 void C3Tuple_OnionMessageContentsDestinationBlindedPathZ_free(struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ _res);
28701 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28703 void CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_free(struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ _res);
28706 * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
28708 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
28711 * Constructs a new COption_TypeZ containing nothing
28713 struct LDKCOption_TypeZ COption_TypeZ_none(void);
28716 * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
28718 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
28721 * Creates a new COption_TypeZ which has the same data as `orig`
28722 * but with all dynamically-allocated buffers duplicated in new buffers.
28724 struct LDKCOption_TypeZ COption_TypeZ_clone(const struct LDKCOption_TypeZ *NONNULL_PTR orig);
28727 * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
28729 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
28732 * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
28734 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
28737 * Checks if the given object is currently in the success state
28739 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
28742 * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
28744 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
28747 * Creates a new CResult_COption_TypeZDecodeErrorZ which has the same data as `orig`
28748 * but with all dynamically-allocated buffers duplicated in new buffers.
28750 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_clone(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR orig);
28753 * Constructs a new COption_SocketAddressZ containing a crate::lightning::ln::msgs::SocketAddress
28755 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_some(struct LDKSocketAddress o);
28758 * Constructs a new COption_SocketAddressZ containing nothing
28760 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_none(void);
28763 * Frees any resources associated with the crate::lightning::ln::msgs::SocketAddress, if we are in the Some state
28765 void COption_SocketAddressZ_free(struct LDKCOption_SocketAddressZ _res);
28768 * Creates a new COption_SocketAddressZ which has the same data as `orig`
28769 * but with all dynamically-allocated buffers duplicated in new buffers.
28771 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_clone(const struct LDKCOption_SocketAddressZ *NONNULL_PTR orig);
28774 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28776 void CVec_PeerDetailsZ_free(struct LDKCVec_PeerDetailsZ _res);
28779 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
28781 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
28784 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
28786 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
28789 * Checks if the given object is currently in the success state
28791 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
28794 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
28796 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
28799 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
28800 * but with all dynamically-allocated buffers duplicated in new buffers.
28802 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
28805 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
28807 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
28810 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
28812 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
28815 * Checks if the given object is currently in the success state
28817 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
28820 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
28822 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
28825 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
28826 * but with all dynamically-allocated buffers duplicated in new buffers.
28828 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
28831 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
28833 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
28836 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
28838 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
28841 * Checks if the given object is currently in the success state
28843 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
28846 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
28848 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
28851 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
28852 * but with all dynamically-allocated buffers duplicated in new buffers.
28854 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
28857 * Creates a new CResult_u32GraphSyncErrorZ in the success state.
28859 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o);
28862 * Creates a new CResult_u32GraphSyncErrorZ in the error state.
28864 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e);
28867 * Checks if the given object is currently in the success state
28869 bool CResult_u32GraphSyncErrorZ_is_ok(const struct LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR o);
28872 * Frees any resources used by the CResult_u32GraphSyncErrorZ.
28874 void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res);
28877 * Creates a new CResult_CVec_u8ZIOErrorZ in the success state.
28879 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_ok(struct LDKCVec_u8Z o);
28882 * Creates a new CResult_CVec_u8ZIOErrorZ in the error state.
28884 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_err(enum LDKIOError e);
28887 * Checks if the given object is currently in the success state
28889 bool CResult_CVec_u8ZIOErrorZ_is_ok(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR o);
28892 * Frees any resources used by the CResult_CVec_u8ZIOErrorZ.
28894 void CResult_CVec_u8ZIOErrorZ_free(struct LDKCResult_CVec_u8ZIOErrorZ _res);
28897 * Creates a new CResult_CVec_u8ZIOErrorZ which has the same data as `orig`
28898 * but with all dynamically-allocated buffers duplicated in new buffers.
28900 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_clone(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR orig);
28903 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28905 void CVec_StrZ_free(struct LDKCVec_StrZ _res);
28908 * Creates a new CResult_CVec_StrZIOErrorZ in the success state.
28910 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_ok(struct LDKCVec_StrZ o);
28913 * Creates a new CResult_CVec_StrZIOErrorZ in the error state.
28915 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_err(enum LDKIOError e);
28918 * Checks if the given object is currently in the success state
28920 bool CResult_CVec_StrZIOErrorZ_is_ok(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR o);
28923 * Frees any resources used by the CResult_CVec_StrZIOErrorZ.
28925 void CResult_CVec_StrZIOErrorZ_free(struct LDKCResult_CVec_StrZIOErrorZ _res);
28928 * Creates a new CResult_CVec_StrZIOErrorZ which has the same data as `orig`
28929 * but with all dynamically-allocated buffers duplicated in new buffers.
28931 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_clone(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR orig);
28934 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28936 void CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ _res);
28939 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the success state.
28941 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ o);
28944 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the error state.
28946 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_err(enum LDKIOError e);
28949 * Checks if the given object is currently in the success state
28951 bool CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR o);
28954 * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ.
28956 void CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ _res);
28959 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ which has the same data as `orig`
28960 * but with all dynamically-allocated buffers duplicated in new buffers.
28962 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR orig);
28965 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the success state.
28967 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ o);
28970 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the error state.
28972 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_err(enum LDKIOError e);
28975 * Checks if the given object is currently in the success state
28977 bool CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR o);
28980 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ.
28982 void CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ _res);
28985 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ which has the same data as `orig`
28986 * but with all dynamically-allocated buffers duplicated in new buffers.
28988 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR orig);
28991 * Creates a new CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ in the success state.
28993 struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_ok(struct LDKUnsignedInvoiceRequest o);
28996 * Creates a new CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ in the error state.
28998 struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
29001 * Checks if the given object is currently in the success state
29003 bool CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok(const struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR o);
29006 * Frees any resources used by the CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ.
29008 void CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_free(struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ _res);
29011 * Creates a new CResult_InvoiceRequestBolt12SemanticErrorZ in the success state.
29013 struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_ok(struct LDKInvoiceRequest o);
29016 * Creates a new CResult_InvoiceRequestBolt12SemanticErrorZ in the error state.
29018 struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
29021 * Checks if the given object is currently in the success state
29023 bool CResult_InvoiceRequestBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR o);
29026 * Frees any resources used by the CResult_InvoiceRequestBolt12SemanticErrorZ.
29028 void CResult_InvoiceRequestBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ _res);
29031 * Creates a new CResult_InvoiceRequestBolt12SemanticErrorZ which has the same data as `orig`
29032 * but with all dynamically-allocated buffers duplicated in new buffers.
29034 struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_clone(const struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR orig);
29037 * Constructs a new COption_SecretKeyZ containing a crate::c_types::SecretKey
29039 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_some(struct LDKSecretKey o);
29042 * Constructs a new COption_SecretKeyZ containing nothing
29044 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_none(void);
29047 * Frees any resources associated with the crate::c_types::SecretKey, if we are in the Some state
29049 void COption_SecretKeyZ_free(struct LDKCOption_SecretKeyZ _res);
29052 * Creates a new COption_SecretKeyZ which has the same data as `orig`
29053 * but with all dynamically-allocated buffers duplicated in new buffers.
29055 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_clone(const struct LDKCOption_SecretKeyZ *NONNULL_PTR orig);
29058 * Creates a new CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ in the success state.
29060 struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceWithExplicitSigningPubkeyBuilder o);
29063 * Creates a new CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ in the error state.
29065 struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
29068 * Checks if the given object is currently in the success state
29070 bool CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
29073 * Frees any resources used by the CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ.
29075 void CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ _res);
29078 * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the success state.
29080 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_ok(struct LDKVerifiedInvoiceRequest o);
29083 * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the error state.
29085 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_err(void);
29088 * Checks if the given object is currently in the success state
29090 bool CResult_VerifiedInvoiceRequestNoneZ_is_ok(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR o);
29093 * Frees any resources used by the CResult_VerifiedInvoiceRequestNoneZ.
29095 void CResult_VerifiedInvoiceRequestNoneZ_free(struct LDKCResult_VerifiedInvoiceRequestNoneZ _res);
29098 * Creates a new CResult_VerifiedInvoiceRequestNoneZ which has the same data as `orig`
29099 * but with all dynamically-allocated buffers duplicated in new buffers.
29101 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_clone(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR orig);
29104 * Creates a new CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ in the success state.
29106 struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceWithDerivedSigningPubkeyBuilder o);
29109 * Creates a new CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ in the error state.
29111 struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
29114 * Checks if the given object is currently in the success state
29116 bool CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
29119 * Frees any resources used by the CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ.
29121 void CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ _res);
29124 * Creates a new CResult_InvoiceRequestFieldsDecodeErrorZ in the success state.
29126 struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ CResult_InvoiceRequestFieldsDecodeErrorZ_ok(struct LDKInvoiceRequestFields o);
29129 * Creates a new CResult_InvoiceRequestFieldsDecodeErrorZ in the error state.
29131 struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ CResult_InvoiceRequestFieldsDecodeErrorZ_err(struct LDKDecodeError e);
29134 * Checks if the given object is currently in the success state
29136 bool CResult_InvoiceRequestFieldsDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR o);
29139 * Frees any resources used by the CResult_InvoiceRequestFieldsDecodeErrorZ.
29141 void CResult_InvoiceRequestFieldsDecodeErrorZ_free(struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ _res);
29144 * Creates a new CResult_InvoiceRequestFieldsDecodeErrorZ which has the same data as `orig`
29145 * but with all dynamically-allocated buffers duplicated in new buffers.
29147 struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ CResult_InvoiceRequestFieldsDecodeErrorZ_clone(const struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR orig);
29150 * Constructs a new COption_NoneZ containing a
29152 enum LDKCOption_NoneZ COption_NoneZ_some(void);
29155 * Constructs a new COption_NoneZ containing nothing
29157 enum LDKCOption_NoneZ COption_NoneZ_none(void);
29160 * Frees any resources associated with the , if we are in the Some state
29162 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
29165 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29167 void CVec_WitnessZ_free(struct LDKCVec_WitnessZ _res);
29170 * Constructs a new COption_ECDSASignatureZ containing a crate::c_types::ECDSASignature
29172 struct LDKCOption_ECDSASignatureZ COption_ECDSASignatureZ_some(struct LDKECDSASignature o);
29175 * Constructs a new COption_ECDSASignatureZ containing nothing
29177 struct LDKCOption_ECDSASignatureZ COption_ECDSASignatureZ_none(void);
29180 * Frees any resources associated with the crate::c_types::ECDSASignature, if we are in the Some state
29182 void COption_ECDSASignatureZ_free(struct LDKCOption_ECDSASignatureZ _res);
29185 * Creates a new COption_ECDSASignatureZ which has the same data as `orig`
29186 * but with all dynamically-allocated buffers duplicated in new buffers.
29188 struct LDKCOption_ECDSASignatureZ COption_ECDSASignatureZ_clone(const struct LDKCOption_ECDSASignatureZ *NONNULL_PTR orig);
29191 * Constructs a new COption_i64Z containing a i64
29193 struct LDKCOption_i64Z COption_i64Z_some(int64_t o);
29196 * Constructs a new COption_i64Z containing nothing
29198 struct LDKCOption_i64Z COption_i64Z_none(void);
29201 * Frees any resources associated with the i64, if we are in the Some state
29203 void COption_i64Z_free(struct LDKCOption_i64Z _res);
29206 * Creates a new COption_i64Z which has the same data as `orig`
29207 * but with all dynamically-allocated buffers duplicated in new buffers.
29209 struct LDKCOption_i64Z COption_i64Z_clone(const struct LDKCOption_i64Z *NONNULL_PTR orig);
29212 * Creates a new CResult_SocketAddressDecodeErrorZ in the success state.
29214 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_ok(struct LDKSocketAddress o);
29217 * Creates a new CResult_SocketAddressDecodeErrorZ in the error state.
29219 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_err(struct LDKDecodeError e);
29222 * Checks if the given object is currently in the success state
29224 bool CResult_SocketAddressDecodeErrorZ_is_ok(const struct LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR o);
29227 * Frees any resources used by the CResult_SocketAddressDecodeErrorZ.
29229 void CResult_SocketAddressDecodeErrorZ_free(struct LDKCResult_SocketAddressDecodeErrorZ _res);
29232 * Creates a new CResult_SocketAddressDecodeErrorZ which has the same data as `orig`
29233 * but with all dynamically-allocated buffers duplicated in new buffers.
29235 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_clone(const struct LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR orig);
29238 * Creates a new CResult_SocketAddressSocketAddressParseErrorZ in the success state.
29240 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_ok(struct LDKSocketAddress o);
29243 * Creates a new CResult_SocketAddressSocketAddressParseErrorZ in the error state.
29245 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_err(enum LDKSocketAddressParseError e);
29248 * Checks if the given object is currently in the success state
29250 bool CResult_SocketAddressSocketAddressParseErrorZ_is_ok(const struct LDKCResult_SocketAddressSocketAddressParseErrorZ *NONNULL_PTR o);
29253 * Frees any resources used by the CResult_SocketAddressSocketAddressParseErrorZ.
29255 void CResult_SocketAddressSocketAddressParseErrorZ_free(struct LDKCResult_SocketAddressSocketAddressParseErrorZ _res);
29258 * Creates a new CResult_SocketAddressSocketAddressParseErrorZ which has the same data as `orig`
29259 * but with all dynamically-allocated buffers duplicated in new buffers.
29261 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_clone(const struct LDKCResult_SocketAddressSocketAddressParseErrorZ *NONNULL_PTR orig);
29264 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29266 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
29269 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29271 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
29274 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29276 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
29279 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29281 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
29284 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
29286 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
29289 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
29291 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
29294 * Checks if the given object is currently in the success state
29296 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
29299 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
29301 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
29304 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
29305 * but with all dynamically-allocated buffers duplicated in new buffers.
29307 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
29310 * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the success state.
29312 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_ok(struct LDKAcceptChannelV2 o);
29315 * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the error state.
29317 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
29320 * Checks if the given object is currently in the success state
29322 bool CResult_AcceptChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR o);
29325 * Frees any resources used by the CResult_AcceptChannelV2DecodeErrorZ.
29327 void CResult_AcceptChannelV2DecodeErrorZ_free(struct LDKCResult_AcceptChannelV2DecodeErrorZ _res);
29330 * Creates a new CResult_AcceptChannelV2DecodeErrorZ which has the same data as `orig`
29331 * but with all dynamically-allocated buffers duplicated in new buffers.
29333 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_clone(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR orig);
29336 * Creates a new CResult_StfuDecodeErrorZ in the success state.
29338 struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_ok(struct LDKStfu o);
29341 * Creates a new CResult_StfuDecodeErrorZ in the error state.
29343 struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_err(struct LDKDecodeError e);
29346 * Checks if the given object is currently in the success state
29348 bool CResult_StfuDecodeErrorZ_is_ok(const struct LDKCResult_StfuDecodeErrorZ *NONNULL_PTR o);
29351 * Frees any resources used by the CResult_StfuDecodeErrorZ.
29353 void CResult_StfuDecodeErrorZ_free(struct LDKCResult_StfuDecodeErrorZ _res);
29356 * Creates a new CResult_StfuDecodeErrorZ which has the same data as `orig`
29357 * but with all dynamically-allocated buffers duplicated in new buffers.
29359 struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_clone(const struct LDKCResult_StfuDecodeErrorZ *NONNULL_PTR orig);
29362 * Creates a new CResult_SpliceDecodeErrorZ in the success state.
29364 struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_ok(struct LDKSplice o);
29367 * Creates a new CResult_SpliceDecodeErrorZ in the error state.
29369 struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_err(struct LDKDecodeError e);
29372 * Checks if the given object is currently in the success state
29374 bool CResult_SpliceDecodeErrorZ_is_ok(const struct LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR o);
29377 * Frees any resources used by the CResult_SpliceDecodeErrorZ.
29379 void CResult_SpliceDecodeErrorZ_free(struct LDKCResult_SpliceDecodeErrorZ _res);
29382 * Creates a new CResult_SpliceDecodeErrorZ which has the same data as `orig`
29383 * but with all dynamically-allocated buffers duplicated in new buffers.
29385 struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_clone(const struct LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR orig);
29388 * Creates a new CResult_SpliceAckDecodeErrorZ in the success state.
29390 struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_ok(struct LDKSpliceAck o);
29393 * Creates a new CResult_SpliceAckDecodeErrorZ in the error state.
29395 struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_err(struct LDKDecodeError e);
29398 * Checks if the given object is currently in the success state
29400 bool CResult_SpliceAckDecodeErrorZ_is_ok(const struct LDKCResult_SpliceAckDecodeErrorZ *NONNULL_PTR o);
29403 * Frees any resources used by the CResult_SpliceAckDecodeErrorZ.
29405 void CResult_SpliceAckDecodeErrorZ_free(struct LDKCResult_SpliceAckDecodeErrorZ _res);
29408 * Creates a new CResult_SpliceAckDecodeErrorZ which has the same data as `orig`
29409 * but with all dynamically-allocated buffers duplicated in new buffers.
29411 struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_clone(const struct LDKCResult_SpliceAckDecodeErrorZ *NONNULL_PTR orig);
29414 * Creates a new CResult_SpliceLockedDecodeErrorZ in the success state.
29416 struct LDKCResult_SpliceLockedDecodeErrorZ CResult_SpliceLockedDecodeErrorZ_ok(struct LDKSpliceLocked o);
29419 * Creates a new CResult_SpliceLockedDecodeErrorZ in the error state.
29421 struct LDKCResult_SpliceLockedDecodeErrorZ CResult_SpliceLockedDecodeErrorZ_err(struct LDKDecodeError e);
29424 * Checks if the given object is currently in the success state
29426 bool CResult_SpliceLockedDecodeErrorZ_is_ok(const struct LDKCResult_SpliceLockedDecodeErrorZ *NONNULL_PTR o);
29429 * Frees any resources used by the CResult_SpliceLockedDecodeErrorZ.
29431 void CResult_SpliceLockedDecodeErrorZ_free(struct LDKCResult_SpliceLockedDecodeErrorZ _res);
29434 * Creates a new CResult_SpliceLockedDecodeErrorZ which has the same data as `orig`
29435 * but with all dynamically-allocated buffers duplicated in new buffers.
29437 struct LDKCResult_SpliceLockedDecodeErrorZ CResult_SpliceLockedDecodeErrorZ_clone(const struct LDKCResult_SpliceLockedDecodeErrorZ *NONNULL_PTR orig);
29440 * Creates a new CResult_TxAddInputDecodeErrorZ in the success state.
29442 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_ok(struct LDKTxAddInput o);
29445 * Creates a new CResult_TxAddInputDecodeErrorZ in the error state.
29447 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_err(struct LDKDecodeError e);
29450 * Checks if the given object is currently in the success state
29452 bool CResult_TxAddInputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR o);
29455 * Frees any resources used by the CResult_TxAddInputDecodeErrorZ.
29457 void CResult_TxAddInputDecodeErrorZ_free(struct LDKCResult_TxAddInputDecodeErrorZ _res);
29460 * Creates a new CResult_TxAddInputDecodeErrorZ which has the same data as `orig`
29461 * but with all dynamically-allocated buffers duplicated in new buffers.
29463 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_clone(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR orig);
29466 * Creates a new CResult_TxAddOutputDecodeErrorZ in the success state.
29468 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_ok(struct LDKTxAddOutput o);
29471 * Creates a new CResult_TxAddOutputDecodeErrorZ in the error state.
29473 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_err(struct LDKDecodeError e);
29476 * Checks if the given object is currently in the success state
29478 bool CResult_TxAddOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR o);
29481 * Frees any resources used by the CResult_TxAddOutputDecodeErrorZ.
29483 void CResult_TxAddOutputDecodeErrorZ_free(struct LDKCResult_TxAddOutputDecodeErrorZ _res);
29486 * Creates a new CResult_TxAddOutputDecodeErrorZ which has the same data as `orig`
29487 * but with all dynamically-allocated buffers duplicated in new buffers.
29489 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_clone(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR orig);
29492 * Creates a new CResult_TxRemoveInputDecodeErrorZ in the success state.
29494 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_ok(struct LDKTxRemoveInput o);
29497 * Creates a new CResult_TxRemoveInputDecodeErrorZ in the error state.
29499 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_err(struct LDKDecodeError e);
29502 * Checks if the given object is currently in the success state
29504 bool CResult_TxRemoveInputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR o);
29507 * Frees any resources used by the CResult_TxRemoveInputDecodeErrorZ.
29509 void CResult_TxRemoveInputDecodeErrorZ_free(struct LDKCResult_TxRemoveInputDecodeErrorZ _res);
29512 * Creates a new CResult_TxRemoveInputDecodeErrorZ which has the same data as `orig`
29513 * but with all dynamically-allocated buffers duplicated in new buffers.
29515 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR orig);
29518 * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the success state.
29520 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_ok(struct LDKTxRemoveOutput o);
29523 * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the error state.
29525 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_err(struct LDKDecodeError e);
29528 * Checks if the given object is currently in the success state
29530 bool CResult_TxRemoveOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR o);
29533 * Frees any resources used by the CResult_TxRemoveOutputDecodeErrorZ.
29535 void CResult_TxRemoveOutputDecodeErrorZ_free(struct LDKCResult_TxRemoveOutputDecodeErrorZ _res);
29538 * Creates a new CResult_TxRemoveOutputDecodeErrorZ which has the same data as `orig`
29539 * but with all dynamically-allocated buffers duplicated in new buffers.
29541 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR orig);
29544 * Creates a new CResult_TxCompleteDecodeErrorZ in the success state.
29546 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_ok(struct LDKTxComplete o);
29549 * Creates a new CResult_TxCompleteDecodeErrorZ in the error state.
29551 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_err(struct LDKDecodeError e);
29554 * Checks if the given object is currently in the success state
29556 bool CResult_TxCompleteDecodeErrorZ_is_ok(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR o);
29559 * Frees any resources used by the CResult_TxCompleteDecodeErrorZ.
29561 void CResult_TxCompleteDecodeErrorZ_free(struct LDKCResult_TxCompleteDecodeErrorZ _res);
29564 * Creates a new CResult_TxCompleteDecodeErrorZ which has the same data as `orig`
29565 * but with all dynamically-allocated buffers duplicated in new buffers.
29567 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_clone(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR orig);
29570 * Creates a new CResult_TxSignaturesDecodeErrorZ in the success state.
29572 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_ok(struct LDKTxSignatures o);
29575 * Creates a new CResult_TxSignaturesDecodeErrorZ in the error state.
29577 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
29580 * Checks if the given object is currently in the success state
29582 bool CResult_TxSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR o);
29585 * Frees any resources used by the CResult_TxSignaturesDecodeErrorZ.
29587 void CResult_TxSignaturesDecodeErrorZ_free(struct LDKCResult_TxSignaturesDecodeErrorZ _res);
29590 * Creates a new CResult_TxSignaturesDecodeErrorZ which has the same data as `orig`
29591 * but with all dynamically-allocated buffers duplicated in new buffers.
29593 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_clone(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR orig);
29596 * Creates a new CResult_TxInitRbfDecodeErrorZ in the success state.
29598 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_ok(struct LDKTxInitRbf o);
29601 * Creates a new CResult_TxInitRbfDecodeErrorZ in the error state.
29603 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_err(struct LDKDecodeError e);
29606 * Checks if the given object is currently in the success state
29608 bool CResult_TxInitRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR o);
29611 * Frees any resources used by the CResult_TxInitRbfDecodeErrorZ.
29613 void CResult_TxInitRbfDecodeErrorZ_free(struct LDKCResult_TxInitRbfDecodeErrorZ _res);
29616 * Creates a new CResult_TxInitRbfDecodeErrorZ which has the same data as `orig`
29617 * but with all dynamically-allocated buffers duplicated in new buffers.
29619 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_clone(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR orig);
29622 * Creates a new CResult_TxAckRbfDecodeErrorZ in the success state.
29624 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_ok(struct LDKTxAckRbf o);
29627 * Creates a new CResult_TxAckRbfDecodeErrorZ in the error state.
29629 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_err(struct LDKDecodeError e);
29632 * Checks if the given object is currently in the success state
29634 bool CResult_TxAckRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR o);
29637 * Frees any resources used by the CResult_TxAckRbfDecodeErrorZ.
29639 void CResult_TxAckRbfDecodeErrorZ_free(struct LDKCResult_TxAckRbfDecodeErrorZ _res);
29642 * Creates a new CResult_TxAckRbfDecodeErrorZ which has the same data as `orig`
29643 * but with all dynamically-allocated buffers duplicated in new buffers.
29645 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_clone(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR orig);
29648 * Creates a new CResult_TxAbortDecodeErrorZ in the success state.
29650 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_ok(struct LDKTxAbort o);
29653 * Creates a new CResult_TxAbortDecodeErrorZ in the error state.
29655 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_err(struct LDKDecodeError e);
29658 * Checks if the given object is currently in the success state
29660 bool CResult_TxAbortDecodeErrorZ_is_ok(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR o);
29663 * Frees any resources used by the CResult_TxAbortDecodeErrorZ.
29665 void CResult_TxAbortDecodeErrorZ_free(struct LDKCResult_TxAbortDecodeErrorZ _res);
29668 * Creates a new CResult_TxAbortDecodeErrorZ which has the same data as `orig`
29669 * but with all dynamically-allocated buffers duplicated in new buffers.
29671 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_clone(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR orig);
29674 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
29676 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
29679 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
29681 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
29684 * Checks if the given object is currently in the success state
29686 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
29689 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
29691 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
29694 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
29695 * but with all dynamically-allocated buffers duplicated in new buffers.
29697 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
29700 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
29702 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
29705 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
29707 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
29710 * Checks if the given object is currently in the success state
29712 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
29715 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
29717 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
29720 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
29721 * but with all dynamically-allocated buffers duplicated in new buffers.
29723 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
29726 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
29728 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
29731 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
29733 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
29736 * Checks if the given object is currently in the success state
29738 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
29741 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
29743 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
29746 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
29747 * but with all dynamically-allocated buffers duplicated in new buffers.
29749 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
29752 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
29754 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
29757 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
29759 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
29762 * Checks if the given object is currently in the success state
29764 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
29767 * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
29769 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
29772 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
29773 * but with all dynamically-allocated buffers duplicated in new buffers.
29775 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
29778 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
29780 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
29783 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
29785 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
29788 * Checks if the given object is currently in the success state
29790 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
29793 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
29795 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
29798 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
29799 * but with all dynamically-allocated buffers duplicated in new buffers.
29801 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
29804 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
29806 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
29809 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
29811 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
29814 * Checks if the given object is currently in the success state
29816 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
29819 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
29821 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
29824 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
29825 * but with all dynamically-allocated buffers duplicated in new buffers.
29827 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
29830 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
29832 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
29835 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
29837 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
29840 * Checks if the given object is currently in the success state
29842 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
29845 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
29847 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
29850 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
29851 * but with all dynamically-allocated buffers duplicated in new buffers.
29853 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
29856 * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state.
29858 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_ok(struct LDKChannelReady o);
29861 * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state.
29863 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_err(struct LDKDecodeError e);
29866 * Checks if the given object is currently in the success state
29868 bool CResult_ChannelReadyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR o);
29871 * Frees any resources used by the CResult_ChannelReadyDecodeErrorZ.
29873 void CResult_ChannelReadyDecodeErrorZ_free(struct LDKCResult_ChannelReadyDecodeErrorZ _res);
29876 * Creates a new CResult_ChannelReadyDecodeErrorZ which has the same data as `orig`
29877 * but with all dynamically-allocated buffers duplicated in new buffers.
29879 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_clone(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR orig);
29882 * Creates a new CResult_InitDecodeErrorZ in the success state.
29884 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
29887 * Creates a new CResult_InitDecodeErrorZ in the error state.
29889 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
29892 * Checks if the given object is currently in the success state
29894 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
29897 * Frees any resources used by the CResult_InitDecodeErrorZ.
29899 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
29902 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
29903 * but with all dynamically-allocated buffers duplicated in new buffers.
29905 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
29908 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
29910 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
29913 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
29915 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
29918 * Checks if the given object is currently in the success state
29920 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
29923 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
29925 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
29928 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
29929 * but with all dynamically-allocated buffers duplicated in new buffers.
29931 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
29934 * Creates a new CResult_OpenChannelV2DecodeErrorZ in the success state.
29936 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_ok(struct LDKOpenChannelV2 o);
29939 * Creates a new CResult_OpenChannelV2DecodeErrorZ in the error state.
29941 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
29944 * Checks if the given object is currently in the success state
29946 bool CResult_OpenChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR o);
29949 * Frees any resources used by the CResult_OpenChannelV2DecodeErrorZ.
29951 void CResult_OpenChannelV2DecodeErrorZ_free(struct LDKCResult_OpenChannelV2DecodeErrorZ _res);
29954 * Creates a new CResult_OpenChannelV2DecodeErrorZ which has the same data as `orig`
29955 * but with all dynamically-allocated buffers duplicated in new buffers.
29957 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_clone(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR orig);
29960 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
29962 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
29965 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
29967 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
29970 * Checks if the given object is currently in the success state
29972 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
29975 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
29977 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
29980 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
29981 * but with all dynamically-allocated buffers duplicated in new buffers.
29983 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
29986 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
29988 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
29991 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
29993 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
29996 * Checks if the given object is currently in the success state
29998 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
30001 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
30003 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
30006 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
30007 * but with all dynamically-allocated buffers duplicated in new buffers.
30009 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
30012 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
30014 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
30017 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
30019 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
30022 * Checks if the given object is currently in the success state
30024 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
30027 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
30029 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
30032 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
30033 * but with all dynamically-allocated buffers duplicated in new buffers.
30035 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
30038 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
30040 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
30043 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
30045 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
30048 * Checks if the given object is currently in the success state
30050 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
30053 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
30055 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
30058 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
30059 * but with all dynamically-allocated buffers duplicated in new buffers.
30061 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
30064 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
30066 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
30069 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
30071 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
30074 * Checks if the given object is currently in the success state
30076 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
30079 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
30081 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
30084 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
30085 * but with all dynamically-allocated buffers duplicated in new buffers.
30087 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
30090 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
30092 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
30095 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
30097 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
30100 * Checks if the given object is currently in the success state
30102 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
30105 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
30107 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
30110 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
30111 * but with all dynamically-allocated buffers duplicated in new buffers.
30113 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
30116 * Creates a new CResult_OnionPacketDecodeErrorZ in the success state.
30118 struct LDKCResult_OnionPacketDecodeErrorZ CResult_OnionPacketDecodeErrorZ_ok(struct LDKOnionPacket o);
30121 * Creates a new CResult_OnionPacketDecodeErrorZ in the error state.
30123 struct LDKCResult_OnionPacketDecodeErrorZ CResult_OnionPacketDecodeErrorZ_err(struct LDKDecodeError e);
30126 * Checks if the given object is currently in the success state
30128 bool CResult_OnionPacketDecodeErrorZ_is_ok(const struct LDKCResult_OnionPacketDecodeErrorZ *NONNULL_PTR o);
30131 * Frees any resources used by the CResult_OnionPacketDecodeErrorZ.
30133 void CResult_OnionPacketDecodeErrorZ_free(struct LDKCResult_OnionPacketDecodeErrorZ _res);
30136 * Creates a new CResult_OnionPacketDecodeErrorZ which has the same data as `orig`
30137 * but with all dynamically-allocated buffers duplicated in new buffers.
30139 struct LDKCResult_OnionPacketDecodeErrorZ CResult_OnionPacketDecodeErrorZ_clone(const struct LDKCResult_OnionPacketDecodeErrorZ *NONNULL_PTR orig);
30142 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
30144 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
30147 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
30149 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
30152 * Checks if the given object is currently in the success state
30154 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
30157 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
30159 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
30162 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
30163 * but with all dynamically-allocated buffers duplicated in new buffers.
30165 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
30168 * Creates a new CResult_OnionMessageDecodeErrorZ in the success state.
30170 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_ok(struct LDKOnionMessage o);
30173 * Creates a new CResult_OnionMessageDecodeErrorZ in the error state.
30175 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_err(struct LDKDecodeError e);
30178 * Checks if the given object is currently in the success state
30180 bool CResult_OnionMessageDecodeErrorZ_is_ok(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR o);
30183 * Frees any resources used by the CResult_OnionMessageDecodeErrorZ.
30185 void CResult_OnionMessageDecodeErrorZ_free(struct LDKCResult_OnionMessageDecodeErrorZ _res);
30188 * Creates a new CResult_OnionMessageDecodeErrorZ which has the same data as `orig`
30189 * but with all dynamically-allocated buffers duplicated in new buffers.
30191 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_clone(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR orig);
30194 * Creates a new CResult_FinalOnionHopDataDecodeErrorZ in the success state.
30196 struct LDKCResult_FinalOnionHopDataDecodeErrorZ CResult_FinalOnionHopDataDecodeErrorZ_ok(struct LDKFinalOnionHopData o);
30199 * Creates a new CResult_FinalOnionHopDataDecodeErrorZ in the error state.
30201 struct LDKCResult_FinalOnionHopDataDecodeErrorZ CResult_FinalOnionHopDataDecodeErrorZ_err(struct LDKDecodeError e);
30204 * Checks if the given object is currently in the success state
30206 bool CResult_FinalOnionHopDataDecodeErrorZ_is_ok(const struct LDKCResult_FinalOnionHopDataDecodeErrorZ *NONNULL_PTR o);
30209 * Frees any resources used by the CResult_FinalOnionHopDataDecodeErrorZ.
30211 void CResult_FinalOnionHopDataDecodeErrorZ_free(struct LDKCResult_FinalOnionHopDataDecodeErrorZ _res);
30214 * Creates a new CResult_FinalOnionHopDataDecodeErrorZ which has the same data as `orig`
30215 * but with all dynamically-allocated buffers duplicated in new buffers.
30217 struct LDKCResult_FinalOnionHopDataDecodeErrorZ CResult_FinalOnionHopDataDecodeErrorZ_clone(const struct LDKCResult_FinalOnionHopDataDecodeErrorZ *NONNULL_PTR orig);
30220 * Creates a new CResult_PingDecodeErrorZ in the success state.
30222 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
30225 * Creates a new CResult_PingDecodeErrorZ in the error state.
30227 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
30230 * Checks if the given object is currently in the success state
30232 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
30235 * Frees any resources used by the CResult_PingDecodeErrorZ.
30237 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
30240 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
30241 * but with all dynamically-allocated buffers duplicated in new buffers.
30243 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
30246 * Creates a new CResult_PongDecodeErrorZ in the success state.
30248 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
30251 * Creates a new CResult_PongDecodeErrorZ in the error state.
30253 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
30256 * Checks if the given object is currently in the success state
30258 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
30261 * Frees any resources used by the CResult_PongDecodeErrorZ.
30263 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
30266 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
30267 * but with all dynamically-allocated buffers duplicated in new buffers.
30269 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
30272 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
30274 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
30277 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
30279 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
30282 * Checks if the given object is currently in the success state
30284 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
30287 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
30289 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
30292 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
30293 * but with all dynamically-allocated buffers duplicated in new buffers.
30295 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
30298 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
30300 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
30303 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
30305 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
30308 * Checks if the given object is currently in the success state
30310 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
30313 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
30315 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
30318 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
30319 * but with all dynamically-allocated buffers duplicated in new buffers.
30321 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
30324 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
30326 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
30329 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
30331 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
30334 * Checks if the given object is currently in the success state
30336 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
30339 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
30341 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
30344 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
30345 * but with all dynamically-allocated buffers duplicated in new buffers.
30347 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
30350 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
30352 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
30355 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
30357 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
30360 * Checks if the given object is currently in the success state
30362 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
30365 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
30367 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
30370 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
30371 * but with all dynamically-allocated buffers duplicated in new buffers.
30373 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
30376 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
30378 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
30381 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
30383 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
30386 * Checks if the given object is currently in the success state
30388 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
30391 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
30393 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
30396 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
30397 * but with all dynamically-allocated buffers duplicated in new buffers.
30399 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
30402 * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
30404 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
30407 * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
30409 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
30412 * Checks if the given object is currently in the success state
30414 bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
30417 * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
30419 void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
30422 * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
30423 * but with all dynamically-allocated buffers duplicated in new buffers.
30425 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
30428 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
30430 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
30433 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
30435 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
30438 * Checks if the given object is currently in the success state
30440 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
30443 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
30445 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
30448 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
30449 * but with all dynamically-allocated buffers duplicated in new buffers.
30451 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
30454 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
30456 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
30459 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
30461 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
30464 * Checks if the given object is currently in the success state
30466 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
30469 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
30471 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
30474 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
30475 * but with all dynamically-allocated buffers duplicated in new buffers.
30477 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
30480 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
30482 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
30485 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
30487 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
30490 * Checks if the given object is currently in the success state
30492 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
30495 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
30497 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
30500 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
30501 * but with all dynamically-allocated buffers duplicated in new buffers.
30503 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
30506 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
30508 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
30511 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
30513 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
30516 * Checks if the given object is currently in the success state
30518 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
30521 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
30523 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
30526 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
30527 * but with all dynamically-allocated buffers duplicated in new buffers.
30529 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
30532 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
30534 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
30537 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
30539 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
30542 * Checks if the given object is currently in the success state
30544 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
30547 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
30549 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
30552 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
30553 * but with all dynamically-allocated buffers duplicated in new buffers.
30555 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
30558 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
30560 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
30563 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
30565 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
30568 * Checks if the given object is currently in the success state
30570 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
30573 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
30575 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
30578 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
30579 * but with all dynamically-allocated buffers duplicated in new buffers.
30581 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
30584 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
30586 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
30589 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
30591 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
30594 * Checks if the given object is currently in the success state
30596 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
30599 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
30601 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
30604 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
30605 * but with all dynamically-allocated buffers duplicated in new buffers.
30607 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
30610 * Frees the buffer pointed to by `data` if `datalen` is non-0.
30612 void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
30615 * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the success state.
30617 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(struct LDKBolt11Invoice o);
30620 * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the error state.
30622 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
30625 * Checks if the given object is currently in the success state
30627 bool CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
30630 * Frees any resources used by the CResult_Bolt11InvoiceSignOrCreationErrorZ.
30632 void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res);
30635 * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ which has the same data as `orig`
30636 * but with all dynamically-allocated buffers duplicated in new buffers.
30638 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
30641 * Frees the buffer pointed to by `data` if `datalen` is non-0.
30643 void CVec_FutureZ_free(struct LDKCVec_FutureZ _res);
30646 * Creates a new CResult_OffersMessageDecodeErrorZ in the success state.
30648 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_ok(struct LDKOffersMessage o);
30651 * Creates a new CResult_OffersMessageDecodeErrorZ in the error state.
30653 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_err(struct LDKDecodeError e);
30656 * Checks if the given object is currently in the success state
30658 bool CResult_OffersMessageDecodeErrorZ_is_ok(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR o);
30661 * Frees any resources used by the CResult_OffersMessageDecodeErrorZ.
30663 void CResult_OffersMessageDecodeErrorZ_free(struct LDKCResult_OffersMessageDecodeErrorZ _res);
30666 * Creates a new CResult_OffersMessageDecodeErrorZ which has the same data as `orig`
30667 * but with all dynamically-allocated buffers duplicated in new buffers.
30669 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_clone(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR orig);
30672 * Constructs a new COption_HTLCClaimZ containing a crate::lightning::ln::chan_utils::HTLCClaim
30674 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_some(enum LDKHTLCClaim o);
30677 * Constructs a new COption_HTLCClaimZ containing nothing
30679 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_none(void);
30682 * Frees any resources associated with the crate::lightning::ln::chan_utils::HTLCClaim, if we are in the Some state
30684 void COption_HTLCClaimZ_free(struct LDKCOption_HTLCClaimZ _res);
30687 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
30689 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
30692 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
30694 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
30697 * Checks if the given object is currently in the success state
30699 bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
30702 * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
30704 void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
30707 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
30708 * but with all dynamically-allocated buffers duplicated in new buffers.
30710 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
30713 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
30715 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
30718 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
30720 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
30723 * Checks if the given object is currently in the success state
30725 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
30728 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
30730 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
30733 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
30734 * but with all dynamically-allocated buffers duplicated in new buffers.
30736 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
30739 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
30741 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
30744 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
30746 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
30749 * Checks if the given object is currently in the success state
30751 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
30754 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
30756 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
30759 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
30760 * but with all dynamically-allocated buffers duplicated in new buffers.
30762 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
30765 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
30767 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
30770 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
30772 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
30775 * Checks if the given object is currently in the success state
30777 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
30780 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
30782 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
30785 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
30786 * but with all dynamically-allocated buffers duplicated in new buffers.
30788 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
30791 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
30793 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
30796 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
30798 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
30801 * Checks if the given object is currently in the success state
30803 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
30806 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
30808 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
30811 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
30812 * but with all dynamically-allocated buffers duplicated in new buffers.
30814 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
30817 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
30819 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
30822 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
30824 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
30827 * Checks if the given object is currently in the success state
30829 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
30832 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
30834 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
30837 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
30838 * but with all dynamically-allocated buffers duplicated in new buffers.
30840 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
30843 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
30845 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
30848 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
30850 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
30853 * Checks if the given object is currently in the success state
30855 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
30858 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
30860 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
30863 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
30864 * but with all dynamically-allocated buffers duplicated in new buffers.
30866 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
30869 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
30871 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
30874 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
30876 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
30879 * Checks if the given object is currently in the success state
30881 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
30884 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
30886 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
30889 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
30890 * but with all dynamically-allocated buffers duplicated in new buffers.
30892 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
30895 * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
30897 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
30900 * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
30902 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
30905 * Checks if the given object is currently in the success state
30907 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
30910 * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
30912 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
30915 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
30917 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
30920 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
30922 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
30925 * Checks if the given object is currently in the success state
30927 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
30930 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
30932 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
30935 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
30936 * but with all dynamically-allocated buffers duplicated in new buffers.
30938 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
30941 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
30943 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
30946 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
30948 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
30951 * Checks if the given object is currently in the success state
30953 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
30956 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
30958 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
30961 * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the success state.
30963 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_ok(struct LDKCVec_ECDSASignatureZ o);
30966 * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the error state.
30968 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_err(void);
30971 * Checks if the given object is currently in the success state
30973 bool CResult_CVec_ECDSASignatureZNoneZ_is_ok(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR o);
30976 * Frees any resources used by the CResult_CVec_ECDSASignatureZNoneZ.
30978 void CResult_CVec_ECDSASignatureZNoneZ_free(struct LDKCResult_CVec_ECDSASignatureZNoneZ _res);
30981 * Creates a new CResult_CVec_ECDSASignatureZNoneZ which has the same data as `orig`
30982 * but with all dynamically-allocated buffers duplicated in new buffers.
30984 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_clone(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR orig);
30987 * Constructs a new COption_usizeZ containing a usize
30989 struct LDKCOption_usizeZ COption_usizeZ_some(uintptr_t o);
30992 * Constructs a new COption_usizeZ containing nothing
30994 struct LDKCOption_usizeZ COption_usizeZ_none(void);
30997 * Frees any resources associated with the usize, if we are in the Some state
30999 void COption_usizeZ_free(struct LDKCOption_usizeZ _res);
31002 * Creates a new COption_usizeZ which has the same data as `orig`
31003 * but with all dynamically-allocated buffers duplicated in new buffers.
31005 struct LDKCOption_usizeZ COption_usizeZ_clone(const struct LDKCOption_usizeZ *NONNULL_PTR orig);
31008 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
31010 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
31013 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
31015 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
31018 * Checks if the given object is currently in the success state
31020 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
31023 * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
31025 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
31028 * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
31029 * but with all dynamically-allocated buffers duplicated in new buffers.
31031 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
31034 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
31036 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
31039 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
31041 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
31044 * Checks if the given object is currently in the success state
31046 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
31049 * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
31051 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
31054 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
31055 * but with all dynamically-allocated buffers duplicated in new buffers.
31057 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
31060 * Frees the buffer pointed to by `data` if `datalen` is non-0.
31062 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
31065 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state.
31067 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o);
31070 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state.
31072 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e);
31075 * Checks if the given object is currently in the success state
31077 bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o);
31080 * Frees any resources used by the CResult_PaymentPurposeDecodeErrorZ.
31082 void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res);
31085 * Creates a new CResult_PaymentPurposeDecodeErrorZ which has the same data as `orig`
31086 * but with all dynamically-allocated buffers duplicated in new buffers.
31088 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig);
31091 * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the success state.
31093 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_ok(struct LDKClaimedHTLC o);
31096 * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the error state.
31098 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
31101 * Checks if the given object is currently in the success state
31103 bool CResult_ClaimedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR o);
31106 * Frees any resources used by the CResult_ClaimedHTLCDecodeErrorZ.
31108 void CResult_ClaimedHTLCDecodeErrorZ_free(struct LDKCResult_ClaimedHTLCDecodeErrorZ _res);
31111 * Creates a new CResult_ClaimedHTLCDecodeErrorZ which has the same data as `orig`
31112 * but with all dynamically-allocated buffers duplicated in new buffers.
31114 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_clone(const struct LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR orig);
31117 * Constructs a new COption_PathFailureZ containing a crate::lightning::events::PathFailure
31119 struct LDKCOption_PathFailureZ COption_PathFailureZ_some(struct LDKPathFailure o);
31122 * Constructs a new COption_PathFailureZ containing nothing
31124 struct LDKCOption_PathFailureZ COption_PathFailureZ_none(void);
31127 * Frees any resources associated with the crate::lightning::events::PathFailure, if we are in the Some state
31129 void COption_PathFailureZ_free(struct LDKCOption_PathFailureZ _res);
31132 * Creates a new COption_PathFailureZ which has the same data as `orig`
31133 * but with all dynamically-allocated buffers duplicated in new buffers.
31135 struct LDKCOption_PathFailureZ COption_PathFailureZ_clone(const struct LDKCOption_PathFailureZ *NONNULL_PTR orig);
31138 * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the success state.
31140 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_ok(struct LDKCOption_PathFailureZ o);
31143 * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the error state.
31145 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_err(struct LDKDecodeError e);
31148 * Checks if the given object is currently in the success state
31150 bool CResult_COption_PathFailureZDecodeErrorZ_is_ok(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR o);
31153 * Frees any resources used by the CResult_COption_PathFailureZDecodeErrorZ.
31155 void CResult_COption_PathFailureZDecodeErrorZ_free(struct LDKCResult_COption_PathFailureZDecodeErrorZ _res);
31158 * Creates a new CResult_COption_PathFailureZDecodeErrorZ which has the same data as `orig`
31159 * but with all dynamically-allocated buffers duplicated in new buffers.
31161 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_clone(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR orig);
31164 * Constructs a new COption_ClosureReasonZ containing a crate::lightning::events::ClosureReason
31166 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
31169 * Constructs a new COption_ClosureReasonZ containing nothing
31171 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
31174 * Frees any resources associated with the crate::lightning::events::ClosureReason, if we are in the Some state
31176 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
31179 * Creates a new COption_ClosureReasonZ which has the same data as `orig`
31180 * but with all dynamically-allocated buffers duplicated in new buffers.
31182 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
31185 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
31187 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
31190 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
31192 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
31195 * Checks if the given object is currently in the success state
31197 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
31200 * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
31202 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
31205 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
31206 * but with all dynamically-allocated buffers duplicated in new buffers.
31208 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
31211 * Constructs a new COption_HTLCDestinationZ containing a crate::lightning::events::HTLCDestination
31213 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_some(struct LDKHTLCDestination o);
31216 * Constructs a new COption_HTLCDestinationZ containing nothing
31218 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_none(void);
31221 * Frees any resources associated with the crate::lightning::events::HTLCDestination, if we are in the Some state
31223 void COption_HTLCDestinationZ_free(struct LDKCOption_HTLCDestinationZ _res);
31226 * Creates a new COption_HTLCDestinationZ which has the same data as `orig`
31227 * but with all dynamically-allocated buffers duplicated in new buffers.
31229 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_clone(const struct LDKCOption_HTLCDestinationZ *NONNULL_PTR orig);
31232 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the success state.
31234 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_ok(struct LDKCOption_HTLCDestinationZ o);
31237 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the error state.
31239 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_err(struct LDKDecodeError e);
31242 * Checks if the given object is currently in the success state
31244 bool CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR o);
31247 * Frees any resources used by the CResult_COption_HTLCDestinationZDecodeErrorZ.
31249 void CResult_COption_HTLCDestinationZDecodeErrorZ_free(struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res);
31252 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ which has the same data as `orig`
31253 * but with all dynamically-allocated buffers duplicated in new buffers.
31255 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig);
31258 * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the success state.
31260 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_ok(enum LDKPaymentFailureReason o);
31263 * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the error state.
31265 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_err(struct LDKDecodeError e);
31268 * Checks if the given object is currently in the success state
31270 bool CResult_PaymentFailureReasonDecodeErrorZ_is_ok(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR o);
31273 * Frees any resources used by the CResult_PaymentFailureReasonDecodeErrorZ.
31275 void CResult_PaymentFailureReasonDecodeErrorZ_free(struct LDKCResult_PaymentFailureReasonDecodeErrorZ _res);
31278 * Creates a new CResult_PaymentFailureReasonDecodeErrorZ which has the same data as `orig`
31279 * but with all dynamically-allocated buffers duplicated in new buffers.
31281 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_clone(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR orig);
31284 * Constructs a new COption_U128Z containing a crate::c_types::U128
31286 struct LDKCOption_U128Z COption_U128Z_some(struct LDKU128 o);
31289 * Constructs a new COption_U128Z containing nothing
31291 struct LDKCOption_U128Z COption_U128Z_none(void);
31294 * Frees any resources associated with the crate::c_types::U128, if we are in the Some state
31296 void COption_U128Z_free(struct LDKCOption_U128Z _res);
31299 * Creates a new COption_U128Z which has the same data as `orig`
31300 * but with all dynamically-allocated buffers duplicated in new buffers.
31302 struct LDKCOption_U128Z COption_U128Z_clone(const struct LDKCOption_U128Z *NONNULL_PTR orig);
31305 * Frees the buffer pointed to by `data` if `datalen` is non-0.
31307 void CVec_ClaimedHTLCZ_free(struct LDKCVec_ClaimedHTLCZ _res);
31310 * Constructs a new COption_PaymentFailureReasonZ containing a crate::lightning::events::PaymentFailureReason
31312 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_some(enum LDKPaymentFailureReason o);
31315 * Constructs a new COption_PaymentFailureReasonZ containing nothing
31317 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_none(void);
31320 * Frees any resources associated with the crate::lightning::events::PaymentFailureReason, if we are in the Some state
31322 void COption_PaymentFailureReasonZ_free(struct LDKCOption_PaymentFailureReasonZ _res);
31325 * Creates a new COption_PaymentFailureReasonZ which has the same data as `orig`
31326 * but with all dynamically-allocated buffers duplicated in new buffers.
31328 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_clone(const struct LDKCOption_PaymentFailureReasonZ *NONNULL_PTR orig);
31331 * Constructs a new COption_EventZ containing a crate::lightning::events::Event
31333 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
31336 * Constructs a new COption_EventZ containing nothing
31338 struct LDKCOption_EventZ COption_EventZ_none(void);
31341 * Frees any resources associated with the crate::lightning::events::Event, if we are in the Some state
31343 void COption_EventZ_free(struct LDKCOption_EventZ _res);
31346 * Creates a new COption_EventZ which has the same data as `orig`
31347 * but with all dynamically-allocated buffers duplicated in new buffers.
31349 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
31352 * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
31354 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
31357 * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
31359 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
31362 * Checks if the given object is currently in the success state
31364 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
31367 * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
31369 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
31372 * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
31373 * but with all dynamically-allocated buffers duplicated in new buffers.
31375 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
31378 * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the success state.
31380 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_ok(enum LDKSiPrefix o);
31383 * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the error state.
31385 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
31388 * Checks if the given object is currently in the success state
31390 bool CResult_SiPrefixBolt11ParseErrorZ_is_ok(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR o);
31393 * Frees any resources used by the CResult_SiPrefixBolt11ParseErrorZ.
31395 void CResult_SiPrefixBolt11ParseErrorZ_free(struct LDKCResult_SiPrefixBolt11ParseErrorZ _res);
31398 * Creates a new CResult_SiPrefixBolt11ParseErrorZ which has the same data as `orig`
31399 * but with all dynamically-allocated buffers duplicated in new buffers.
31401 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_clone(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR orig);
31404 * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the success state.
31406 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(struct LDKBolt11Invoice o);
31409 * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the error state.
31411 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e);
31414 * Checks if the given object is currently in the success state
31416 bool CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR o);
31419 * Frees any resources used by the CResult_Bolt11InvoiceParseOrSemanticErrorZ.
31421 void CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ _res);
31424 * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ which has the same data as `orig`
31425 * but with all dynamically-allocated buffers duplicated in new buffers.
31427 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig);
31430 * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the success state.
31432 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(struct LDKSignedRawBolt11Invoice o);
31435 * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the error state.
31437 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
31440 * Checks if the given object is currently in the success state
31442 bool CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR o);
31445 * Frees any resources used by the CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ.
31447 void CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ _res);
31450 * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ which has the same data as `orig`
31451 * but with all dynamically-allocated buffers duplicated in new buffers.
31453 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR orig);
31456 * Creates a new tuple which has the same data as `orig`
31457 * but with all dynamically-allocated buffers duplicated in new buffers.
31459 struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ *NONNULL_PTR orig);
31462 * Creates a new C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ from the contained elements.
31464 struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(struct LDKRawBolt11Invoice a, struct LDKThirtyTwoBytes b, struct LDKBolt11InvoiceSignature c);
31467 * Frees any resources used by the C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.
31469 void C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ _res);
31472 * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the success state.
31474 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_ok(struct LDKPayeePubKey o);
31477 * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the error state.
31479 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
31482 * Checks if the given object is currently in the success state
31484 bool CResult_PayeePubKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR o);
31487 * Frees any resources used by the CResult_PayeePubKeySecp256k1ErrorZ.
31489 void CResult_PayeePubKeySecp256k1ErrorZ_free(struct LDKCResult_PayeePubKeySecp256k1ErrorZ _res);
31492 * Creates a new CResult_PayeePubKeySecp256k1ErrorZ which has the same data as `orig`
31493 * but with all dynamically-allocated buffers duplicated in new buffers.
31495 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_clone(const struct LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR orig);
31498 * Frees the buffer pointed to by `data` if `datalen` is non-0.
31500 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
31503 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
31505 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
31508 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
31510 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
31513 * Checks if the given object is currently in the success state
31515 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
31518 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
31520 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
31523 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
31524 * but with all dynamically-allocated buffers duplicated in new buffers.
31526 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
31529 * Creates a new CResult_NoneBolt11SemanticErrorZ in the success state.
31531 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_ok(void);
31534 * Creates a new CResult_NoneBolt11SemanticErrorZ in the error state.
31536 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
31539 * Checks if the given object is currently in the success state
31541 bool CResult_NoneBolt11SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR o);
31544 * Frees any resources used by the CResult_NoneBolt11SemanticErrorZ.
31546 void CResult_NoneBolt11SemanticErrorZ_free(struct LDKCResult_NoneBolt11SemanticErrorZ _res);
31549 * Creates a new CResult_NoneBolt11SemanticErrorZ which has the same data as `orig`
31550 * but with all dynamically-allocated buffers duplicated in new buffers.
31552 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_clone(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR orig);
31555 * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the success state.
31557 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(struct LDKBolt11Invoice o);
31560 * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the error state.
31562 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
31565 * Checks if the given object is currently in the success state
31567 bool CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR o);
31570 * Frees any resources used by the CResult_Bolt11InvoiceBolt11SemanticErrorZ.
31572 void CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ _res);
31575 * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ which has the same data as `orig`
31576 * but with all dynamically-allocated buffers duplicated in new buffers.
31578 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR orig);
31581 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
31583 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
31586 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
31588 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
31591 * Checks if the given object is currently in the success state
31593 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
31596 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
31598 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
31601 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
31602 * but with all dynamically-allocated buffers duplicated in new buffers.
31604 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
31607 * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
31609 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
31612 * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
31614 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
31617 * Checks if the given object is currently in the success state
31619 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
31622 * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
31624 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
31627 * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
31628 * but with all dynamically-allocated buffers duplicated in new buffers.
31630 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
31633 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
31635 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
31638 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
31640 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
31643 * Checks if the given object is currently in the success state
31645 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
31648 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
31650 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
31653 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
31654 * but with all dynamically-allocated buffers duplicated in new buffers.
31656 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
31659 * Creates a new CResult_BigSizeDecodeErrorZ in the success state.
31661 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_ok(struct LDKBigSize o);
31664 * Creates a new CResult_BigSizeDecodeErrorZ in the error state.
31666 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_err(struct LDKDecodeError e);
31669 * Checks if the given object is currently in the success state
31671 bool CResult_BigSizeDecodeErrorZ_is_ok(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR o);
31674 * Frees any resources used by the CResult_BigSizeDecodeErrorZ.
31676 void CResult_BigSizeDecodeErrorZ_free(struct LDKCResult_BigSizeDecodeErrorZ _res);
31679 * Creates a new CResult_BigSizeDecodeErrorZ which has the same data as `orig`
31680 * but with all dynamically-allocated buffers duplicated in new buffers.
31682 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_clone(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR orig);
31685 * Creates a new CResult_HostnameDecodeErrorZ in the success state.
31687 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_ok(struct LDKHostname o);
31690 * Creates a new CResult_HostnameDecodeErrorZ in the error state.
31692 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_err(struct LDKDecodeError e);
31695 * Checks if the given object is currently in the success state
31697 bool CResult_HostnameDecodeErrorZ_is_ok(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR o);
31700 * Frees any resources used by the CResult_HostnameDecodeErrorZ.
31702 void CResult_HostnameDecodeErrorZ_free(struct LDKCResult_HostnameDecodeErrorZ _res);
31705 * Creates a new CResult_HostnameDecodeErrorZ which has the same data as `orig`
31706 * but with all dynamically-allocated buffers duplicated in new buffers.
31708 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_clone(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR orig);
31711 * Creates a new CResult_TransactionU16LenLimitedNoneZ in the success state.
31713 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_ok(struct LDKTransactionU16LenLimited o);
31716 * Creates a new CResult_TransactionU16LenLimitedNoneZ in the error state.
31718 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_err(void);
31721 * Checks if the given object is currently in the success state
31723 bool CResult_TransactionU16LenLimitedNoneZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR o);
31726 * Frees any resources used by the CResult_TransactionU16LenLimitedNoneZ.
31728 void CResult_TransactionU16LenLimitedNoneZ_free(struct LDKCResult_TransactionU16LenLimitedNoneZ _res);
31731 * Creates a new CResult_TransactionU16LenLimitedNoneZ which has the same data as `orig`
31732 * but with all dynamically-allocated buffers duplicated in new buffers.
31734 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_clone(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR orig);
31737 * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the success state.
31739 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_ok(struct LDKTransactionU16LenLimited o);
31742 * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the error state.
31744 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_err(struct LDKDecodeError e);
31747 * Checks if the given object is currently in the success state
31749 bool CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR o);
31752 * Frees any resources used by the CResult_TransactionU16LenLimitedDecodeErrorZ.
31754 void CResult_TransactionU16LenLimitedDecodeErrorZ_free(struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ _res);
31757 * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ which has the same data as `orig`
31758 * but with all dynamically-allocated buffers duplicated in new buffers.
31760 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_clone(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR orig);
31763 * Creates a new CResult_UntrustedStringDecodeErrorZ in the success state.
31765 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_ok(struct LDKUntrustedString o);
31768 * Creates a new CResult_UntrustedStringDecodeErrorZ in the error state.
31770 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_err(struct LDKDecodeError e);
31773 * Checks if the given object is currently in the success state
31775 bool CResult_UntrustedStringDecodeErrorZ_is_ok(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR o);
31778 * Frees any resources used by the CResult_UntrustedStringDecodeErrorZ.
31780 void CResult_UntrustedStringDecodeErrorZ_free(struct LDKCResult_UntrustedStringDecodeErrorZ _res);
31783 * Creates a new CResult_UntrustedStringDecodeErrorZ which has the same data as `orig`
31784 * but with all dynamically-allocated buffers duplicated in new buffers.
31786 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_clone(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR orig);
31789 * Creates a new CResult_ChannelIdDecodeErrorZ in the success state.
31791 struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_ok(struct LDKChannelId o);
31794 * Creates a new CResult_ChannelIdDecodeErrorZ in the error state.
31796 struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_err(struct LDKDecodeError e);
31799 * Checks if the given object is currently in the success state
31801 bool CResult_ChannelIdDecodeErrorZ_is_ok(const struct LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR o);
31804 * Frees any resources used by the CResult_ChannelIdDecodeErrorZ.
31806 void CResult_ChannelIdDecodeErrorZ_free(struct LDKCResult_ChannelIdDecodeErrorZ _res);
31809 * Creates a new CResult_ChannelIdDecodeErrorZ which has the same data as `orig`
31810 * but with all dynamically-allocated buffers duplicated in new buffers.
31812 struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_clone(const struct LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR orig);
31815 * Creates a new tuple which has the same data as `orig`
31816 * but with all dynamically-allocated buffers duplicated in new buffers.
31818 struct LDKC2Tuple__u832u16Z C2Tuple__u832u16Z_clone(const struct LDKC2Tuple__u832u16Z *NONNULL_PTR orig);
31821 * Creates a new C2Tuple__u832u16Z from the contained elements.
31823 struct LDKC2Tuple__u832u16Z C2Tuple__u832u16Z_new(struct LDKThirtyTwoBytes a, uint16_t b);
31826 * Frees any resources used by the C2Tuple__u832u16Z.
31828 void C2Tuple__u832u16Z_free(struct LDKC2Tuple__u832u16Z _res);
31831 * Creates a new CResult_PaymentRelayDecodeErrorZ in the success state.
31833 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_ok(struct LDKPaymentRelay o);
31836 * Creates a new CResult_PaymentRelayDecodeErrorZ in the error state.
31838 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_err(struct LDKDecodeError e);
31841 * Checks if the given object is currently in the success state
31843 bool CResult_PaymentRelayDecodeErrorZ_is_ok(const struct LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR o);
31846 * Frees any resources used by the CResult_PaymentRelayDecodeErrorZ.
31848 void CResult_PaymentRelayDecodeErrorZ_free(struct LDKCResult_PaymentRelayDecodeErrorZ _res);
31851 * Creates a new CResult_PaymentRelayDecodeErrorZ which has the same data as `orig`
31852 * but with all dynamically-allocated buffers duplicated in new buffers.
31854 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_clone(const struct LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR orig);
31857 * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the success state.
31859 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_ok(struct LDKPaymentConstraints o);
31862 * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the error state.
31864 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_err(struct LDKDecodeError e);
31867 * Checks if the given object is currently in the success state
31869 bool CResult_PaymentConstraintsDecodeErrorZ_is_ok(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR o);
31872 * Frees any resources used by the CResult_PaymentConstraintsDecodeErrorZ.
31874 void CResult_PaymentConstraintsDecodeErrorZ_free(struct LDKCResult_PaymentConstraintsDecodeErrorZ _res);
31877 * Creates a new CResult_PaymentConstraintsDecodeErrorZ which has the same data as `orig`
31878 * but with all dynamically-allocated buffers duplicated in new buffers.
31880 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_clone(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR orig);
31883 * Creates a new CResult_PaymentContextDecodeErrorZ in the success state.
31885 struct LDKCResult_PaymentContextDecodeErrorZ CResult_PaymentContextDecodeErrorZ_ok(struct LDKPaymentContext o);
31888 * Creates a new CResult_PaymentContextDecodeErrorZ in the error state.
31890 struct LDKCResult_PaymentContextDecodeErrorZ CResult_PaymentContextDecodeErrorZ_err(struct LDKDecodeError e);
31893 * Checks if the given object is currently in the success state
31895 bool CResult_PaymentContextDecodeErrorZ_is_ok(const struct LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR o);
31898 * Frees any resources used by the CResult_PaymentContextDecodeErrorZ.
31900 void CResult_PaymentContextDecodeErrorZ_free(struct LDKCResult_PaymentContextDecodeErrorZ _res);
31903 * Creates a new CResult_PaymentContextDecodeErrorZ which has the same data as `orig`
31904 * but with all dynamically-allocated buffers duplicated in new buffers.
31906 struct LDKCResult_PaymentContextDecodeErrorZ CResult_PaymentContextDecodeErrorZ_clone(const struct LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR orig);
31909 * Creates a new CResult_UnknownPaymentContextDecodeErrorZ in the success state.
31911 struct LDKCResult_UnknownPaymentContextDecodeErrorZ CResult_UnknownPaymentContextDecodeErrorZ_ok(struct LDKUnknownPaymentContext o);
31914 * Creates a new CResult_UnknownPaymentContextDecodeErrorZ in the error state.
31916 struct LDKCResult_UnknownPaymentContextDecodeErrorZ CResult_UnknownPaymentContextDecodeErrorZ_err(struct LDKDecodeError e);
31919 * Checks if the given object is currently in the success state
31921 bool CResult_UnknownPaymentContextDecodeErrorZ_is_ok(const struct LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR o);
31924 * Frees any resources used by the CResult_UnknownPaymentContextDecodeErrorZ.
31926 void CResult_UnknownPaymentContextDecodeErrorZ_free(struct LDKCResult_UnknownPaymentContextDecodeErrorZ _res);
31929 * Creates a new CResult_UnknownPaymentContextDecodeErrorZ which has the same data as `orig`
31930 * but with all dynamically-allocated buffers duplicated in new buffers.
31932 struct LDKCResult_UnknownPaymentContextDecodeErrorZ CResult_UnknownPaymentContextDecodeErrorZ_clone(const struct LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR orig);
31935 * Creates a new CResult_Bolt12OfferContextDecodeErrorZ in the success state.
31937 struct LDKCResult_Bolt12OfferContextDecodeErrorZ CResult_Bolt12OfferContextDecodeErrorZ_ok(struct LDKBolt12OfferContext o);
31940 * Creates a new CResult_Bolt12OfferContextDecodeErrorZ in the error state.
31942 struct LDKCResult_Bolt12OfferContextDecodeErrorZ CResult_Bolt12OfferContextDecodeErrorZ_err(struct LDKDecodeError e);
31945 * Checks if the given object is currently in the success state
31947 bool CResult_Bolt12OfferContextDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR o);
31950 * Frees any resources used by the CResult_Bolt12OfferContextDecodeErrorZ.
31952 void CResult_Bolt12OfferContextDecodeErrorZ_free(struct LDKCResult_Bolt12OfferContextDecodeErrorZ _res);
31955 * Creates a new CResult_Bolt12OfferContextDecodeErrorZ which has the same data as `orig`
31956 * but with all dynamically-allocated buffers duplicated in new buffers.
31958 struct LDKCResult_Bolt12OfferContextDecodeErrorZ CResult_Bolt12OfferContextDecodeErrorZ_clone(const struct LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR orig);
31961 * Creates a new CResult_Bolt12RefundContextDecodeErrorZ in the success state.
31963 struct LDKCResult_Bolt12RefundContextDecodeErrorZ CResult_Bolt12RefundContextDecodeErrorZ_ok(struct LDKBolt12RefundContext o);
31966 * Creates a new CResult_Bolt12RefundContextDecodeErrorZ in the error state.
31968 struct LDKCResult_Bolt12RefundContextDecodeErrorZ CResult_Bolt12RefundContextDecodeErrorZ_err(struct LDKDecodeError e);
31971 * Checks if the given object is currently in the success state
31973 bool CResult_Bolt12RefundContextDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR o);
31976 * Frees any resources used by the CResult_Bolt12RefundContextDecodeErrorZ.
31978 void CResult_Bolt12RefundContextDecodeErrorZ_free(struct LDKCResult_Bolt12RefundContextDecodeErrorZ _res);
31981 * Creates a new CResult_Bolt12RefundContextDecodeErrorZ which has the same data as `orig`
31982 * but with all dynamically-allocated buffers duplicated in new buffers.
31984 struct LDKCResult_Bolt12RefundContextDecodeErrorZ CResult_Bolt12RefundContextDecodeErrorZ_clone(const struct LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR orig);
31987 * Creates a new CResult_StrSecp256k1ErrorZ in the success state.
31989 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_ok(struct LDKStr o);
31992 * Creates a new CResult_StrSecp256k1ErrorZ in the error state.
31994 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
31997 * Checks if the given object is currently in the success state
31999 bool CResult_StrSecp256k1ErrorZ_is_ok(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR o);
32002 * Frees any resources used by the CResult_StrSecp256k1ErrorZ.
32004 void CResult_StrSecp256k1ErrorZ_free(struct LDKCResult_StrSecp256k1ErrorZ _res);
32007 * Creates a new CResult_StrSecp256k1ErrorZ which has the same data as `orig`
32008 * but with all dynamically-allocated buffers duplicated in new buffers.
32010 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_clone(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR orig);
32013 * Creates a new tuple which has the same data as `orig`
32014 * but with all dynamically-allocated buffers duplicated in new buffers.
32016 struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(const struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR orig);
32019 * Creates a new C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ from the contained elements.
32021 struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(struct LDKThirtyTwoBytes a, struct LDKRecipientOnionFields b, struct LDKRouteParameters c);
32024 * Frees any resources used by the C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ.
32026 void C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ _res);
32029 * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ in the success state.
32031 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ o);
32034 * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ in the error state.
32036 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(void);
32039 * Checks if the given object is currently in the success state
32041 bool CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR o);
32044 * Frees any resources used by the CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ.
32046 void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ _res);
32049 * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ which has the same data as `orig`
32050 * but with all dynamically-allocated buffers duplicated in new buffers.
32052 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR orig);
32055 * Creates a new CResult_TxOutUtxoLookupErrorZ in the success state.
32057 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_ok(struct LDKTxOut o);
32060 * Creates a new CResult_TxOutUtxoLookupErrorZ in the error state.
32062 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_err(enum LDKUtxoLookupError e);
32065 * Checks if the given object is currently in the success state
32067 bool CResult_TxOutUtxoLookupErrorZ_is_ok(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR o);
32070 * Frees any resources used by the CResult_TxOutUtxoLookupErrorZ.
32072 void CResult_TxOutUtxoLookupErrorZ_free(struct LDKCResult_TxOutUtxoLookupErrorZ _res);
32075 * Creates a new CResult_TxOutUtxoLookupErrorZ which has the same data as `orig`
32076 * but with all dynamically-allocated buffers duplicated in new buffers.
32078 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_clone(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR orig);
32081 * Creates a new tuple which has the same data as `orig`
32082 * but with all dynamically-allocated buffers duplicated in new buffers.
32084 struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(const struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR orig);
32087 * Creates a new C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ from the contained elements.
32089 struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_new(struct LDKPublicKey a, struct LDKOnionMessage b, struct LDKCOption_CVec_SocketAddressZZ c);
32092 * Frees any resources used by the C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ.
32094 void C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_free(struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ _res);
32097 * Creates a new CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ in the success state.
32099 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok(struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ o);
32102 * Creates a new CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ in the error state.
32104 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_err(struct LDKSendError e);
32107 * Checks if the given object is currently in the success state
32109 bool CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_is_ok(const struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR o);
32112 * Frees any resources used by the CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.
32114 void CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ _res);
32117 * Creates a new CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ which has the same data as `orig`
32118 * but with all dynamically-allocated buffers duplicated in new buffers.
32120 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(const struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR orig);
32123 * Creates a new CResult_PeeledOnionNoneZ in the success state.
32125 struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_ok(struct LDKPeeledOnion o);
32128 * Creates a new CResult_PeeledOnionNoneZ in the error state.
32130 struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_err(void);
32133 * Checks if the given object is currently in the success state
32135 bool CResult_PeeledOnionNoneZ_is_ok(const struct LDKCResult_PeeledOnionNoneZ *NONNULL_PTR o);
32138 * Frees any resources used by the CResult_PeeledOnionNoneZ.
32140 void CResult_PeeledOnionNoneZ_free(struct LDKCResult_PeeledOnionNoneZ _res);
32143 * Creates a new CResult_PeeledOnionNoneZ which has the same data as `orig`
32144 * but with all dynamically-allocated buffers duplicated in new buffers.
32146 struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_clone(const struct LDKCResult_PeeledOnionNoneZ *NONNULL_PTR orig);
32149 * Creates a new CResult_SendSuccessSendErrorZ in the success state.
32151 struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_ok(struct LDKSendSuccess o);
32154 * Creates a new CResult_SendSuccessSendErrorZ in the error state.
32156 struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_err(struct LDKSendError e);
32159 * Checks if the given object is currently in the success state
32161 bool CResult_SendSuccessSendErrorZ_is_ok(const struct LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR o);
32164 * Frees any resources used by the CResult_SendSuccessSendErrorZ.
32166 void CResult_SendSuccessSendErrorZ_free(struct LDKCResult_SendSuccessSendErrorZ _res);
32169 * Creates a new CResult_SendSuccessSendErrorZ which has the same data as `orig`
32170 * but with all dynamically-allocated buffers duplicated in new buffers.
32172 struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_clone(const struct LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR orig);
32175 * Creates a new CResult_BlindedPathNoneZ in the success state.
32177 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_ok(struct LDKBlindedPath o);
32180 * Creates a new CResult_BlindedPathNoneZ in the error state.
32182 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_err(void);
32185 * Checks if the given object is currently in the success state
32187 bool CResult_BlindedPathNoneZ_is_ok(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR o);
32190 * Frees any resources used by the CResult_BlindedPathNoneZ.
32192 void CResult_BlindedPathNoneZ_free(struct LDKCResult_BlindedPathNoneZ _res);
32195 * Creates a new CResult_BlindedPathNoneZ which has the same data as `orig`
32196 * but with all dynamically-allocated buffers duplicated in new buffers.
32198 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_clone(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR orig);
32201 * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the success state.
32203 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ o);
32206 * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the error state.
32208 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err(void);
32211 * Checks if the given object is currently in the success state
32213 bool CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR o);
32216 * Frees any resources used by the CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.
32218 void CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ _res);
32221 * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ which has the same data as `orig`
32222 * but with all dynamically-allocated buffers duplicated in new buffers.
32224 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR orig);
32227 * Frees the buffer pointed to by `data` if `datalen` is non-0.
32229 void CVec_ForwardNodeZ_free(struct LDKCVec_ForwardNodeZ _res);
32232 * Creates a new CResult_BlindedPathDecodeErrorZ in the success state.
32234 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_ok(struct LDKBlindedPath o);
32237 * Creates a new CResult_BlindedPathDecodeErrorZ in the error state.
32239 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_err(struct LDKDecodeError e);
32242 * Checks if the given object is currently in the success state
32244 bool CResult_BlindedPathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR o);
32247 * Frees any resources used by the CResult_BlindedPathDecodeErrorZ.
32249 void CResult_BlindedPathDecodeErrorZ_free(struct LDKCResult_BlindedPathDecodeErrorZ _res);
32252 * Creates a new CResult_BlindedPathDecodeErrorZ which has the same data as `orig`
32253 * but with all dynamically-allocated buffers duplicated in new buffers.
32255 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_clone(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR orig);
32258 * Creates a new CResult_BlindedHopDecodeErrorZ in the success state.
32260 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o);
32263 * Creates a new CResult_BlindedHopDecodeErrorZ in the error state.
32265 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e);
32268 * Checks if the given object is currently in the success state
32270 bool CResult_BlindedHopDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR o);
32273 * Frees any resources used by the CResult_BlindedHopDecodeErrorZ.
32275 void CResult_BlindedHopDecodeErrorZ_free(struct LDKCResult_BlindedHopDecodeErrorZ _res);
32278 * Creates a new CResult_BlindedHopDecodeErrorZ which has the same data as `orig`
32279 * but with all dynamically-allocated buffers duplicated in new buffers.
32281 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_clone(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR orig);
32284 * Creates a new CResult_InvoiceErrorDecodeErrorZ in the success state.
32286 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_ok(struct LDKInvoiceError o);
32289 * Creates a new CResult_InvoiceErrorDecodeErrorZ in the error state.
32291 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_err(struct LDKDecodeError e);
32294 * Checks if the given object is currently in the success state
32296 bool CResult_InvoiceErrorDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR o);
32299 * Frees any resources used by the CResult_InvoiceErrorDecodeErrorZ.
32301 void CResult_InvoiceErrorDecodeErrorZ_free(struct LDKCResult_InvoiceErrorDecodeErrorZ _res);
32304 * Creates a new CResult_InvoiceErrorDecodeErrorZ which has the same data as `orig`
32305 * but with all dynamically-allocated buffers duplicated in new buffers.
32307 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_clone(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR orig);
32310 * Creates a new CResult_TrackedSpendableOutputDecodeErrorZ in the success state.
32312 struct LDKCResult_TrackedSpendableOutputDecodeErrorZ CResult_TrackedSpendableOutputDecodeErrorZ_ok(struct LDKTrackedSpendableOutput o);
32315 * Creates a new CResult_TrackedSpendableOutputDecodeErrorZ in the error state.
32317 struct LDKCResult_TrackedSpendableOutputDecodeErrorZ CResult_TrackedSpendableOutputDecodeErrorZ_err(struct LDKDecodeError e);
32320 * Checks if the given object is currently in the success state
32322 bool CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(const struct LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR o);
32325 * Frees any resources used by the CResult_TrackedSpendableOutputDecodeErrorZ.
32327 void CResult_TrackedSpendableOutputDecodeErrorZ_free(struct LDKCResult_TrackedSpendableOutputDecodeErrorZ _res);
32330 * Creates a new CResult_TrackedSpendableOutputDecodeErrorZ which has the same data as `orig`
32331 * but with all dynamically-allocated buffers duplicated in new buffers.
32333 struct LDKCResult_TrackedSpendableOutputDecodeErrorZ CResult_TrackedSpendableOutputDecodeErrorZ_clone(const struct LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR orig);
32336 * Creates a new CResult_OutputSpendStatusDecodeErrorZ in the success state.
32338 struct LDKCResult_OutputSpendStatusDecodeErrorZ CResult_OutputSpendStatusDecodeErrorZ_ok(struct LDKOutputSpendStatus o);
32341 * Creates a new CResult_OutputSpendStatusDecodeErrorZ in the error state.
32343 struct LDKCResult_OutputSpendStatusDecodeErrorZ CResult_OutputSpendStatusDecodeErrorZ_err(struct LDKDecodeError e);
32346 * Checks if the given object is currently in the success state
32348 bool CResult_OutputSpendStatusDecodeErrorZ_is_ok(const struct LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR o);
32351 * Frees any resources used by the CResult_OutputSpendStatusDecodeErrorZ.
32353 void CResult_OutputSpendStatusDecodeErrorZ_free(struct LDKCResult_OutputSpendStatusDecodeErrorZ _res);
32356 * Creates a new CResult_OutputSpendStatusDecodeErrorZ which has the same data as `orig`
32357 * but with all dynamically-allocated buffers duplicated in new buffers.
32359 struct LDKCResult_OutputSpendStatusDecodeErrorZ CResult_OutputSpendStatusDecodeErrorZ_clone(const struct LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR orig);
32362 * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
32364 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
32367 * Constructs a new COption_FilterZ containing nothing
32369 struct LDKCOption_FilterZ COption_FilterZ_none(void);
32372 * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
32374 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
32377 * Frees the buffer pointed to by `data` if `datalen` is non-0.
32379 void CVec_TrackedSpendableOutputZ_free(struct LDKCVec_TrackedSpendableOutputZ _res);
32382 * Creates a new CResult_OutputSweeperDecodeErrorZ in the success state.
32384 struct LDKCResult_OutputSweeperDecodeErrorZ CResult_OutputSweeperDecodeErrorZ_ok(struct LDKOutputSweeper o);
32387 * Creates a new CResult_OutputSweeperDecodeErrorZ in the error state.
32389 struct LDKCResult_OutputSweeperDecodeErrorZ CResult_OutputSweeperDecodeErrorZ_err(struct LDKDecodeError e);
32392 * Checks if the given object is currently in the success state
32394 bool CResult_OutputSweeperDecodeErrorZ_is_ok(const struct LDKCResult_OutputSweeperDecodeErrorZ *NONNULL_PTR o);
32397 * Frees any resources used by the CResult_OutputSweeperDecodeErrorZ.
32399 void CResult_OutputSweeperDecodeErrorZ_free(struct LDKCResult_OutputSweeperDecodeErrorZ _res);
32402 * Creates a new C2Tuple_BestBlockOutputSweeperZ from the contained elements.
32404 struct LDKC2Tuple_BestBlockOutputSweeperZ C2Tuple_BestBlockOutputSweeperZ_new(struct LDKBestBlock a, struct LDKOutputSweeper b);
32407 * Frees any resources used by the C2Tuple_BestBlockOutputSweeperZ.
32409 void C2Tuple_BestBlockOutputSweeperZ_free(struct LDKC2Tuple_BestBlockOutputSweeperZ _res);
32412 * Creates a new CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ in the success state.
32414 struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok(struct LDKC2Tuple_BestBlockOutputSweeperZ o);
32417 * Creates a new CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ in the error state.
32419 struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_err(struct LDKDecodeError e);
32422 * Checks if the given object is currently in the success state
32424 bool CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ *NONNULL_PTR o);
32427 * Frees any resources used by the CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ.
32429 void CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ _res);
32432 * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ in the success state.
32434 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_ok(struct LDKDelayedPaymentBasepoint o);
32437 * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ in the error state.
32439 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_err(struct LDKDecodeError e);
32442 * Checks if the given object is currently in the success state
32444 bool CResult_DelayedPaymentBasepointDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR o);
32447 * Frees any resources used by the CResult_DelayedPaymentBasepointDecodeErrorZ.
32449 void CResult_DelayedPaymentBasepointDecodeErrorZ_free(struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ _res);
32452 * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ which has the same data as `orig`
32453 * but with all dynamically-allocated buffers duplicated in new buffers.
32455 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR orig);
32458 * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ in the success state.
32460 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ CResult_DelayedPaymentKeyDecodeErrorZ_ok(struct LDKDelayedPaymentKey o);
32463 * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ in the error state.
32465 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ CResult_DelayedPaymentKeyDecodeErrorZ_err(struct LDKDecodeError e);
32468 * Checks if the given object is currently in the success state
32470 bool CResult_DelayedPaymentKeyDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR o);
32473 * Frees any resources used by the CResult_DelayedPaymentKeyDecodeErrorZ.
32475 void CResult_DelayedPaymentKeyDecodeErrorZ_free(struct LDKCResult_DelayedPaymentKeyDecodeErrorZ _res);
32478 * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ which has the same data as `orig`
32479 * but with all dynamically-allocated buffers duplicated in new buffers.
32481 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ CResult_DelayedPaymentKeyDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR orig);
32484 * Creates a new CResult_HtlcBasepointDecodeErrorZ in the success state.
32486 struct LDKCResult_HtlcBasepointDecodeErrorZ CResult_HtlcBasepointDecodeErrorZ_ok(struct LDKHtlcBasepoint o);
32489 * Creates a new CResult_HtlcBasepointDecodeErrorZ in the error state.
32491 struct LDKCResult_HtlcBasepointDecodeErrorZ CResult_HtlcBasepointDecodeErrorZ_err(struct LDKDecodeError e);
32494 * Checks if the given object is currently in the success state
32496 bool CResult_HtlcBasepointDecodeErrorZ_is_ok(const struct LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR o);
32499 * Frees any resources used by the CResult_HtlcBasepointDecodeErrorZ.
32501 void CResult_HtlcBasepointDecodeErrorZ_free(struct LDKCResult_HtlcBasepointDecodeErrorZ _res);
32504 * Creates a new CResult_HtlcBasepointDecodeErrorZ which has the same data as `orig`
32505 * but with all dynamically-allocated buffers duplicated in new buffers.
32507 struct LDKCResult_HtlcBasepointDecodeErrorZ CResult_HtlcBasepointDecodeErrorZ_clone(const struct LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR orig);
32510 * Creates a new CResult_HtlcKeyDecodeErrorZ in the success state.
32512 struct LDKCResult_HtlcKeyDecodeErrorZ CResult_HtlcKeyDecodeErrorZ_ok(struct LDKHtlcKey o);
32515 * Creates a new CResult_HtlcKeyDecodeErrorZ in the error state.
32517 struct LDKCResult_HtlcKeyDecodeErrorZ CResult_HtlcKeyDecodeErrorZ_err(struct LDKDecodeError e);
32520 * Checks if the given object is currently in the success state
32522 bool CResult_HtlcKeyDecodeErrorZ_is_ok(const struct LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR o);
32525 * Frees any resources used by the CResult_HtlcKeyDecodeErrorZ.
32527 void CResult_HtlcKeyDecodeErrorZ_free(struct LDKCResult_HtlcKeyDecodeErrorZ _res);
32530 * Creates a new CResult_HtlcKeyDecodeErrorZ which has the same data as `orig`
32531 * but with all dynamically-allocated buffers duplicated in new buffers.
32533 struct LDKCResult_HtlcKeyDecodeErrorZ CResult_HtlcKeyDecodeErrorZ_clone(const struct LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR orig);
32536 * Creates a new CResult_RevocationBasepointDecodeErrorZ in the success state.
32538 struct LDKCResult_RevocationBasepointDecodeErrorZ CResult_RevocationBasepointDecodeErrorZ_ok(struct LDKRevocationBasepoint o);
32541 * Creates a new CResult_RevocationBasepointDecodeErrorZ in the error state.
32543 struct LDKCResult_RevocationBasepointDecodeErrorZ CResult_RevocationBasepointDecodeErrorZ_err(struct LDKDecodeError e);
32546 * Checks if the given object is currently in the success state
32548 bool CResult_RevocationBasepointDecodeErrorZ_is_ok(const struct LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR o);
32551 * Frees any resources used by the CResult_RevocationBasepointDecodeErrorZ.
32553 void CResult_RevocationBasepointDecodeErrorZ_free(struct LDKCResult_RevocationBasepointDecodeErrorZ _res);
32556 * Creates a new CResult_RevocationBasepointDecodeErrorZ which has the same data as `orig`
32557 * but with all dynamically-allocated buffers duplicated in new buffers.
32559 struct LDKCResult_RevocationBasepointDecodeErrorZ CResult_RevocationBasepointDecodeErrorZ_clone(const struct LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR orig);
32562 * Creates a new CResult_RevocationKeyDecodeErrorZ in the success state.
32564 struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_ok(struct LDKRevocationKey o);
32567 * Creates a new CResult_RevocationKeyDecodeErrorZ in the error state.
32569 struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_err(struct LDKDecodeError e);
32572 * Checks if the given object is currently in the success state
32574 bool CResult_RevocationKeyDecodeErrorZ_is_ok(const struct LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR o);
32577 * Frees any resources used by the CResult_RevocationKeyDecodeErrorZ.
32579 void CResult_RevocationKeyDecodeErrorZ_free(struct LDKCResult_RevocationKeyDecodeErrorZ _res);
32582 * Creates a new CResult_RevocationKeyDecodeErrorZ which has the same data as `orig`
32583 * but with all dynamically-allocated buffers duplicated in new buffers.
32585 struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_clone(const struct LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR orig);
32588 * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
32590 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
32593 * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
32595 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
32598 * Checks if the given object is currently in the success state
32600 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
32603 * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
32605 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
32608 * Creates a new tuple which has the same data as `orig`
32609 * but with all dynamically-allocated buffers duplicated in new buffers.
32611 struct LDKC2Tuple_OutPointChannelIdZ C2Tuple_OutPointChannelIdZ_clone(const struct LDKC2Tuple_OutPointChannelIdZ *NONNULL_PTR orig);
32614 * Creates a new C2Tuple_OutPointChannelIdZ from the contained elements.
32616 struct LDKC2Tuple_OutPointChannelIdZ C2Tuple_OutPointChannelIdZ_new(struct LDKOutPoint a, struct LDKChannelId b);
32619 * Frees any resources used by the C2Tuple_OutPointChannelIdZ.
32621 void C2Tuple_OutPointChannelIdZ_free(struct LDKC2Tuple_OutPointChannelIdZ _res);
32624 * Frees the buffer pointed to by `data` if `datalen` is non-0.
32626 void CVec_C2Tuple_OutPointChannelIdZZ_free(struct LDKCVec_C2Tuple_OutPointChannelIdZZ _res);
32629 * Frees the buffer pointed to by `data` if `datalen` is non-0.
32631 void CVec_MonitorUpdateIdZ_free(struct LDKCVec_MonitorUpdateIdZ _res);
32634 * Creates a new tuple which has the same data as `orig`
32635 * but with all dynamically-allocated buffers duplicated in new buffers.
32637 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR orig);
32640 * Creates a new C2Tuple_OutPointCVec_MonitorUpdateIdZZ from the contained elements.
32642 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorUpdateIdZ b);
32645 * Frees any resources used by the C2Tuple_OutPointCVec_MonitorUpdateIdZZ.
32647 void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res);
32650 * Frees the buffer pointed to by `data` if `datalen` is non-0.
32652 void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res);
32655 * Frees any resources used by the APIError
32657 void APIError_free(struct LDKAPIError this_ptr);
32660 * Creates a copy of the APIError
32662 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
32665 * Utility method to constructs a new APIMisuseError-variant APIError
32667 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
32670 * Utility method to constructs a new FeeRateTooHigh-variant APIError
32672 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
32675 * Utility method to constructs a new InvalidRoute-variant APIError
32677 struct LDKAPIError APIError_invalid_route(struct LDKStr err);
32680 * Utility method to constructs a new ChannelUnavailable-variant APIError
32682 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
32685 * Utility method to constructs a new MonitorUpdateInProgress-variant APIError
32687 struct LDKAPIError APIError_monitor_update_in_progress(void);
32690 * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
32692 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
32695 * Checks if two APIErrors contain equal inner contents.
32696 * This ignores pointers and is_owned flags and looks at the values in fields.
32698 bool APIError_eq(const struct LDKAPIError *NONNULL_PTR a, const struct LDKAPIError *NONNULL_PTR b);
32701 * Serialize the APIError object into a byte array which can be read by APIError_read
32703 struct LDKCVec_u8Z APIError_write(const struct LDKAPIError *NONNULL_PTR obj);
32706 * Read a APIError from a byte array, created by APIError_write
32708 struct LDKCResult_COption_APIErrorZDecodeErrorZ APIError_read(struct LDKu8slice ser);
32711 * Frees any resources used by the BigSize, if is_owned is set and inner is non-NULL.
32713 void BigSize_free(struct LDKBigSize this_obj);
32715 uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr);
32717 void BigSize_set_a(struct LDKBigSize *NONNULL_PTR this_ptr, uint64_t val);
32720 * Constructs a new BigSize given each field
32722 MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg);
32725 * Creates a copy of the BigSize
32727 struct LDKBigSize BigSize_clone(const struct LDKBigSize *NONNULL_PTR orig);
32730 * Generates a non-cryptographic 64-bit hash of the BigSize.
32732 uint64_t BigSize_hash(const struct LDKBigSize *NONNULL_PTR o);
32735 * Checks if two BigSizes contain equal inner contents.
32736 * This ignores pointers and is_owned flags and looks at the values in fields.
32737 * Two objects with NULL inner values will be considered "equal" here.
32739 bool BigSize_eq(const struct LDKBigSize *NONNULL_PTR a, const struct LDKBigSize *NONNULL_PTR b);
32742 * Serialize the BigSize object into a byte array which can be read by BigSize_read
32744 struct LDKCVec_u8Z BigSize_write(const struct LDKBigSize *NONNULL_PTR obj);
32747 * Read a BigSize from a byte array, created by BigSize_write
32749 struct LDKCResult_BigSizeDecodeErrorZ BigSize_read(struct LDKu8slice ser);
32752 * Frees any resources used by the Hostname, if is_owned is set and inner is non-NULL.
32754 void Hostname_free(struct LDKHostname this_obj);
32757 * Creates a copy of the Hostname
32759 struct LDKHostname Hostname_clone(const struct LDKHostname *NONNULL_PTR orig);
32762 * Generates a non-cryptographic 64-bit hash of the Hostname.
32764 uint64_t Hostname_hash(const struct LDKHostname *NONNULL_PTR o);
32767 * Checks if two Hostnames contain equal inner contents.
32768 * This ignores pointers and is_owned flags and looks at the values in fields.
32769 * Two objects with NULL inner values will be considered "equal" here.
32771 bool Hostname_eq(const struct LDKHostname *NONNULL_PTR a, const struct LDKHostname *NONNULL_PTR b);
32774 * Returns the length of the hostname.
32776 MUST_USE_RES uint8_t Hostname_len(const struct LDKHostname *NONNULL_PTR this_arg);
32779 * Serialize the Hostname object into a byte array which can be read by Hostname_read
32781 struct LDKCVec_u8Z Hostname_write(const struct LDKHostname *NONNULL_PTR obj);
32784 * Read a Hostname from a byte array, created by Hostname_write
32786 struct LDKCResult_HostnameDecodeErrorZ Hostname_read(struct LDKu8slice ser);
32789 * Frees any resources used by the TransactionU16LenLimited, if is_owned is set and inner is non-NULL.
32791 void TransactionU16LenLimited_free(struct LDKTransactionU16LenLimited this_obj);
32794 * Creates a copy of the TransactionU16LenLimited
32796 struct LDKTransactionU16LenLimited TransactionU16LenLimited_clone(const struct LDKTransactionU16LenLimited *NONNULL_PTR orig);
32799 * Generates a non-cryptographic 64-bit hash of the TransactionU16LenLimited.
32801 uint64_t TransactionU16LenLimited_hash(const struct LDKTransactionU16LenLimited *NONNULL_PTR o);
32804 * Checks if two TransactionU16LenLimiteds contain equal inner contents.
32805 * This ignores pointers and is_owned flags and looks at the values in fields.
32806 * Two objects with NULL inner values will be considered "equal" here.
32808 bool TransactionU16LenLimited_eq(const struct LDKTransactionU16LenLimited *NONNULL_PTR a, const struct LDKTransactionU16LenLimited *NONNULL_PTR b);
32811 * Constructs a new `TransactionU16LenLimited` from a `Transaction` only if it's consensus-
32812 * serialized length is <= u16::MAX.
32814 MUST_USE_RES struct LDKCResult_TransactionU16LenLimitedNoneZ TransactionU16LenLimited_new(struct LDKTransaction transaction);
32817 * Consumes this `TransactionU16LenLimited` and returns its contained `Transaction`.
32819 MUST_USE_RES struct LDKTransaction TransactionU16LenLimited_into_transaction(struct LDKTransactionU16LenLimited this_arg);
32822 * Returns a reference to the contained `Transaction`
32824 MUST_USE_RES struct LDKTransaction TransactionU16LenLimited_as_transaction(const struct LDKTransactionU16LenLimited *NONNULL_PTR this_arg);
32827 * Serialize the TransactionU16LenLimited object into a byte array which can be read by TransactionU16LenLimited_read
32829 struct LDKCVec_u8Z TransactionU16LenLimited_write(const struct LDKTransactionU16LenLimited *NONNULL_PTR obj);
32832 * Read a TransactionU16LenLimited from a byte array, created by TransactionU16LenLimited_write
32834 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ TransactionU16LenLimited_read(struct LDKu8slice ser);
32837 * Creates a digital signature of a message given a SecretKey, like the node's secret.
32838 * 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.
32839 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
32841 struct LDKCResult_StrSecp256k1ErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
32844 * Recovers the PublicKey of the signer of the message given the message and the signature.
32846 struct LDKCResult_PublicKeySecp256k1ErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
32849 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
32850 * and the PublicKey.
32852 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
32855 * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
32857 struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z data_without_signature);
32860 * Calls the free function if one is set
32862 void KVStore_free(struct LDKKVStore this_ptr);
32865 * Calls the free function if one is set
32867 void Persister_free(struct LDKPersister this_ptr);
32870 * Read previously persisted [`ChannelMonitor`]s from the store.
32872 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ read_channel_monitors(struct LDKKVStore kv_store, struct LDKEntropySource entropy_source, struct LDKSignerProvider signer_provider);
32875 * Frees any resources used by the MonitorUpdatingPersister, if is_owned is set and inner is non-NULL.
32877 void MonitorUpdatingPersister_free(struct LDKMonitorUpdatingPersister this_obj);
32880 * Constructs a new [`MonitorUpdatingPersister`].
32882 * The `maximum_pending_updates` parameter controls how many updates may be stored before a
32883 * [`MonitorUpdatingPersister`] consolidates updates by writing a full monitor. Note that
32884 * consolidation will frequently occur with fewer updates than what you set here; this number
32885 * is merely the maximum that may be stored. When setting this value, consider that for higher
32886 * values of `maximum_pending_updates`:
32888 * - [`MonitorUpdatingPersister`] will tend to write more [`ChannelMonitorUpdate`]s than
32889 * [`ChannelMonitor`]s, approaching one [`ChannelMonitor`] write for every
32890 * `maximum_pending_updates` [`ChannelMonitorUpdate`]s.
32891 * - [`MonitorUpdatingPersister`] will issue deletes differently. Lazy deletes will come in
32892 * \"waves\" for each [`ChannelMonitor`] write. A larger `maximum_pending_updates` means bigger,
32893 * less frequent \"waves.\"
32894 * - [`MonitorUpdatingPersister`] will potentially have more listing to do if you need to run
32895 * [`MonitorUpdatingPersister::cleanup_stale_updates`].
32897 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);
32900 * Reads all stored channel monitors, along with any stored updates for them.
32902 * It is extremely important that your [`KVStore::read`] implementation uses the
32903 * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
32904 * documentation for [`MonitorUpdatingPersister`].
32906 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);
32909 * Read a single channel monitor, along with any stored updates for it.
32911 * It is extremely important that your [`KVStore::read`] implementation uses the
32912 * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
32913 * documentation for [`MonitorUpdatingPersister`].
32915 * For `monitor_key`, channel storage keys be the channel's transaction ID and index, or
32916 * [`OutPoint`], with an underscore `_` between them. For example, given:
32918 * - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
32921 * The correct `monitor_key` would be:
32922 * `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
32924 * Loading a large number of monitors will be faster if done in parallel. You can use this
32925 * function to accomplish this. Take care to limit the number of parallel readers.
32927 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);
32930 * Cleans up stale updates for all monitors.
32932 * This function works by first listing all monitors, and then for each of them, listing all
32933 * updates. The updates that have an `update_id` less than or equal to than the stored monitor
32934 * are deleted. The deletion can either be lazy or non-lazy based on the `lazy` flag; this will
32935 * be passed to [`KVStore::remove`].
32937 MUST_USE_RES struct LDKCResult_NoneIOErrorZ MonitorUpdatingPersister_cleanup_stale_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, bool lazy);
32940 * Constructs a new Persist which calls the relevant methods on this_arg.
32941 * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
32943 struct LDKPersist MonitorUpdatingPersister_as_Persist(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg);
32946 * Creates a copy of the ShortChannelIdError
32948 enum LDKShortChannelIdError ShortChannelIdError_clone(const enum LDKShortChannelIdError *NONNULL_PTR orig);
32951 * Utility method to constructs a new BlockOverflow-variant ShortChannelIdError
32953 enum LDKShortChannelIdError ShortChannelIdError_block_overflow(void);
32956 * Utility method to constructs a new TxIndexOverflow-variant ShortChannelIdError
32958 enum LDKShortChannelIdError ShortChannelIdError_tx_index_overflow(void);
32961 * Utility method to constructs a new VoutIndexOverflow-variant ShortChannelIdError
32963 enum LDKShortChannelIdError ShortChannelIdError_vout_index_overflow(void);
32966 * Checks if two ShortChannelIdErrors contain equal inner contents.
32967 * This ignores pointers and is_owned flags and looks at the values in fields.
32969 bool ShortChannelIdError_eq(const enum LDKShortChannelIdError *NONNULL_PTR a, const enum LDKShortChannelIdError *NONNULL_PTR b);
32972 * Extracts the block height (most significant 3-bytes) from the `short_channel_id`
32974 uint32_t block_from_scid(uint64_t short_channel_id);
32977 * Extracts the tx index (bytes [2..4]) from the `short_channel_id`
32979 uint32_t tx_index_from_scid(uint64_t short_channel_id);
32982 * Extracts the vout (bytes [0..2]) from the `short_channel_id`
32984 uint16_t vout_from_scid(uint64_t short_channel_id);
32987 * Constructs a `short_channel_id` using the components pieces. Results in an error
32988 * if the block height, tx index, or vout index overflow the maximum sizes.
32990 struct LDKCResult_u64ShortChannelIdErrorZ scid_from_parts(uint64_t block, uint64_t tx_index, uint64_t vout_index);
32993 * Frees any resources used by the UntrustedString, if is_owned is set and inner is non-NULL.
32995 void UntrustedString_free(struct LDKUntrustedString this_obj);
32997 struct LDKStr UntrustedString_get_a(const struct LDKUntrustedString *NONNULL_PTR this_ptr);
32999 void UntrustedString_set_a(struct LDKUntrustedString *NONNULL_PTR this_ptr, struct LDKStr val);
33002 * Constructs a new UntrustedString given each field
33004 MUST_USE_RES struct LDKUntrustedString UntrustedString_new(struct LDKStr a_arg);
33007 * Creates a copy of the UntrustedString
33009 struct LDKUntrustedString UntrustedString_clone(const struct LDKUntrustedString *NONNULL_PTR orig);
33012 * Checks if two UntrustedStrings contain equal inner contents.
33013 * This ignores pointers and is_owned flags and looks at the values in fields.
33014 * Two objects with NULL inner values will be considered "equal" here.
33016 bool UntrustedString_eq(const struct LDKUntrustedString *NONNULL_PTR a, const struct LDKUntrustedString *NONNULL_PTR b);
33019 * Generates a non-cryptographic 64-bit hash of the UntrustedString.
33021 uint64_t UntrustedString_hash(const struct LDKUntrustedString *NONNULL_PTR o);
33024 * Serialize the UntrustedString object into a byte array which can be read by UntrustedString_read
33026 struct LDKCVec_u8Z UntrustedString_write(const struct LDKUntrustedString *NONNULL_PTR obj);
33029 * Read a UntrustedString from a byte array, created by UntrustedString_write
33031 struct LDKCResult_UntrustedStringDecodeErrorZ UntrustedString_read(struct LDKu8slice ser);
33034 * Frees any resources used by the PrintableString, if is_owned is set and inner is non-NULL.
33036 void PrintableString_free(struct LDKPrintableString this_obj);
33038 struct LDKStr PrintableString_get_a(const struct LDKPrintableString *NONNULL_PTR this_ptr);
33040 void PrintableString_set_a(struct LDKPrintableString *NONNULL_PTR this_ptr, struct LDKStr val);
33043 * Constructs a new PrintableString given each field
33045 MUST_USE_RES struct LDKPrintableString PrintableString_new(struct LDKStr a_arg);
33048 * Frees any resources used by the TrackedSpendableOutput, if is_owned is set and inner is non-NULL.
33050 void TrackedSpendableOutput_free(struct LDKTrackedSpendableOutput this_obj);
33053 * The tracked output descriptor.
33055 struct LDKSpendableOutputDescriptor TrackedSpendableOutput_get_descriptor(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr);
33058 * The tracked output descriptor.
33060 void TrackedSpendableOutput_set_descriptor(struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr, struct LDKSpendableOutputDescriptor val);
33063 * The channel this output belongs to.
33065 * Will be `None` if no `channel_id` was given to [`OutputSweeper::track_spendable_outputs`]
33067 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33069 struct LDKChannelId TrackedSpendableOutput_get_channel_id(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr);
33072 * The channel this output belongs to.
33074 * Will be `None` if no `channel_id` was given to [`OutputSweeper::track_spendable_outputs`]
33076 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
33078 void TrackedSpendableOutput_set_channel_id(struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr, struct LDKChannelId val);
33081 * The current status of the output spend.
33083 struct LDKOutputSpendStatus TrackedSpendableOutput_get_status(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr);
33086 * The current status of the output spend.
33088 void TrackedSpendableOutput_set_status(struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr, struct LDKOutputSpendStatus val);
33091 * Constructs a new TrackedSpendableOutput given each field
33093 * Note that channel_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
33095 MUST_USE_RES struct LDKTrackedSpendableOutput TrackedSpendableOutput_new(struct LDKSpendableOutputDescriptor descriptor_arg, struct LDKChannelId channel_id_arg, struct LDKOutputSpendStatus status_arg);
33098 * Creates a copy of the TrackedSpendableOutput
33100 struct LDKTrackedSpendableOutput TrackedSpendableOutput_clone(const struct LDKTrackedSpendableOutput *NONNULL_PTR orig);
33103 * Checks if two TrackedSpendableOutputs contain equal inner contents.
33104 * This ignores pointers and is_owned flags and looks at the values in fields.
33105 * Two objects with NULL inner values will be considered "equal" here.
33107 bool TrackedSpendableOutput_eq(const struct LDKTrackedSpendableOutput *NONNULL_PTR a, const struct LDKTrackedSpendableOutput *NONNULL_PTR b);
33110 * Returns whether the output is spent in the given transaction.
33112 MUST_USE_RES bool TrackedSpendableOutput_is_spent_in(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_arg, struct LDKTransaction tx);
33115 * Serialize the TrackedSpendableOutput object into a byte array which can be read by TrackedSpendableOutput_read
33117 struct LDKCVec_u8Z TrackedSpendableOutput_write(const struct LDKTrackedSpendableOutput *NONNULL_PTR obj);
33120 * Read a TrackedSpendableOutput from a byte array, created by TrackedSpendableOutput_write
33122 struct LDKCResult_TrackedSpendableOutputDecodeErrorZ TrackedSpendableOutput_read(struct LDKu8slice ser);
33125 * Frees any resources used by the OutputSpendStatus
33127 void OutputSpendStatus_free(struct LDKOutputSpendStatus this_ptr);
33130 * Creates a copy of the OutputSpendStatus
33132 struct LDKOutputSpendStatus OutputSpendStatus_clone(const struct LDKOutputSpendStatus *NONNULL_PTR orig);
33135 * Utility method to constructs a new PendingInitialBroadcast-variant OutputSpendStatus
33137 struct LDKOutputSpendStatus OutputSpendStatus_pending_initial_broadcast(struct LDKCOption_u32Z delayed_until_height);
33140 * Utility method to constructs a new PendingFirstConfirmation-variant OutputSpendStatus
33142 struct LDKOutputSpendStatus OutputSpendStatus_pending_first_confirmation(struct LDKThirtyTwoBytes first_broadcast_hash, uint32_t latest_broadcast_height, struct LDKTransaction latest_spending_tx);
33145 * Utility method to constructs a new PendingThresholdConfirmations-variant OutputSpendStatus
33147 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);
33150 * Checks if two OutputSpendStatuss contain equal inner contents.
33151 * This ignores pointers and is_owned flags and looks at the values in fields.
33153 bool OutputSpendStatus_eq(const struct LDKOutputSpendStatus *NONNULL_PTR a, const struct LDKOutputSpendStatus *NONNULL_PTR b);
33156 * Serialize the OutputSpendStatus object into a byte array which can be read by OutputSpendStatus_read
33158 struct LDKCVec_u8Z OutputSpendStatus_write(const struct LDKOutputSpendStatus *NONNULL_PTR obj);
33161 * Read a OutputSpendStatus from a byte array, created by OutputSpendStatus_write
33163 struct LDKCResult_OutputSpendStatusDecodeErrorZ OutputSpendStatus_read(struct LDKu8slice ser);
33166 * Frees any resources used by the OutputSweeper, if is_owned is set and inner is non-NULL.
33168 void OutputSweeper_free(struct LDKOutputSweeper this_obj);
33171 * Constructs a new [`OutputSweeper`].
33173 * If chain data is provided via the [`Confirm`] interface or via filtered blocks, users also
33174 * need to register their [`Filter`] implementation via the given `chain_data_source`.
33176 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);
33179 * Tells the sweeper to track the given outputs descriptors.
33181 * Usually, this should be called based on the values emitted by the
33182 * [`Event::SpendableOutputs`].
33184 * The given `exclude_static_outputs` flag controls whether the sweeper will filter out
33185 * [`SpendableOutputDescriptor::StaticOutput`]s, which may be handled directly by the on-chain
33186 * wallet implementation.
33188 * If `delay_until_height` is set, we will delay the spending until the respective block
33189 * height is reached. This can be used to batch spends, e.g., to reduce on-chain fees.
33191 * Returns `Err` on persistence failure, in which case the call may be safely retried.
33193 * [`Event::SpendableOutputs`]: crate::events::Event::SpendableOutputs
33195 * Note that channel_id (or a relevant inner pointer) may be NULL or all-0s to represent None
33197 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);
33200 * Returns a list of the currently tracked spendable outputs.
33202 MUST_USE_RES struct LDKCVec_TrackedSpendableOutputZ OutputSweeper_tracked_spendable_outputs(const struct LDKOutputSweeper *NONNULL_PTR this_arg);
33205 * Gets the latest best block which was connected either via the [`Listen`] or
33206 * [`Confirm`] interfaces.
33208 MUST_USE_RES struct LDKBestBlock OutputSweeper_current_best_block(const struct LDKOutputSweeper *NONNULL_PTR this_arg);
33211 * Constructs a new Listen which calls the relevant methods on this_arg.
33212 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
33214 struct LDKListen OutputSweeper_as_Listen(const struct LDKOutputSweeper *NONNULL_PTR this_arg);
33217 * Constructs a new Confirm which calls the relevant methods on this_arg.
33218 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
33220 struct LDKConfirm OutputSweeper_as_Confirm(const struct LDKOutputSweeper *NONNULL_PTR this_arg);
33223 * Frees any resources used by the SpendingDelay
33225 void SpendingDelay_free(struct LDKSpendingDelay this_ptr);
33228 * Creates a copy of the SpendingDelay
33230 struct LDKSpendingDelay SpendingDelay_clone(const struct LDKSpendingDelay *NONNULL_PTR orig);
33233 * Utility method to constructs a new Relative-variant SpendingDelay
33235 struct LDKSpendingDelay SpendingDelay_relative(uint32_t num_blocks);
33238 * Utility method to constructs a new Absolute-variant SpendingDelay
33240 struct LDKSpendingDelay SpendingDelay_absolute(uint32_t height);
33243 * Read a OutputSweeper from a byte array, created by OutputSweeper_write
33245 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);
33248 * Read a C2Tuple_BestBlockOutputSweeperZ from a byte array, created by C2Tuple_BestBlockOutputSweeperZ_write
33250 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);
33253 * Calls the free function if one is set
33255 void FutureCallback_free(struct LDKFutureCallback this_ptr);
33258 * Frees any resources used by the Future, if is_owned is set and inner is non-NULL.
33260 void Future_free(struct LDKFuture this_obj);
33263 * Registers a callback to be called upon completion of this future. If the future has already
33264 * completed, the callback will be called immediately.
33266 void Future_register_callback_fn(const struct LDKFuture *NONNULL_PTR this_arg, struct LDKFutureCallback callback);
33269 * Waits until this [`Future`] completes.
33271 void Future_wait(const struct LDKFuture *NONNULL_PTR this_arg);
33274 * Waits until this [`Future`] completes or the given amount of time has elapsed.
33276 * Returns true if the [`Future`] completed, false if the time elapsed.
33278 MUST_USE_RES bool Future_wait_timeout(const struct LDKFuture *NONNULL_PTR this_arg, uint64_t max_wait);
33281 * Frees any resources used by the Sleeper, if is_owned is set and inner is non-NULL.
33283 void Sleeper_free(struct LDKSleeper this_obj);
33286 * Constructs a new sleeper from one future, allowing blocking on it.
33288 MUST_USE_RES struct LDKSleeper Sleeper_from_single_future(const struct LDKFuture *NONNULL_PTR future);
33291 * Constructs a new sleeper from two futures, allowing blocking on both at once.
33293 MUST_USE_RES struct LDKSleeper Sleeper_from_two_futures(const struct LDKFuture *NONNULL_PTR fut_a, const struct LDKFuture *NONNULL_PTR fut_b);
33296 * Constructs a new sleeper on many futures, allowing blocking on all at once.
33298 MUST_USE_RES struct LDKSleeper Sleeper_new(struct LDKCVec_FutureZ futures);
33301 * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed.
33303 void Sleeper_wait(const struct LDKSleeper *NONNULL_PTR this_arg);
33306 * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed or the
33307 * given amount of time has elapsed. Returns true if a [`Future`] completed, false if the time
33310 MUST_USE_RES bool Sleeper_wait_timeout(const struct LDKSleeper *NONNULL_PTR this_arg, uint64_t max_wait);
33313 * Creates a copy of the Level
33315 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
33318 * Utility method to constructs a new Gossip-variant Level
33320 enum LDKLevel Level_gossip(void);
33323 * Utility method to constructs a new Trace-variant Level
33325 enum LDKLevel Level_trace(void);
33328 * Utility method to constructs a new Debug-variant Level
33330 enum LDKLevel Level_debug(void);
33333 * Utility method to constructs a new Info-variant Level
33335 enum LDKLevel Level_info(void);
33338 * Utility method to constructs a new Warn-variant Level
33340 enum LDKLevel Level_warn(void);
33343 * Utility method to constructs a new Error-variant Level
33345 enum LDKLevel Level_error(void);
33348 * Checks if two Levels contain equal inner contents.
33349 * This ignores pointers and is_owned flags and looks at the values in fields.
33351 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
33354 * Generates a non-cryptographic 64-bit hash of the Level.
33356 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
33359 * Returns the most verbose logging level.
33361 MUST_USE_RES enum LDKLevel Level_max(void);
33364 * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
33366 void Record_free(struct LDKRecord this_obj);
33369 * The verbosity level of the message.
33371 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
33374 * The verbosity level of the message.
33376 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
33379 * The node id of the peer pertaining to the logged record.
33381 * Note that in some cases a [`Self::channel_id`] may be filled in but this may still be
33382 * `None`, depending on if the peer information is readily available in LDK when the log is
33385 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33387 struct LDKPublicKey Record_get_peer_id(const struct LDKRecord *NONNULL_PTR this_ptr);
33390 * The node id of the peer pertaining to the logged record.
33392 * Note that in some cases a [`Self::channel_id`] may be filled in but this may still be
33393 * `None`, depending on if the peer information is readily available in LDK when the log is
33396 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
33398 void Record_set_peer_id(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33401 * The channel id of the channel pertaining to the logged record. May be a temporary id before
33402 * the channel has been funded.
33404 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33406 struct LDKChannelId Record_get_channel_id(const struct LDKRecord *NONNULL_PTR this_ptr);
33409 * The channel id of the channel pertaining to the logged record. May be a temporary id before
33410 * the channel has been funded.
33412 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
33414 void Record_set_channel_id(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKChannelId val);
33417 * The message body.
33419 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
33422 * The message body.
33424 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
33427 * The module path of the message.
33429 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
33432 * The module path of the message.
33434 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
33437 * The source file containing the message.
33439 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
33442 * The source file containing the message.
33444 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
33447 * The line containing the message.
33449 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
33452 * The line containing the message.
33454 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
33457 * Constructs a new Record given each field
33459 * Note that peer_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
33460 * Note that channel_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
33462 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);
33465 * Creates a copy of the Record
33467 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
33470 * Calls the free function if one is set
33472 void Logger_free(struct LDKLogger this_ptr);
33475 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
33477 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
33480 * Confirmations we will wait for before considering the channel locked in.
33481 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
33482 * equivalent limit applied to outbound channels).
33484 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
33485 * transaction before operation. If you wish to accept channels with zero confirmations, see
33486 * [`UserConfig::manually_accept_inbound_channels`] and
33487 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
33489 * Default value: 6.
33491 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
33492 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
33494 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33497 * Confirmations we will wait for before considering the channel locked in.
33498 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
33499 * equivalent limit applied to outbound channels).
33501 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
33502 * transaction before operation. If you wish to accept channels with zero confirmations, see
33503 * [`UserConfig::manually_accept_inbound_channels`] and
33504 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
33506 * Default value: 6.
33508 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
33509 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
33511 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
33514 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
33515 * the number of blocks we have to punish our counterparty if they broadcast a revoked
33518 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
33519 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
33520 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
33521 * possibly with time in between to RBF the spending transaction).
33523 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
33524 * case of an honest unilateral channel close, which implicitly decrease the economic value of
33527 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
33528 * can tweak config to ask for more security, not less.
33530 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33533 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
33534 * the number of blocks we have to punish our counterparty if they broadcast a revoked
33537 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
33538 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
33539 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
33540 * possibly with time in between to RBF the spending transaction).
33542 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
33543 * case of an honest unilateral channel close, which implicitly decrease the economic value of
33546 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
33547 * can tweak config to ask for more security, not less.
33549 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
33552 * Set to the smallest value HTLC we will accept to process.
33554 * This value is sent to our counterparty on channel-open and we close the channel any time
33555 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
33557 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
33560 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33563 * Set to the smallest value HTLC we will accept to process.
33565 * This value is sent to our counterparty on channel-open and we close the channel any time
33566 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
33568 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
33571 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
33574 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
33577 * This can be set to a value between 1-100, where the value corresponds to the percent of the
33578 * channel value in whole percentages.
33581 * * If configured to another value than the default value 10, any new channels created with
33582 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
33583 * `ChannelManager`.
33585 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
33586 * no way to configure the cap for the total value of outbound HTLCs in-flight.
33588 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
33589 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
33590 * restrict exposure to loss due to being offline for too long.
33591 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
33592 * for more information.
33594 * Default value: 10.
33595 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
33596 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
33598 uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33601 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
33604 * This can be set to a value between 1-100, where the value corresponds to the percent of the
33605 * channel value in whole percentages.
33608 * * If configured to another value than the default value 10, any new channels created with
33609 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
33610 * `ChannelManager`.
33612 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
33613 * no way to configure the cap for the total value of outbound HTLCs in-flight.
33615 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
33616 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
33617 * restrict exposure to loss due to being offline for too long.
33618 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
33619 * for more information.
33621 * Default value: 10.
33622 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
33623 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
33625 void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val);
33628 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
33629 * BOLTs) option for outbound private channels. This provides better privacy by not including
33630 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
33631 * relay HTLCs to us using the channel's SCID alias.
33633 * If this option is set, channels may be created that will not be readable by LDK versions
33634 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
33635 * [`DecodeError::InvalidValue`].
33637 * Note that setting this to true does *not* prevent us from opening channels with
33638 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
33639 * private channel without that option.
33641 * Ignored if the channel is negotiated to be announced, see
33642 * [`ChannelHandshakeConfig::announced_channel`] and
33643 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
33645 * Default value: false. This value is likely to change to true in the future.
33647 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
33648 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
33650 bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33653 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
33654 * BOLTs) option for outbound private channels. This provides better privacy by not including
33655 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
33656 * relay HTLCs to us using the channel's SCID alias.
33658 * If this option is set, channels may be created that will not be readable by LDK versions
33659 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
33660 * [`DecodeError::InvalidValue`].
33662 * Note that setting this to true does *not* prevent us from opening channels with
33663 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
33664 * private channel without that option.
33666 * Ignored if the channel is negotiated to be announced, see
33667 * [`ChannelHandshakeConfig::announced_channel`] and
33668 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
33670 * Default value: false. This value is likely to change to true in the future.
33672 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
33673 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
33675 void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
33678 * Set to announce the channel publicly and notify all nodes that they can route via this
33681 * This should only be set to true for nodes which expect to be online reliably.
33683 * As the node which funds a channel picks this value this will only apply for new outbound
33684 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
33686 * Default value: false.
33688 bool ChannelHandshakeConfig_get_announced_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33691 * Set to announce the channel publicly and notify all nodes that they can route via this
33694 * This should only be set to true for nodes which expect to be online reliably.
33696 * As the node which funds a channel picks this value this will only apply for new outbound
33697 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
33699 * Default value: false.
33701 void ChannelHandshakeConfig_set_announced_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
33704 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
33705 * supports it, they will then enforce the mutual-close output to us matches what we provided
33706 * at intialization, preventing us from closing to an alternate pubkey.
33708 * This is set to true by default to provide a slight increase in security, though ultimately
33709 * any attacker who is able to take control of a channel can just as easily send the funds via
33710 * lightning payments, so we never require that our counterparties support this option.
33712 * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
33714 * Default value: true.
33716 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
33718 bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33721 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
33722 * supports it, they will then enforce the mutual-close output to us matches what we provided
33723 * at intialization, preventing us from closing to an alternate pubkey.
33725 * This is set to true by default to provide a slight increase in security, though ultimately
33726 * any attacker who is able to take control of a channel can just as easily send the funds via
33727 * lightning payments, so we never require that our counterparties support this option.
33729 * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
33731 * Default value: true.
33733 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
33735 void ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
33738 * The Proportion of the channel value to configure as counterparty's channel reserve,
33739 * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
33741 * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
33742 * on their side, at all times.
33743 * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
33744 * claiming at least this value on chain.
33746 * Channel reserve values greater than 30% could be considered highly unreasonable, since that
33747 * amount can never be used for payments.
33748 * Also, if our selected channel reserve for counterparty and counterparty's selected
33749 * channel reserve for us sum up to equal or greater than channel value, channel negotiations
33752 * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
33753 * other than the default value.
33755 * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
33756 * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
33757 * as 1000 sats instead, which is a safe implementation-specific lower bound.
33758 * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
33759 * instead, although channel negotiations will fail in that case.
33761 uint32_t ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33764 * The Proportion of the channel value to configure as counterparty's channel reserve,
33765 * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
33767 * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
33768 * on their side, at all times.
33769 * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
33770 * claiming at least this value on chain.
33772 * Channel reserve values greater than 30% could be considered highly unreasonable, since that
33773 * amount can never be used for payments.
33774 * Also, if our selected channel reserve for counterparty and counterparty's selected
33775 * channel reserve for us sum up to equal or greater than channel value, channel negotiations
33778 * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
33779 * other than the default value.
33781 * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
33782 * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
33783 * as 1000 sats instead, which is a safe implementation-specific lower bound.
33784 * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
33785 * instead, although channel negotiations will fail in that case.
33787 void ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
33790 * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
33791 * channels. This feature requires having a reserve of onchain funds readily available to bump
33792 * transactions in the event of a channel force close to avoid the possibility of losing funds.
33794 * Note that if you wish accept inbound channels with anchor outputs, you must enable
33795 * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
33796 * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
33797 * whether your reserve of onchain funds is enough to cover the fees for all existing and new
33798 * channels featuring anchor outputs in the event of a force close.
33800 * If this option is set, channels may be created that will not be readable by LDK versions
33801 * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
33802 * [`DecodeError::InvalidValue`].
33804 * Note that setting this to true does *not* prevent us from opening channels with
33805 * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
33806 * fall back to a `static_remote_key` channel.
33808 * LDK will not support the legacy `option_anchors` commitment version due to a discovered
33809 * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
33810 * Considered Harmful`] mailing list post.
33812 * Default value: false. This value is likely to change to true in the future.
33814 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
33815 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
33816 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
33817 * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
33819 bool ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33822 * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
33823 * channels. This feature requires having a reserve of onchain funds readily available to bump
33824 * transactions in the event of a channel force close to avoid the possibility of losing funds.
33826 * Note that if you wish accept inbound channels with anchor outputs, you must enable
33827 * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
33828 * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
33829 * whether your reserve of onchain funds is enough to cover the fees for all existing and new
33830 * channels featuring anchor outputs in the event of a force close.
33832 * If this option is set, channels may be created that will not be readable by LDK versions
33833 * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
33834 * [`DecodeError::InvalidValue`].
33836 * Note that setting this to true does *not* prevent us from opening channels with
33837 * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
33838 * fall back to a `static_remote_key` channel.
33840 * LDK will not support the legacy `option_anchors` commitment version due to a discovered
33841 * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
33842 * Considered Harmful`] mailing list post.
33844 * Default value: false. This value is likely to change to true in the future.
33846 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
33847 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
33848 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
33849 * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
33851 void ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
33854 * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
33856 * Increasing the value can help improve liquidity and stability in
33857 * routing at the cost of higher long term disk / DB usage.
33859 * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
33860 * other than the default value.
33862 * Default value: 50
33863 * Maximum value: 483, any values larger will be treated as 483.
33864 * This is the BOLT #2 spec limit on `max_accepted_htlcs`.
33866 uint16_t ChannelHandshakeConfig_get_our_max_accepted_htlcs(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33869 * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
33871 * Increasing the value can help improve liquidity and stability in
33872 * routing at the cost of higher long term disk / DB usage.
33874 * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
33875 * other than the default value.
33877 * Default value: 50
33878 * Maximum value: 483, any values larger will be treated as 483.
33879 * This is the BOLT #2 spec limit on `max_accepted_htlcs`.
33881 void ChannelHandshakeConfig_set_our_max_accepted_htlcs(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
33884 * Constructs a new ChannelHandshakeConfig given each field
33886 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);
33889 * Creates a copy of the ChannelHandshakeConfig
33891 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
33894 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
33896 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
33899 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
33901 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
33904 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
33905 * only applies to inbound channels.
33907 * Default value: 0.
33909 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
33912 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
33913 * only applies to inbound channels.
33915 * Default value: 0.
33917 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
33920 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
33921 * only applies to inbound channels.
33923 * Default value: 2^24 - 1.
33925 uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
33928 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
33929 * only applies to inbound channels.
33931 * Default value: 2^24 - 1.
33933 void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
33936 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
33937 * you to limit the maximum minimum-size they can require.
33939 * Default value: u64::max_value.
33941 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
33944 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
33945 * you to limit the maximum minimum-size they can require.
33947 * Default value: u64::max_value.
33949 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
33952 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
33953 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
33955 * Default value: 0.
33957 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
33960 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
33961 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
33963 * Default value: 0.
33965 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
33968 * The remote node will require we keep a certain amount in direct payment to ourselves at all
33969 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
33970 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
33972 * Default value: u64::max_value.
33974 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
33977 * The remote node will require we keep a certain amount in direct payment to ourselves at all
33978 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
33979 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
33981 * Default value: u64::max_value.
33983 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
33986 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
33987 * time. This allows you to set a minimum such value.
33989 * Default value: 0.
33991 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
33994 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
33995 * time. This allows you to set a minimum such value.
33997 * Default value: 0.
33999 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
34002 * Before a channel is usable the funding transaction will need to be confirmed by at least a
34003 * certain number of blocks, specified by the node which is not the funder (as the funder can
34004 * assume they aren't going to double-spend themselves).
34005 * This config allows you to set a limit on the maximum amount of time to wait.
34007 * Default value: 144, or roughly one day and only applies to outbound channels.
34009 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34012 * Before a channel is usable the funding transaction will need to be confirmed by at least a
34013 * certain number of blocks, specified by the node which is not the funder (as the funder can
34014 * assume they aren't going to double-spend themselves).
34015 * This config allows you to set a limit on the maximum amount of time to wait.
34017 * Default value: 144, or roughly one day and only applies to outbound channels.
34019 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
34022 * Whether we implicitly trust funding transactions generated by us for our own outbound
34023 * channels to not be double-spent.
34025 * If this is set, we assume that our own funding transactions are *never* double-spent, and
34026 * thus we can trust them without any confirmations. This is generally a reasonable
34027 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
34028 * control of the signing keys).
34030 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
34031 * double-spend the funding transaction to RBF with an alternative channel open.
34033 * This only applies if our counterparty set their confirmations-required value to 0, and we
34034 * always trust our own funding transaction at 1 confirmation irrespective of this value.
34035 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
34036 * `true` (0) and `false` (1).
34038 * Default value: true
34040 bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34043 * Whether we implicitly trust funding transactions generated by us for our own outbound
34044 * channels to not be double-spent.
34046 * If this is set, we assume that our own funding transactions are *never* double-spent, and
34047 * thus we can trust them without any confirmations. This is generally a reasonable
34048 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
34049 * control of the signing keys).
34051 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
34052 * double-spend the funding transaction to RBF with an alternative channel open.
34054 * This only applies if our counterparty set their confirmations-required value to 0, and we
34055 * always trust our own funding transaction at 1 confirmation irrespective of this value.
34056 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
34057 * `true` (0) and `false` (1).
34059 * Default value: true
34061 void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
34064 * Set to force an incoming channel to match our announced channel preference in
34065 * [`ChannelHandshakeConfig::announced_channel`].
34067 * For a node which is not online reliably, this should be set to true and
34068 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
34069 * channels will ever be opened.
34071 * Default value: true.
34073 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34076 * Set to force an incoming channel to match our announced channel preference in
34077 * [`ChannelHandshakeConfig::announced_channel`].
34079 * For a node which is not online reliably, this should be set to true and
34080 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
34081 * channels will ever be opened.
34083 * Default value: true.
34085 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
34088 * Set to the amount of time we're willing to wait to claim money back to us.
34090 * Not checking this value would be a security issue, as our peer would be able to set it to
34091 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
34093 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
34094 * reduce the loss of having useless locked funds (if your peer accepts)
34096 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34099 * Set to the amount of time we're willing to wait to claim money back to us.
34101 * Not checking this value would be a security issue, as our peer would be able to set it to
34102 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
34104 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
34105 * reduce the loss of having useless locked funds (if your peer accepts)
34107 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
34110 * Constructs a new ChannelHandshakeLimits given each field
34112 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);
34115 * Creates a copy of the ChannelHandshakeLimits
34117 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
34120 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
34122 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
34125 * Frees any resources used by the MaxDustHTLCExposure
34127 void MaxDustHTLCExposure_free(struct LDKMaxDustHTLCExposure this_ptr);
34130 * Creates a copy of the MaxDustHTLCExposure
34132 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_clone(const struct LDKMaxDustHTLCExposure *NONNULL_PTR orig);
34135 * Utility method to constructs a new FixedLimitMsat-variant MaxDustHTLCExposure
34137 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fixed_limit_msat(uint64_t a);
34140 * Utility method to constructs a new FeeRateMultiplier-variant MaxDustHTLCExposure
34142 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fee_rate_multiplier(uint64_t a);
34145 * Checks if two MaxDustHTLCExposures contain equal inner contents.
34146 * This ignores pointers and is_owned flags and looks at the values in fields.
34148 bool MaxDustHTLCExposure_eq(const struct LDKMaxDustHTLCExposure *NONNULL_PTR a, const struct LDKMaxDustHTLCExposure *NONNULL_PTR b);
34151 * Serialize the MaxDustHTLCExposure object into a byte array which can be read by MaxDustHTLCExposure_read
34153 struct LDKCVec_u8Z MaxDustHTLCExposure_write(const struct LDKMaxDustHTLCExposure *NONNULL_PTR obj);
34156 * Read a MaxDustHTLCExposure from a byte array, created by MaxDustHTLCExposure_write
34158 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ MaxDustHTLCExposure_read(struct LDKu8slice ser);
34161 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
34163 void ChannelConfig_free(struct LDKChannelConfig this_obj);
34166 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
34167 * over the channel.
34168 * This may be allowed to change at runtime in a later update, however doing so must result in
34169 * update messages sent to notify all nodes of our updated relay fee.
34171 * Default value: 0.
34173 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
34176 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
34177 * over the channel.
34178 * This may be allowed to change at runtime in a later update, however doing so must result in
34179 * update messages sent to notify all nodes of our updated relay fee.
34181 * Default value: 0.
34183 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
34186 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
34187 * excess of [`forwarding_fee_proportional_millionths`].
34188 * This may be allowed to change at runtime in a later update, however doing so must result in
34189 * update messages sent to notify all nodes of our updated relay fee.
34191 * The default value of a single satoshi roughly matches the market rate on many routing nodes
34192 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
34195 * Default value: 1000.
34197 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
34199 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
34202 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
34203 * excess of [`forwarding_fee_proportional_millionths`].
34204 * This may be allowed to change at runtime in a later update, however doing so must result in
34205 * update messages sent to notify all nodes of our updated relay fee.
34207 * The default value of a single satoshi roughly matches the market rate on many routing nodes
34208 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
34211 * Default value: 1000.
34213 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
34215 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
34218 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
34219 * the channel this config applies to.
34221 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
34222 * HTLC balance when a channel appears on-chain whereas
34223 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
34224 * (non-HTLC-encumbered) balance.
34226 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
34227 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
34228 * commitment transaction at least once per this many blocks (minus some margin to allow us
34229 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
34230 * the spending transaction).
34232 * Default value: 72 (12 hours at an average of 6 blocks/hour).
34233 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
34234 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
34236 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
34238 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
34241 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
34242 * the channel this config applies to.
34244 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
34245 * HTLC balance when a channel appears on-chain whereas
34246 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
34247 * (non-HTLC-encumbered) balance.
34249 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
34250 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
34251 * commitment transaction at least once per this many blocks (minus some margin to allow us
34252 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
34253 * the spending transaction).
34255 * Default value: 72 (12 hours at an average of 6 blocks/hour).
34256 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
34257 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
34259 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
34261 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
34264 * Limit our total exposure to potential loss to on-chain fees on close, including in-flight
34265 * HTLCs which are burned to fees as they are too small to claim on-chain and fees on
34266 * commitment transaction(s) broadcasted by our counterparty in excess of our own fee estimate.
34268 * # HTLC-based Dust Exposure
34270 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
34271 * not be claimable on-chain, instead being turned into additional miner fees if either
34272 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
34273 * to such payments may be substantial if there are many dust HTLCs present when the
34274 * channel is force-closed.
34276 * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
34277 * channel negotiated throughout the channel open process, along with the fees required to have
34278 * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
34279 * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
34280 * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
34281 * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
34282 * variant is primarily intended for use with pre-anchor channels.
34284 * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
34285 * exposure across all three types per-channel.
34287 * # Transaction Fee Dust Exposure
34289 * Further, counterparties broadcasting a commitment transaction in a force-close may result
34290 * in other balance being burned to fees, and thus all fees on commitment and HTLC
34291 * transactions in excess of our local fee estimates are included in the dust calculation.
34293 * Because of this, another way to look at this limit is to divide it by 43,000 (or 218,750
34294 * for non-anchor channels) and see it as the maximum feerate disagreement (in sats/vB) per
34295 * non-dust HTLC we're allowed to have with our peers before risking a force-closure for
34296 * inbound channels.
34298 * Thus, for the default value of 10_000 * a current feerate estimate of 10 sat/vB (or 2,500
34299 * sat/KW), we risk force-closure if we disagree with our peer by:
34300 * * `10_000 * 2_500 / 43_000 / (483*2)` = 0.6 sat/vB for anchor channels with 483 HTLCs in
34301 * both directions (the maximum),
34302 * * `10_000 * 2_500 / 43_000 / (50*2)` = 5.8 sat/vB for anchor channels with 50 HTLCs in both
34303 * directions (the LDK default max from [`ChannelHandshakeConfig::our_max_accepted_htlcs`])
34304 * * `10_000 * 2_500 / 218_750 / (483*2)` = 0.1 sat/vB for non-anchor channels with 483 HTLCs
34305 * in both directions (the maximum),
34306 * * `10_000 * 2_500 / 218_750 / (50*2)` = 1.1 sat/vB for non-anchor channels with 50 HTLCs
34307 * in both (the LDK default maximum from [`ChannelHandshakeConfig::our_max_accepted_htlcs`])
34309 * Note that when using [`MaxDustHTLCExposure::FeeRateMultiplier`] this maximum disagreement
34310 * will scale linearly with increases (or decreases) in the our feerate estimates. Further,
34311 * for anchor channels we expect our counterparty to use a relatively low feerate estimate
34312 * while we use [`ConfirmationTarget::OnChainSweep`] (which should be relatively high) and
34313 * feerate disagreement force-closures should only occur when theirs is higher than ours.
34315 * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 10_000.
34317 * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep
34319 struct LDKMaxDustHTLCExposure ChannelConfig_get_max_dust_htlc_exposure(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
34322 * Limit our total exposure to potential loss to on-chain fees on close, including in-flight
34323 * HTLCs which are burned to fees as they are too small to claim on-chain and fees on
34324 * commitment transaction(s) broadcasted by our counterparty in excess of our own fee estimate.
34326 * # HTLC-based Dust Exposure
34328 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
34329 * not be claimable on-chain, instead being turned into additional miner fees if either
34330 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
34331 * to such payments may be substantial if there are many dust HTLCs present when the
34332 * channel is force-closed.
34334 * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
34335 * channel negotiated throughout the channel open process, along with the fees required to have
34336 * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
34337 * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
34338 * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
34339 * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
34340 * variant is primarily intended for use with pre-anchor channels.
34342 * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
34343 * exposure across all three types per-channel.
34345 * # Transaction Fee Dust Exposure
34347 * Further, counterparties broadcasting a commitment transaction in a force-close may result
34348 * in other balance being burned to fees, and thus all fees on commitment and HTLC
34349 * transactions in excess of our local fee estimates are included in the dust calculation.
34351 * Because of this, another way to look at this limit is to divide it by 43,000 (or 218,750
34352 * for non-anchor channels) and see it as the maximum feerate disagreement (in sats/vB) per
34353 * non-dust HTLC we're allowed to have with our peers before risking a force-closure for
34354 * inbound channels.
34356 * Thus, for the default value of 10_000 * a current feerate estimate of 10 sat/vB (or 2,500
34357 * sat/KW), we risk force-closure if we disagree with our peer by:
34358 * * `10_000 * 2_500 / 43_000 / (483*2)` = 0.6 sat/vB for anchor channels with 483 HTLCs in
34359 * both directions (the maximum),
34360 * * `10_000 * 2_500 / 43_000 / (50*2)` = 5.8 sat/vB for anchor channels with 50 HTLCs in both
34361 * directions (the LDK default max from [`ChannelHandshakeConfig::our_max_accepted_htlcs`])
34362 * * `10_000 * 2_500 / 218_750 / (483*2)` = 0.1 sat/vB for non-anchor channels with 483 HTLCs
34363 * in both directions (the maximum),
34364 * * `10_000 * 2_500 / 218_750 / (50*2)` = 1.1 sat/vB for non-anchor channels with 50 HTLCs
34365 * in both (the LDK default maximum from [`ChannelHandshakeConfig::our_max_accepted_htlcs`])
34367 * Note that when using [`MaxDustHTLCExposure::FeeRateMultiplier`] this maximum disagreement
34368 * will scale linearly with increases (or decreases) in the our feerate estimates. Further,
34369 * for anchor channels we expect our counterparty to use a relatively low feerate estimate
34370 * while we use [`ConfirmationTarget::OnChainSweep`] (which should be relatively high) and
34371 * feerate disagreement force-closures should only occur when theirs is higher than ours.
34373 * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 10_000.
34375 * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep
34377 void ChannelConfig_set_max_dust_htlc_exposure(struct LDKChannelConfig *NONNULL_PTR this_ptr, struct LDKMaxDustHTLCExposure val);
34380 * The additional fee we're willing to pay to avoid waiting for the counterparty's
34381 * `to_self_delay` to reclaim funds.
34383 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
34384 * closing transaction which both sides find acceptable, ultimately paid by the channel
34385 * funder/initiator.
34387 * When we are the funder, because we have to pay the channel closing fee, we bound the
34388 * acceptable fee by our [`ChannelCloseMinimum`] and [`NonAnchorChannelFee`] fees, with the upper bound increased by
34389 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
34390 * [`NonAnchorChannelFee`] feerate during normal operation, this value represents the additional fee we're
34391 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
34394 * When we are not the funder, we require the closing transaction fee pay at least our
34395 * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like.
34396 * Thus, this value is ignored when we are not the funder.
34398 * Default value: 1000 satoshis.
34400 * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
34401 * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
34403 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
34406 * The additional fee we're willing to pay to avoid waiting for the counterparty's
34407 * `to_self_delay` to reclaim funds.
34409 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
34410 * closing transaction which both sides find acceptable, ultimately paid by the channel
34411 * funder/initiator.
34413 * When we are the funder, because we have to pay the channel closing fee, we bound the
34414 * acceptable fee by our [`ChannelCloseMinimum`] and [`NonAnchorChannelFee`] fees, with the upper bound increased by
34415 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
34416 * [`NonAnchorChannelFee`] feerate during normal operation, this value represents the additional fee we're
34417 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
34420 * When we are not the funder, we require the closing transaction fee pay at least our
34421 * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like.
34422 * Thus, this value is ignored when we are not the funder.
34424 * Default value: 1000 satoshis.
34426 * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
34427 * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
34429 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
34432 * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
34433 * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
34436 * - The payee will set this option and set its invoice route hints to use [intercept scids]
34437 * generated by this channel's counterparty.
34438 * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
34439 * [`forward_intercepted_htlc`] with less than the amount provided in
34440 * [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
34441 * actual forward amounts is their fee. See
34442 * <https://github.com/BitcoinAndLightningLayerSpecs/lsp/tree/main/LSPS2#flow-lsp-trusts-client-model>
34443 * for how this feature may be used in the LSP use case.
34446 * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
34447 * as-expected if this feature is activated, otherwise they may lose money!
34448 * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
34452 * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
34453 * Unsetting this flag between restarts may lead to payment receive failures.
34455 * Default value: false.
34457 * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
34458 * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
34459 * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
34460 * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
34461 * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
34462 * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
34464 bool ChannelConfig_get_accept_underpaying_htlcs(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
34467 * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
34468 * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
34471 * - The payee will set this option and set its invoice route hints to use [intercept scids]
34472 * generated by this channel's counterparty.
34473 * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
34474 * [`forward_intercepted_htlc`] with less than the amount provided in
34475 * [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
34476 * actual forward amounts is their fee. See
34477 * <https://github.com/BitcoinAndLightningLayerSpecs/lsp/tree/main/LSPS2#flow-lsp-trusts-client-model>
34478 * for how this feature may be used in the LSP use case.
34481 * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
34482 * as-expected if this feature is activated, otherwise they may lose money!
34483 * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
34487 * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
34488 * Unsetting this flag between restarts may lead to payment receive failures.
34490 * Default value: false.
34492 * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
34493 * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
34494 * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
34495 * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
34496 * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
34497 * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
34499 void ChannelConfig_set_accept_underpaying_htlcs(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
34502 * Constructs a new ChannelConfig given each field
34504 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);
34507 * Creates a copy of the ChannelConfig
34509 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
34512 * Checks if two ChannelConfigs contain equal inner contents.
34513 * This ignores pointers and is_owned flags and looks at the values in fields.
34514 * Two objects with NULL inner values will be considered "equal" here.
34516 bool ChannelConfig_eq(const struct LDKChannelConfig *NONNULL_PTR a, const struct LDKChannelConfig *NONNULL_PTR b);
34519 * Applies the given [`ChannelConfigUpdate`] as a partial update to the [`ChannelConfig`].
34521 void ChannelConfig_apply(struct LDKChannelConfig *NONNULL_PTR this_arg, const struct LDKChannelConfigUpdate *NONNULL_PTR update);
34524 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
34526 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
34529 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
34531 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
34534 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
34536 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
34539 * Frees any resources used by the ChannelConfigUpdate, if is_owned is set and inner is non-NULL.
34541 void ChannelConfigUpdate_free(struct LDKChannelConfigUpdate this_obj);
34543 struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
34545 void ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
34547 struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_base_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
34549 void ChannelConfigUpdate_set_forwarding_fee_base_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
34551 struct LDKCOption_u16Z ChannelConfigUpdate_get_cltv_expiry_delta(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
34553 void ChannelConfigUpdate_set_cltv_expiry_delta(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
34557 * Returns a copy of the field.
34559 struct LDKCOption_MaxDustHTLCExposureZ ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
34561 void ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_MaxDustHTLCExposureZ val);
34563 struct LDKCOption_u64Z ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
34565 void ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
34568 * Constructs a new ChannelConfigUpdate given each field
34570 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);
34573 * Creates a "default" ChannelConfigUpdate. See struct and individual field documentaiton for details on which values are used.
34575 MUST_USE_RES struct LDKChannelConfigUpdate ChannelConfigUpdate_default(void);
34578 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
34580 void UserConfig_free(struct LDKUserConfig this_obj);
34583 * Channel handshake config that we propose to our counterparty.
34585 struct LDKChannelHandshakeConfig UserConfig_get_channel_handshake_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
34588 * Channel handshake config that we propose to our counterparty.
34590 void UserConfig_set_channel_handshake_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
34593 * Limits applied to our counterparty's proposed channel handshake config settings.
34595 struct LDKChannelHandshakeLimits UserConfig_get_channel_handshake_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
34598 * Limits applied to our counterparty's proposed channel handshake config settings.
34600 void UserConfig_set_channel_handshake_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
34603 * Channel config which affects behavior during channel lifetime.
34605 struct LDKChannelConfig UserConfig_get_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
34608 * Channel config which affects behavior during channel lifetime.
34610 void UserConfig_set_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
34613 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
34614 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
34615 * node which is not online reliably.
34617 * For nodes which are not online reliably, you should set all channels to *not* be announced
34618 * (using [`ChannelHandshakeConfig::announced_channel`] and
34619 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
34620 * ensure you are not exposed to any forwarding risk.
34622 * Note that because you cannot change a channel's announced state after creation, there is no
34623 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
34624 * from a publicly-announced forwarding node to a private non-forwarding node you must close
34625 * all your channels and open new ones. For privacy, you should also change your node_id
34626 * (swapping all private and public key material for new ones) at that time.
34628 * Default value: false.
34630 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
34633 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
34634 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
34635 * node which is not online reliably.
34637 * For nodes which are not online reliably, you should set all channels to *not* be announced
34638 * (using [`ChannelHandshakeConfig::announced_channel`] and
34639 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
34640 * ensure you are not exposed to any forwarding risk.
34642 * Note that because you cannot change a channel's announced state after creation, there is no
34643 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
34644 * from a publicly-announced forwarding node to a private non-forwarding node you must close
34645 * all your channels and open new ones. For privacy, you should also change your node_id
34646 * (swapping all private and public key material for new ones) at that time.
34648 * Default value: false.
34650 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
34653 * If this is set to false, we do not accept inbound requests to open a new channel.
34654 * Default value: true.
34656 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
34659 * If this is set to false, we do not accept inbound requests to open a new channel.
34660 * Default value: true.
34662 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
34665 * If this is set to true, the user needs to manually accept inbound requests to open a new
34668 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
34669 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
34670 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
34671 * user explicitly chooses to accept the request.
34673 * Default value: false.
34675 * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
34676 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
34677 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
34679 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
34682 * If this is set to true, the user needs to manually accept inbound requests to open a new
34685 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
34686 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
34687 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
34688 * user explicitly chooses to accept the request.
34690 * Default value: false.
34692 * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
34693 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
34694 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
34696 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
34699 * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
34700 * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
34701 * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
34703 * Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
34705 * Default value: false.
34707 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
34708 * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
34710 bool UserConfig_get_accept_intercept_htlcs(const struct LDKUserConfig *NONNULL_PTR this_ptr);
34713 * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
34714 * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
34715 * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
34717 * Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
34719 * Default value: false.
34721 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
34722 * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
34724 void UserConfig_set_accept_intercept_htlcs(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
34727 * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
34728 * parts. If this is set to true, we'll accept the payment.
34730 * Setting this to true will break backwards compatibility upon downgrading to an LDK
34731 * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
34732 * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
34734 * Default value: false.
34736 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
34738 bool UserConfig_get_accept_mpp_keysend(const struct LDKUserConfig *NONNULL_PTR this_ptr);
34741 * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
34742 * parts. If this is set to true, we'll accept the payment.
34744 * Setting this to true will break backwards compatibility upon downgrading to an LDK
34745 * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
34746 * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
34748 * Default value: false.
34750 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
34752 void UserConfig_set_accept_mpp_keysend(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
34755 * Constructs a new UserConfig given each field
34757 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);
34760 * Creates a copy of the UserConfig
34762 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
34765 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
34767 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
34770 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
34772 void BestBlock_free(struct LDKBestBlock this_obj);
34777 const uint8_t (*BestBlock_get_block_hash(const struct LDKBestBlock *NONNULL_PTR this_ptr))[32];
34782 void BestBlock_set_block_hash(struct LDKBestBlock *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34785 * The height at which the block was confirmed.
34787 uint32_t BestBlock_get_height(const struct LDKBestBlock *NONNULL_PTR this_ptr);
34790 * The height at which the block was confirmed.
34792 void BestBlock_set_height(struct LDKBestBlock *NONNULL_PTR this_ptr, uint32_t val);
34795 * Constructs a new BestBlock given each field
34797 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash_arg, uint32_t height_arg);
34800 * Creates a copy of the BestBlock
34802 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
34805 * Generates a non-cryptographic 64-bit hash of the BestBlock.
34807 uint64_t BestBlock_hash(const struct LDKBestBlock *NONNULL_PTR o);
34810 * Checks if two BestBlocks contain equal inner contents.
34811 * This ignores pointers and is_owned flags and looks at the values in fields.
34812 * Two objects with NULL inner values will be considered "equal" here.
34814 bool BestBlock_eq(const struct LDKBestBlock *NONNULL_PTR a, const struct LDKBestBlock *NONNULL_PTR b);
34817 * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
34820 MUST_USE_RES struct LDKBestBlock BestBlock_from_network(enum LDKNetwork network);
34823 * Serialize the BestBlock object into a byte array which can be read by BestBlock_read
34825 struct LDKCVec_u8Z BestBlock_write(const struct LDKBestBlock *NONNULL_PTR obj);
34828 * Read a BestBlock from a byte array, created by BestBlock_write
34830 struct LDKCResult_BestBlockDecodeErrorZ BestBlock_read(struct LDKu8slice ser);
34833 * Calls the free function if one is set
34835 void Listen_free(struct LDKListen this_ptr);
34838 * Calls the free function if one is set
34840 void Confirm_free(struct LDKConfirm this_ptr);
34843 * Creates a copy of the ChannelMonitorUpdateStatus
34845 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_clone(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR orig);
34848 * Utility method to constructs a new Completed-variant ChannelMonitorUpdateStatus
34850 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_completed(void);
34853 * Utility method to constructs a new InProgress-variant ChannelMonitorUpdateStatus
34855 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_in_progress(void);
34858 * Utility method to constructs a new UnrecoverableError-variant ChannelMonitorUpdateStatus
34860 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_unrecoverable_error(void);
34863 * Checks if two ChannelMonitorUpdateStatuss contain equal inner contents.
34864 * This ignores pointers and is_owned flags and looks at the values in fields.
34866 bool ChannelMonitorUpdateStatus_eq(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR a, const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR b);
34869 * Calls the free function if one is set
34871 void Watch_free(struct LDKWatch this_ptr);
34874 * Calls the free function if one is set
34876 void Filter_free(struct LDKFilter this_ptr);
34879 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
34881 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
34884 * First block where the transaction output may have been spent.
34886 struct LDKCOption_ThirtyTwoBytesZ WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
34889 * First block where the transaction output may have been spent.
34891 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
34894 * Outpoint identifying the transaction output.
34896 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
34899 * Outpoint identifying the transaction output.
34901 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
34904 * Spending condition of the transaction output.
34906 struct LDKCVec_u8Z WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
34909 * Spending condition of the transaction output.
34911 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
34914 * Constructs a new WatchedOutput given each field
34916 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKCOption_ThirtyTwoBytesZ block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
34919 * Creates a copy of the WatchedOutput
34921 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
34924 * Checks if two WatchedOutputs contain equal inner contents.
34925 * This ignores pointers and is_owned flags and looks at the values in fields.
34926 * Two objects with NULL inner values will be considered "equal" here.
34928 bool WatchedOutput_eq(const struct LDKWatchedOutput *NONNULL_PTR a, const struct LDKWatchedOutput *NONNULL_PTR b);
34931 * Generates a non-cryptographic 64-bit hash of the WatchedOutput.
34933 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
34936 * Calls the free function if one is set
34938 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
34941 * Creates a copy of the ConfirmationTarget
34943 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
34946 * Utility method to constructs a new OnChainSweep-variant ConfirmationTarget
34948 enum LDKConfirmationTarget ConfirmationTarget_on_chain_sweep(void);
34951 * Utility method to constructs a new MinAllowedAnchorChannelRemoteFee-variant ConfirmationTarget
34953 enum LDKConfirmationTarget ConfirmationTarget_min_allowed_anchor_channel_remote_fee(void);
34956 * Utility method to constructs a new MinAllowedNonAnchorChannelRemoteFee-variant ConfirmationTarget
34958 enum LDKConfirmationTarget ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee(void);
34961 * Utility method to constructs a new AnchorChannelFee-variant ConfirmationTarget
34963 enum LDKConfirmationTarget ConfirmationTarget_anchor_channel_fee(void);
34966 * Utility method to constructs a new NonAnchorChannelFee-variant ConfirmationTarget
34968 enum LDKConfirmationTarget ConfirmationTarget_non_anchor_channel_fee(void);
34971 * Utility method to constructs a new ChannelCloseMinimum-variant ConfirmationTarget
34973 enum LDKConfirmationTarget ConfirmationTarget_channel_close_minimum(void);
34976 * Utility method to constructs a new OutputSpendingFee-variant ConfirmationTarget
34978 enum LDKConfirmationTarget ConfirmationTarget_output_spending_fee(void);
34981 * Generates a non-cryptographic 64-bit hash of the ConfirmationTarget.
34983 uint64_t ConfirmationTarget_hash(const enum LDKConfirmationTarget *NONNULL_PTR o);
34986 * Checks if two ConfirmationTargets contain equal inner contents.
34987 * This ignores pointers and is_owned flags and looks at the values in fields.
34989 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
34992 * Calls the free function if one is set
34994 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
34997 * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
34999 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
35002 * Creates a copy of the MonitorUpdateId
35004 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
35007 * Generates a non-cryptographic 64-bit hash of the MonitorUpdateId.
35009 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
35012 * Checks if two MonitorUpdateIds contain equal inner contents.
35013 * This ignores pointers and is_owned flags and looks at the values in fields.
35014 * Two objects with NULL inner values will be considered "equal" here.
35016 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
35019 * Calls the free function if one is set
35021 void Persist_free(struct LDKPersist this_ptr);
35024 * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
35026 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
35029 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
35031 void ChainMonitor_free(struct LDKChainMonitor this_obj);
35034 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
35036 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
35037 * will call back to it indicating transactions and outputs of interest. This allows clients to
35038 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
35039 * always need to fetch full blocks absent another means for determining which blocks contain
35040 * transactions relevant to the watched channels.
35042 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
35045 * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
35046 * claims which are awaiting confirmation.
35048 * Includes the balances from each [`ChannelMonitor`] *except* those included in
35049 * `ignored_channels`, allowing you to filter out balances from channels which are still open
35050 * (and whose balance should likely be pulled from the [`ChannelDetails`]).
35052 * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
35053 * inclusion in the return value.
35055 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
35058 * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
35059 * such [`ChannelMonitor`] is currently being monitored for.
35061 * Note that the result holds a mutex over our monitor set, and should not be held
35064 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
35067 * Lists the funding outpoint and channel ID of each [`ChannelMonitor`] being monitored.
35069 * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
35070 * monitoring for on-chain state resolutions.
35072 MUST_USE_RES struct LDKCVec_C2Tuple_OutPointChannelIdZZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35075 * Lists the pending updates for each [`ChannelMonitor`] (by `OutPoint` being monitored).
35077 MUST_USE_RES struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ChainMonitor_list_pending_monitor_updates(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35080 * Indicates the persistence of a [`ChannelMonitor`] has completed after
35081 * [`ChannelMonitorUpdateStatus::InProgress`] was returned from an update operation.
35083 * Thus, the anticipated use is, at a high level:
35084 * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
35085 * update to disk and begins updating any remote (e.g. watchtower/backup) copies,
35086 * returning [`ChannelMonitorUpdateStatus::InProgress`],
35087 * 2) once all remote copies are updated, you call this function with the
35088 * `completed_update_id` that completed, and once all pending updates have completed the
35089 * channel will be re-enabled.
35091 * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
35092 * registered [`ChannelMonitor`]s.
35094 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);
35097 * Gets a [`Future`] that completes when an event is available either via
35098 * [`chain::Watch::release_pending_monitor_events`] or
35099 * [`EventsProvider::process_pending_events`].
35101 * Note that callbacks registered on the [`Future`] MUST NOT call back into this
35102 * [`ChainMonitor`] and should instead register actions to be taken later.
35104 * [`EventsProvider::process_pending_events`]: crate::events::EventsProvider::process_pending_events
35106 MUST_USE_RES struct LDKFuture ChainMonitor_get_update_future(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35109 * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
35110 * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
35111 * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
35112 * invoking this every 30 seconds, or lower if running in an environment with spotty
35113 * connections, like on mobile.
35115 void ChainMonitor_rebroadcast_pending_claims(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35118 * Triggers rebroadcasts of pending claims from force-closed channels after a transaction
35119 * signature generation failure.
35121 * `monitor_opt` can be used as a filter to only trigger them for a specific channel monitor.
35123 * Note that monitor_opt (or a relevant inner pointer) may be NULL or all-0s to represent None
35125 void ChainMonitor_signer_unblocked(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint monitor_opt);
35128 * Archives fully resolved channel monitors by calling [`Persist::archive_persisted_channel`].
35130 * This is useful for pruning fully resolved monitors from the monitor set and primary
35131 * storage so they are not kept in memory and reloaded on restart.
35133 * Should be called occasionally (once every handful of blocks or on startup).
35135 * Depending on the implementation of [`Persist::archive_persisted_channel`] the monitor
35136 * data could be moved to an archive location or removed entirely.
35138 void ChainMonitor_archive_fully_resolved_channel_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35141 * Constructs a new Listen which calls the relevant methods on this_arg.
35142 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
35144 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35147 * Constructs a new Confirm which calls the relevant methods on this_arg.
35148 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
35150 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35153 * Constructs a new Watch which calls the relevant methods on this_arg.
35154 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
35156 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35159 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
35160 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
35162 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35165 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
35167 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
35170 * The sequence number of this update. Updates *must* be replayed in-order according to this
35171 * sequence number (and updates may panic if they are not). The update_id values are strictly
35172 * increasing and increase by one for each new update, with two exceptions specified below.
35174 * This sequence number is also used to track up to which points updates which returned
35175 * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
35176 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
35178 * The only instances we allow where update_id values are not strictly increasing have a
35179 * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
35180 * will force close the channel by broadcasting the latest commitment transaction or
35181 * special post-force-close updates, like providing preimages necessary to claim outputs on the
35182 * broadcast commitment transaction. See its docs for more details.
35184 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
35186 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
35189 * The sequence number of this update. Updates *must* be replayed in-order according to this
35190 * sequence number (and updates may panic if they are not). The update_id values are strictly
35191 * increasing and increase by one for each new update, with two exceptions specified below.
35193 * This sequence number is also used to track up to which points updates which returned
35194 * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
35195 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
35197 * The only instances we allow where update_id values are not strictly increasing have a
35198 * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
35199 * will force close the channel by broadcasting the latest commitment transaction or
35200 * special post-force-close updates, like providing preimages necessary to claim outputs on the
35201 * broadcast commitment transaction. See its docs for more details.
35203 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
35205 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
35208 * The channel ID associated with these updates.
35210 * Will be `None` for `ChannelMonitorUpdate`s constructed on LDK versions prior to 0.0.121 and
35211 * always `Some` otherwise.
35213 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35215 struct LDKChannelId ChannelMonitorUpdate_get_channel_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
35218 * The channel ID associated with these updates.
35220 * Will be `None` for `ChannelMonitorUpdate`s constructed on LDK versions prior to 0.0.121 and
35221 * always `Some` otherwise.
35223 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
35225 void ChannelMonitorUpdate_set_channel_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, struct LDKChannelId val);
35228 * Creates a copy of the ChannelMonitorUpdate
35230 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
35233 * Checks if two ChannelMonitorUpdates contain equal inner contents.
35234 * This ignores pointers and is_owned flags and looks at the values in fields.
35235 * Two objects with NULL inner values will be considered "equal" here.
35237 bool ChannelMonitorUpdate_eq(const struct LDKChannelMonitorUpdate *NONNULL_PTR a, const struct LDKChannelMonitorUpdate *NONNULL_PTR b);
35240 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
35242 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
35245 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
35247 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
35250 * Frees any resources used by the MonitorEvent
35252 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
35255 * Creates a copy of the MonitorEvent
35257 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
35260 * Utility method to constructs a new HTLCEvent-variant MonitorEvent
35262 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
35265 * Utility method to constructs a new HolderForceClosedWithInfo-variant MonitorEvent
35267 struct LDKMonitorEvent MonitorEvent_holder_force_closed_with_info(struct LDKClosureReason reason, struct LDKOutPoint outpoint, struct LDKChannelId channel_id);
35270 * Utility method to constructs a new HolderForceClosed-variant MonitorEvent
35272 struct LDKMonitorEvent MonitorEvent_holder_force_closed(struct LDKOutPoint a);
35275 * Utility method to constructs a new Completed-variant MonitorEvent
35277 struct LDKMonitorEvent MonitorEvent_completed(struct LDKOutPoint funding_txo, struct LDKChannelId channel_id, uint64_t monitor_update_id);
35280 * Checks if two MonitorEvents contain equal inner contents.
35281 * This ignores pointers and is_owned flags and looks at the values in fields.
35283 bool MonitorEvent_eq(const struct LDKMonitorEvent *NONNULL_PTR a, const struct LDKMonitorEvent *NONNULL_PTR b);
35286 * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
35288 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
35291 * Read a MonitorEvent from a byte array, created by MonitorEvent_write
35293 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
35296 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
35298 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
35301 * Creates a copy of the HTLCUpdate
35303 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
35306 * Checks if two HTLCUpdates contain equal inner contents.
35307 * This ignores pointers and is_owned flags and looks at the values in fields.
35308 * Two objects with NULL inner values will be considered "equal" here.
35310 bool HTLCUpdate_eq(const struct LDKHTLCUpdate *NONNULL_PTR a, const struct LDKHTLCUpdate *NONNULL_PTR b);
35313 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
35315 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
35318 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
35320 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
35323 * Frees any resources used by the Balance
35325 void Balance_free(struct LDKBalance this_ptr);
35328 * Creates a copy of the Balance
35330 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
35333 * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
35335 struct LDKBalance Balance_claimable_on_channel_close(uint64_t amount_satoshis);
35338 * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
35340 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t amount_satoshis, uint32_t confirmation_height);
35343 * Utility method to constructs a new ContentiousClaimable-variant Balance
35345 struct LDKBalance Balance_contentious_claimable(uint64_t amount_satoshis, uint32_t timeout_height, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_preimage);
35348 * Utility method to constructs a new MaybeTimeoutClaimableHTLC-variant Balance
35350 struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t amount_satoshis, uint32_t claimable_height, struct LDKThirtyTwoBytes payment_hash);
35353 * Utility method to constructs a new MaybePreimageClaimableHTLC-variant Balance
35355 struct LDKBalance Balance_maybe_preimage_claimable_htlc(uint64_t amount_satoshis, uint32_t expiry_height, struct LDKThirtyTwoBytes payment_hash);
35358 * Utility method to constructs a new CounterpartyRevokedOutputClaimable-variant Balance
35360 struct LDKBalance Balance_counterparty_revoked_output_claimable(uint64_t amount_satoshis);
35363 * Checks if two Balances contain equal inner contents.
35364 * This ignores pointers and is_owned flags and looks at the values in fields.
35366 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
35369 * The amount claimable, in satoshis. This excludes balances that we are unsure if we are able
35370 * to claim, this is because we are waiting for a preimage or for a timeout to expire. For more
35371 * information on these balances see [`Balance::MaybeTimeoutClaimableHTLC`] and
35372 * [`Balance::MaybePreimageClaimableHTLC`].
35374 * On-chain fees required to claim the balance are not included in this amount.
35376 MUST_USE_RES uint64_t Balance_claimable_amount_satoshis(const struct LDKBalance *NONNULL_PTR this_arg);
35379 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
35381 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
35384 * Creates a copy of the ChannelMonitor
35386 struct LDKChannelMonitor ChannelMonitor_clone(const struct LDKChannelMonitor *NONNULL_PTR orig);
35389 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
35391 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
35394 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
35397 * panics if the given update is not the next update by update_id.
35399 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);
35402 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
35405 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35408 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
35410 MUST_USE_RES struct LDKC2Tuple_OutPointCVec_u8ZZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35413 * Gets the channel_id of the channel this ChannelMonitor is monitoring for.
35415 MUST_USE_RES struct LDKChannelId ChannelMonitor_channel_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35418 * Gets a list of txids, with their output scripts (in the order they appear in the
35419 * transaction), which we must learn about spends of via block_connected().
35421 MUST_USE_RES struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35424 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
35425 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
35426 * have been registered.
35428 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);
35431 * Get the list of HTLCs who's status has been updated on chain. This should be called by
35432 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
35434 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35437 * Processes [`SpendableOutputs`] events produced from each [`ChannelMonitor`] upon maturity.
35439 * For channels featuring anchor outputs, this method will also process [`BumpTransaction`]
35440 * events produced from each [`ChannelMonitor`] while there is a balance to claim onchain
35441 * within each channel. As the confirmation of a commitment transaction may be critical to the
35442 * safety of funds, we recommend invoking this every 30 seconds, or lower if running in an
35443 * environment with spotty connections, like on mobile.
35445 * An [`EventHandler`] may safely call back to the provider, though this shouldn't be needed in
35446 * order to handle these events.
35448 * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
35449 * [`BumpTransaction`]: crate::events::Event::BumpTransaction
35451 void ChannelMonitor_process_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKEventHandler *NONNULL_PTR handler);
35454 * Gets the counterparty's initial commitment transaction. The returned commitment
35455 * transaction is unsigned. This is intended to be called during the initial persistence of
35456 * the monitor (inside an implementation of [`Persist::persist_new_channel`]), to allow for
35457 * watchtowers in the persistence pipeline to have enough data to form justice transactions.
35459 * This is similar to [`Self::counterparty_commitment_txs_from_update`], except
35460 * that for the initial commitment transaction, we don't have a corresponding update.
35462 * This will only return `Some` for channel monitors that have been created after upgrading
35465 * [`Persist::persist_new_channel`]: crate::chain::chainmonitor::Persist::persist_new_channel
35467 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35469 MUST_USE_RES struct LDKCommitmentTransaction ChannelMonitor_initial_counterparty_commitment_tx(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35472 * Gets all of the counterparty commitment transactions provided by the given update. This
35473 * may be empty if the update doesn't include any new counterparty commitments. Returned
35474 * commitment transactions are unsigned.
35476 * This is provided so that watchtower clients in the persistence pipeline are able to build
35477 * justice transactions for each counterparty commitment upon each update. It's intended to be
35478 * used within an implementation of [`Persist::update_persisted_channel`], which is provided
35479 * with a monitor and an update. Once revoked, signing a justice transaction can be done using
35480 * [`Self::sign_to_local_justice_tx`].
35482 * It is expected that a watchtower client may use this method to retrieve the latest counterparty
35483 * commitment transaction(s), and then hold the necessary data until a later update in which
35484 * the monitor has been updated with the corresponding revocation data, at which point the
35485 * monitor can sign the justice transaction.
35487 * This will only return a non-empty list for monitor updates that have been created after
35488 * upgrading to LDK 0.0.117+. Note that no restriction lies on the monitors themselves, which
35489 * may have been created prior to upgrading.
35491 * [`Persist::update_persisted_channel`]: crate::chain::chainmonitor::Persist::update_persisted_channel
35493 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);
35496 * Wrapper around [`EcdsaChannelSigner::sign_justice_revoked_output`] to make
35497 * signing the justice transaction easier for implementors of
35498 * [`chain::chainmonitor::Persist`]. On success this method returns the provided transaction
35499 * signing the input at `input_idx`. This method will only produce a valid signature for
35500 * a transaction spending the `to_local` output of a commitment transaction, i.e. this cannot
35501 * be used for revoked HTLC outputs.
35503 * `Value` is the value of the output being spent by the input at `input_idx`, committed
35504 * in the BIP 143 signature.
35506 * This method will only succeed if this monitor has received the revocation secret for the
35507 * provided `commitment_number`. If a commitment number is provided that does not correspond
35508 * to the commitment transaction being revoked, this will return a signed transaction, but
35509 * the signature will not be valid.
35511 * [`EcdsaChannelSigner::sign_justice_revoked_output`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_justice_revoked_output
35512 * [`Persist`]: crate::chain::chainmonitor::Persist
35514 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);
35517 * Gets the `node_id` of the counterparty for this channel.
35519 * Will be `None` for channels constructed on LDK versions prior to 0.0.110 and always `Some`
35522 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35524 MUST_USE_RES struct LDKPublicKey ChannelMonitor_get_counterparty_node_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35527 * You may use this to broadcast the latest local commitment transaction, either because
35528 * a monitor update failed or because we've fallen behind (i.e. we've received proof that our
35529 * counterparty side knows a revocation secret we gave them that they shouldn't know).
35531 * Broadcasting these transactions in this manner is UNSAFE, as they allow counterparty
35532 * side to punish you. Nevertheless you may want to broadcast them if counterparty doesn't
35533 * close channel with their commitment transaction after a substantial amount of time. Best
35534 * may be to contact the other node operator out-of-band to coordinate other options available
35537 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);
35540 * Processes transactions in a newly connected block, which may result in any of the following:
35541 * - update the monitor's state against resolved HTLCs
35542 * - punish the counterparty in the case of seeing a revoked commitment transaction
35543 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
35544 * - detect settled outputs for later spending
35545 * - schedule and bump any in-flight claims
35547 * Returns any new outputs to watch from `txdata`; after called, these are also included in
35548 * [`get_outputs_to_watch`].
35550 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
35552 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);
35555 * Determines if the disconnected block contained any transactions of interest and updates
35558 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);
35561 * Processes transactions confirmed in a block with the given header and height, returning new
35562 * outputs to watch. See [`block_connected`] for details.
35564 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
35565 * blocks. See [`chain::Confirm`] for calling expectations.
35567 * [`block_connected`]: Self::block_connected
35569 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);
35572 * Processes a transaction that was reorganized out of the chain.
35574 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
35575 * than blocks. See [`chain::Confirm`] for calling expectations.
35577 * [`block_disconnected`]: Self::block_disconnected
35579 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);
35582 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
35583 * [`block_connected`] for details.
35585 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
35586 * blocks. See [`chain::Confirm`] for calling expectations.
35588 * [`block_connected`]: Self::block_connected
35590 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);
35593 * Returns the set of txids that should be monitored for re-organization out of the chain.
35595 MUST_USE_RES struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35598 * Gets the latest best block which was connected either via the [`chain::Listen`] or
35599 * [`chain::Confirm`] interfaces.
35601 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35604 * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
35605 * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
35606 * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
35607 * invoking this every 30 seconds, or lower if running in an environment with spotty
35608 * connections, like on mobile.
35610 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);
35613 * Triggers rebroadcasts of pending claims from a force-closed channel after a transaction
35614 * signature generation failure.
35616 void ChannelMonitor_signer_unblocked(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
35619 * Returns the descriptors for relevant outputs (i.e., those that we can spend) within the
35620 * transaction if they exist and the transaction has at least [`ANTI_REORG_DELAY`]
35621 * confirmations. For [`SpendableOutputDescriptor::DelayedPaymentOutput`] descriptors to be
35622 * returned, the transaction must have at least `max(ANTI_REORG_DELAY, to_self_delay)`
35625 * Descriptors returned by this method are primarily exposed via [`Event::SpendableOutputs`]
35626 * once they are no longer under reorg risk. This method serves as a way to retrieve these
35627 * descriptors at a later time, either for historical purposes, or to replay any
35628 * missed/unhandled descriptors. For the purpose of gathering historical records, if the
35629 * channel close has fully resolved (i.e., [`ChannelMonitor::get_claimable_balances`] returns
35630 * an empty set), you can retrieve all spendable outputs by providing all descendant spending
35631 * transactions starting from the channel's funding transaction and going down three levels.
35633 * `tx` is a transaction we'll scan the outputs of. Any transaction can be provided. If any
35634 * outputs which can be spent by us are found, at least one descriptor is returned.
35636 * `confirmation_height` must be the height of the block in which `tx` was included in.
35638 MUST_USE_RES struct LDKCVec_SpendableOutputDescriptorZ ChannelMonitor_get_spendable_outputs(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKTransaction tx, uint32_t confirmation_height);
35641 * Checks if the monitor is fully resolved. Resolved monitor is one that has claimed all of
35642 * its outputs and balances (i.e. [`Self::get_claimable_balances`] returns an empty set).
35644 * This function returns true only if [`Self::get_claimable_balances`] has been empty for at least
35645 * 4032 blocks as an additional protection against any bugs resulting in spuriously empty balance sets.
35647 MUST_USE_RES bool ChannelMonitor_is_fully_resolved(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKLogger *NONNULL_PTR logger);
35650 * Gets the balances in this channel which are either claimable by us if we were to
35651 * force-close the channel now or which are claimable on-chain (possibly awaiting
35654 * Any balances in the channel which are available on-chain (excluding on-chain fees) are
35655 * included here until an [`Event::SpendableOutputs`] event has been generated for the
35656 * balance, or until our counterparty has claimed the balance and accrued several
35657 * confirmations on the claim transaction.
35659 * Note that for `ChannelMonitors` which track a channel which went on-chain with versions of
35660 * LDK prior to 0.0.111, not all or excess balances may be included.
35662 * See [`Balance`] for additional details on the types of claimable balances which
35663 * may be returned here and their meanings.
35665 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35668 * Read a C2Tuple_ThirtyTwoBytesChannelMonitorZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelMonitorZ_write
35670 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKEntropySource *NONNULL_PTR arg_a, const struct LDKSignerProvider *NONNULL_PTR arg_b);
35673 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
35675 void OutPoint_free(struct LDKOutPoint this_obj);
35678 * The referenced transaction's txid.
35680 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
35683 * The referenced transaction's txid.
35685 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35688 * The index of the referenced output in its transaction's vout.
35690 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
35693 * The index of the referenced output in its transaction's vout.
35695 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
35698 * Constructs a new OutPoint given each field
35700 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
35703 * Creates a copy of the OutPoint
35705 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
35708 * Checks if two OutPoints contain equal inner contents.
35709 * This ignores pointers and is_owned flags and looks at the values in fields.
35710 * Two objects with NULL inner values will be considered "equal" here.
35712 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
35715 * Generates a non-cryptographic 64-bit hash of the OutPoint.
35717 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
35720 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
35722 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
35725 * Read a OutPoint from a byte array, created by OutPoint_write
35727 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
35730 * Frees any resources used by the InboundHTLCErr, if is_owned is set and inner is non-NULL.
35732 void InboundHTLCErr_free(struct LDKInboundHTLCErr this_obj);
35735 * BOLT 4 error code.
35737 uint16_t InboundHTLCErr_get_err_code(const struct LDKInboundHTLCErr *NONNULL_PTR this_ptr);
35740 * BOLT 4 error code.
35742 void InboundHTLCErr_set_err_code(struct LDKInboundHTLCErr *NONNULL_PTR this_ptr, uint16_t val);
35745 * Data attached to this error.
35747 * Returns a copy of the field.
35749 struct LDKCVec_u8Z InboundHTLCErr_get_err_data(const struct LDKInboundHTLCErr *NONNULL_PTR this_ptr);
35752 * Data attached to this error.
35754 void InboundHTLCErr_set_err_data(struct LDKInboundHTLCErr *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
35757 * Error message text.
35759 struct LDKStr InboundHTLCErr_get_msg(const struct LDKInboundHTLCErr *NONNULL_PTR this_ptr);
35762 * Error message text.
35764 void InboundHTLCErr_set_msg(struct LDKInboundHTLCErr *NONNULL_PTR this_ptr, struct LDKStr val);
35767 * Constructs a new InboundHTLCErr given each field
35769 MUST_USE_RES struct LDKInboundHTLCErr InboundHTLCErr_new(uint16_t err_code_arg, struct LDKCVec_u8Z err_data_arg, struct LDKStr msg_arg);
35772 * Peel one layer off an incoming onion, returning a [`PendingHTLCInfo`] that contains information
35773 * about the intended next-hop for the HTLC.
35775 * This does all the relevant context-free checks that LDK requires for payment relay or
35776 * acceptance. If the payment is to be received, and the amount matches the expected amount for
35777 * a given invoice, this indicates the [`msgs::UpdateAddHTLC`], once fully committed in the
35778 * channel, will generate an [`Event::PaymentClaimable`].
35780 * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
35782 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);
35785 * Frees any resources used by the PendingHTLCRouting
35787 void PendingHTLCRouting_free(struct LDKPendingHTLCRouting this_ptr);
35790 * Creates a copy of the PendingHTLCRouting
35792 struct LDKPendingHTLCRouting PendingHTLCRouting_clone(const struct LDKPendingHTLCRouting *NONNULL_PTR orig);
35795 * Utility method to constructs a new Forward-variant PendingHTLCRouting
35797 struct LDKPendingHTLCRouting PendingHTLCRouting_forward(struct LDKOnionPacket onion_packet, uint64_t short_channel_id, struct LDKBlindedForward blinded);
35800 * Utility method to constructs a new Receive-variant PendingHTLCRouting
35802 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);
35805 * Utility method to constructs a new ReceiveKeysend-variant PendingHTLCRouting
35807 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);
35810 * Frees any resources used by the BlindedForward, if is_owned is set and inner is non-NULL.
35812 void BlindedForward_free(struct LDKBlindedForward this_obj);
35815 * The `blinding_point` that was set in the inbound [`msgs::UpdateAddHTLC`], or in the inbound
35816 * onion payload if we're the introduction node. Useful for calculating the next hop's
35817 * [`msgs::UpdateAddHTLC::blinding_point`].
35819 struct LDKPublicKey BlindedForward_get_inbound_blinding_point(const struct LDKBlindedForward *NONNULL_PTR this_ptr);
35822 * The `blinding_point` that was set in the inbound [`msgs::UpdateAddHTLC`], or in the inbound
35823 * onion payload if we're the introduction node. Useful for calculating the next hop's
35824 * [`msgs::UpdateAddHTLC::blinding_point`].
35826 void BlindedForward_set_inbound_blinding_point(struct LDKBlindedForward *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35829 * If needed, this determines how this HTLC should be failed backwards, based on whether we are
35830 * the introduction node.
35832 enum LDKBlindedFailure BlindedForward_get_failure(const struct LDKBlindedForward *NONNULL_PTR this_ptr);
35835 * If needed, this determines how this HTLC should be failed backwards, based on whether we are
35836 * the introduction node.
35838 void BlindedForward_set_failure(struct LDKBlindedForward *NONNULL_PTR this_ptr, enum LDKBlindedFailure val);
35841 * Constructs a new BlindedForward given each field
35843 MUST_USE_RES struct LDKBlindedForward BlindedForward_new(struct LDKPublicKey inbound_blinding_point_arg, enum LDKBlindedFailure failure_arg);
35846 * Creates a copy of the BlindedForward
35848 struct LDKBlindedForward BlindedForward_clone(const struct LDKBlindedForward *NONNULL_PTR orig);
35851 * Generates a non-cryptographic 64-bit hash of the BlindedForward.
35853 uint64_t BlindedForward_hash(const struct LDKBlindedForward *NONNULL_PTR o);
35856 * Checks if two BlindedForwards contain equal inner contents.
35857 * This ignores pointers and is_owned flags and looks at the values in fields.
35858 * Two objects with NULL inner values will be considered "equal" here.
35860 bool BlindedForward_eq(const struct LDKBlindedForward *NONNULL_PTR a, const struct LDKBlindedForward *NONNULL_PTR b);
35863 * Frees any resources used by the PendingHTLCInfo, if is_owned is set and inner is non-NULL.
35865 void PendingHTLCInfo_free(struct LDKPendingHTLCInfo this_obj);
35868 * Further routing details based on whether the HTLC is being forwarded or received.
35870 struct LDKPendingHTLCRouting PendingHTLCInfo_get_routing(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
35873 * Further routing details based on whether the HTLC is being forwarded or received.
35875 void PendingHTLCInfo_set_routing(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKPendingHTLCRouting val);
35878 * The onion shared secret we build with the sender used to decrypt the onion.
35880 * This is later used to encrypt failure packets in the event that the HTLC is failed.
35882 const uint8_t (*PendingHTLCInfo_get_incoming_shared_secret(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr))[32];
35885 * The onion shared secret we build with the sender used to decrypt the onion.
35887 * This is later used to encrypt failure packets in the event that the HTLC is failed.
35889 void PendingHTLCInfo_set_incoming_shared_secret(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35892 * Hash of the payment preimage, to lock the payment until the receiver releases the preimage.
35894 const uint8_t (*PendingHTLCInfo_get_payment_hash(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr))[32];
35897 * Hash of the payment preimage, to lock the payment until the receiver releases the preimage.
35899 void PendingHTLCInfo_set_payment_hash(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35902 * Amount received in the incoming HTLC.
35904 * This field was added in LDK 0.0.113 and will be `None` for objects written by prior
35907 struct LDKCOption_u64Z PendingHTLCInfo_get_incoming_amt_msat(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
35910 * Amount received in the incoming HTLC.
35912 * This field was added in LDK 0.0.113 and will be `None` for objects written by prior
35915 void PendingHTLCInfo_set_incoming_amt_msat(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
35918 * The amount the sender indicated should be forwarded on to the next hop or amount the sender
35919 * intended for us to receive for received payments.
35921 * If the received amount is less than this for received payments, an intermediary hop has
35922 * attempted to steal some of our funds and we should fail the HTLC (the sender should retry
35923 * it along another path).
35925 * Because nodes can take less than their required fees, and because senders may wish to
35926 * improve their own privacy, this amount may be less than [`Self::incoming_amt_msat`] for
35927 * received payments. In such cases, recipients must handle this HTLC as if it had received
35928 * [`Self::outgoing_amt_msat`].
35930 uint64_t PendingHTLCInfo_get_outgoing_amt_msat(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
35933 * The amount the sender indicated should be forwarded on to the next hop or amount the sender
35934 * intended for us to receive for received payments.
35936 * If the received amount is less than this for received payments, an intermediary hop has
35937 * attempted to steal some of our funds and we should fail the HTLC (the sender should retry
35938 * it along another path).
35940 * Because nodes can take less than their required fees, and because senders may wish to
35941 * improve their own privacy, this amount may be less than [`Self::incoming_amt_msat`] for
35942 * received payments. In such cases, recipients must handle this HTLC as if it had received
35943 * [`Self::outgoing_amt_msat`].
35945 void PendingHTLCInfo_set_outgoing_amt_msat(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, uint64_t val);
35948 * The CLTV the sender has indicated we should set on the forwarded HTLC (or has indicated
35949 * should have been set on the received HTLC for received payments).
35951 uint32_t PendingHTLCInfo_get_outgoing_cltv_value(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
35954 * The CLTV the sender has indicated we should set on the forwarded HTLC (or has indicated
35955 * should have been set on the received HTLC for received payments).
35957 void PendingHTLCInfo_set_outgoing_cltv_value(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, uint32_t val);
35960 * The fee taken for this HTLC in addition to the standard protocol HTLC fees.
35962 * If this is a payment for forwarding, this is the fee we are taking before forwarding the
35965 * If this is a received payment, this is the fee that our counterparty took.
35967 * This is used to allow LSPs to take fees as a part of payments, without the sender having to
35970 struct LDKCOption_u64Z PendingHTLCInfo_get_skimmed_fee_msat(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
35973 * The fee taken for this HTLC in addition to the standard protocol HTLC fees.
35975 * If this is a payment for forwarding, this is the fee we are taking before forwarding the
35978 * If this is a received payment, this is the fee that our counterparty took.
35980 * This is used to allow LSPs to take fees as a part of payments, without the sender having to
35983 void PendingHTLCInfo_set_skimmed_fee_msat(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
35986 * Constructs a new PendingHTLCInfo given each field
35988 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);
35991 * Creates a copy of the PendingHTLCInfo
35993 struct LDKPendingHTLCInfo PendingHTLCInfo_clone(const struct LDKPendingHTLCInfo *NONNULL_PTR orig);
35996 * Creates a copy of the BlindedFailure
35998 enum LDKBlindedFailure BlindedFailure_clone(const enum LDKBlindedFailure *NONNULL_PTR orig);
36001 * Utility method to constructs a new FromIntroductionNode-variant BlindedFailure
36003 enum LDKBlindedFailure BlindedFailure_from_introduction_node(void);
36006 * Utility method to constructs a new FromBlindedNode-variant BlindedFailure
36008 enum LDKBlindedFailure BlindedFailure_from_blinded_node(void);
36011 * Generates a non-cryptographic 64-bit hash of the BlindedFailure.
36013 uint64_t BlindedFailure_hash(const enum LDKBlindedFailure *NONNULL_PTR o);
36016 * Checks if two BlindedFailures contain equal inner contents.
36017 * This ignores pointers and is_owned flags and looks at the values in fields.
36019 bool BlindedFailure_eq(const enum LDKBlindedFailure *NONNULL_PTR a, const enum LDKBlindedFailure *NONNULL_PTR b);
36022 * Frees any resources used by the FailureCode
36024 void FailureCode_free(struct LDKFailureCode this_ptr);
36027 * Creates a copy of the FailureCode
36029 struct LDKFailureCode FailureCode_clone(const struct LDKFailureCode *NONNULL_PTR orig);
36032 * Utility method to constructs a new TemporaryNodeFailure-variant FailureCode
36034 struct LDKFailureCode FailureCode_temporary_node_failure(void);
36037 * Utility method to constructs a new RequiredNodeFeatureMissing-variant FailureCode
36039 struct LDKFailureCode FailureCode_required_node_feature_missing(void);
36042 * Utility method to constructs a new IncorrectOrUnknownPaymentDetails-variant FailureCode
36044 struct LDKFailureCode FailureCode_incorrect_or_unknown_payment_details(void);
36047 * Utility method to constructs a new InvalidOnionPayload-variant FailureCode
36049 struct LDKFailureCode FailureCode_invalid_onion_payload(struct LDKCOption_C2Tuple_u64u16ZZ a);
36052 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
36054 void ChannelManager_free(struct LDKChannelManager this_obj);
36057 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
36059 void ChainParameters_free(struct LDKChainParameters this_obj);
36062 * The network for determining the `chain_hash` in Lightning messages.
36064 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
36067 * The network for determining the `chain_hash` in Lightning messages.
36069 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
36072 * The hash and height of the latest block successfully connected.
36074 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
36076 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
36079 * The hash and height of the latest block successfully connected.
36081 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
36083 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
36086 * Constructs a new ChainParameters given each field
36088 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
36091 * Creates a copy of the ChainParameters
36093 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
36096 * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
36098 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
36101 * Base routing fee in millisatoshis.
36103 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
36106 * Base routing fee in millisatoshis.
36108 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
36111 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
36113 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
36116 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
36118 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
36121 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
36122 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
36123 * `cltv_expiry_delta` for more details.
36125 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
36128 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
36129 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
36130 * `cltv_expiry_delta` for more details.
36132 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
36135 * Constructs a new CounterpartyForwardingInfo given each field
36137 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);
36140 * Creates a copy of the CounterpartyForwardingInfo
36142 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
36145 * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
36147 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
36150 * The node_id of our counterparty
36152 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
36155 * The node_id of our counterparty
36157 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36160 * The Features the channel counterparty provided upon last connection.
36161 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
36162 * many routing-relevant features are present in the init context.
36164 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
36167 * The Features the channel counterparty provided upon last connection.
36168 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
36169 * many routing-relevant features are present in the init context.
36171 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
36174 * The value, in satoshis, that must always be held in the channel for our counterparty. This
36175 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
36176 * claiming at least this value on chain.
36178 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
36180 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
36182 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
36185 * The value, in satoshis, that must always be held in the channel for our counterparty. This
36186 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
36187 * claiming at least this value on chain.
36189 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
36191 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
36193 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
36196 * Information on the fees and requirements that the counterparty requires when forwarding
36197 * payments to us through this channel.
36199 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36201 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
36204 * Information on the fees and requirements that the counterparty requires when forwarding
36205 * payments to us through this channel.
36207 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36209 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
36212 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
36213 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
36214 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
36216 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
36219 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
36220 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
36221 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
36223 void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36226 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
36228 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
36231 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
36233 void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36236 * Constructs a new ChannelCounterparty given each field
36238 * Note that forwarding_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
36240 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);
36243 * Creates a copy of the ChannelCounterparty
36245 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
36248 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
36250 void ChannelDetails_free(struct LDKChannelDetails this_obj);
36253 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
36254 * thereafter this is the txid of the funding transaction xor the funding transaction output).
36255 * Note that this means this value is *not* persistent - it can change once during the
36256 * lifetime of the channel.
36258 struct LDKChannelId ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36261 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
36262 * thereafter this is the txid of the funding transaction xor the funding transaction output).
36263 * Note that this means this value is *not* persistent - it can change once during the
36264 * lifetime of the channel.
36266 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelId val);
36269 * Parameters which apply to our counterparty. See individual fields for more information.
36271 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36274 * Parameters which apply to our counterparty. See individual fields for more information.
36276 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
36279 * The Channel's funding transaction output, if we've negotiated the funding transaction with
36280 * our counterparty already.
36282 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36284 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36287 * The Channel's funding transaction output, if we've negotiated the funding transaction with
36288 * our counterparty already.
36290 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36292 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
36295 * The features which this channel operates with. See individual features for more info.
36297 * `None` until negotiation completes and the channel type is finalized.
36299 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36301 struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36304 * The features which this channel operates with. See individual features for more info.
36306 * `None` until negotiation completes and the channel type is finalized.
36308 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36310 void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
36313 * The position of the funding transaction in the chain. None if the funding transaction has
36314 * not yet been confirmed and the channel fully opened.
36316 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
36317 * payments instead of this. See [`get_inbound_payment_scid`].
36319 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
36320 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
36322 * [`inbound_scid_alias`]: Self::inbound_scid_alias
36323 * [`outbound_scid_alias`]: Self::outbound_scid_alias
36324 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
36325 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
36326 * [`confirmations_required`]: Self::confirmations_required
36328 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36331 * The position of the funding transaction in the chain. None if the funding transaction has
36332 * not yet been confirmed and the channel fully opened.
36334 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
36335 * payments instead of this. See [`get_inbound_payment_scid`].
36337 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
36338 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
36340 * [`inbound_scid_alias`]: Self::inbound_scid_alias
36341 * [`outbound_scid_alias`]: Self::outbound_scid_alias
36342 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
36343 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
36344 * [`confirmations_required`]: Self::confirmations_required
36346 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36349 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
36350 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
36351 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
36354 * This will be `None` as long as the channel is not available for routing outbound payments.
36356 * [`short_channel_id`]: Self::short_channel_id
36357 * [`confirmations_required`]: Self::confirmations_required
36359 struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36362 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
36363 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
36364 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
36367 * This will be `None` as long as the channel is not available for routing outbound payments.
36369 * [`short_channel_id`]: Self::short_channel_id
36370 * [`confirmations_required`]: Self::confirmations_required
36372 void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36375 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
36376 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
36377 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
36378 * when they see a payment to be routed to us.
36380 * Our counterparty may choose to rotate this value at any time, though will always recognize
36381 * previous values for inbound payment forwarding.
36383 * [`short_channel_id`]: Self::short_channel_id
36385 struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36388 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
36389 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
36390 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
36391 * when they see a payment to be routed to us.
36393 * Our counterparty may choose to rotate this value at any time, though will always recognize
36394 * previous values for inbound payment forwarding.
36396 * [`short_channel_id`]: Self::short_channel_id
36398 void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36401 * The value, in satoshis, of this channel as appears in the funding output
36403 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36406 * The value, in satoshis, of this channel as appears in the funding output
36408 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
36411 * The value, in satoshis, that must always be held in the channel for us. This value ensures
36412 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
36413 * this value on chain.
36415 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
36417 * This value will be `None` for outbound channels until the counterparty accepts the channel.
36419 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
36421 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36424 * The value, in satoshis, that must always be held in the channel for us. This value ensures
36425 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
36426 * this value on chain.
36428 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
36430 * This value will be `None` for outbound channels until the counterparty accepts the channel.
36432 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
36434 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36437 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
36438 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
36439 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
36440 * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
36441 * serialized with LDK versions prior to 0.0.113.
36443 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
36444 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
36445 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
36447 struct LDKU128 ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36450 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
36451 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
36452 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
36453 * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
36454 * serialized with LDK versions prior to 0.0.113.
36456 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
36457 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
36458 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
36460 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKU128 val);
36463 * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
36464 * which is applied to commitment and HTLC transactions.
36466 * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
36468 struct LDKCOption_u32Z ChannelDetails_get_feerate_sat_per_1000_weight(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36471 * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
36472 * which is applied to commitment and HTLC transactions.
36474 * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
36476 void ChannelDetails_set_feerate_sat_per_1000_weight(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
36479 * Our total balance. This is the amount we would get if we close the channel.
36480 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
36481 * amount is not likely to be recoverable on close.
36483 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
36484 * balance is not available for inclusion in new outbound HTLCs). This further does not include
36485 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
36486 * This does not consider any on-chain fees.
36488 * See also [`ChannelDetails::outbound_capacity_msat`]
36490 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36493 * Our total balance. This is the amount we would get if we close the channel.
36494 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
36495 * amount is not likely to be recoverable on close.
36497 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
36498 * balance is not available for inclusion in new outbound HTLCs). This further does not include
36499 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
36500 * This does not consider any on-chain fees.
36502 * See also [`ChannelDetails::outbound_capacity_msat`]
36504 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
36507 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
36508 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
36509 * available for inclusion in new outbound HTLCs). This further does not include any pending
36510 * outgoing HTLCs which are awaiting some other resolution to be sent.
36512 * See also [`ChannelDetails::balance_msat`]
36514 * This value is not exact. Due to various in-flight changes, feerate changes, and our
36515 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
36516 * should be able to spend nearly this amount.
36518 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36521 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
36522 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
36523 * available for inclusion in new outbound HTLCs). This further does not include any pending
36524 * outgoing HTLCs which are awaiting some other resolution to be sent.
36526 * See also [`ChannelDetails::balance_msat`]
36528 * This value is not exact. Due to various in-flight changes, feerate changes, and our
36529 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
36530 * should be able to spend nearly this amount.
36532 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
36535 * The available outbound capacity for sending a single HTLC to the remote peer. This is
36536 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
36537 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
36538 * to use a limit as close as possible to the HTLC limit we can currently send.
36540 * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
36541 * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
36543 uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36546 * The available outbound capacity for sending a single HTLC to the remote peer. This is
36547 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
36548 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
36549 * to use a limit as close as possible to the HTLC limit we can currently send.
36551 * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
36552 * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
36554 void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
36557 * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
36558 * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
36559 * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
36560 * route which is valid.
36562 uint64_t ChannelDetails_get_next_outbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36565 * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
36566 * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
36567 * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
36568 * route which is valid.
36570 void ChannelDetails_set_next_outbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
36573 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
36574 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
36575 * available for inclusion in new inbound HTLCs).
36576 * Note that there are some corner cases not fully handled here, so the actual available
36577 * inbound capacity may be slightly higher than this.
36579 * This value is not exact. Due to various in-flight changes, feerate changes, and our
36580 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
36581 * However, our counterparty should be able to spend nearly this amount.
36583 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36586 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
36587 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
36588 * available for inclusion in new inbound HTLCs).
36589 * Note that there are some corner cases not fully handled here, so the actual available
36590 * inbound capacity may be slightly higher than this.
36592 * This value is not exact. Due to various in-flight changes, feerate changes, and our
36593 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
36594 * However, our counterparty should be able to spend nearly this amount.
36596 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
36599 * The number of required confirmations on the funding transaction before the funding will be
36600 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
36601 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
36602 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
36603 * [`ChannelHandshakeLimits::max_minimum_depth`].
36605 * This value will be `None` for outbound channels until the counterparty accepts the channel.
36607 * [`is_outbound`]: ChannelDetails::is_outbound
36608 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
36609 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
36611 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36614 * The number of required confirmations on the funding transaction before the funding will be
36615 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
36616 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
36617 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
36618 * [`ChannelHandshakeLimits::max_minimum_depth`].
36620 * This value will be `None` for outbound channels until the counterparty accepts the channel.
36622 * [`is_outbound`]: ChannelDetails::is_outbound
36623 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
36624 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
36626 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
36629 * The current number of confirmations on the funding transaction.
36631 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
36633 struct LDKCOption_u32Z ChannelDetails_get_confirmations(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36636 * The current number of confirmations on the funding transaction.
36638 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
36640 void ChannelDetails_set_confirmations(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
36643 * The number of blocks (after our commitment transaction confirms) that we will need to wait
36644 * until we can claim our funds after we force-close the channel. During this time our
36645 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
36646 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
36647 * time to claim our non-HTLC-encumbered funds.
36649 * This value will be `None` for outbound channels until the counterparty accepts the channel.
36651 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36654 * The number of blocks (after our commitment transaction confirms) that we will need to wait
36655 * until we can claim our funds after we force-close the channel. During this time our
36656 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
36657 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
36658 * time to claim our non-HTLC-encumbered funds.
36660 * This value will be `None` for outbound channels until the counterparty accepts the channel.
36662 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
36665 * True if the channel was initiated (and thus funded) by us.
36667 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36670 * True if the channel was initiated (and thus funded) by us.
36672 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
36675 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
36676 * channel is not currently being shut down. `channel_ready` message exchange implies the
36677 * required confirmation count has been reached (and we were connected to the peer at some
36678 * point after the funding transaction received enough confirmations). The required
36679 * confirmation count is provided in [`confirmations_required`].
36681 * [`confirmations_required`]: ChannelDetails::confirmations_required
36683 bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36686 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
36687 * channel is not currently being shut down. `channel_ready` message exchange implies the
36688 * required confirmation count has been reached (and we were connected to the peer at some
36689 * point after the funding transaction received enough confirmations). The required
36690 * confirmation count is provided in [`confirmations_required`].
36692 * [`confirmations_required`]: ChannelDetails::confirmations_required
36694 void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
36697 * The stage of the channel's shutdown.
36698 * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
36700 * Returns a copy of the field.
36702 struct LDKCOption_ChannelShutdownStateZ ChannelDetails_get_channel_shutdown_state(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36705 * The stage of the channel's shutdown.
36706 * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
36708 void ChannelDetails_set_channel_shutdown_state(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_ChannelShutdownStateZ val);
36711 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
36712 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
36714 * This is a strict superset of `is_channel_ready`.
36716 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36719 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
36720 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
36722 * This is a strict superset of `is_channel_ready`.
36724 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
36727 * True if this channel is (or will be) publicly-announced.
36729 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36732 * True if this channel is (or will be) publicly-announced.
36734 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
36737 * The smallest value HTLC (in msat) we will accept, for this channel. This field
36738 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
36740 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36743 * The smallest value HTLC (in msat) we will accept, for this channel. This field
36744 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
36746 void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36749 * The largest value HTLC (in msat) we currently will accept, for this channel.
36751 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36754 * The largest value HTLC (in msat) we currently will accept, for this channel.
36756 void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36759 * Set of configurable parameters that affect channel operation.
36761 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
36763 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36765 struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36768 * Set of configurable parameters that affect channel operation.
36770 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
36772 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36774 void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
36777 * Creates a copy of the ChannelDetails
36779 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
36782 * Gets the current SCID which should be used to identify this channel for inbound payments.
36783 * This should be used for providing invoice hints or in any other context where our
36784 * counterparty will forward a payment to us.
36786 * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
36787 * [`ChannelDetails::short_channel_id`]. See those for more information.
36789 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
36792 * Gets the current SCID which should be used to identify this channel for outbound payments.
36793 * This should be used in [`Route`]s to describe the first hop or in other contexts where
36794 * we're sending or forwarding a payment outbound over this channel.
36796 * This is either the [`ChannelDetails::short_channel_id`], if set, or the
36797 * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
36799 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
36802 * Creates a copy of the ChannelShutdownState
36804 enum LDKChannelShutdownState ChannelShutdownState_clone(const enum LDKChannelShutdownState *NONNULL_PTR orig);
36807 * Utility method to constructs a new NotShuttingDown-variant ChannelShutdownState
36809 enum LDKChannelShutdownState ChannelShutdownState_not_shutting_down(void);
36812 * Utility method to constructs a new ShutdownInitiated-variant ChannelShutdownState
36814 enum LDKChannelShutdownState ChannelShutdownState_shutdown_initiated(void);
36817 * Utility method to constructs a new ResolvingHTLCs-variant ChannelShutdownState
36819 enum LDKChannelShutdownState ChannelShutdownState_resolving_htlcs(void);
36822 * Utility method to constructs a new NegotiatingClosingFee-variant ChannelShutdownState
36824 enum LDKChannelShutdownState ChannelShutdownState_negotiating_closing_fee(void);
36827 * Utility method to constructs a new ShutdownComplete-variant ChannelShutdownState
36829 enum LDKChannelShutdownState ChannelShutdownState_shutdown_complete(void);
36832 * Checks if two ChannelShutdownStates contain equal inner contents.
36833 * This ignores pointers and is_owned flags and looks at the values in fields.
36835 bool ChannelShutdownState_eq(const enum LDKChannelShutdownState *NONNULL_PTR a, const enum LDKChannelShutdownState *NONNULL_PTR b);
36838 * Frees any resources used by the RecentPaymentDetails
36840 void RecentPaymentDetails_free(struct LDKRecentPaymentDetails this_ptr);
36843 * Creates a copy of the RecentPaymentDetails
36845 struct LDKRecentPaymentDetails RecentPaymentDetails_clone(const struct LDKRecentPaymentDetails *NONNULL_PTR orig);
36848 * Utility method to constructs a new AwaitingInvoice-variant RecentPaymentDetails
36850 struct LDKRecentPaymentDetails RecentPaymentDetails_awaiting_invoice(struct LDKThirtyTwoBytes payment_id);
36853 * Utility method to constructs a new Pending-variant RecentPaymentDetails
36855 struct LDKRecentPaymentDetails RecentPaymentDetails_pending(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, uint64_t total_msat);
36858 * Utility method to constructs a new Fulfilled-variant RecentPaymentDetails
36860 struct LDKRecentPaymentDetails RecentPaymentDetails_fulfilled(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash);
36863 * Utility method to constructs a new Abandoned-variant RecentPaymentDetails
36865 struct LDKRecentPaymentDetails RecentPaymentDetails_abandoned(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
36868 * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
36870 void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
36873 * The list of channels to be included in the invoice route hints.
36875 struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
36878 * The list of channels to be included in the invoice route hints.
36880 void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
36883 * A fake scid used for representing the phantom node's fake channel in generating the invoice
36886 uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
36889 * A fake scid used for representing the phantom node's fake channel in generating the invoice
36892 void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
36895 * The pubkey of the real backing node that would ultimately receive the payment.
36897 struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
36900 * The pubkey of the real backing node that would ultimately receive the payment.
36902 void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36905 * Constructs a new PhantomRouteHints given each field
36907 MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
36910 * Creates a copy of the PhantomRouteHints
36912 struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
36915 * Constructs a new `ChannelManager` to hold several channels and route between them.
36917 * The current time or latest block header time can be provided as the `current_timestamp`.
36919 * This is the main \"logic hub\" for all channel-related actions, and implements
36920 * [`ChannelMessageHandler`].
36922 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
36924 * Users need to notify the new `ChannelManager` when a new block is connected or
36925 * disconnected using its [`block_connected`] and [`block_disconnected`] methods, starting
36926 * from after [`params.best_block.block_hash`]. See [`chain::Listen`] and [`chain::Confirm`] for
36929 * [`block_connected`]: chain::Listen::block_connected
36930 * [`block_disconnected`]: chain::Listen::block_disconnected
36931 * [`params.best_block.block_hash`]: chain::BestBlock::block_hash
36933 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);
36936 * Gets the current configuration applied to all new channels.
36938 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
36941 * Creates a new outbound channel to the given remote node and with the given value.
36943 * `user_channel_id` will be provided back as in
36944 * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
36945 * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to a
36946 * randomized value for inbound channels. `user_channel_id` has no meaning inside of LDK, it
36947 * is simply copied to events and otherwise ignored.
36949 * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
36950 * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
36952 * Raises [`APIError::ChannelUnavailable`] if the channel cannot be opened due to failing to
36953 * generate a shutdown scriptpubkey or destination script set by
36954 * [`SignerProvider::get_shutdown_scriptpubkey`] or [`SignerProvider::get_destination_script`].
36956 * Note that we do not check if you are currently connected to the given peer. If no
36957 * connection is available, the outbound `open_channel` message may fail to send, resulting in
36958 * the channel eventually being silently forgotten (dropped on reload).
36960 * If `temporary_channel_id` is specified, it will be used as the temporary channel ID of the
36961 * channel. Otherwise, a random one will be generated for you.
36963 * Returns the new Channel's temporary `channel_id`. This ID will appear as
36964 * [`Event::FundingGenerationReady::temporary_channel_id`] and in
36965 * [`ChannelDetails::channel_id`] until after
36966 * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
36967 * one derived from the funding transaction's TXID. If the counterparty rejects the channel
36968 * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
36970 * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
36971 * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
36972 * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
36974 * Note that temporary_channel_id (or a relevant inner pointer) may be NULL or all-0s to represent None
36975 * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
36977 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);
36980 * Gets the list of open channels, in random order. See [`ChannelDetails`] field documentation for
36981 * more information.
36983 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
36986 * Gets the list of usable channels, in random order. Useful as an argument to
36987 * [`Router::find_route`] to ensure non-announced channels are used.
36989 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
36990 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
36993 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
36996 * Gets the list of channels we have with a given counterparty, in random order.
36998 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels_with_counterparty(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id);
37001 * Returns in an undefined order recent payments that -- if not fulfilled -- have yet to find a
37002 * successful path, or have unresolved HTLCs.
37004 * This can be useful for payments that may have been prepared, but ultimately not sent, as a
37005 * result of a crash. If such a payment exists, is not listed here, and an
37006 * [`Event::PaymentSent`] has not been received, you may consider resending the payment.
37008 * [`Event::PaymentSent`]: events::Event::PaymentSent
37010 MUST_USE_RES struct LDKCVec_RecentPaymentDetailsZ ChannelManager_list_recent_payments(const struct LDKChannelManager *NONNULL_PTR this_arg);
37013 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
37014 * will be accepted on the given channel, and after additional timeout/the closing of all
37015 * pending HTLCs, the channel will be closed on chain.
37017 * * If we are the channel initiator, we will pay between our [`ChannelCloseMinimum`] and
37018 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
37020 * * If our counterparty is the channel initiator, we will require a channel closing
37021 * transaction feerate of at least our [`ChannelCloseMinimum`] feerate or the feerate which
37022 * would appear on a force-closure transaction, whichever is lower. We will allow our
37023 * counterparty to pay as much fee as they'd like, however.
37025 * May generate a [`SendShutdown`] message event on success, which should be relayed.
37027 * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
37028 * generate a shutdown scriptpubkey or destination script set by
37029 * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
37032 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
37033 * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
37034 * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
37035 * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
37037 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);
37040 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
37041 * will be accepted on the given channel, and after additional timeout/the closing of all
37042 * pending HTLCs, the channel will be closed on chain.
37044 * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
37045 * the channel being closed or not:
37046 * * If we are the channel initiator, we will pay at least this feerate on the closing
37047 * transaction. The upper-bound is set by
37048 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
37049 * fee estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
37050 * * If our counterparty is the channel initiator, we will refuse to accept a channel closure
37051 * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
37052 * will appear on a force-closure transaction, whichever is lower).
37054 * The `shutdown_script` provided will be used as the `scriptPubKey` for the closing transaction.
37055 * Will fail if a shutdown script has already been set for this channel by
37056 * ['ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must
37057 * also be compatible with our and the counterparty's features.
37059 * May generate a [`SendShutdown`] message event on success, which should be relayed.
37061 * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
37062 * generate a shutdown scriptpubkey or destination script set by
37063 * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
37066 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
37067 * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
37068 * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
37070 * Note that shutdown_script (or a relevant inner pointer) may be NULL or all-0s to represent None
37072 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);
37075 * Force closes a channel, immediately broadcasting the latest local transaction(s) and
37076 * rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to
37077 * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding
37080 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);
37083 * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting
37084 * the latest local transaction(s). Fails if `channel_id` is unknown to the manager, or if the
37085 * `counterparty_node_id` isn't the counterparty of the corresponding channel.
37087 * You can always broadcast the latest local transaction(s) via
37088 * [`ChannelMonitor::broadcast_latest_holder_commitment_txn`].
37090 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);
37093 * Force close all channels, immediately broadcasting the latest local commitment transaction
37094 * for each to the chain and rejecting new HTLCs on each.
37096 void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
37099 * Force close all channels rejecting new HTLCs on each but without broadcasting the latest
37100 * local transaction(s).
37102 void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
37105 * Sends a payment along a given route.
37107 * Value parameters are provided via the last hop in route, see documentation for [`RouteHop`]
37108 * fields for more info.
37110 * May generate [`UpdateHTLCs`] message(s) event on success, which should be relayed (e.g. via
37111 * [`PeerManager::process_events`]).
37113 * # Avoiding Duplicate Payments
37115 * If a pending payment is currently in-flight with the same [`PaymentId`] provided, this
37116 * method will error with an [`APIError::InvalidRoute`]. Note, however, that once a payment
37117 * is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of an
37118 * [`Event::PaymentSent`] or [`Event::PaymentFailed`]) LDK will not stop you from sending a
37119 * second payment with the same [`PaymentId`].
37121 * Thus, in order to ensure duplicate payments are not sent, you should implement your own
37122 * tracking of payments, including state to indicate once a payment has completed. Because you
37123 * should also ensure that [`PaymentHash`]es are not re-used, for simplicity, you should
37124 * consider using the [`PaymentHash`] as the key for tracking payments. In that case, the
37125 * [`PaymentId`] should be a copy of the [`PaymentHash`] bytes.
37127 * Additionally, in the scenario where we begin the process of sending a payment, but crash
37128 * before `send_payment` returns (or prior to [`ChannelMonitorUpdate`] persistence if you're
37129 * using [`ChannelMonitorUpdateStatus::InProgress`]), the payment may be lost on restart. See
37130 * [`ChannelManager::list_recent_payments`] for more information.
37132 * # Possible Error States on [`PaymentSendFailure`]
37134 * Each path may have a different return value, and [`PaymentSendFailure`] may return a `Vec` with
37135 * each entry matching the corresponding-index entry in the route paths, see
37136 * [`PaymentSendFailure`] for more info.
37138 * In general, a path may raise:
37139 * * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee,
37140 * node public key) is specified.
37141 * * [`APIError::ChannelUnavailable`] if the next-hop channel is not available as it has been
37142 * closed, doesn't exist, or the peer is currently disconnected.
37143 * * [`APIError::MonitorUpdateInProgress`] if a new monitor update failure prevented sending the
37144 * relevant updates.
37146 * Note that depending on the type of the [`PaymentSendFailure`] the HTLC may have been
37147 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
37148 * different route unless you intend to pay twice!
37150 * [`RouteHop`]: crate::routing::router::RouteHop
37151 * [`Event::PaymentSent`]: events::Event::PaymentSent
37152 * [`Event::PaymentFailed`]: events::Event::PaymentFailed
37153 * [`UpdateHTLCs`]: events::MessageSendEvent::UpdateHTLCs
37154 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
37155 * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
37157 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);
37160 * Similar to [`ChannelManager::send_payment_with_route`], but will automatically find a route based on
37161 * `route_params` and retry failed payment paths based on `retry_strategy`.
37163 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);
37166 * Signals that no further attempts for the given payment should occur. Useful if you have a
37167 * pending outbound payment with retries remaining, but wish to stop retrying the payment before
37168 * retries are exhausted.
37170 * # Event Generation
37172 * If no [`Event::PaymentFailed`] event had been generated before, one will be generated as soon
37173 * as there are no remaining pending HTLCs for this payment.
37175 * Note that calling this method does *not* prevent a payment from succeeding. You must still
37176 * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
37177 * determine the ultimate status of a payment.
37179 * # Requested Invoices
37181 * In the case of paying a [`Bolt12Invoice`] via [`ChannelManager::pay_for_offer`], abandoning
37182 * the payment prior to receiving the invoice will result in an [`Event::InvoiceRequestFailed`]
37183 * and prevent any attempts at paying it once received. The other events may only be generated
37184 * once the invoice has been received.
37186 * # Restart Behavior
37188 * If an [`Event::PaymentFailed`] is generated and we restart without first persisting the
37189 * [`ChannelManager`], another [`Event::PaymentFailed`] may be generated; likewise for
37190 * [`Event::InvoiceRequestFailed`].
37192 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
37194 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
37197 * Send a spontaneous payment, which is a payment that does not require the recipient to have
37198 * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
37199 * the preimage, it must be a cryptographically secure random value that no intermediate node
37200 * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
37201 * never reach the recipient.
37203 * See [`send_payment`] documentation for more details on the return value of this function
37204 * and idempotency guarantees provided by the [`PaymentId`] key.
37206 * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
37207 * [`send_payment`] for more information about the risks of duplicate preimage usage.
37209 * [`send_payment`]: Self::send_payment
37211 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);
37214 * Similar to [`ChannelManager::send_spontaneous_payment`], but will automatically find a route
37215 * based on `route_params` and retry failed payment paths based on `retry_strategy`.
37217 * See [`PaymentParameters::for_keysend`] for help in constructing `route_params` for spontaneous
37220 * [`PaymentParameters::for_keysend`]: crate::routing::router::PaymentParameters::for_keysend
37222 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);
37225 * Send a payment that is probing the given route for liquidity. We calculate the
37226 * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows
37227 * us to easily discern them from real payments.
37229 MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPath path);
37232 * Sends payment probes over all paths of a route that would be used to pay the given
37233 * amount to the given `node_id`.
37235 * See [`ChannelManager::send_preflight_probes`] for more information.
37237 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);
37240 * Sends payment probes over all paths of a route that would be used to pay a route found
37241 * according to the given [`RouteParameters`].
37243 * This may be used to send \"pre-flight\" probes, i.e., to train our scorer before conducting
37244 * the actual payment. Note this is only useful if there likely is sufficient time for the
37245 * probe to settle before sending out the actual payment, e.g., when waiting for user
37246 * confirmation in a wallet UI.
37248 * Otherwise, there is a chance the probe could take up some liquidity needed to complete the
37249 * actual payment. Users should therefore be cautious and might avoid sending probes if
37250 * liquidity is scarce and/or they don't expect the probe to return before they send the
37251 * payment. To mitigate this issue, channels with available liquidity less than the required
37252 * amount times the given `liquidity_limit_multiplier` won't be used to send pre-flight
37253 * probes. If `None` is given as `liquidity_limit_multiplier`, it defaults to `3`.
37255 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);
37258 * Call this upon creation of a funding transaction for the given channel.
37260 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
37261 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
37263 * Returns [`APIError::APIMisuseError`] if the funding transaction is not final for propagation
37264 * across the p2p network.
37266 * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
37267 * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
37269 * May panic if the output found in the funding transaction is duplicative with some other
37270 * channel (note that this should be trivially prevented by using unique funding transaction
37271 * keys per-channel).
37273 * Do NOT broadcast the funding transaction yourself. When we have safely received our
37274 * counterparty's signature the funding transaction will automatically be broadcast via the
37275 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
37277 * Note that this includes RBF or similar transaction replacement strategies - lightning does
37278 * not currently support replacing a funding transaction on an existing channel. Instead,
37279 * create a new channel with a conflicting funding transaction.
37281 * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
37282 * the wallet software generating the funding transaction to apply anti-fee sniping as
37283 * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/>
37284 * for more details.
37286 * [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady
37287 * [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed
37289 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);
37292 * Call this upon creation of a batch funding transaction for the given channels.
37294 * Return values are identical to [`Self::funding_transaction_generated`], respective to
37295 * each individual channel and transaction output.
37297 * Do NOT broadcast the funding transaction yourself. This batch funding transaction
37298 * will only be broadcast when we have safely received and persisted the counterparty's
37299 * signature for each channel.
37301 * If there is an error, all channels in the batch are to be considered closed.
37303 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);
37306 * Atomically applies partial updates to the [`ChannelConfig`] of the given channels.
37308 * Once the updates are applied, each eligible channel (advertised with a known short channel
37309 * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
37310 * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
37311 * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
37313 * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
37314 * `counterparty_node_id` is provided.
37316 * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
37317 * below [`MIN_CLTV_EXPIRY_DELTA`].
37319 * If an error is returned, none of the updates should be considered applied.
37321 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
37322 * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
37323 * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
37324 * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
37325 * [`ChannelUpdate`]: msgs::ChannelUpdate
37326 * [`ChannelUnavailable`]: APIError::ChannelUnavailable
37327 * [`APIMisuseError`]: APIError::APIMisuseError
37329 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);
37332 * Atomically updates the [`ChannelConfig`] for the given channels.
37334 * Once the updates are applied, each eligible channel (advertised with a known short channel
37335 * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
37336 * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
37337 * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
37339 * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
37340 * `counterparty_node_id` is provided.
37342 * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
37343 * below [`MIN_CLTV_EXPIRY_DELTA`].
37345 * If an error is returned, none of the updates should be considered applied.
37347 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
37348 * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
37349 * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
37350 * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
37351 * [`ChannelUpdate`]: msgs::ChannelUpdate
37352 * [`ChannelUnavailable`]: APIError::ChannelUnavailable
37353 * [`APIMisuseError`]: APIError::APIMisuseError
37355 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);
37358 * Attempts to forward an intercepted HTLC over the provided channel id and with the provided
37359 * amount to forward. Should only be called in response to an [`HTLCIntercepted`] event.
37361 * Intercepted HTLCs can be useful for Lightning Service Providers (LSPs) to open a just-in-time
37362 * channel to a receiving node if the node lacks sufficient inbound liquidity.
37364 * To make use of intercepted HTLCs, set [`UserConfig::accept_intercept_htlcs`] and use
37365 * [`ChannelManager::get_intercept_scid`] to generate short channel id(s) to put in the
37366 * receiver's invoice route hints. These route hints will signal to LDK to generate an
37367 * [`HTLCIntercepted`] event when it receives the forwarded HTLC, and this method or
37368 * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event.
37370 * Note that LDK does not enforce fee requirements in `amt_to_forward_msat`, and will not stop
37371 * you from forwarding more than you received. See
37372 * [`HTLCIntercepted::expected_outbound_amount_msat`] for more on forwarding a different amount
37375 * Errors if the event was not handled in time, in which case the HTLC was automatically failed
37378 * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
37379 * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
37380 * [`HTLCIntercepted::expected_outbound_amount_msat`]: events::Event::HTLCIntercepted::expected_outbound_amount_msat
37382 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);
37385 * Fails the intercepted HTLC indicated by intercept_id. Should only be called in response to
37386 * an [`HTLCIntercepted`] event. See [`ChannelManager::forward_intercepted_htlc`].
37388 * Errors if the event was not handled in time, in which case the HTLC was automatically failed
37391 * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
37393 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_fail_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id);
37396 * Processes HTLCs which are pending waiting on random forward delay.
37398 * Should only really ever be called in response to a PendingHTLCsForwardable event.
37399 * Will likely generate further events.
37401 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
37404 * Performs actions which should happen on startup and roughly once per minute thereafter.
37406 * This currently includes:
37407 * * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
37408 * * Broadcasting [`ChannelUpdate`] messages if we've been disconnected from our peer for more
37409 * than a minute, informing the network that they should no longer attempt to route over
37411 * * Expiring a channel's previous [`ChannelConfig`] if necessary to only allow forwarding HTLCs
37412 * with the current [`ChannelConfig`].
37413 * * Removing peers which have disconnected but and no longer have any channels.
37414 * * Force-closing and removing channels which have not completed establishment in a timely manner.
37415 * * Forgetting about stale outbound payments, either those that have already been fulfilled
37416 * or those awaiting an invoice that hasn't been delivered in the necessary amount of time.
37417 * The latter is determined using the system clock in `std` and the highest seen block time
37418 * minus two hours in `no-std`.
37420 * Note that this may cause reentrancy through [`chain::Watch::update_channel`] calls or feerate
37421 * estimate fetches.
37423 * [`ChannelUpdate`]: msgs::ChannelUpdate
37424 * [`ChannelConfig`]: crate::util::config::ChannelConfig
37426 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
37429 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
37430 * after a PaymentClaimable event, failing the HTLC back to its origin and freeing resources
37431 * along the path (including in our own channel on which we received it).
37433 * Note that in some cases around unclean shutdown, it is possible the payment may have
37434 * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
37435 * second copy of) the [`events::Event::PaymentClaimable`] event. Alternatively, the payment
37436 * may have already been failed automatically by LDK if it was nearing its expiration time.
37438 * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
37439 * [`ChannelManager::claim_funds`]), you should still monitor for
37440 * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
37441 * startup during which time claims that were in-progress at shutdown may be replayed.
37443 void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
37446 * This is a variant of [`ChannelManager::fail_htlc_backwards`] that allows you to specify the
37447 * reason for the failure.
37449 * See [`FailureCode`] for valid failure codes.
37451 void ChannelManager_fail_htlc_backwards_with_reason(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32], struct LDKFailureCode failure_code);
37454 * Provides a payment preimage in response to [`Event::PaymentClaimable`], generating any
37455 * [`MessageSendEvent`]s needed to claim the payment.
37457 * This method is guaranteed to ensure the payment has been claimed but only if the current
37458 * height is strictly below [`Event::PaymentClaimable::claim_deadline`]. To avoid race
37459 * conditions, you should wait for an [`Event::PaymentClaimed`] before considering the payment
37460 * successful. It will generally be available in the next [`process_pending_events`] call.
37462 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
37463 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentClaimable`
37464 * event matches your expectation. If you fail to do so and call this method, you may provide
37465 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
37467 * This function will fail the payment if it has custom TLVs with even type numbers, as we
37468 * will assume they are unknown. If you intend to accept even custom TLVs, you should use
37469 * [`claim_funds_with_known_custom_tlvs`].
37471 * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
37472 * [`Event::PaymentClaimable::claim_deadline`]: crate::events::Event::PaymentClaimable::claim_deadline
37473 * [`Event::PaymentClaimed`]: crate::events::Event::PaymentClaimed
37474 * [`process_pending_events`]: EventsProvider::process_pending_events
37475 * [`create_inbound_payment`]: Self::create_inbound_payment
37476 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
37477 * [`claim_funds_with_known_custom_tlvs`]: Self::claim_funds_with_known_custom_tlvs
37479 void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
37482 * This is a variant of [`claim_funds`] that allows accepting a payment with custom TLVs with
37483 * even type numbers.
37487 * You MUST check you've understood all even TLVs before using this to
37488 * claim, otherwise you may unintentionally agree to some protocol you do not understand.
37490 * [`claim_funds`]: Self::claim_funds
37492 void ChannelManager_claim_funds_with_known_custom_tlvs(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
37495 * Gets the node_id held by this ChannelManager
37497 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
37500 * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
37502 * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
37503 * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
37506 * The `user_channel_id` parameter will be provided back in
37507 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
37508 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
37510 * Note that this method will return an error and reject the channel, if it requires support
37511 * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
37512 * used to accept such channels.
37514 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
37515 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
37517 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);
37520 * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
37521 * it as confirmed immediately.
37523 * The `user_channel_id` parameter will be provided back in
37524 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
37525 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
37527 * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
37528 * and (if the counterparty agrees), enables forwarding of payments immediately.
37530 * This fully trusts that the counterparty has honestly and correctly constructed the funding
37531 * transaction and blindly assumes that it will eventually confirm.
37533 * If it does not confirm before we decide to close the channel, or if the funding transaction
37534 * does not pay to the correct script the correct amount, *you will lose funds*.
37536 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
37537 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
37539 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);
37542 * Pays for an [`Offer`] using the given parameters by creating an [`InvoiceRequest`] and
37543 * enqueuing it to be sent via an onion message. [`ChannelManager`] will pay the actual
37544 * [`Bolt12Invoice`] once it is received.
37546 * Uses [`InvoiceRequestBuilder`] such that the [`InvoiceRequest`] it builds is recognized by
37547 * the [`ChannelManager`] when handling a [`Bolt12Invoice`] message in response to the request.
37548 * The optional parameters are used in the builder, if `Some`:
37549 * - `quantity` for [`InvoiceRequest::quantity`] which must be set if
37550 * [`Offer::expects_quantity`] is `true`.
37551 * - `amount_msats` if overpaying what is required for the given `quantity` is desired, and
37552 * - `payer_note` for [`InvoiceRequest::payer_note`].
37554 * If `max_total_routing_fee_msat` is not specified, The default from
37555 * [`RouteParameters::from_payment_params_and_value`] is applied.
37559 * The provided `payment_id` is used to ensure that only one invoice is paid for the request
37560 * when received. See [Avoiding Duplicate Payments] for other requirements once the payment has
37563 * To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving the
37564 * invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the
37565 * payment will fail with an [`Event::InvoiceRequestFailed`].
37569 * Uses a one-hop [`BlindedPath`] for the reply path with [`ChannelManager::get_our_node_id`]
37570 * as the introduction node and a derived payer id for payer privacy. As such, currently, the
37571 * node must be announced. Otherwise, there is no way to find a path to the introduction node
37572 * in order to send the [`Bolt12Invoice`].
37576 * Requires a direct connection to an introduction node in [`Offer::paths`] or to
37577 * [`Offer::signing_pubkey`], if empty. A similar restriction applies to the responding
37578 * [`Bolt12Invoice::payment_paths`].
37583 * - a duplicate `payment_id` is provided given the caveats in the aforementioned link,
37584 * - the provided parameters are invalid for the offer,
37585 * - the offer is for an unsupported chain, or
37586 * - the parameterized [`Router`] is unable to create a blinded reply path for the invoice
37589 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
37590 * [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
37591 * [`InvoiceRequest::payer_note`]: crate::offers::invoice_request::InvoiceRequest::payer_note
37592 * [`InvoiceRequestBuilder`]: crate::offers::invoice_request::InvoiceRequestBuilder
37593 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
37594 * [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
37595 * [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
37597 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);
37600 * Creates a [`Bolt12Invoice`] for a [`Refund`] and enqueues it to be sent via an onion
37603 * The resulting invoice uses a [`PaymentHash`] recognized by the [`ChannelManager`] and a
37604 * [`BlindedPath`] containing the [`PaymentSecret`] needed to reconstruct the corresponding
37605 * [`PaymentPreimage`]. It is returned purely for informational purposes.
37609 * Requires a direct connection to an introduction node in [`Refund::paths`] or to
37610 * [`Refund::payer_id`], if empty. This request is best effort; an invoice will be sent to each
37611 * node meeting the aforementioned criteria, but there's no guarantee that they will be
37612 * received and no retries will be made.
37617 * - the refund is for an unsupported chain, or
37618 * - the parameterized [`Router`] is unable to create a blinded payment path or reply path for
37621 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
37623 MUST_USE_RES struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ ChannelManager_request_refund_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRefund *NONNULL_PTR refund);
37626 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
37629 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
37630 * [`PaymentHash`] and [`PaymentPreimage`] for you.
37632 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`] event, which
37633 * will have the [`PaymentClaimable::purpose`] return `Some` for [`PaymentPurpose::preimage`]. That
37634 * should then be passed directly to [`claim_funds`].
37636 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
37638 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
37639 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
37643 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
37644 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
37646 * Errors if `min_value_msat` is greater than total bitcoin supply.
37648 * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
37649 * on versions of LDK prior to 0.0.114.
37651 * [`claim_funds`]: Self::claim_funds
37652 * [`PaymentClaimable`]: events::Event::PaymentClaimable
37653 * [`PaymentClaimable::purpose`]: events::Event::PaymentClaimable::purpose
37654 * [`PaymentPurpose::preimage`]: events::PaymentPurpose::preimage
37655 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
37657 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);
37660 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
37661 * stored external to LDK.
37663 * A [`PaymentClaimable`] event will only be generated if the [`PaymentSecret`] matches a
37664 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
37665 * the `min_value_msat` provided here, if one is provided.
37667 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
37668 * note that LDK will not stop you from registering duplicate payment hashes for inbound
37671 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
37672 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
37673 * before a [`PaymentClaimable`] event will be generated, ensuring that we do not provide the
37674 * sender \"proof-of-payment\" unless they have paid the required amount.
37676 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
37677 * in excess of the current time. This should roughly match the expiry time set in the invoice.
37678 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
37679 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
37680 * invoices when no timeout is set.
37682 * Note that we use block header time to time-out pending inbound payments (with some margin
37683 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
37684 * accept a payment and generate a [`PaymentClaimable`] event for some time after the expiry.
37685 * If you need exact expiry semantics, you should enforce them upon receipt of
37686 * [`PaymentClaimable`].
37688 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry_delta`
37689 * set to at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
37691 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
37692 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
37696 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
37697 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
37699 * Errors if `min_value_msat` is greater than total bitcoin supply.
37701 * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
37702 * on versions of LDK prior to 0.0.114.
37704 * [`create_inbound_payment`]: Self::create_inbound_payment
37705 * [`PaymentClaimable`]: events::Event::PaymentClaimable
37707 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);
37710 * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
37711 * previously returned from [`create_inbound_payment`].
37713 * [`create_inbound_payment`]: Self::create_inbound_payment
37715 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);
37718 * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
37719 * are used when constructing the phantom invoice's route hints.
37721 * [phantom node payments]: crate::sign::PhantomKeysManager
37723 MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
37726 * Gets route hints for use in receiving [phantom node payments].
37728 * [phantom node payments]: crate::sign::PhantomKeysManager
37730 MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
37733 * Gets a fake short channel id for use in receiving intercepted payments. These fake scids are
37734 * used when constructing the route hints for HTLCs intended to be intercepted. See
37735 * [`ChannelManager::forward_intercepted_htlc`].
37737 * Note that this method is not guaranteed to return unique values, you may need to call it a few
37738 * times to get a unique scid.
37740 MUST_USE_RES uint64_t ChannelManager_get_intercept_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
37743 * Gets inflight HTLC information by processing pending outbound payments that are in
37744 * our channels. May be used during pathfinding to account for in-use channel liquidity.
37746 MUST_USE_RES struct LDKInFlightHtlcs ChannelManager_compute_inflight_htlcs(const struct LDKChannelManager *NONNULL_PTR this_arg);
37749 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
37750 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
37752 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
37755 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
37756 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
37758 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
37761 * Constructs a new Listen which calls the relevant methods on this_arg.
37762 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
37764 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
37767 * Constructs a new Confirm which calls the relevant methods on this_arg.
37768 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
37770 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
37773 * Gets a [`Future`] that completes when this [`ChannelManager`] may need to be persisted or
37774 * may have events that need processing.
37776 * In order to check if this [`ChannelManager`] needs persisting, call
37777 * [`Self::get_and_clear_needs_persistence`].
37779 * Note that callbacks registered on the [`Future`] MUST NOT call back into this
37780 * [`ChannelManager`] and should instead register actions to be taken later.
37782 MUST_USE_RES struct LDKFuture ChannelManager_get_event_or_persistence_needed_future(const struct LDKChannelManager *NONNULL_PTR this_arg);
37785 * Returns true if this [`ChannelManager`] needs to be persisted.
37787 * See [`Self::get_event_or_persistence_needed_future`] for retrieving a [`Future`] that
37788 * indicates this should be checked.
37790 MUST_USE_RES bool ChannelManager_get_and_clear_needs_persistence(const struct LDKChannelManager *NONNULL_PTR this_arg);
37793 * Gets the latest best block which was connected either via the [`chain::Listen`] or
37794 * [`chain::Confirm`] interfaces.
37796 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
37799 * Fetches the set of [`NodeFeatures`] flags that are provided by or required by
37800 * [`ChannelManager`].
37802 MUST_USE_RES struct LDKNodeFeatures ChannelManager_node_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
37805 * Fetches the set of [`ChannelFeatures`] flags that are provided by or required by
37806 * [`ChannelManager`].
37808 MUST_USE_RES struct LDKChannelFeatures ChannelManager_channel_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
37811 * Fetches the set of [`ChannelTypeFeatures`] flags that are provided by or required by
37812 * [`ChannelManager`].
37814 MUST_USE_RES struct LDKChannelTypeFeatures ChannelManager_channel_type_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
37817 * Fetches the set of [`InitFeatures`] flags that are provided by or required by
37818 * [`ChannelManager`].
37820 MUST_USE_RES struct LDKInitFeatures ChannelManager_init_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
37823 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
37824 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
37826 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
37829 * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
37830 * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
37832 struct LDKOffersMessageHandler ChannelManager_as_OffersMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
37835 * Constructs a new NodeIdLookUp which calls the relevant methods on this_arg.
37836 * This copies the `inner` pointer in this_arg and thus the returned NodeIdLookUp must be freed before this_arg is
37838 struct LDKNodeIdLookUp ChannelManager_as_NodeIdLookUp(const struct LDKChannelManager *NONNULL_PTR this_arg);
37841 * Fetches the set of [`InitFeatures`] flags that are provided by or required by
37842 * [`ChannelManager`].
37844 struct LDKInitFeatures provided_init_features(const struct LDKUserConfig *NONNULL_PTR config);
37847 * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
37849 struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
37852 * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
37854 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
37857 * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
37859 struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
37862 * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
37864 struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
37867 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
37869 struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
37872 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
37874 struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
37877 * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
37879 struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
37882 * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
37884 struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
37887 * Serialize the BlindedForward object into a byte array which can be read by BlindedForward_read
37889 struct LDKCVec_u8Z BlindedForward_write(const struct LDKBlindedForward *NONNULL_PTR obj);
37892 * Read a BlindedForward from a byte array, created by BlindedForward_write
37894 struct LDKCResult_BlindedForwardDecodeErrorZ BlindedForward_read(struct LDKu8slice ser);
37897 * Serialize the PendingHTLCRouting object into a byte array which can be read by PendingHTLCRouting_read
37899 struct LDKCVec_u8Z PendingHTLCRouting_write(const struct LDKPendingHTLCRouting *NONNULL_PTR obj);
37902 * Read a PendingHTLCRouting from a byte array, created by PendingHTLCRouting_write
37904 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ PendingHTLCRouting_read(struct LDKu8slice ser);
37907 * Serialize the PendingHTLCInfo object into a byte array which can be read by PendingHTLCInfo_read
37909 struct LDKCVec_u8Z PendingHTLCInfo_write(const struct LDKPendingHTLCInfo *NONNULL_PTR obj);
37912 * Read a PendingHTLCInfo from a byte array, created by PendingHTLCInfo_write
37914 struct LDKCResult_PendingHTLCInfoDecodeErrorZ PendingHTLCInfo_read(struct LDKu8slice ser);
37917 * Serialize the BlindedFailure object into a byte array which can be read by BlindedFailure_read
37919 struct LDKCVec_u8Z BlindedFailure_write(const enum LDKBlindedFailure *NONNULL_PTR obj);
37922 * Read a BlindedFailure from a byte array, created by BlindedFailure_write
37924 struct LDKCResult_BlindedFailureDecodeErrorZ BlindedFailure_read(struct LDKu8slice ser);
37927 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
37929 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
37932 * Serialize the ChannelShutdownState object into a byte array which can be read by ChannelShutdownState_read
37934 struct LDKCVec_u8Z ChannelShutdownState_write(const enum LDKChannelShutdownState *NONNULL_PTR obj);
37937 * Read a ChannelShutdownState from a byte array, created by ChannelShutdownState_write
37939 struct LDKCResult_ChannelShutdownStateDecodeErrorZ ChannelShutdownState_read(struct LDKu8slice ser);
37942 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
37944 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
37947 * A cryptographically secure source of entropy.
37949 const struct LDKEntropySource *ChannelManagerReadArgs_get_entropy_source(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
37952 * A cryptographically secure source of entropy.
37954 void ChannelManagerReadArgs_set_entropy_source(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKEntropySource val);
37957 * A signer that is able to perform node-scoped cryptographic operations.
37959 const struct LDKNodeSigner *ChannelManagerReadArgs_get_node_signer(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
37962 * A signer that is able to perform node-scoped cryptographic operations.
37964 void ChannelManagerReadArgs_set_node_signer(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKNodeSigner val);
37967 * The keys provider which will give us relevant keys. Some keys will be loaded during
37968 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
37971 const struct LDKSignerProvider *ChannelManagerReadArgs_get_signer_provider(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
37974 * The keys provider which will give us relevant keys. Some keys will be loaded during
37975 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
37978 void ChannelManagerReadArgs_set_signer_provider(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKSignerProvider val);
37981 * The fee_estimator for use in the ChannelManager in the future.
37983 * No calls to the FeeEstimator will be made during deserialization.
37985 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
37988 * The fee_estimator for use in the ChannelManager in the future.
37990 * No calls to the FeeEstimator will be made during deserialization.
37992 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
37995 * The chain::Watch for use in the ChannelManager in the future.
37997 * No calls to the chain::Watch will be made during deserialization. It is assumed that
37998 * you have deserialized ChannelMonitors separately and will add them to your
37999 * chain::Watch after deserializing this ChannelManager.
38001 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38004 * The chain::Watch for use in the ChannelManager in the future.
38006 * No calls to the chain::Watch will be made during deserialization. It is assumed that
38007 * you have deserialized ChannelMonitors separately and will add them to your
38008 * chain::Watch after deserializing this ChannelManager.
38010 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
38013 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
38014 * used to broadcast the latest local commitment transactions of channels which must be
38015 * force-closed during deserialization.
38017 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38020 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
38021 * used to broadcast the latest local commitment transactions of channels which must be
38022 * force-closed during deserialization.
38024 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
38027 * The router which will be used in the ChannelManager in the future for finding routes
38028 * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
38030 * No calls to the router will be made during deserialization.
38032 const struct LDKRouter *ChannelManagerReadArgs_get_router(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38035 * The router which will be used in the ChannelManager in the future for finding routes
38036 * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
38038 * No calls to the router will be made during deserialization.
38040 void ChannelManagerReadArgs_set_router(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKRouter val);
38043 * The Logger for use in the ChannelManager and which may be used to log information during
38046 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38049 * The Logger for use in the ChannelManager and which may be used to log information during
38052 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
38055 * Default settings used for new channels. Any existing channels will continue to use the
38056 * runtime settings which were stored when the ChannelManager was serialized.
38058 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38061 * Default settings used for new channels. Any existing channels will continue to use the
38062 * runtime settings which were stored when the ChannelManager was serialized.
38064 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
38067 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
38068 * HashMap for you. This is primarily useful for C bindings where it is not practical to
38069 * populate a HashMap directly from C.
38071 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);
38074 * Read a C2Tuple_ThirtyTwoBytesChannelManagerZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelManagerZ_write
38076 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
38079 * Frees any resources used by the DelayedPaymentBasepoint, if is_owned is set and inner is non-NULL.
38081 void DelayedPaymentBasepoint_free(struct LDKDelayedPaymentBasepoint this_obj);
38083 struct LDKPublicKey DelayedPaymentBasepoint_get_a(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_ptr);
38085 void DelayedPaymentBasepoint_set_a(struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38088 * Constructs a new DelayedPaymentBasepoint given each field
38090 MUST_USE_RES struct LDKDelayedPaymentBasepoint DelayedPaymentBasepoint_new(struct LDKPublicKey a_arg);
38093 * Checks if two DelayedPaymentBasepoints contain equal inner contents.
38094 * This ignores pointers and is_owned flags and looks at the values in fields.
38095 * Two objects with NULL inner values will be considered "equal" here.
38097 bool DelayedPaymentBasepoint_eq(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR a, const struct LDKDelayedPaymentBasepoint *NONNULL_PTR b);
38100 * Creates a copy of the DelayedPaymentBasepoint
38102 struct LDKDelayedPaymentBasepoint DelayedPaymentBasepoint_clone(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR orig);
38105 * Generates a non-cryptographic 64-bit hash of the DelayedPaymentBasepoint.
38107 uint64_t DelayedPaymentBasepoint_hash(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR o);
38110 * Get inner Public Key
38112 MUST_USE_RES struct LDKPublicKey DelayedPaymentBasepoint_to_public_key(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_arg);
38115 *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.
38117 MUST_USE_RES struct LDKThirtyTwoBytes DelayedPaymentBasepoint_derive_add_tweak(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_arg, struct LDKPublicKey per_commitment_point);
38120 * Serialize the DelayedPaymentBasepoint object into a byte array which can be read by DelayedPaymentBasepoint_read
38122 struct LDKCVec_u8Z DelayedPaymentBasepoint_write(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR obj);
38125 * Read a DelayedPaymentBasepoint from a byte array, created by DelayedPaymentBasepoint_write
38127 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ DelayedPaymentBasepoint_read(struct LDKu8slice ser);
38130 * Frees any resources used by the DelayedPaymentKey, if is_owned is set and inner is non-NULL.
38132 void DelayedPaymentKey_free(struct LDKDelayedPaymentKey this_obj);
38134 struct LDKPublicKey DelayedPaymentKey_get_a(const struct LDKDelayedPaymentKey *NONNULL_PTR this_ptr);
38136 void DelayedPaymentKey_set_a(struct LDKDelayedPaymentKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38139 * Constructs a new DelayedPaymentKey given each field
38141 MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_new(struct LDKPublicKey a_arg);
38144 * Checks if two DelayedPaymentKeys contain equal inner contents.
38145 * This ignores pointers and is_owned flags and looks at the values in fields.
38146 * Two objects with NULL inner values will be considered "equal" here.
38148 bool DelayedPaymentKey_eq(const struct LDKDelayedPaymentKey *NONNULL_PTR a, const struct LDKDelayedPaymentKey *NONNULL_PTR b);
38151 * Creates a copy of the DelayedPaymentKey
38153 struct LDKDelayedPaymentKey DelayedPaymentKey_clone(const struct LDKDelayedPaymentKey *NONNULL_PTR orig);
38156 *Derive a public delayedpubkey using one node\'s `per_commitment_point` and its countersignatory\'s `basepoint`
38158 MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_from_basepoint(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
38161 *Build a delayedpubkey directly from an already-derived private key
38163 MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_from_secret_key(const uint8_t (*sk)[32]);
38166 * Get inner Public Key
38168 MUST_USE_RES struct LDKPublicKey DelayedPaymentKey_to_public_key(const struct LDKDelayedPaymentKey *NONNULL_PTR this_arg);
38171 * Serialize the DelayedPaymentKey object into a byte array which can be read by DelayedPaymentKey_read
38173 struct LDKCVec_u8Z DelayedPaymentKey_write(const struct LDKDelayedPaymentKey *NONNULL_PTR obj);
38176 * Read a DelayedPaymentKey from a byte array, created by DelayedPaymentKey_write
38178 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ DelayedPaymentKey_read(struct LDKu8slice ser);
38181 * Frees any resources used by the HtlcBasepoint, if is_owned is set and inner is non-NULL.
38183 void HtlcBasepoint_free(struct LDKHtlcBasepoint this_obj);
38185 struct LDKPublicKey HtlcBasepoint_get_a(const struct LDKHtlcBasepoint *NONNULL_PTR this_ptr);
38187 void HtlcBasepoint_set_a(struct LDKHtlcBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38190 * Constructs a new HtlcBasepoint given each field
38192 MUST_USE_RES struct LDKHtlcBasepoint HtlcBasepoint_new(struct LDKPublicKey a_arg);
38195 * Checks if two HtlcBasepoints contain equal inner contents.
38196 * This ignores pointers and is_owned flags and looks at the values in fields.
38197 * Two objects with NULL inner values will be considered "equal" here.
38199 bool HtlcBasepoint_eq(const struct LDKHtlcBasepoint *NONNULL_PTR a, const struct LDKHtlcBasepoint *NONNULL_PTR b);
38202 * Creates a copy of the HtlcBasepoint
38204 struct LDKHtlcBasepoint HtlcBasepoint_clone(const struct LDKHtlcBasepoint *NONNULL_PTR orig);
38207 * Generates a non-cryptographic 64-bit hash of the HtlcBasepoint.
38209 uint64_t HtlcBasepoint_hash(const struct LDKHtlcBasepoint *NONNULL_PTR o);
38212 * Get inner Public Key
38214 MUST_USE_RES struct LDKPublicKey HtlcBasepoint_to_public_key(const struct LDKHtlcBasepoint *NONNULL_PTR this_arg);
38217 *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.
38219 MUST_USE_RES struct LDKThirtyTwoBytes HtlcBasepoint_derive_add_tweak(const struct LDKHtlcBasepoint *NONNULL_PTR this_arg, struct LDKPublicKey per_commitment_point);
38222 * Serialize the HtlcBasepoint object into a byte array which can be read by HtlcBasepoint_read
38224 struct LDKCVec_u8Z HtlcBasepoint_write(const struct LDKHtlcBasepoint *NONNULL_PTR obj);
38227 * Read a HtlcBasepoint from a byte array, created by HtlcBasepoint_write
38229 struct LDKCResult_HtlcBasepointDecodeErrorZ HtlcBasepoint_read(struct LDKu8slice ser);
38232 * Frees any resources used by the HtlcKey, if is_owned is set and inner is non-NULL.
38234 void HtlcKey_free(struct LDKHtlcKey this_obj);
38236 struct LDKPublicKey HtlcKey_get_a(const struct LDKHtlcKey *NONNULL_PTR this_ptr);
38238 void HtlcKey_set_a(struct LDKHtlcKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38241 * Constructs a new HtlcKey given each field
38243 MUST_USE_RES struct LDKHtlcKey HtlcKey_new(struct LDKPublicKey a_arg);
38246 * Checks if two HtlcKeys contain equal inner contents.
38247 * This ignores pointers and is_owned flags and looks at the values in fields.
38248 * Two objects with NULL inner values will be considered "equal" here.
38250 bool HtlcKey_eq(const struct LDKHtlcKey *NONNULL_PTR a, const struct LDKHtlcKey *NONNULL_PTR b);
38253 * Creates a copy of the HtlcKey
38255 struct LDKHtlcKey HtlcKey_clone(const struct LDKHtlcKey *NONNULL_PTR orig);
38258 *Derive a public htlcpubkey using one node\'s `per_commitment_point` and its countersignatory\'s `basepoint`
38260 MUST_USE_RES struct LDKHtlcKey HtlcKey_from_basepoint(const struct LDKHtlcBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
38263 *Build a htlcpubkey directly from an already-derived private key
38265 MUST_USE_RES struct LDKHtlcKey HtlcKey_from_secret_key(const uint8_t (*sk)[32]);
38268 * Get inner Public Key
38270 MUST_USE_RES struct LDKPublicKey HtlcKey_to_public_key(const struct LDKHtlcKey *NONNULL_PTR this_arg);
38273 * Serialize the HtlcKey object into a byte array which can be read by HtlcKey_read
38275 struct LDKCVec_u8Z HtlcKey_write(const struct LDKHtlcKey *NONNULL_PTR obj);
38278 * Read a HtlcKey from a byte array, created by HtlcKey_write
38280 struct LDKCResult_HtlcKeyDecodeErrorZ HtlcKey_read(struct LDKu8slice ser);
38283 * Adds a tweak to a public key to derive a new public key.
38285 * May panic if `tweak` is not the output of a SHA-256 hash.
38287 struct LDKPublicKey add_public_key_tweak(struct LDKPublicKey base_point, const uint8_t (*tweak)[32]);
38290 * Frees any resources used by the RevocationBasepoint, if is_owned is set and inner is non-NULL.
38292 void RevocationBasepoint_free(struct LDKRevocationBasepoint this_obj);
38294 struct LDKPublicKey RevocationBasepoint_get_a(const struct LDKRevocationBasepoint *NONNULL_PTR this_ptr);
38296 void RevocationBasepoint_set_a(struct LDKRevocationBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38299 * Constructs a new RevocationBasepoint given each field
38301 MUST_USE_RES struct LDKRevocationBasepoint RevocationBasepoint_new(struct LDKPublicKey a_arg);
38304 * Checks if two RevocationBasepoints contain equal inner contents.
38305 * This ignores pointers and is_owned flags and looks at the values in fields.
38306 * Two objects with NULL inner values will be considered "equal" here.
38308 bool RevocationBasepoint_eq(const struct LDKRevocationBasepoint *NONNULL_PTR a, const struct LDKRevocationBasepoint *NONNULL_PTR b);
38311 * Creates a copy of the RevocationBasepoint
38313 struct LDKRevocationBasepoint RevocationBasepoint_clone(const struct LDKRevocationBasepoint *NONNULL_PTR orig);
38316 * Generates a non-cryptographic 64-bit hash of the RevocationBasepoint.
38318 uint64_t RevocationBasepoint_hash(const struct LDKRevocationBasepoint *NONNULL_PTR o);
38321 * Get inner Public Key
38323 MUST_USE_RES struct LDKPublicKey RevocationBasepoint_to_public_key(const struct LDKRevocationBasepoint *NONNULL_PTR this_arg);
38326 * Serialize the RevocationBasepoint object into a byte array which can be read by RevocationBasepoint_read
38328 struct LDKCVec_u8Z RevocationBasepoint_write(const struct LDKRevocationBasepoint *NONNULL_PTR obj);
38331 * Read a RevocationBasepoint from a byte array, created by RevocationBasepoint_write
38333 struct LDKCResult_RevocationBasepointDecodeErrorZ RevocationBasepoint_read(struct LDKu8slice ser);
38336 * Frees any resources used by the RevocationKey, if is_owned is set and inner is non-NULL.
38338 void RevocationKey_free(struct LDKRevocationKey this_obj);
38340 struct LDKPublicKey RevocationKey_get_a(const struct LDKRevocationKey *NONNULL_PTR this_ptr);
38342 void RevocationKey_set_a(struct LDKRevocationKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38345 * Constructs a new RevocationKey given each field
38347 MUST_USE_RES struct LDKRevocationKey RevocationKey_new(struct LDKPublicKey a_arg);
38350 * Checks if two RevocationKeys contain equal inner contents.
38351 * This ignores pointers and is_owned flags and looks at the values in fields.
38352 * Two objects with NULL inner values will be considered "equal" here.
38354 bool RevocationKey_eq(const struct LDKRevocationKey *NONNULL_PTR a, const struct LDKRevocationKey *NONNULL_PTR b);
38357 * Creates a copy of the RevocationKey
38359 struct LDKRevocationKey RevocationKey_clone(const struct LDKRevocationKey *NONNULL_PTR orig);
38362 * Generates a non-cryptographic 64-bit hash of the RevocationKey.
38364 uint64_t RevocationKey_hash(const struct LDKRevocationKey *NONNULL_PTR o);
38367 * Derives a per-commitment-transaction revocation public key from one party's per-commitment
38368 * point and the other party's [`RevocationBasepoint`]. This is the public equivalent of
38369 * [`chan_utils::derive_private_revocation_key`] - using only public keys to derive a public
38370 * key instead of private keys.
38372 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
38373 * generated (ie our own).
38375 * [`chan_utils::derive_private_revocation_key`]: crate::ln::chan_utils::derive_private_revocation_key
38377 MUST_USE_RES struct LDKRevocationKey RevocationKey_from_basepoint(const struct LDKRevocationBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
38380 * Get inner Public Key
38382 MUST_USE_RES struct LDKPublicKey RevocationKey_to_public_key(const struct LDKRevocationKey *NONNULL_PTR this_arg);
38385 * Serialize the RevocationKey object into a byte array which can be read by RevocationKey_read
38387 struct LDKCVec_u8Z RevocationKey_write(const struct LDKRevocationKey *NONNULL_PTR obj);
38390 * Read a RevocationKey from a byte array, created by RevocationKey_write
38392 struct LDKCResult_RevocationKeyDecodeErrorZ RevocationKey_read(struct LDKu8slice ser);
38395 * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
38397 void ExpandedKey_free(struct LDKExpandedKey this_obj);
38400 * Create a new [`ExpandedKey`] for generating an inbound payment hash and secret.
38402 * It is recommended to cache this value and not regenerate it for each new inbound payment.
38404 MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
38407 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
38408 * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
38409 * a `ChannelManager`.
38411 * `keys` is generated by calling [`NodeSigner::get_inbound_payment_key_material`] and then
38412 * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
38413 * regenerate it for each new inbound payment.
38415 * `current_time` is a Unix timestamp representing the current time.
38417 * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
38418 * on versions of LDK prior to 0.0.114.
38420 * [phantom node payments]: crate::sign::PhantomKeysManager
38421 * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
38423 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);
38426 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
38427 * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
38428 * without a `ChannelManager`.
38430 * See [`create`] for information on the `keys` and `current_time` parameters.
38432 * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
38433 * on versions of LDK prior to 0.0.114.
38435 * [phantom node payments]: crate::sign::PhantomKeysManager
38437 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);
38440 * Frees any resources used by the DecodeError
38442 void DecodeError_free(struct LDKDecodeError this_ptr);
38445 * Creates a copy of the DecodeError
38447 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
38450 * Utility method to constructs a new UnknownVersion-variant DecodeError
38452 struct LDKDecodeError DecodeError_unknown_version(void);
38455 * Utility method to constructs a new UnknownRequiredFeature-variant DecodeError
38457 struct LDKDecodeError DecodeError_unknown_required_feature(void);
38460 * Utility method to constructs a new InvalidValue-variant DecodeError
38462 struct LDKDecodeError DecodeError_invalid_value(void);
38465 * Utility method to constructs a new ShortRead-variant DecodeError
38467 struct LDKDecodeError DecodeError_short_read(void);
38470 * Utility method to constructs a new BadLengthDescriptor-variant DecodeError
38472 struct LDKDecodeError DecodeError_bad_length_descriptor(void);
38475 * Utility method to constructs a new Io-variant DecodeError
38477 struct LDKDecodeError DecodeError_io(enum LDKIOError a);
38480 * Utility method to constructs a new UnsupportedCompression-variant DecodeError
38482 struct LDKDecodeError DecodeError_unsupported_compression(void);
38485 * Utility method to constructs a new DangerousValue-variant DecodeError
38487 struct LDKDecodeError DecodeError_dangerous_value(void);
38490 * Generates a non-cryptographic 64-bit hash of the DecodeError.
38492 uint64_t DecodeError_hash(const struct LDKDecodeError *NONNULL_PTR o);
38495 * Checks if two DecodeErrors contain equal inner contents.
38496 * This ignores pointers and is_owned flags and looks at the values in fields.
38498 bool DecodeError_eq(const struct LDKDecodeError *NONNULL_PTR a, const struct LDKDecodeError *NONNULL_PTR b);
38501 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
38503 void Init_free(struct LDKInit this_obj);
38506 * The relevant features which the sender supports.
38508 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
38511 * The relevant features which the sender supports.
38513 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
38516 * Indicates chains the sender is interested in.
38518 * If there are no common chains, the connection will be closed.
38520 * Returns a copy of the field.
38522 struct LDKCOption_CVec_ThirtyTwoBytesZZ Init_get_networks(const struct LDKInit *NONNULL_PTR this_ptr);
38525 * Indicates chains the sender is interested in.
38527 * If there are no common chains, the connection will be closed.
38529 void Init_set_networks(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_CVec_ThirtyTwoBytesZZ val);
38532 * The receipient's network address.
38534 * This adds the option to report a remote IP address back to a connecting peer using the init
38535 * message. A node can decide to use that information to discover a potential update to its
38536 * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
38539 struct LDKCOption_SocketAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
38542 * The receipient's network address.
38544 * This adds the option to report a remote IP address back to a connecting peer using the init
38545 * message. A node can decide to use that information to discover a potential update to its
38546 * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
38549 void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_SocketAddressZ val);
38552 * Constructs a new Init given each field
38554 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_CVec_ThirtyTwoBytesZZ networks_arg, struct LDKCOption_SocketAddressZ remote_network_address_arg);
38557 * Creates a copy of the Init
38559 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
38562 * Generates a non-cryptographic 64-bit hash of the Init.
38564 uint64_t Init_hash(const struct LDKInit *NONNULL_PTR o);
38567 * Checks if two Inits contain equal inner contents.
38568 * This ignores pointers and is_owned flags and looks at the values in fields.
38569 * Two objects with NULL inner values will be considered "equal" here.
38571 bool Init_eq(const struct LDKInit *NONNULL_PTR a, const struct LDKInit *NONNULL_PTR b);
38574 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
38576 void ErrorMessage_free(struct LDKErrorMessage this_obj);
38579 * The channel ID involved in the error.
38581 * All-0s indicates a general error unrelated to a specific channel, after which all channels
38582 * with the sending peer should be closed.
38584 struct LDKChannelId ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
38587 * The channel ID involved in the error.
38589 * All-0s indicates a general error unrelated to a specific channel, after which all channels
38590 * with the sending peer should be closed.
38592 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKChannelId val);
38595 * A possibly human-readable error description.
38597 * The string should be sanitized before it is used (e.g., emitted to logs or printed to
38598 * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
38599 * the terminal emulator or the logging subsystem.
38601 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
38604 * A possibly human-readable error description.
38606 * The string should be sanitized before it is used (e.g., emitted to logs or printed to
38607 * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
38608 * the terminal emulator or the logging subsystem.
38610 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
38613 * Constructs a new ErrorMessage given each field
38615 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKChannelId channel_id_arg, struct LDKStr data_arg);
38618 * Creates a copy of the ErrorMessage
38620 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
38623 * Generates a non-cryptographic 64-bit hash of the ErrorMessage.
38625 uint64_t ErrorMessage_hash(const struct LDKErrorMessage *NONNULL_PTR o);
38628 * Checks if two ErrorMessages contain equal inner contents.
38629 * This ignores pointers and is_owned flags and looks at the values in fields.
38630 * Two objects with NULL inner values will be considered "equal" here.
38632 bool ErrorMessage_eq(const struct LDKErrorMessage *NONNULL_PTR a, const struct LDKErrorMessage *NONNULL_PTR b);
38635 * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
38637 void WarningMessage_free(struct LDKWarningMessage this_obj);
38640 * The channel ID involved in the warning.
38642 * All-0s indicates a warning unrelated to a specific channel.
38644 struct LDKChannelId WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
38647 * The channel ID involved in the warning.
38649 * All-0s indicates a warning unrelated to a specific channel.
38651 void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKChannelId val);
38654 * A possibly human-readable warning description.
38656 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
38657 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
38658 * the terminal emulator or the logging subsystem.
38660 struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
38663 * A possibly human-readable warning description.
38665 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
38666 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
38667 * the terminal emulator or the logging subsystem.
38669 void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
38672 * Constructs a new WarningMessage given each field
38674 MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKChannelId channel_id_arg, struct LDKStr data_arg);
38677 * Creates a copy of the WarningMessage
38679 struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
38682 * Generates a non-cryptographic 64-bit hash of the WarningMessage.
38684 uint64_t WarningMessage_hash(const struct LDKWarningMessage *NONNULL_PTR o);
38687 * Checks if two WarningMessages contain equal inner contents.
38688 * This ignores pointers and is_owned flags and looks at the values in fields.
38689 * Two objects with NULL inner values will be considered "equal" here.
38691 bool WarningMessage_eq(const struct LDKWarningMessage *NONNULL_PTR a, const struct LDKWarningMessage *NONNULL_PTR b);
38694 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
38696 void Ping_free(struct LDKPing this_obj);
38699 * The desired response length.
38701 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
38704 * The desired response length.
38706 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
38709 * The ping packet size.
38711 * This field is not sent on the wire. byteslen zeros are sent.
38713 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
38716 * The ping packet size.
38718 * This field is not sent on the wire. byteslen zeros are sent.
38720 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
38723 * Constructs a new Ping given each field
38725 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
38728 * Creates a copy of the Ping
38730 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
38733 * Generates a non-cryptographic 64-bit hash of the Ping.
38735 uint64_t Ping_hash(const struct LDKPing *NONNULL_PTR o);
38738 * Checks if two Pings contain equal inner contents.
38739 * This ignores pointers and is_owned flags and looks at the values in fields.
38740 * Two objects with NULL inner values will be considered "equal" here.
38742 bool Ping_eq(const struct LDKPing *NONNULL_PTR a, const struct LDKPing *NONNULL_PTR b);
38745 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
38747 void Pong_free(struct LDKPong this_obj);
38750 * The pong packet size.
38752 * This field is not sent on the wire. byteslen zeros are sent.
38754 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
38757 * The pong packet size.
38759 * This field is not sent on the wire. byteslen zeros are sent.
38761 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
38764 * Constructs a new Pong given each field
38766 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
38769 * Creates a copy of the Pong
38771 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
38774 * Generates a non-cryptographic 64-bit hash of the Pong.
38776 uint64_t Pong_hash(const struct LDKPong *NONNULL_PTR o);
38779 * Checks if two Pongs contain equal inner contents.
38780 * This ignores pointers and is_owned flags and looks at the values in fields.
38781 * Two objects with NULL inner values will be considered "equal" here.
38783 bool Pong_eq(const struct LDKPong *NONNULL_PTR a, const struct LDKPong *NONNULL_PTR b);
38786 * Frees any resources used by the CommonOpenChannelFields, if is_owned is set and inner is non-NULL.
38788 void CommonOpenChannelFields_free(struct LDKCommonOpenChannelFields this_obj);
38791 * The genesis hash of the blockchain where the channel is to be opened
38793 const uint8_t (*CommonOpenChannelFields_get_chain_hash(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr))[32];
38796 * The genesis hash of the blockchain where the channel is to be opened
38798 void CommonOpenChannelFields_set_chain_hash(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
38801 * A temporary channel ID
38802 * For V2 channels: derived using a zeroed out value for the channel acceptor's revocation basepoint
38803 * For V1 channels: a temporary channel ID, until the funding outpoint is announced
38805 struct LDKChannelId CommonOpenChannelFields_get_temporary_channel_id(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38808 * A temporary channel ID
38809 * For V2 channels: derived using a zeroed out value for the channel acceptor's revocation basepoint
38810 * For V1 channels: a temporary channel ID, until the funding outpoint is announced
38812 void CommonOpenChannelFields_set_temporary_channel_id(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKChannelId val);
38815 * For V1 channels: The channel value
38816 * For V2 channels: Part of the channel value contributed by the channel initiator
38818 uint64_t CommonOpenChannelFields_get_funding_satoshis(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38821 * For V1 channels: The channel value
38822 * For V2 channels: Part of the channel value contributed by the channel initiator
38824 void CommonOpenChannelFields_set_funding_satoshis(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
38827 * The threshold below which outputs on transactions broadcast by the channel initiator will be
38830 uint64_t CommonOpenChannelFields_get_dust_limit_satoshis(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38833 * The threshold below which outputs on transactions broadcast by the channel initiator will be
38836 void CommonOpenChannelFields_set_dust_limit_satoshis(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
38839 * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
38841 uint64_t CommonOpenChannelFields_get_max_htlc_value_in_flight_msat(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38844 * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
38846 void CommonOpenChannelFields_set_max_htlc_value_in_flight_msat(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
38849 * The minimum HTLC size incoming to channel initiator, in milli-satoshi
38851 uint64_t CommonOpenChannelFields_get_htlc_minimum_msat(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38854 * The minimum HTLC size incoming to channel initiator, in milli-satoshi
38856 void CommonOpenChannelFields_set_htlc_minimum_msat(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
38859 * The feerate for the commitment transaction set by the channel initiator until updated by
38862 uint32_t CommonOpenChannelFields_get_commitment_feerate_sat_per_1000_weight(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38865 * The feerate for the commitment transaction set by the channel initiator until updated by
38868 void CommonOpenChannelFields_set_commitment_feerate_sat_per_1000_weight(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint32_t val);
38871 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
38872 * broadcast a commitment transaction
38874 uint16_t CommonOpenChannelFields_get_to_self_delay(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38877 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
38878 * broadcast a commitment transaction
38880 void CommonOpenChannelFields_set_to_self_delay(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint16_t val);
38883 * The maximum number of inbound HTLCs towards channel initiator
38885 uint16_t CommonOpenChannelFields_get_max_accepted_htlcs(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38888 * The maximum number of inbound HTLCs towards channel initiator
38890 void CommonOpenChannelFields_set_max_accepted_htlcs(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint16_t val);
38893 * The channel initiator's key controlling the funding transaction
38895 struct LDKPublicKey CommonOpenChannelFields_get_funding_pubkey(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38898 * The channel initiator's key controlling the funding transaction
38900 void CommonOpenChannelFields_set_funding_pubkey(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38903 * Used to derive a revocation key for transactions broadcast by counterparty
38905 struct LDKPublicKey CommonOpenChannelFields_get_revocation_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38908 * Used to derive a revocation key for transactions broadcast by counterparty
38910 void CommonOpenChannelFields_set_revocation_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38913 * A payment key to channel initiator for transactions broadcast by counterparty
38915 struct LDKPublicKey CommonOpenChannelFields_get_payment_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38918 * A payment key to channel initiator for transactions broadcast by counterparty
38920 void CommonOpenChannelFields_set_payment_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38923 * Used to derive a payment key to channel initiator for transactions broadcast by channel
38926 struct LDKPublicKey CommonOpenChannelFields_get_delayed_payment_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38929 * Used to derive a payment key to channel initiator for transactions broadcast by channel
38932 void CommonOpenChannelFields_set_delayed_payment_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38935 * Used to derive an HTLC payment key to channel initiator
38937 struct LDKPublicKey CommonOpenChannelFields_get_htlc_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38940 * Used to derive an HTLC payment key to channel initiator
38942 void CommonOpenChannelFields_set_htlc_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38945 * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
38947 struct LDKPublicKey CommonOpenChannelFields_get_first_per_commitment_point(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38950 * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
38952 void CommonOpenChannelFields_set_first_per_commitment_point(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38955 * The channel flags to be used
38957 uint8_t CommonOpenChannelFields_get_channel_flags(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38960 * The channel flags to be used
38962 void CommonOpenChannelFields_set_channel_flags(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint8_t val);
38965 * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
38966 * collaboratively close
38968 struct LDKCOption_CVec_u8ZZ CommonOpenChannelFields_get_shutdown_scriptpubkey(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38971 * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
38972 * collaboratively close
38974 void CommonOpenChannelFields_set_shutdown_scriptpubkey(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
38977 * The channel type that this channel will represent
38979 * If this is `None`, we derive the channel type from the intersection of our
38980 * feature bits with our counterparty's feature bits from the [`Init`] message.
38982 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
38984 struct LDKChannelTypeFeatures CommonOpenChannelFields_get_channel_type(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38987 * The channel type that this channel will represent
38989 * If this is `None`, we derive the channel type from the intersection of our
38990 * feature bits with our counterparty's feature bits from the [`Init`] message.
38992 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
38994 void CommonOpenChannelFields_set_channel_type(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
38997 * Constructs a new CommonOpenChannelFields given each field
38999 * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
39001 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);
39004 * Creates a copy of the CommonOpenChannelFields
39006 struct LDKCommonOpenChannelFields CommonOpenChannelFields_clone(const struct LDKCommonOpenChannelFields *NONNULL_PTR orig);
39009 * Generates a non-cryptographic 64-bit hash of the CommonOpenChannelFields.
39011 uint64_t CommonOpenChannelFields_hash(const struct LDKCommonOpenChannelFields *NONNULL_PTR o);
39014 * Checks if two CommonOpenChannelFieldss contain equal inner contents.
39015 * This ignores pointers and is_owned flags and looks at the values in fields.
39016 * Two objects with NULL inner values will be considered "equal" here.
39018 bool CommonOpenChannelFields_eq(const struct LDKCommonOpenChannelFields *NONNULL_PTR a, const struct LDKCommonOpenChannelFields *NONNULL_PTR b);
39021 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
39023 void OpenChannel_free(struct LDKOpenChannel this_obj);
39026 * Common fields of `open_channel(2)`-like messages
39028 struct LDKCommonOpenChannelFields OpenChannel_get_common_fields(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
39031 * Common fields of `open_channel(2)`-like messages
39033 void OpenChannel_set_common_fields(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKCommonOpenChannelFields val);
39036 * The amount to push to the counterparty as part of the open, in milli-satoshi
39038 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
39041 * The amount to push to the counterparty as part of the open, in milli-satoshi
39043 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
39046 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
39048 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
39051 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
39053 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
39056 * Constructs a new OpenChannel given each field
39058 MUST_USE_RES struct LDKOpenChannel OpenChannel_new(struct LDKCommonOpenChannelFields common_fields_arg, uint64_t push_msat_arg, uint64_t channel_reserve_satoshis_arg);
39061 * Creates a copy of the OpenChannel
39063 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
39066 * Generates a non-cryptographic 64-bit hash of the OpenChannel.
39068 uint64_t OpenChannel_hash(const struct LDKOpenChannel *NONNULL_PTR o);
39071 * Checks if two OpenChannels contain equal inner contents.
39072 * This ignores pointers and is_owned flags and looks at the values in fields.
39073 * Two objects with NULL inner values will be considered "equal" here.
39075 bool OpenChannel_eq(const struct LDKOpenChannel *NONNULL_PTR a, const struct LDKOpenChannel *NONNULL_PTR b);
39078 * Frees any resources used by the OpenChannelV2, if is_owned is set and inner is non-NULL.
39080 void OpenChannelV2_free(struct LDKOpenChannelV2 this_obj);
39083 * Common fields of `open_channel(2)`-like messages
39085 struct LDKCommonOpenChannelFields OpenChannelV2_get_common_fields(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
39088 * Common fields of `open_channel(2)`-like messages
39090 void OpenChannelV2_set_common_fields(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKCommonOpenChannelFields val);
39093 * The feerate for the funding transaction set by the channel initiator
39095 uint32_t OpenChannelV2_get_funding_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
39098 * The feerate for the funding transaction set by the channel initiator
39100 void OpenChannelV2_set_funding_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
39103 * The locktime for the funding transaction
39105 uint32_t OpenChannelV2_get_locktime(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
39108 * The locktime for the funding transaction
39110 void OpenChannelV2_set_locktime(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
39113 * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
39115 struct LDKPublicKey OpenChannelV2_get_second_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
39118 * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
39120 void OpenChannelV2_set_second_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39123 * Optionally, a requirement that only confirmed inputs can be added
39125 enum LDKCOption_NoneZ OpenChannelV2_get_require_confirmed_inputs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
39128 * Optionally, a requirement that only confirmed inputs can be added
39130 void OpenChannelV2_set_require_confirmed_inputs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
39133 * Constructs a new OpenChannelV2 given each field
39135 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);
39138 * Creates a copy of the OpenChannelV2
39140 struct LDKOpenChannelV2 OpenChannelV2_clone(const struct LDKOpenChannelV2 *NONNULL_PTR orig);
39143 * Generates a non-cryptographic 64-bit hash of the OpenChannelV2.
39145 uint64_t OpenChannelV2_hash(const struct LDKOpenChannelV2 *NONNULL_PTR o);
39148 * Checks if two OpenChannelV2s contain equal inner contents.
39149 * This ignores pointers and is_owned flags and looks at the values in fields.
39150 * Two objects with NULL inner values will be considered "equal" here.
39152 bool OpenChannelV2_eq(const struct LDKOpenChannelV2 *NONNULL_PTR a, const struct LDKOpenChannelV2 *NONNULL_PTR b);
39155 * Frees any resources used by the CommonAcceptChannelFields, if is_owned is set and inner is non-NULL.
39157 void CommonAcceptChannelFields_free(struct LDKCommonAcceptChannelFields this_obj);
39160 * The same `temporary_channel_id` received from the initiator's `open_channel2` or `open_channel` message.
39162 struct LDKChannelId CommonAcceptChannelFields_get_temporary_channel_id(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39165 * The same `temporary_channel_id` received from the initiator's `open_channel2` or `open_channel` message.
39167 void CommonAcceptChannelFields_set_temporary_channel_id(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKChannelId val);
39170 * The threshold below which outputs on transactions broadcast by the channel acceptor will be
39173 uint64_t CommonAcceptChannelFields_get_dust_limit_satoshis(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39176 * The threshold below which outputs on transactions broadcast by the channel acceptor will be
39179 void CommonAcceptChannelFields_set_dust_limit_satoshis(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val);
39182 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
39184 uint64_t CommonAcceptChannelFields_get_max_htlc_value_in_flight_msat(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39187 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
39189 void CommonAcceptChannelFields_set_max_htlc_value_in_flight_msat(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val);
39192 * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
39194 uint64_t CommonAcceptChannelFields_get_htlc_minimum_msat(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39197 * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
39199 void CommonAcceptChannelFields_set_htlc_minimum_msat(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val);
39202 * Minimum depth of the funding transaction before the channel is considered open
39204 uint32_t CommonAcceptChannelFields_get_minimum_depth(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39207 * Minimum depth of the funding transaction before the channel is considered open
39209 void CommonAcceptChannelFields_set_minimum_depth(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint32_t val);
39212 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
39213 * broadcast a commitment transaction
39215 uint16_t CommonAcceptChannelFields_get_to_self_delay(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39218 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
39219 * broadcast a commitment transaction
39221 void CommonAcceptChannelFields_set_to_self_delay(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint16_t val);
39224 * The maximum number of inbound HTLCs towards channel acceptor
39226 uint16_t CommonAcceptChannelFields_get_max_accepted_htlcs(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39229 * The maximum number of inbound HTLCs towards channel acceptor
39231 void CommonAcceptChannelFields_set_max_accepted_htlcs(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint16_t val);
39234 * The channel acceptor's key controlling the funding transaction
39236 struct LDKPublicKey CommonAcceptChannelFields_get_funding_pubkey(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39239 * The channel acceptor's key controlling the funding transaction
39241 void CommonAcceptChannelFields_set_funding_pubkey(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39244 * Used to derive a revocation key for transactions broadcast by counterparty
39246 struct LDKPublicKey CommonAcceptChannelFields_get_revocation_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39249 * Used to derive a revocation key for transactions broadcast by counterparty
39251 void CommonAcceptChannelFields_set_revocation_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39254 * A payment key to channel acceptor for transactions broadcast by counterparty
39256 struct LDKPublicKey CommonAcceptChannelFields_get_payment_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39259 * A payment key to channel acceptor for transactions broadcast by counterparty
39261 void CommonAcceptChannelFields_set_payment_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39264 * Used to derive a payment key to channel acceptor for transactions broadcast by channel
39267 struct LDKPublicKey CommonAcceptChannelFields_get_delayed_payment_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39270 * Used to derive a payment key to channel acceptor for transactions broadcast by channel
39273 void CommonAcceptChannelFields_set_delayed_payment_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39276 * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
39278 struct LDKPublicKey CommonAcceptChannelFields_get_htlc_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39281 * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
39283 void CommonAcceptChannelFields_set_htlc_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39286 * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
39288 struct LDKPublicKey CommonAcceptChannelFields_get_first_per_commitment_point(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39291 * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
39293 void CommonAcceptChannelFields_set_first_per_commitment_point(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39296 * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
39297 * collaboratively close
39299 struct LDKCOption_CVec_u8ZZ CommonAcceptChannelFields_get_shutdown_scriptpubkey(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39302 * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
39303 * collaboratively close
39305 void CommonAcceptChannelFields_set_shutdown_scriptpubkey(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
39308 * The channel type that this channel will represent. If none is set, we derive the channel
39309 * type from the intersection of our feature bits with our counterparty's feature bits from
39310 * the Init message.
39312 * This is required to match the equivalent field in [`OpenChannel`] or [`OpenChannelV2`]'s
39313 * [`CommonOpenChannelFields::channel_type`].
39315 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39317 struct LDKChannelTypeFeatures CommonAcceptChannelFields_get_channel_type(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39320 * The channel type that this channel will represent. If none is set, we derive the channel
39321 * type from the intersection of our feature bits with our counterparty's feature bits from
39322 * the Init message.
39324 * This is required to match the equivalent field in [`OpenChannel`] or [`OpenChannelV2`]'s
39325 * [`CommonOpenChannelFields::channel_type`].
39327 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
39329 void CommonAcceptChannelFields_set_channel_type(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
39332 * Constructs a new CommonAcceptChannelFields given each field
39334 * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
39336 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);
39339 * Creates a copy of the CommonAcceptChannelFields
39341 struct LDKCommonAcceptChannelFields CommonAcceptChannelFields_clone(const struct LDKCommonAcceptChannelFields *NONNULL_PTR orig);
39344 * Generates a non-cryptographic 64-bit hash of the CommonAcceptChannelFields.
39346 uint64_t CommonAcceptChannelFields_hash(const struct LDKCommonAcceptChannelFields *NONNULL_PTR o);
39349 * Checks if two CommonAcceptChannelFieldss contain equal inner contents.
39350 * This ignores pointers and is_owned flags and looks at the values in fields.
39351 * Two objects with NULL inner values will be considered "equal" here.
39353 bool CommonAcceptChannelFields_eq(const struct LDKCommonAcceptChannelFields *NONNULL_PTR a, const struct LDKCommonAcceptChannelFields *NONNULL_PTR b);
39356 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
39358 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
39361 * Common fields of `accept_channel(2)`-like messages
39363 struct LDKCommonAcceptChannelFields AcceptChannel_get_common_fields(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
39366 * Common fields of `accept_channel(2)`-like messages
39368 void AcceptChannel_set_common_fields(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKCommonAcceptChannelFields val);
39371 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
39373 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
39376 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
39378 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
39381 * Constructs a new AcceptChannel given each field
39383 MUST_USE_RES struct LDKAcceptChannel AcceptChannel_new(struct LDKCommonAcceptChannelFields common_fields_arg, uint64_t channel_reserve_satoshis_arg);
39386 * Creates a copy of the AcceptChannel
39388 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
39391 * Generates a non-cryptographic 64-bit hash of the AcceptChannel.
39393 uint64_t AcceptChannel_hash(const struct LDKAcceptChannel *NONNULL_PTR o);
39396 * Checks if two AcceptChannels contain equal inner contents.
39397 * This ignores pointers and is_owned flags and looks at the values in fields.
39398 * Two objects with NULL inner values will be considered "equal" here.
39400 bool AcceptChannel_eq(const struct LDKAcceptChannel *NONNULL_PTR a, const struct LDKAcceptChannel *NONNULL_PTR b);
39403 * Frees any resources used by the AcceptChannelV2, if is_owned is set and inner is non-NULL.
39405 void AcceptChannelV2_free(struct LDKAcceptChannelV2 this_obj);
39408 * Common fields of `accept_channel(2)`-like messages
39410 struct LDKCommonAcceptChannelFields AcceptChannelV2_get_common_fields(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
39413 * Common fields of `accept_channel(2)`-like messages
39415 void AcceptChannelV2_set_common_fields(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKCommonAcceptChannelFields val);
39418 * Part of the channel value contributed by the channel acceptor
39420 uint64_t AcceptChannelV2_get_funding_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
39423 * Part of the channel value contributed by the channel acceptor
39425 void AcceptChannelV2_set_funding_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
39428 * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
39430 struct LDKPublicKey AcceptChannelV2_get_second_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
39433 * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
39435 void AcceptChannelV2_set_second_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39438 * Optionally, a requirement that only confirmed inputs can be added
39440 enum LDKCOption_NoneZ AcceptChannelV2_get_require_confirmed_inputs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
39443 * Optionally, a requirement that only confirmed inputs can be added
39445 void AcceptChannelV2_set_require_confirmed_inputs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
39448 * Constructs a new AcceptChannelV2 given each field
39450 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);
39453 * Creates a copy of the AcceptChannelV2
39455 struct LDKAcceptChannelV2 AcceptChannelV2_clone(const struct LDKAcceptChannelV2 *NONNULL_PTR orig);
39458 * Generates a non-cryptographic 64-bit hash of the AcceptChannelV2.
39460 uint64_t AcceptChannelV2_hash(const struct LDKAcceptChannelV2 *NONNULL_PTR o);
39463 * Checks if two AcceptChannelV2s contain equal inner contents.
39464 * This ignores pointers and is_owned flags and looks at the values in fields.
39465 * Two objects with NULL inner values will be considered "equal" here.
39467 bool AcceptChannelV2_eq(const struct LDKAcceptChannelV2 *NONNULL_PTR a, const struct LDKAcceptChannelV2 *NONNULL_PTR b);
39470 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
39472 void FundingCreated_free(struct LDKFundingCreated this_obj);
39475 * A temporary channel ID, until the funding is established
39477 struct LDKChannelId FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
39480 * A temporary channel ID, until the funding is established
39482 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKChannelId val);
39485 * The funding transaction ID
39487 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
39490 * The funding transaction ID
39492 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
39495 * The specific output index funding this channel
39497 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
39500 * The specific output index funding this channel
39502 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
39505 * The signature of the channel initiator (funder) on the initial commitment transaction
39507 struct LDKECDSASignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
39510 * The signature of the channel initiator (funder) on the initial commitment transaction
39512 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
39515 * Constructs a new FundingCreated given each field
39517 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);
39520 * Creates a copy of the FundingCreated
39522 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
39525 * Generates a non-cryptographic 64-bit hash of the FundingCreated.
39527 uint64_t FundingCreated_hash(const struct LDKFundingCreated *NONNULL_PTR o);
39530 * Checks if two FundingCreateds contain equal inner contents.
39531 * This ignores pointers and is_owned flags and looks at the values in fields.
39532 * Two objects with NULL inner values will be considered "equal" here.
39534 bool FundingCreated_eq(const struct LDKFundingCreated *NONNULL_PTR a, const struct LDKFundingCreated *NONNULL_PTR b);
39537 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
39539 void FundingSigned_free(struct LDKFundingSigned this_obj);
39544 struct LDKChannelId FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
39549 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKChannelId val);
39552 * The signature of the channel acceptor (fundee) on the initial commitment transaction
39554 struct LDKECDSASignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
39557 * The signature of the channel acceptor (fundee) on the initial commitment transaction
39559 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
39562 * Constructs a new FundingSigned given each field
39564 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKChannelId channel_id_arg, struct LDKECDSASignature signature_arg);
39567 * Creates a copy of the FundingSigned
39569 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
39572 * Generates a non-cryptographic 64-bit hash of the FundingSigned.
39574 uint64_t FundingSigned_hash(const struct LDKFundingSigned *NONNULL_PTR o);
39577 * Checks if two FundingSigneds contain equal inner contents.
39578 * This ignores pointers and is_owned flags and looks at the values in fields.
39579 * Two objects with NULL inner values will be considered "equal" here.
39581 bool FundingSigned_eq(const struct LDKFundingSigned *NONNULL_PTR a, const struct LDKFundingSigned *NONNULL_PTR b);
39584 * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
39586 void ChannelReady_free(struct LDKChannelReady this_obj);
39591 struct LDKChannelId ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr);
39596 void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKChannelId val);
39599 * The per-commitment point of the second commitment transaction
39601 struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
39604 * The per-commitment point of the second commitment transaction
39606 void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39609 * If set, provides a `short_channel_id` alias for this channel.
39611 * The sender will accept payments to be forwarded over this SCID and forward them to this
39612 * messages' recipient.
39614 struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
39617 * If set, provides a `short_channel_id` alias for this channel.
39619 * The sender will accept payments to be forwarded over this SCID and forward them to this
39620 * messages' recipient.
39622 void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
39625 * Constructs a new ChannelReady given each field
39627 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);
39630 * Creates a copy of the ChannelReady
39632 struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
39635 * Generates a non-cryptographic 64-bit hash of the ChannelReady.
39637 uint64_t ChannelReady_hash(const struct LDKChannelReady *NONNULL_PTR o);
39640 * Checks if two ChannelReadys 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 ChannelReady_eq(const struct LDKChannelReady *NONNULL_PTR a, const struct LDKChannelReady *NONNULL_PTR b);
39647 * Frees any resources used by the Stfu, if is_owned is set and inner is non-NULL.
39649 void Stfu_free(struct LDKStfu this_obj);
39652 * The channel ID where quiescence is intended
39654 struct LDKChannelId Stfu_get_channel_id(const struct LDKStfu *NONNULL_PTR this_ptr);
39657 * The channel ID where quiescence is intended
39659 void Stfu_set_channel_id(struct LDKStfu *NONNULL_PTR this_ptr, struct LDKChannelId val);
39662 * Initiator flag, 1 if initiating, 0 if replying to an stfu.
39664 uint8_t Stfu_get_initiator(const struct LDKStfu *NONNULL_PTR this_ptr);
39667 * Initiator flag, 1 if initiating, 0 if replying to an stfu.
39669 void Stfu_set_initiator(struct LDKStfu *NONNULL_PTR this_ptr, uint8_t val);
39672 * Constructs a new Stfu given each field
39674 MUST_USE_RES struct LDKStfu Stfu_new(struct LDKChannelId channel_id_arg, uint8_t initiator_arg);
39677 * Creates a copy of the Stfu
39679 struct LDKStfu Stfu_clone(const struct LDKStfu *NONNULL_PTR orig);
39682 * Checks if two Stfus contain equal inner contents.
39683 * This ignores pointers and is_owned flags and looks at the values in fields.
39684 * Two objects with NULL inner values will be considered "equal" here.
39686 bool Stfu_eq(const struct LDKStfu *NONNULL_PTR a, const struct LDKStfu *NONNULL_PTR b);
39689 * Frees any resources used by the Splice, if is_owned is set and inner is non-NULL.
39691 void Splice_free(struct LDKSplice this_obj);
39694 * The channel ID where splicing is intended
39696 struct LDKChannelId Splice_get_channel_id(const struct LDKSplice *NONNULL_PTR this_ptr);
39699 * The channel ID where splicing is intended
39701 void Splice_set_channel_id(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKChannelId val);
39704 * The genesis hash of the blockchain where the channel is intended to be spliced
39706 const uint8_t (*Splice_get_chain_hash(const struct LDKSplice *NONNULL_PTR this_ptr))[32];
39709 * The genesis hash of the blockchain where the channel is intended to be spliced
39711 void Splice_set_chain_hash(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
39714 * The intended change in channel capacity: the amount to be added (positive value)
39715 * or removed (negative value) by the sender (splice initiator) by splicing into/from the channel.
39717 int64_t Splice_get_relative_satoshis(const struct LDKSplice *NONNULL_PTR this_ptr);
39720 * The intended change in channel capacity: the amount to be added (positive value)
39721 * or removed (negative value) by the sender (splice initiator) by splicing into/from the channel.
39723 void Splice_set_relative_satoshis(struct LDKSplice *NONNULL_PTR this_ptr, int64_t val);
39726 * The feerate for the new funding transaction, set by the splice initiator
39728 uint32_t Splice_get_funding_feerate_perkw(const struct LDKSplice *NONNULL_PTR this_ptr);
39731 * The feerate for the new funding transaction, set by the splice initiator
39733 void Splice_set_funding_feerate_perkw(struct LDKSplice *NONNULL_PTR this_ptr, uint32_t val);
39736 * The locktime for the new funding transaction
39738 uint32_t Splice_get_locktime(const struct LDKSplice *NONNULL_PTR this_ptr);
39741 * The locktime for the new funding transaction
39743 void Splice_set_locktime(struct LDKSplice *NONNULL_PTR this_ptr, uint32_t val);
39746 * The key of the sender (splice initiator) controlling the new funding transaction
39748 struct LDKPublicKey Splice_get_funding_pubkey(const struct LDKSplice *NONNULL_PTR this_ptr);
39751 * The key of the sender (splice initiator) controlling the new funding transaction
39753 void Splice_set_funding_pubkey(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39756 * Constructs a new Splice given each field
39758 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);
39761 * Creates a copy of the Splice
39763 struct LDKSplice Splice_clone(const struct LDKSplice *NONNULL_PTR orig);
39766 * Checks if two Splices contain equal inner contents.
39767 * This ignores pointers and is_owned flags and looks at the values in fields.
39768 * Two objects with NULL inner values will be considered "equal" here.
39770 bool Splice_eq(const struct LDKSplice *NONNULL_PTR a, const struct LDKSplice *NONNULL_PTR b);
39773 * Frees any resources used by the SpliceAck, if is_owned is set and inner is non-NULL.
39775 void SpliceAck_free(struct LDKSpliceAck this_obj);
39778 * The channel ID where splicing is intended
39780 struct LDKChannelId SpliceAck_get_channel_id(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
39783 * The channel ID where splicing is intended
39785 void SpliceAck_set_channel_id(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKChannelId val);
39788 * The genesis hash of the blockchain where the channel is intended to be spliced
39790 const uint8_t (*SpliceAck_get_chain_hash(const struct LDKSpliceAck *NONNULL_PTR this_ptr))[32];
39793 * The genesis hash of the blockchain where the channel is intended to be spliced
39795 void SpliceAck_set_chain_hash(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
39798 * The intended change in channel capacity: the amount to be added (positive value)
39799 * or removed (negative value) by the sender (splice acceptor) by splicing into/from the channel.
39801 int64_t SpliceAck_get_relative_satoshis(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
39804 * The intended change in channel capacity: the amount to be added (positive value)
39805 * or removed (negative value) by the sender (splice acceptor) by splicing into/from the channel.
39807 void SpliceAck_set_relative_satoshis(struct LDKSpliceAck *NONNULL_PTR this_ptr, int64_t val);
39810 * The key of the sender (splice acceptor) controlling the new funding transaction
39812 struct LDKPublicKey SpliceAck_get_funding_pubkey(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
39815 * The key of the sender (splice acceptor) controlling the new funding transaction
39817 void SpliceAck_set_funding_pubkey(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39820 * Constructs a new SpliceAck given each field
39822 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);
39825 * Creates a copy of the SpliceAck
39827 struct LDKSpliceAck SpliceAck_clone(const struct LDKSpliceAck *NONNULL_PTR orig);
39830 * Checks if two SpliceAcks contain equal inner contents.
39831 * This ignores pointers and is_owned flags and looks at the values in fields.
39832 * Two objects with NULL inner values will be considered "equal" here.
39834 bool SpliceAck_eq(const struct LDKSpliceAck *NONNULL_PTR a, const struct LDKSpliceAck *NONNULL_PTR b);
39837 * Frees any resources used by the SpliceLocked, if is_owned is set and inner is non-NULL.
39839 void SpliceLocked_free(struct LDKSpliceLocked this_obj);
39844 struct LDKChannelId SpliceLocked_get_channel_id(const struct LDKSpliceLocked *NONNULL_PTR this_ptr);
39849 void SpliceLocked_set_channel_id(struct LDKSpliceLocked *NONNULL_PTR this_ptr, struct LDKChannelId val);
39852 * Constructs a new SpliceLocked given each field
39854 MUST_USE_RES struct LDKSpliceLocked SpliceLocked_new(struct LDKChannelId channel_id_arg);
39857 * Creates a copy of the SpliceLocked
39859 struct LDKSpliceLocked SpliceLocked_clone(const struct LDKSpliceLocked *NONNULL_PTR orig);
39862 * Checks if two SpliceLockeds contain equal inner contents.
39863 * This ignores pointers and is_owned flags and looks at the values in fields.
39864 * Two objects with NULL inner values will be considered "equal" here.
39866 bool SpliceLocked_eq(const struct LDKSpliceLocked *NONNULL_PTR a, const struct LDKSpliceLocked *NONNULL_PTR b);
39869 * Frees any resources used by the TxAddInput, if is_owned is set and inner is non-NULL.
39871 void TxAddInput_free(struct LDKTxAddInput this_obj);
39876 struct LDKChannelId TxAddInput_get_channel_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
39881 void TxAddInput_set_channel_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKChannelId val);
39884 * A randomly chosen unique identifier for this input, which is even for initiators and odd for
39887 uint64_t TxAddInput_get_serial_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
39890 * A randomly chosen unique identifier for this input, which is even for initiators and odd for
39893 void TxAddInput_set_serial_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint64_t val);
39896 * Serialized transaction that contains the output this input spends to verify that it is non
39899 struct LDKTransactionU16LenLimited TxAddInput_get_prevtx(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
39902 * Serialized transaction that contains the output this input spends to verify that it is non
39905 void TxAddInput_set_prevtx(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKTransactionU16LenLimited val);
39908 * The index of the output being spent
39910 uint32_t TxAddInput_get_prevtx_out(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
39913 * The index of the output being spent
39915 void TxAddInput_set_prevtx_out(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
39918 * The sequence number of this input
39920 uint32_t TxAddInput_get_sequence(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
39923 * The sequence number of this input
39925 void TxAddInput_set_sequence(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
39928 * Constructs a new TxAddInput given each field
39930 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);
39933 * Creates a copy of the TxAddInput
39935 struct LDKTxAddInput TxAddInput_clone(const struct LDKTxAddInput *NONNULL_PTR orig);
39938 * Generates a non-cryptographic 64-bit hash of the TxAddInput.
39940 uint64_t TxAddInput_hash(const struct LDKTxAddInput *NONNULL_PTR o);
39943 * Checks if two TxAddInputs contain equal inner contents.
39944 * This ignores pointers and is_owned flags and looks at the values in fields.
39945 * Two objects with NULL inner values will be considered "equal" here.
39947 bool TxAddInput_eq(const struct LDKTxAddInput *NONNULL_PTR a, const struct LDKTxAddInput *NONNULL_PTR b);
39950 * Frees any resources used by the TxAddOutput, if is_owned is set and inner is non-NULL.
39952 void TxAddOutput_free(struct LDKTxAddOutput this_obj);
39957 struct LDKChannelId TxAddOutput_get_channel_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
39962 void TxAddOutput_set_channel_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKChannelId val);
39965 * A randomly chosen unique identifier for this output, which is even for initiators and odd for
39968 uint64_t TxAddOutput_get_serial_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
39971 * A randomly chosen unique identifier for this output, which is even for initiators and odd for
39974 void TxAddOutput_set_serial_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
39977 * The satoshi value of the output
39979 uint64_t TxAddOutput_get_sats(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
39982 * The satoshi value of the output
39984 void TxAddOutput_set_sats(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
39987 * The scriptPubKey for the output
39989 struct LDKCVec_u8Z TxAddOutput_get_script(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
39992 * The scriptPubKey for the output
39994 void TxAddOutput_set_script(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
39997 * Constructs a new TxAddOutput given each field
39999 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);
40002 * Creates a copy of the TxAddOutput
40004 struct LDKTxAddOutput TxAddOutput_clone(const struct LDKTxAddOutput *NONNULL_PTR orig);
40007 * Generates a non-cryptographic 64-bit hash of the TxAddOutput.
40009 uint64_t TxAddOutput_hash(const struct LDKTxAddOutput *NONNULL_PTR o);
40012 * Checks if two TxAddOutputs contain equal inner contents.
40013 * This ignores pointers and is_owned flags and looks at the values in fields.
40014 * Two objects with NULL inner values will be considered "equal" here.
40016 bool TxAddOutput_eq(const struct LDKTxAddOutput *NONNULL_PTR a, const struct LDKTxAddOutput *NONNULL_PTR b);
40019 * Frees any resources used by the TxRemoveInput, if is_owned is set and inner is non-NULL.
40021 void TxRemoveInput_free(struct LDKTxRemoveInput this_obj);
40026 struct LDKChannelId TxRemoveInput_get_channel_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr);
40031 void TxRemoveInput_set_channel_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, struct LDKChannelId val);
40034 * The serial ID of the input to be removed
40036 uint64_t TxRemoveInput_get_serial_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr);
40039 * The serial ID of the input to be removed
40041 void TxRemoveInput_set_serial_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, uint64_t val);
40044 * Constructs a new TxRemoveInput given each field
40046 MUST_USE_RES struct LDKTxRemoveInput TxRemoveInput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg);
40049 * Creates a copy of the TxRemoveInput
40051 struct LDKTxRemoveInput TxRemoveInput_clone(const struct LDKTxRemoveInput *NONNULL_PTR orig);
40054 * Generates a non-cryptographic 64-bit hash of the TxRemoveInput.
40056 uint64_t TxRemoveInput_hash(const struct LDKTxRemoveInput *NONNULL_PTR o);
40059 * Checks if two TxRemoveInputs contain equal inner contents.
40060 * This ignores pointers and is_owned flags and looks at the values in fields.
40061 * Two objects with NULL inner values will be considered "equal" here.
40063 bool TxRemoveInput_eq(const struct LDKTxRemoveInput *NONNULL_PTR a, const struct LDKTxRemoveInput *NONNULL_PTR b);
40066 * Frees any resources used by the TxRemoveOutput, if is_owned is set and inner is non-NULL.
40068 void TxRemoveOutput_free(struct LDKTxRemoveOutput this_obj);
40073 struct LDKChannelId TxRemoveOutput_get_channel_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr);
40078 void TxRemoveOutput_set_channel_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, struct LDKChannelId val);
40081 * The serial ID of the output to be removed
40083 uint64_t TxRemoveOutput_get_serial_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr);
40086 * The serial ID of the output to be removed
40088 void TxRemoveOutput_set_serial_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, uint64_t val);
40091 * Constructs a new TxRemoveOutput given each field
40093 MUST_USE_RES struct LDKTxRemoveOutput TxRemoveOutput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg);
40096 * Creates a copy of the TxRemoveOutput
40098 struct LDKTxRemoveOutput TxRemoveOutput_clone(const struct LDKTxRemoveOutput *NONNULL_PTR orig);
40101 * Generates a non-cryptographic 64-bit hash of the TxRemoveOutput.
40103 uint64_t TxRemoveOutput_hash(const struct LDKTxRemoveOutput *NONNULL_PTR o);
40106 * Checks if two TxRemoveOutputs contain equal inner contents.
40107 * This ignores pointers and is_owned flags and looks at the values in fields.
40108 * Two objects with NULL inner values will be considered "equal" here.
40110 bool TxRemoveOutput_eq(const struct LDKTxRemoveOutput *NONNULL_PTR a, const struct LDKTxRemoveOutput *NONNULL_PTR b);
40113 * Frees any resources used by the TxComplete, if is_owned is set and inner is non-NULL.
40115 void TxComplete_free(struct LDKTxComplete this_obj);
40120 struct LDKChannelId TxComplete_get_channel_id(const struct LDKTxComplete *NONNULL_PTR this_ptr);
40125 void TxComplete_set_channel_id(struct LDKTxComplete *NONNULL_PTR this_ptr, struct LDKChannelId val);
40128 * Constructs a new TxComplete given each field
40130 MUST_USE_RES struct LDKTxComplete TxComplete_new(struct LDKChannelId channel_id_arg);
40133 * Creates a copy of the TxComplete
40135 struct LDKTxComplete TxComplete_clone(const struct LDKTxComplete *NONNULL_PTR orig);
40138 * Generates a non-cryptographic 64-bit hash of the TxComplete.
40140 uint64_t TxComplete_hash(const struct LDKTxComplete *NONNULL_PTR o);
40143 * Checks if two TxCompletes contain equal inner contents.
40144 * This ignores pointers and is_owned flags and looks at the values in fields.
40145 * Two objects with NULL inner values will be considered "equal" here.
40147 bool TxComplete_eq(const struct LDKTxComplete *NONNULL_PTR a, const struct LDKTxComplete *NONNULL_PTR b);
40150 * Frees any resources used by the TxSignatures, if is_owned is set and inner is non-NULL.
40152 void TxSignatures_free(struct LDKTxSignatures this_obj);
40157 struct LDKChannelId TxSignatures_get_channel_id(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
40162 void TxSignatures_set_channel_id(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKChannelId val);
40167 const uint8_t (*TxSignatures_get_tx_hash(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32];
40172 void TxSignatures_set_tx_hash(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
40175 * The list of witnesses
40177 * Returns a copy of the field.
40179 struct LDKCVec_WitnessZ TxSignatures_get_witnesses(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
40182 * The list of witnesses
40184 void TxSignatures_set_witnesses(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCVec_WitnessZ val);
40187 * Optional signature for the shared input -- the previous funding outpoint -- signed by both peers
40189 struct LDKCOption_ECDSASignatureZ TxSignatures_get_funding_outpoint_sig(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
40192 * Optional signature for the shared input -- the previous funding outpoint -- signed by both peers
40194 void TxSignatures_set_funding_outpoint_sig(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCOption_ECDSASignatureZ val);
40197 * Constructs a new TxSignatures given each field
40199 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);
40202 * Creates a copy of the TxSignatures
40204 struct LDKTxSignatures TxSignatures_clone(const struct LDKTxSignatures *NONNULL_PTR orig);
40207 * Generates a non-cryptographic 64-bit hash of the TxSignatures.
40209 uint64_t TxSignatures_hash(const struct LDKTxSignatures *NONNULL_PTR o);
40212 * Checks if two TxSignaturess contain equal inner contents.
40213 * This ignores pointers and is_owned flags and looks at the values in fields.
40214 * Two objects with NULL inner values will be considered "equal" here.
40216 bool TxSignatures_eq(const struct LDKTxSignatures *NONNULL_PTR a, const struct LDKTxSignatures *NONNULL_PTR b);
40219 * Frees any resources used by the TxInitRbf, if is_owned is set and inner is non-NULL.
40221 void TxInitRbf_free(struct LDKTxInitRbf this_obj);
40226 struct LDKChannelId TxInitRbf_get_channel_id(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
40231 void TxInitRbf_set_channel_id(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKChannelId val);
40234 * The locktime of the transaction
40236 uint32_t TxInitRbf_get_locktime(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
40239 * The locktime of the transaction
40241 void TxInitRbf_set_locktime(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
40244 * The feerate of the transaction
40246 uint32_t TxInitRbf_get_feerate_sat_per_1000_weight(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
40249 * The feerate of the transaction
40251 void TxInitRbf_set_feerate_sat_per_1000_weight(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
40254 * The number of satoshis the sender will contribute to or, if negative, remove from
40255 * (e.g. splice-out) the funding output of the transaction
40257 struct LDKCOption_i64Z TxInitRbf_get_funding_output_contribution(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
40260 * The number of satoshis the sender will contribute to or, if negative, remove from
40261 * (e.g. splice-out) the funding output of the transaction
40263 void TxInitRbf_set_funding_output_contribution(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
40266 * Constructs a new TxInitRbf given each field
40268 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);
40271 * Creates a copy of the TxInitRbf
40273 struct LDKTxInitRbf TxInitRbf_clone(const struct LDKTxInitRbf *NONNULL_PTR orig);
40276 * Generates a non-cryptographic 64-bit hash of the TxInitRbf.
40278 uint64_t TxInitRbf_hash(const struct LDKTxInitRbf *NONNULL_PTR o);
40281 * Checks if two TxInitRbfs contain equal inner contents.
40282 * This ignores pointers and is_owned flags and looks at the values in fields.
40283 * Two objects with NULL inner values will be considered "equal" here.
40285 bool TxInitRbf_eq(const struct LDKTxInitRbf *NONNULL_PTR a, const struct LDKTxInitRbf *NONNULL_PTR b);
40288 * Frees any resources used by the TxAckRbf, if is_owned is set and inner is non-NULL.
40290 void TxAckRbf_free(struct LDKTxAckRbf this_obj);
40295 struct LDKChannelId TxAckRbf_get_channel_id(const struct LDKTxAckRbf *NONNULL_PTR this_ptr);
40300 void TxAckRbf_set_channel_id(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKChannelId val);
40303 * The number of satoshis the sender will contribute to or, if negative, remove from
40304 * (e.g. splice-out) the funding output of the transaction
40306 struct LDKCOption_i64Z TxAckRbf_get_funding_output_contribution(const struct LDKTxAckRbf *NONNULL_PTR this_ptr);
40309 * The number of satoshis the sender will contribute to or, if negative, remove from
40310 * (e.g. splice-out) the funding output of the transaction
40312 void TxAckRbf_set_funding_output_contribution(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
40315 * Constructs a new TxAckRbf given each field
40317 MUST_USE_RES struct LDKTxAckRbf TxAckRbf_new(struct LDKChannelId channel_id_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
40320 * Creates a copy of the TxAckRbf
40322 struct LDKTxAckRbf TxAckRbf_clone(const struct LDKTxAckRbf *NONNULL_PTR orig);
40325 * Generates a non-cryptographic 64-bit hash of the TxAckRbf.
40327 uint64_t TxAckRbf_hash(const struct LDKTxAckRbf *NONNULL_PTR o);
40330 * Checks if two TxAckRbfs contain equal inner contents.
40331 * This ignores pointers and is_owned flags and looks at the values in fields.
40332 * Two objects with NULL inner values will be considered "equal" here.
40334 bool TxAckRbf_eq(const struct LDKTxAckRbf *NONNULL_PTR a, const struct LDKTxAckRbf *NONNULL_PTR b);
40337 * Frees any resources used by the TxAbort, if is_owned is set and inner is non-NULL.
40339 void TxAbort_free(struct LDKTxAbort this_obj);
40344 struct LDKChannelId TxAbort_get_channel_id(const struct LDKTxAbort *NONNULL_PTR this_ptr);
40349 void TxAbort_set_channel_id(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKChannelId val);
40354 * Returns a copy of the field.
40356 struct LDKCVec_u8Z TxAbort_get_data(const struct LDKTxAbort *NONNULL_PTR this_ptr);
40361 void TxAbort_set_data(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
40364 * Constructs a new TxAbort given each field
40366 MUST_USE_RES struct LDKTxAbort TxAbort_new(struct LDKChannelId channel_id_arg, struct LDKCVec_u8Z data_arg);
40369 * Creates a copy of the TxAbort
40371 struct LDKTxAbort TxAbort_clone(const struct LDKTxAbort *NONNULL_PTR orig);
40374 * Generates a non-cryptographic 64-bit hash of the TxAbort.
40376 uint64_t TxAbort_hash(const struct LDKTxAbort *NONNULL_PTR o);
40379 * Checks if two TxAborts contain equal inner contents.
40380 * This ignores pointers and is_owned flags and looks at the values in fields.
40381 * Two objects with NULL inner values will be considered "equal" here.
40383 bool TxAbort_eq(const struct LDKTxAbort *NONNULL_PTR a, const struct LDKTxAbort *NONNULL_PTR b);
40386 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
40388 void Shutdown_free(struct LDKShutdown this_obj);
40393 struct LDKChannelId Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr);
40398 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKChannelId val);
40401 * The destination of this peer's funds on closing.
40403 * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
40405 struct LDKCVec_u8Z Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
40408 * The destination of this peer's funds on closing.
40410 * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
40412 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
40415 * Constructs a new Shutdown given each field
40417 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKChannelId channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
40420 * Creates a copy of the Shutdown
40422 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
40425 * Generates a non-cryptographic 64-bit hash of the Shutdown.
40427 uint64_t Shutdown_hash(const struct LDKShutdown *NONNULL_PTR o);
40430 * Checks if two Shutdowns contain equal inner contents.
40431 * This ignores pointers and is_owned flags and looks at the values in fields.
40432 * Two objects with NULL inner values will be considered "equal" here.
40434 bool Shutdown_eq(const struct LDKShutdown *NONNULL_PTR a, const struct LDKShutdown *NONNULL_PTR b);
40437 * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
40439 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
40442 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
40445 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
40448 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
40451 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
40454 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
40457 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
40460 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
40463 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
40466 * Constructs a new ClosingSignedFeeRange given each field
40468 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
40471 * Creates a copy of the ClosingSignedFeeRange
40473 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
40476 * Generates a non-cryptographic 64-bit hash of the ClosingSignedFeeRange.
40478 uint64_t ClosingSignedFeeRange_hash(const struct LDKClosingSignedFeeRange *NONNULL_PTR o);
40481 * Checks if two ClosingSignedFeeRanges contain equal inner contents.
40482 * This ignores pointers and is_owned flags and looks at the values in fields.
40483 * Two objects with NULL inner values will be considered "equal" here.
40485 bool ClosingSignedFeeRange_eq(const struct LDKClosingSignedFeeRange *NONNULL_PTR a, const struct LDKClosingSignedFeeRange *NONNULL_PTR b);
40488 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
40490 void ClosingSigned_free(struct LDKClosingSigned this_obj);
40495 struct LDKChannelId ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
40500 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKChannelId val);
40503 * The proposed total fee for the closing transaction
40505 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
40508 * The proposed total fee for the closing transaction
40510 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
40513 * A signature on the closing transaction
40515 struct LDKECDSASignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
40518 * A signature on the closing transaction
40520 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
40523 * The minimum and maximum fees which the sender is willing to accept, provided only by new
40526 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40528 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
40531 * The minimum and maximum fees which the sender is willing to accept, provided only by new
40534 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40536 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
40539 * Constructs a new ClosingSigned given each field
40541 * Note that fee_range_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
40543 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);
40546 * Creates a copy of the ClosingSigned
40548 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
40551 * Generates a non-cryptographic 64-bit hash of the ClosingSigned.
40553 uint64_t ClosingSigned_hash(const struct LDKClosingSigned *NONNULL_PTR o);
40556 * Checks if two ClosingSigneds contain equal inner contents.
40557 * This ignores pointers and is_owned flags and looks at the values in fields.
40558 * Two objects with NULL inner values will be considered "equal" here.
40560 bool ClosingSigned_eq(const struct LDKClosingSigned *NONNULL_PTR a, const struct LDKClosingSigned *NONNULL_PTR b);
40563 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
40565 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
40570 struct LDKChannelId UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
40575 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
40580 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
40585 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
40588 * The HTLC value in milli-satoshi
40590 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
40593 * The HTLC value in milli-satoshi
40595 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
40598 * The payment hash, the pre-image of which controls HTLC redemption
40600 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
40603 * The payment hash, the pre-image of which controls HTLC redemption
40605 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
40608 * The expiry height of the HTLC
40610 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
40613 * The expiry height of the HTLC
40615 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
40618 * The extra fee skimmed by the sender of this message. See
40619 * [`ChannelConfig::accept_underpaying_htlcs`].
40621 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
40623 struct LDKCOption_u64Z UpdateAddHTLC_get_skimmed_fee_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
40626 * The extra fee skimmed by the sender of this message. See
40627 * [`ChannelConfig::accept_underpaying_htlcs`].
40629 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
40631 void UpdateAddHTLC_set_skimmed_fee_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
40634 * The onion routing packet with encrypted data for the next hop.
40636 struct LDKOnionPacket UpdateAddHTLC_get_onion_routing_packet(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
40639 * The onion routing packet with encrypted data for the next hop.
40641 void UpdateAddHTLC_set_onion_routing_packet(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKOnionPacket val);
40644 * Provided if we are relaying or receiving a payment within a blinded path, to decrypt the onion
40645 * routing packet and the recipient-provided encrypted payload within.
40647 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40649 struct LDKPublicKey UpdateAddHTLC_get_blinding_point(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
40652 * Provided if we are relaying or receiving a payment within a blinded path, to decrypt the onion
40653 * routing packet and the recipient-provided encrypted payload within.
40655 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40657 void UpdateAddHTLC_set_blinding_point(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40660 * Constructs a new UpdateAddHTLC given each field
40662 * Note that blinding_point_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
40664 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);
40667 * Creates a copy of the UpdateAddHTLC
40669 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
40672 * Generates a non-cryptographic 64-bit hash of the UpdateAddHTLC.
40674 uint64_t UpdateAddHTLC_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR o);
40677 * Checks if two UpdateAddHTLCs contain equal inner contents.
40678 * This ignores pointers and is_owned flags and looks at the values in fields.
40679 * Two objects with NULL inner values will be considered "equal" here.
40681 bool UpdateAddHTLC_eq(const struct LDKUpdateAddHTLC *NONNULL_PTR a, const struct LDKUpdateAddHTLC *NONNULL_PTR b);
40684 * Frees any resources used by the OnionMessage, if is_owned is set and inner is non-NULL.
40686 void OnionMessage_free(struct LDKOnionMessage this_obj);
40689 * Used in decrypting the onion packet's payload.
40691 struct LDKPublicKey OnionMessage_get_blinding_point(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
40694 * Used in decrypting the onion packet's payload.
40696 void OnionMessage_set_blinding_point(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40699 * The full onion packet including hop data, pubkey, and hmac
40701 struct LDKPacket OnionMessage_get_onion_routing_packet(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
40704 * The full onion packet including hop data, pubkey, and hmac
40706 void OnionMessage_set_onion_routing_packet(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPacket val);
40709 * Constructs a new OnionMessage given each field
40711 MUST_USE_RES struct LDKOnionMessage OnionMessage_new(struct LDKPublicKey blinding_point_arg, struct LDKPacket onion_routing_packet_arg);
40714 * Creates a copy of the OnionMessage
40716 struct LDKOnionMessage OnionMessage_clone(const struct LDKOnionMessage *NONNULL_PTR orig);
40719 * Generates a non-cryptographic 64-bit hash of the OnionMessage.
40721 uint64_t OnionMessage_hash(const struct LDKOnionMessage *NONNULL_PTR o);
40724 * Checks if two OnionMessages contain equal inner contents.
40725 * This ignores pointers and is_owned flags and looks at the values in fields.
40726 * Two objects with NULL inner values will be considered "equal" here.
40728 bool OnionMessage_eq(const struct LDKOnionMessage *NONNULL_PTR a, const struct LDKOnionMessage *NONNULL_PTR b);
40731 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
40733 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
40738 struct LDKChannelId UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
40743 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
40748 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
40753 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
40756 * The pre-image of the payment hash, allowing HTLC redemption
40758 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
40761 * The pre-image of the payment hash, allowing HTLC redemption
40763 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
40766 * Constructs a new UpdateFulfillHTLC given each field
40768 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKChannelId channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
40771 * Creates a copy of the UpdateFulfillHTLC
40773 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
40776 * Generates a non-cryptographic 64-bit hash of the UpdateFulfillHTLC.
40778 uint64_t UpdateFulfillHTLC_hash(const struct LDKUpdateFulfillHTLC *NONNULL_PTR o);
40781 * Checks if two UpdateFulfillHTLCs contain equal inner contents.
40782 * This ignores pointers and is_owned flags and looks at the values in fields.
40783 * Two objects with NULL inner values will be considered "equal" here.
40785 bool UpdateFulfillHTLC_eq(const struct LDKUpdateFulfillHTLC *NONNULL_PTR a, const struct LDKUpdateFulfillHTLC *NONNULL_PTR b);
40788 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
40790 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
40795 struct LDKChannelId UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
40800 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
40805 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
40810 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
40813 * Creates a copy of the UpdateFailHTLC
40815 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
40818 * Generates a non-cryptographic 64-bit hash of the UpdateFailHTLC.
40820 uint64_t UpdateFailHTLC_hash(const struct LDKUpdateFailHTLC *NONNULL_PTR o);
40823 * Checks if two UpdateFailHTLCs contain equal inner contents.
40824 * This ignores pointers and is_owned flags and looks at the values in fields.
40825 * Two objects with NULL inner values will be considered "equal" here.
40827 bool UpdateFailHTLC_eq(const struct LDKUpdateFailHTLC *NONNULL_PTR a, const struct LDKUpdateFailHTLC *NONNULL_PTR b);
40830 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
40832 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
40837 struct LDKChannelId UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
40842 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
40847 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
40852 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
40857 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
40862 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
40865 * Creates a copy of the UpdateFailMalformedHTLC
40867 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
40870 * Generates a non-cryptographic 64-bit hash of the UpdateFailMalformedHTLC.
40872 uint64_t UpdateFailMalformedHTLC_hash(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR o);
40875 * Checks if two UpdateFailMalformedHTLCs contain equal inner contents.
40876 * This ignores pointers and is_owned flags and looks at the values in fields.
40877 * Two objects with NULL inner values will be considered "equal" here.
40879 bool UpdateFailMalformedHTLC_eq(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR a, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR b);
40882 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
40884 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
40889 struct LDKChannelId CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
40894 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKChannelId val);
40897 * A signature on the commitment transaction
40899 struct LDKECDSASignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
40902 * A signature on the commitment transaction
40904 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
40907 * Signatures on the HTLC transactions
40909 * Returns a copy of the field.
40911 struct LDKCVec_ECDSASignatureZ CommitmentSigned_get_htlc_signatures(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
40914 * Signatures on the HTLC transactions
40916 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
40919 * Constructs a new CommitmentSigned given each field
40921 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKChannelId channel_id_arg, struct LDKECDSASignature signature_arg, struct LDKCVec_ECDSASignatureZ htlc_signatures_arg);
40924 * Creates a copy of the CommitmentSigned
40926 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
40929 * Generates a non-cryptographic 64-bit hash of the CommitmentSigned.
40931 uint64_t CommitmentSigned_hash(const struct LDKCommitmentSigned *NONNULL_PTR o);
40934 * Checks if two CommitmentSigneds contain equal inner contents.
40935 * This ignores pointers and is_owned flags and looks at the values in fields.
40936 * Two objects with NULL inner values will be considered "equal" here.
40938 bool CommitmentSigned_eq(const struct LDKCommitmentSigned *NONNULL_PTR a, const struct LDKCommitmentSigned *NONNULL_PTR b);
40941 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
40943 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
40948 struct LDKChannelId RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
40953 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKChannelId val);
40956 * The secret corresponding to the per-commitment point
40958 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
40961 * The secret corresponding to the per-commitment point
40963 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
40966 * The next sender-broadcast commitment transaction's per-commitment point
40968 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
40971 * The next sender-broadcast commitment transaction's per-commitment point
40973 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40976 * Constructs a new RevokeAndACK given each field
40978 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);
40981 * Creates a copy of the RevokeAndACK
40983 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
40986 * Generates a non-cryptographic 64-bit hash of the RevokeAndACK.
40988 uint64_t RevokeAndACK_hash(const struct LDKRevokeAndACK *NONNULL_PTR o);
40991 * Checks if two RevokeAndACKs contain equal inner contents.
40992 * This ignores pointers and is_owned flags and looks at the values in fields.
40993 * Two objects with NULL inner values will be considered "equal" here.
40995 bool RevokeAndACK_eq(const struct LDKRevokeAndACK *NONNULL_PTR a, const struct LDKRevokeAndACK *NONNULL_PTR b);
40998 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
41000 void UpdateFee_free(struct LDKUpdateFee this_obj);
41005 struct LDKChannelId UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
41010 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKChannelId val);
41013 * Fee rate per 1000-weight of the transaction
41015 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
41018 * Fee rate per 1000-weight of the transaction
41020 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
41023 * Constructs a new UpdateFee given each field
41025 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKChannelId channel_id_arg, uint32_t feerate_per_kw_arg);
41028 * Creates a copy of the UpdateFee
41030 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
41033 * Generates a non-cryptographic 64-bit hash of the UpdateFee.
41035 uint64_t UpdateFee_hash(const struct LDKUpdateFee *NONNULL_PTR o);
41038 * Checks if two UpdateFees contain equal inner contents.
41039 * This ignores pointers and is_owned flags and looks at the values in fields.
41040 * Two objects with NULL inner values will be considered "equal" here.
41042 bool UpdateFee_eq(const struct LDKUpdateFee *NONNULL_PTR a, const struct LDKUpdateFee *NONNULL_PTR b);
41045 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
41047 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
41052 struct LDKChannelId ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
41057 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKChannelId val);
41060 * The next commitment number for the sender
41062 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
41065 * The next commitment number for the sender
41067 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
41070 * The next commitment number for the recipient
41072 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
41075 * The next commitment number for the recipient
41077 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
41080 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
41081 * belonging to the recipient
41083 const uint8_t (*ChannelReestablish_get_your_last_per_commitment_secret(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
41086 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
41087 * belonging to the recipient
41089 void ChannelReestablish_set_your_last_per_commitment_secret(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41092 * The sender's per-commitment point for their current commitment transaction
41094 struct LDKPublicKey ChannelReestablish_get_my_current_per_commitment_point(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
41097 * The sender's per-commitment point for their current commitment transaction
41099 void ChannelReestablish_set_my_current_per_commitment_point(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKPublicKey val);
41102 * The next funding transaction ID
41104 struct LDKCOption_ThirtyTwoBytesZ ChannelReestablish_get_next_funding_txid(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
41107 * The next funding transaction ID
41109 void ChannelReestablish_set_next_funding_txid(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
41112 * Constructs a new ChannelReestablish given each field
41114 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);
41117 * Creates a copy of the ChannelReestablish
41119 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
41122 * Generates a non-cryptographic 64-bit hash of the ChannelReestablish.
41124 uint64_t ChannelReestablish_hash(const struct LDKChannelReestablish *NONNULL_PTR o);
41127 * Checks if two ChannelReestablishs contain equal inner contents.
41128 * This ignores pointers and is_owned flags and looks at the values in fields.
41129 * Two objects with NULL inner values will be considered "equal" here.
41131 bool ChannelReestablish_eq(const struct LDKChannelReestablish *NONNULL_PTR a, const struct LDKChannelReestablish *NONNULL_PTR b);
41134 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
41136 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
41141 struct LDKChannelId AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
41146 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKChannelId val);
41149 * The short channel ID
41151 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
41154 * The short channel ID
41156 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
41159 * A signature by the node key
41161 struct LDKECDSASignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
41164 * A signature by the node key
41166 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41169 * A signature by the funding key
41171 struct LDKECDSASignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
41174 * A signature by the funding key
41176 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41179 * Constructs a new AnnouncementSignatures given each field
41181 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);
41184 * Creates a copy of the AnnouncementSignatures
41186 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
41189 * Generates a non-cryptographic 64-bit hash of the AnnouncementSignatures.
41191 uint64_t AnnouncementSignatures_hash(const struct LDKAnnouncementSignatures *NONNULL_PTR o);
41194 * Checks if two AnnouncementSignaturess contain equal inner contents.
41195 * This ignores pointers and is_owned flags and looks at the values in fields.
41196 * Two objects with NULL inner values will be considered "equal" here.
41198 bool AnnouncementSignatures_eq(const struct LDKAnnouncementSignatures *NONNULL_PTR a, const struct LDKAnnouncementSignatures *NONNULL_PTR b);
41201 * Frees any resources used by the SocketAddress
41203 void SocketAddress_free(struct LDKSocketAddress this_ptr);
41206 * Creates a copy of the SocketAddress
41208 struct LDKSocketAddress SocketAddress_clone(const struct LDKSocketAddress *NONNULL_PTR orig);
41211 * Utility method to constructs a new TcpIpV4-variant SocketAddress
41213 struct LDKSocketAddress SocketAddress_tcp_ip_v4(struct LDKFourBytes addr, uint16_t port);
41216 * Utility method to constructs a new TcpIpV6-variant SocketAddress
41218 struct LDKSocketAddress SocketAddress_tcp_ip_v6(struct LDKSixteenBytes addr, uint16_t port);
41221 * Utility method to constructs a new OnionV2-variant SocketAddress
41223 struct LDKSocketAddress SocketAddress_onion_v2(struct LDKTwelveBytes a);
41226 * Utility method to constructs a new OnionV3-variant SocketAddress
41228 struct LDKSocketAddress SocketAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
41231 * Utility method to constructs a new Hostname-variant SocketAddress
41233 struct LDKSocketAddress SocketAddress_hostname(struct LDKHostname hostname, uint16_t port);
41236 * Generates a non-cryptographic 64-bit hash of the SocketAddress.
41238 uint64_t SocketAddress_hash(const struct LDKSocketAddress *NONNULL_PTR o);
41241 * Checks if two SocketAddresss contain equal inner contents.
41242 * This ignores pointers and is_owned flags and looks at the values in fields.
41244 bool SocketAddress_eq(const struct LDKSocketAddress *NONNULL_PTR a, const struct LDKSocketAddress *NONNULL_PTR b);
41247 * Serialize the SocketAddress object into a byte array which can be read by SocketAddress_read
41249 struct LDKCVec_u8Z SocketAddress_write(const struct LDKSocketAddress *NONNULL_PTR obj);
41252 * Read a SocketAddress from a byte array, created by SocketAddress_write
41254 struct LDKCResult_SocketAddressDecodeErrorZ SocketAddress_read(struct LDKu8slice ser);
41257 * Creates a copy of the SocketAddressParseError
41259 enum LDKSocketAddressParseError SocketAddressParseError_clone(const enum LDKSocketAddressParseError *NONNULL_PTR orig);
41262 * Utility method to constructs a new SocketAddrParse-variant SocketAddressParseError
41264 enum LDKSocketAddressParseError SocketAddressParseError_socket_addr_parse(void);
41267 * Utility method to constructs a new InvalidInput-variant SocketAddressParseError
41269 enum LDKSocketAddressParseError SocketAddressParseError_invalid_input(void);
41272 * Utility method to constructs a new InvalidPort-variant SocketAddressParseError
41274 enum LDKSocketAddressParseError SocketAddressParseError_invalid_port(void);
41277 * Utility method to constructs a new InvalidOnionV3-variant SocketAddressParseError
41279 enum LDKSocketAddressParseError SocketAddressParseError_invalid_onion_v3(void);
41282 * Generates a non-cryptographic 64-bit hash of the SocketAddressParseError.
41284 uint64_t SocketAddressParseError_hash(const enum LDKSocketAddressParseError *NONNULL_PTR o);
41287 * Checks if two SocketAddressParseErrors contain equal inner contents.
41288 * This ignores pointers and is_owned flags and looks at the values in fields.
41290 bool SocketAddressParseError_eq(const enum LDKSocketAddressParseError *NONNULL_PTR a, const enum LDKSocketAddressParseError *NONNULL_PTR b);
41293 * Parses an OnionV3 host and port into a [`SocketAddress::OnionV3`].
41295 * The host part must end with \".onion\".
41297 struct LDKCResult_SocketAddressSocketAddressParseErrorZ parse_onion_address(struct LDKStr host, uint16_t port);
41300 * Get the string representation of a SocketAddress object
41302 struct LDKStr SocketAddress_to_str(const struct LDKSocketAddress *NONNULL_PTR o);
41305 * Read a SocketAddress object from a string
41307 struct LDKCResult_SocketAddressSocketAddressParseErrorZ SocketAddress_from_str(struct LDKStr s);
41310 * Frees any resources used by the UnsignedGossipMessage
41312 void UnsignedGossipMessage_free(struct LDKUnsignedGossipMessage this_ptr);
41315 * Creates a copy of the UnsignedGossipMessage
41317 struct LDKUnsignedGossipMessage UnsignedGossipMessage_clone(const struct LDKUnsignedGossipMessage *NONNULL_PTR orig);
41320 * Utility method to constructs a new ChannelAnnouncement-variant UnsignedGossipMessage
41322 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_announcement(struct LDKUnsignedChannelAnnouncement a);
41325 * Utility method to constructs a new ChannelUpdate-variant UnsignedGossipMessage
41327 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_update(struct LDKUnsignedChannelUpdate a);
41330 * Utility method to constructs a new NodeAnnouncement-variant UnsignedGossipMessage
41332 struct LDKUnsignedGossipMessage UnsignedGossipMessage_node_announcement(struct LDKUnsignedNodeAnnouncement a);
41335 * Serialize the UnsignedGossipMessage object into a byte array which can be read by UnsignedGossipMessage_read
41337 struct LDKCVec_u8Z UnsignedGossipMessage_write(const struct LDKUnsignedGossipMessage *NONNULL_PTR obj);
41340 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
41342 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
41345 * The advertised features
41347 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
41350 * The advertised features
41352 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
41355 * A strictly monotonic announcement counter, with gaps allowed
41357 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
41360 * A strictly monotonic announcement counter, with gaps allowed
41362 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
41365 * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
41368 struct LDKNodeId UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
41371 * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
41374 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
41377 * An RGB color for UI purposes
41379 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
41382 * An RGB color for UI purposes
41384 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
41387 * An alias, for UI purposes.
41389 * This should be sanitized before use. There is no guarantee of uniqueness.
41391 struct LDKNodeAlias UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
41394 * An alias, for UI purposes.
41396 * This should be sanitized before use. There is no guarantee of uniqueness.
41398 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
41401 * List of addresses on which this node is reachable
41403 * Returns a copy of the field.
41405 struct LDKCVec_SocketAddressZ UnsignedNodeAnnouncement_get_addresses(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
41408 * List of addresses on which this node is reachable
41410 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_SocketAddressZ val);
41413 * Excess address data which was signed as a part of the message which we do not (yet) understand how
41416 * This is stored to ensure forward-compatibility as new address types are added to the lightning gossip protocol.
41418 * Returns a copy of the field.
41420 struct LDKCVec_u8Z UnsignedNodeAnnouncement_get_excess_address_data(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
41423 * Excess address data which was signed as a part of the message which we do not (yet) understand how
41426 * This is stored to ensure forward-compatibility as new address types are added to the lightning gossip protocol.
41428 void UnsignedNodeAnnouncement_set_excess_address_data(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
41431 * Excess data which was signed as a part of the message which we do not (yet) understand how
41434 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
41436 * Returns a copy of the field.
41438 struct LDKCVec_u8Z UnsignedNodeAnnouncement_get_excess_data(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
41441 * Excess data which was signed as a part of the message which we do not (yet) understand how
41444 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
41446 void UnsignedNodeAnnouncement_set_excess_data(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
41449 * Constructs a new UnsignedNodeAnnouncement given each field
41451 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);
41454 * Creates a copy of the UnsignedNodeAnnouncement
41456 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
41459 * Generates a non-cryptographic 64-bit hash of the UnsignedNodeAnnouncement.
41461 uint64_t UnsignedNodeAnnouncement_hash(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR o);
41464 * Checks if two UnsignedNodeAnnouncements contain equal inner contents.
41465 * This ignores pointers and is_owned flags and looks at the values in fields.
41466 * Two objects with NULL inner values will be considered "equal" here.
41468 bool UnsignedNodeAnnouncement_eq(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR a, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR b);
41471 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
41473 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
41476 * The signature by the node key
41478 struct LDKECDSASignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
41481 * The signature by the node key
41483 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41486 * The actual content of the announcement
41488 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
41491 * The actual content of the announcement
41493 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
41496 * Constructs a new NodeAnnouncement given each field
41498 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
41501 * Creates a copy of the NodeAnnouncement
41503 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
41506 * Generates a non-cryptographic 64-bit hash of the NodeAnnouncement.
41508 uint64_t NodeAnnouncement_hash(const struct LDKNodeAnnouncement *NONNULL_PTR o);
41511 * Checks if two NodeAnnouncements contain equal inner contents.
41512 * This ignores pointers and is_owned flags and looks at the values in fields.
41513 * Two objects with NULL inner values will be considered "equal" here.
41515 bool NodeAnnouncement_eq(const struct LDKNodeAnnouncement *NONNULL_PTR a, const struct LDKNodeAnnouncement *NONNULL_PTR b);
41518 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
41520 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
41523 * The advertised channel features
41525 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
41528 * The advertised channel features
41530 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
41533 * The genesis hash of the blockchain where the channel is to be opened
41535 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
41538 * The genesis hash of the blockchain where the channel is to be opened
41540 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41543 * The short channel ID
41545 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
41548 * The short channel ID
41550 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
41553 * One of the two `node_id`s which are endpoints of this channel
41555 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
41558 * One of the two `node_id`s which are endpoints of this channel
41560 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
41563 * The other of the two `node_id`s which are endpoints of this channel
41565 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
41568 * The other of the two `node_id`s which are endpoints of this channel
41570 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
41573 * The funding key for the first node
41575 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
41578 * The funding key for the first node
41580 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
41583 * The funding key for the second node
41585 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
41588 * The funding key for the second node
41590 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
41593 * Excess data which was signed as a part of the message which we do not (yet) understand how
41596 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
41598 * Returns a copy of the field.
41600 struct LDKCVec_u8Z UnsignedChannelAnnouncement_get_excess_data(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
41603 * Excess data which was signed as a part of the message which we do not (yet) understand how
41606 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
41608 void UnsignedChannelAnnouncement_set_excess_data(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
41611 * Constructs a new UnsignedChannelAnnouncement given each field
41613 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);
41616 * Creates a copy of the UnsignedChannelAnnouncement
41618 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
41621 * Generates a non-cryptographic 64-bit hash of the UnsignedChannelAnnouncement.
41623 uint64_t UnsignedChannelAnnouncement_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR o);
41626 * Checks if two UnsignedChannelAnnouncements contain equal inner contents.
41627 * This ignores pointers and is_owned flags and looks at the values in fields.
41628 * Two objects with NULL inner values will be considered "equal" here.
41630 bool UnsignedChannelAnnouncement_eq(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR a, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR b);
41633 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
41635 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
41638 * Authentication of the announcement by the first public node
41640 struct LDKECDSASignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
41643 * Authentication of the announcement by the first public node
41645 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41648 * Authentication of the announcement by the second public node
41650 struct LDKECDSASignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
41653 * Authentication of the announcement by the second public node
41655 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41658 * Proof of funding UTXO ownership by the first public node
41660 struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
41663 * Proof of funding UTXO ownership by the first public node
41665 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41668 * Proof of funding UTXO ownership by the second public node
41670 struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
41673 * Proof of funding UTXO ownership by the second public node
41675 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41678 * The actual announcement
41680 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
41683 * The actual announcement
41685 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
41688 * Constructs a new ChannelAnnouncement given each field
41690 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);
41693 * Creates a copy of the ChannelAnnouncement
41695 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
41698 * Generates a non-cryptographic 64-bit hash of the ChannelAnnouncement.
41700 uint64_t ChannelAnnouncement_hash(const struct LDKChannelAnnouncement *NONNULL_PTR o);
41703 * Checks if two ChannelAnnouncements contain equal inner contents.
41704 * This ignores pointers and is_owned flags and looks at the values in fields.
41705 * Two objects with NULL inner values will be considered "equal" here.
41707 bool ChannelAnnouncement_eq(const struct LDKChannelAnnouncement *NONNULL_PTR a, const struct LDKChannelAnnouncement *NONNULL_PTR b);
41710 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
41712 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
41715 * The genesis hash of the blockchain where the channel is to be opened
41717 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
41720 * The genesis hash of the blockchain where the channel is to be opened
41722 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41725 * The short channel ID
41727 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
41730 * The short channel ID
41732 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
41735 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
41737 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
41740 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
41742 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
41747 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
41752 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
41755 * The number of blocks such that if:
41756 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
41757 * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
41758 * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
41759 * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
41760 * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
41761 * forwarding. Note that the HTLC sender is the one who originally sets this value when
41762 * constructing the route.
41764 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
41767 * The number of blocks such that if:
41768 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
41769 * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
41770 * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
41771 * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
41772 * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
41773 * forwarding. Note that the HTLC sender is the one who originally sets this value when
41774 * constructing the route.
41776 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
41779 * The minimum HTLC size incoming to sender, in milli-satoshi
41781 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
41784 * The minimum HTLC size incoming to sender, in milli-satoshi
41786 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
41789 * The maximum HTLC value incoming to sender, in milli-satoshi.
41791 * This used to be optional.
41793 uint64_t UnsignedChannelUpdate_get_htlc_maximum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
41796 * The maximum HTLC value incoming to sender, in milli-satoshi.
41798 * This used to be optional.
41800 void UnsignedChannelUpdate_set_htlc_maximum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
41803 * The base HTLC fee charged by sender, in milli-satoshi
41805 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
41808 * The base HTLC fee charged by sender, in milli-satoshi
41810 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
41813 * The amount to fee multiplier, in micro-satoshi
41815 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
41818 * The amount to fee multiplier, in micro-satoshi
41820 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
41823 * Excess data which was signed as a part of the message which we do not (yet) understand how
41826 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
41828 * Returns a copy of the field.
41830 struct LDKCVec_u8Z UnsignedChannelUpdate_get_excess_data(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
41833 * Excess data which was signed as a part of the message which we do not (yet) understand how
41836 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
41838 void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
41841 * Constructs a new UnsignedChannelUpdate given each field
41843 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);
41846 * Creates a copy of the UnsignedChannelUpdate
41848 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
41851 * Generates a non-cryptographic 64-bit hash of the UnsignedChannelUpdate.
41853 uint64_t UnsignedChannelUpdate_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR o);
41856 * Checks if two UnsignedChannelUpdates contain equal inner contents.
41857 * This ignores pointers and is_owned flags and looks at the values in fields.
41858 * Two objects with NULL inner values will be considered "equal" here.
41860 bool UnsignedChannelUpdate_eq(const struct LDKUnsignedChannelUpdate *NONNULL_PTR a, const struct LDKUnsignedChannelUpdate *NONNULL_PTR b);
41863 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
41865 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
41868 * A signature of the channel update
41870 struct LDKECDSASignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
41873 * A signature of the channel update
41875 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41878 * The actual channel update
41880 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
41883 * The actual channel update
41885 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
41888 * Constructs a new ChannelUpdate given each field
41890 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
41893 * Creates a copy of the ChannelUpdate
41895 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
41898 * Generates a non-cryptographic 64-bit hash of the ChannelUpdate.
41900 uint64_t ChannelUpdate_hash(const struct LDKChannelUpdate *NONNULL_PTR o);
41903 * Checks if two ChannelUpdates contain equal inner contents.
41904 * This ignores pointers and is_owned flags and looks at the values in fields.
41905 * Two objects with NULL inner values will be considered "equal" here.
41907 bool ChannelUpdate_eq(const struct LDKChannelUpdate *NONNULL_PTR a, const struct LDKChannelUpdate *NONNULL_PTR b);
41910 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
41912 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
41915 * The genesis hash of the blockchain being queried
41917 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
41920 * The genesis hash of the blockchain being queried
41922 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41925 * The height of the first block for the channel UTXOs being queried
41927 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
41930 * The height of the first block for the channel UTXOs being queried
41932 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
41935 * The number of blocks to include in the query results
41937 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
41940 * The number of blocks to include in the query results
41942 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
41945 * Constructs a new QueryChannelRange given each field
41947 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
41950 * Creates a copy of the QueryChannelRange
41952 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
41955 * Generates a non-cryptographic 64-bit hash of the QueryChannelRange.
41957 uint64_t QueryChannelRange_hash(const struct LDKQueryChannelRange *NONNULL_PTR o);
41960 * Checks if two QueryChannelRanges contain equal inner contents.
41961 * This ignores pointers and is_owned flags and looks at the values in fields.
41962 * Two objects with NULL inner values will be considered "equal" here.
41964 bool QueryChannelRange_eq(const struct LDKQueryChannelRange *NONNULL_PTR a, const struct LDKQueryChannelRange *NONNULL_PTR b);
41967 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
41969 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
41972 * The genesis hash of the blockchain being queried
41974 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
41977 * The genesis hash of the blockchain being queried
41979 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41982 * The height of the first block in the range of the reply
41984 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
41987 * The height of the first block in the range of the reply
41989 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
41992 * The number of blocks included in the range of the reply
41994 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
41997 * The number of blocks included in the range of the reply
41999 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
42002 * True when this is the final reply for a query
42004 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
42007 * True when this is the final reply for a query
42009 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
42012 * The `short_channel_id`s in the channel range
42014 * Returns a copy of the field.
42016 struct LDKCVec_u64Z ReplyChannelRange_get_short_channel_ids(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
42019 * The `short_channel_id`s in the channel range
42021 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
42024 * Constructs a new ReplyChannelRange given each field
42026 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);
42029 * Creates a copy of the ReplyChannelRange
42031 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
42034 * Generates a non-cryptographic 64-bit hash of the ReplyChannelRange.
42036 uint64_t ReplyChannelRange_hash(const struct LDKReplyChannelRange *NONNULL_PTR o);
42039 * Checks if two ReplyChannelRanges contain equal inner contents.
42040 * This ignores pointers and is_owned flags and looks at the values in fields.
42041 * Two objects with NULL inner values will be considered "equal" here.
42043 bool ReplyChannelRange_eq(const struct LDKReplyChannelRange *NONNULL_PTR a, const struct LDKReplyChannelRange *NONNULL_PTR b);
42046 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
42048 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
42051 * The genesis hash of the blockchain being queried
42053 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
42056 * The genesis hash of the blockchain being queried
42058 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42061 * The short_channel_ids that are being queried
42063 * Returns a copy of the field.
42065 struct LDKCVec_u64Z QueryShortChannelIds_get_short_channel_ids(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr);
42068 * The short_channel_ids that are being queried
42070 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
42073 * Constructs a new QueryShortChannelIds given each field
42075 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
42078 * Creates a copy of the QueryShortChannelIds
42080 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
42083 * Generates a non-cryptographic 64-bit hash of the QueryShortChannelIds.
42085 uint64_t QueryShortChannelIds_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR o);
42088 * Checks if two QueryShortChannelIdss contain equal inner contents.
42089 * This ignores pointers and is_owned flags and looks at the values in fields.
42090 * Two objects with NULL inner values will be considered "equal" here.
42092 bool QueryShortChannelIds_eq(const struct LDKQueryShortChannelIds *NONNULL_PTR a, const struct LDKQueryShortChannelIds *NONNULL_PTR b);
42095 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
42097 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
42100 * The genesis hash of the blockchain that was queried
42102 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
42105 * The genesis hash of the blockchain that was queried
42107 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42110 * Indicates if the query recipient maintains up-to-date channel
42111 * information for the `chain_hash`
42113 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
42116 * Indicates if the query recipient maintains up-to-date channel
42117 * information for the `chain_hash`
42119 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
42122 * Constructs a new ReplyShortChannelIdsEnd given each field
42124 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
42127 * Creates a copy of the ReplyShortChannelIdsEnd
42129 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
42132 * Generates a non-cryptographic 64-bit hash of the ReplyShortChannelIdsEnd.
42134 uint64_t ReplyShortChannelIdsEnd_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR o);
42137 * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
42138 * This ignores pointers and is_owned flags and looks at the values in fields.
42139 * Two objects with NULL inner values will be considered "equal" here.
42141 bool ReplyShortChannelIdsEnd_eq(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR a, const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR b);
42144 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
42146 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
42149 * The genesis hash of the blockchain for channel and node information
42151 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
42154 * The genesis hash of the blockchain for channel and node information
42156 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42159 * The starting unix timestamp
42161 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
42164 * The starting unix timestamp
42166 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
42169 * The range of information in seconds
42171 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
42174 * The range of information in seconds
42176 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
42179 * Constructs a new GossipTimestampFilter given each field
42181 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
42184 * Creates a copy of the GossipTimestampFilter
42186 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
42189 * Generates a non-cryptographic 64-bit hash of the GossipTimestampFilter.
42191 uint64_t GossipTimestampFilter_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR o);
42194 * Checks if two GossipTimestampFilters 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 GossipTimestampFilter_eq(const struct LDKGossipTimestampFilter *NONNULL_PTR a, const struct LDKGossipTimestampFilter *NONNULL_PTR b);
42201 * Frees any resources used by the ErrorAction
42203 void ErrorAction_free(struct LDKErrorAction this_ptr);
42206 * Creates a copy of the ErrorAction
42208 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
42211 * Utility method to constructs a new DisconnectPeer-variant ErrorAction
42213 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
42216 * Utility method to constructs a new DisconnectPeerWithWarning-variant ErrorAction
42218 struct LDKErrorAction ErrorAction_disconnect_peer_with_warning(struct LDKWarningMessage msg);
42221 * Utility method to constructs a new IgnoreError-variant ErrorAction
42223 struct LDKErrorAction ErrorAction_ignore_error(void);
42226 * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
42228 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
42231 * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
42233 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
42236 * Utility method to constructs a new SendErrorMessage-variant ErrorAction
42238 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
42241 * Utility method to constructs a new SendWarningMessage-variant ErrorAction
42243 struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
42246 * Generates a non-cryptographic 64-bit hash of the ErrorAction.
42248 uint64_t ErrorAction_hash(const struct LDKErrorAction *NONNULL_PTR o);
42251 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
42253 void LightningError_free(struct LDKLightningError this_obj);
42256 * A human-readable message describing the error
42258 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
42261 * A human-readable message describing the error
42263 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
42266 * The action which should be taken against the offending peer.
42268 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
42271 * The action which should be taken against the offending peer.
42273 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
42276 * Constructs a new LightningError given each field
42278 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
42281 * Creates a copy of the LightningError
42283 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
42286 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
42288 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
42291 * `update_add_htlc` messages which should be sent
42293 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
42296 * `update_add_htlc` messages which should be sent
42298 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
42301 * `update_fulfill_htlc` messages which should be sent
42303 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
42306 * `update_fulfill_htlc` messages which should be sent
42308 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
42311 * `update_fail_htlc` messages which should be sent
42313 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
42316 * `update_fail_htlc` messages which should be sent
42318 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
42321 * `update_fail_malformed_htlc` messages which should be sent
42323 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
42326 * `update_fail_malformed_htlc` messages which should be sent
42328 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
42331 * An `update_fee` message which should be sent
42333 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
42335 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
42338 * An `update_fee` message which should be sent
42340 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
42342 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
42345 * A `commitment_signed` message which should be sent
42347 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
42350 * A `commitment_signed` message which should be sent
42352 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
42355 * Constructs a new CommitmentUpdate given each field
42357 * Note that update_fee_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
42359 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);
42362 * Creates a copy of the CommitmentUpdate
42364 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
42367 * Generates a non-cryptographic 64-bit hash of the CommitmentUpdate.
42369 uint64_t CommitmentUpdate_hash(const struct LDKCommitmentUpdate *NONNULL_PTR o);
42372 * Checks if two CommitmentUpdates contain equal inner contents.
42373 * This ignores pointers and is_owned flags and looks at the values in fields.
42374 * Two objects with NULL inner values will be considered "equal" here.
42376 bool CommitmentUpdate_eq(const struct LDKCommitmentUpdate *NONNULL_PTR a, const struct LDKCommitmentUpdate *NONNULL_PTR b);
42379 * Calls the free function if one is set
42381 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
42384 * Calls the free function if one is set
42386 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
42389 * Calls the free function if one is set
42391 void OnionMessageHandler_free(struct LDKOnionMessageHandler this_ptr);
42394 * Frees any resources used by the FinalOnionHopData, if is_owned is set and inner is non-NULL.
42396 void FinalOnionHopData_free(struct LDKFinalOnionHopData this_obj);
42399 * When sending a multi-part payment, this secret is used to identify a payment across HTLCs.
42400 * Because it is generated by the recipient and included in the invoice, it also provides
42401 * proof to the recipient that the payment was sent by someone with the generated invoice.
42403 const uint8_t (*FinalOnionHopData_get_payment_secret(const struct LDKFinalOnionHopData *NONNULL_PTR this_ptr))[32];
42406 * When sending a multi-part payment, this secret is used to identify a payment across HTLCs.
42407 * Because it is generated by the recipient and included in the invoice, it also provides
42408 * proof to the recipient that the payment was sent by someone with the generated invoice.
42410 void FinalOnionHopData_set_payment_secret(struct LDKFinalOnionHopData *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42413 * The intended total amount that this payment is for.
42415 * Message serialization may panic if this value is more than 21 million Bitcoin.
42417 uint64_t FinalOnionHopData_get_total_msat(const struct LDKFinalOnionHopData *NONNULL_PTR this_ptr);
42420 * The intended total amount that this payment is for.
42422 * Message serialization may panic if this value is more than 21 million Bitcoin.
42424 void FinalOnionHopData_set_total_msat(struct LDKFinalOnionHopData *NONNULL_PTR this_ptr, uint64_t val);
42427 * Constructs a new FinalOnionHopData given each field
42429 MUST_USE_RES struct LDKFinalOnionHopData FinalOnionHopData_new(struct LDKThirtyTwoBytes payment_secret_arg, uint64_t total_msat_arg);
42432 * Creates a copy of the FinalOnionHopData
42434 struct LDKFinalOnionHopData FinalOnionHopData_clone(const struct LDKFinalOnionHopData *NONNULL_PTR orig);
42437 * Frees any resources used by the OnionPacket, if is_owned is set and inner is non-NULL.
42439 void OnionPacket_free(struct LDKOnionPacket this_obj);
42442 * BOLT 4 version number.
42444 uint8_t OnionPacket_get_version(const struct LDKOnionPacket *NONNULL_PTR this_ptr);
42447 * BOLT 4 version number.
42449 void OnionPacket_set_version(struct LDKOnionPacket *NONNULL_PTR this_ptr, uint8_t val);
42452 * In order to ensure we always return an error on onion decode in compliance with [BOLT
42453 * #4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md), we have to
42454 * deserialize `OnionPacket`s contained in [`UpdateAddHTLC`] messages even if the ephemeral
42455 * public key (here) is bogus, so we hold a [`Result`] instead of a [`PublicKey`] as we'd
42458 * Returns a copy of the field.
42460 struct LDKCResult_PublicKeySecp256k1ErrorZ OnionPacket_get_public_key(const struct LDKOnionPacket *NONNULL_PTR this_ptr);
42463 * In order to ensure we always return an error on onion decode in compliance with [BOLT
42464 * #4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md), we have to
42465 * deserialize `OnionPacket`s contained in [`UpdateAddHTLC`] messages even if the ephemeral
42466 * public key (here) is bogus, so we hold a [`Result`] instead of a [`PublicKey`] as we'd
42469 void OnionPacket_set_public_key(struct LDKOnionPacket *NONNULL_PTR this_ptr, struct LDKCResult_PublicKeySecp256k1ErrorZ val);
42472 * HMAC to verify the integrity of hop_data.
42474 const uint8_t (*OnionPacket_get_hmac(const struct LDKOnionPacket *NONNULL_PTR this_ptr))[32];
42477 * HMAC to verify the integrity of hop_data.
42479 void OnionPacket_set_hmac(struct LDKOnionPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42482 * Creates a copy of the OnionPacket
42484 struct LDKOnionPacket OnionPacket_clone(const struct LDKOnionPacket *NONNULL_PTR orig);
42487 * Generates a non-cryptographic 64-bit hash of the OnionPacket.
42489 uint64_t OnionPacket_hash(const struct LDKOnionPacket *NONNULL_PTR o);
42492 * Checks if two OnionPackets contain equal inner contents.
42493 * This ignores pointers and is_owned flags and looks at the values in fields.
42494 * Two objects with NULL inner values will be considered "equal" here.
42496 bool OnionPacket_eq(const struct LDKOnionPacket *NONNULL_PTR a, const struct LDKOnionPacket *NONNULL_PTR b);
42499 * Frees any resources used by the TrampolineOnionPacket, if is_owned is set and inner is non-NULL.
42501 void TrampolineOnionPacket_free(struct LDKTrampolineOnionPacket this_obj);
42504 * Bolt 04 version number
42506 uint8_t TrampolineOnionPacket_get_version(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr);
42509 * Bolt 04 version number
42511 void TrampolineOnionPacket_set_version(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, uint8_t val);
42514 * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
42516 struct LDKPublicKey TrampolineOnionPacket_get_public_key(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr);
42519 * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
42521 void TrampolineOnionPacket_set_public_key(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, struct LDKPublicKey val);
42524 * Encrypted payload for the next hop
42526 * Returns a copy of the field.
42528 struct LDKCVec_u8Z TrampolineOnionPacket_get_hop_data(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr);
42531 * Encrypted payload for the next hop
42533 void TrampolineOnionPacket_set_hop_data(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
42536 * HMAC to verify the integrity of hop_data
42538 const uint8_t (*TrampolineOnionPacket_get_hmac(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr))[32];
42541 * HMAC to verify the integrity of hop_data
42543 void TrampolineOnionPacket_set_hmac(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42546 * Constructs a new TrampolineOnionPacket given each field
42548 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);
42551 * Creates a copy of the TrampolineOnionPacket
42553 struct LDKTrampolineOnionPacket TrampolineOnionPacket_clone(const struct LDKTrampolineOnionPacket *NONNULL_PTR orig);
42556 * Generates a non-cryptographic 64-bit hash of the TrampolineOnionPacket.
42558 uint64_t TrampolineOnionPacket_hash(const struct LDKTrampolineOnionPacket *NONNULL_PTR o);
42561 * Checks if two TrampolineOnionPackets contain equal inner contents.
42562 * This ignores pointers and is_owned flags and looks at the values in fields.
42563 * Two objects with NULL inner values will be considered "equal" here.
42565 bool TrampolineOnionPacket_eq(const struct LDKTrampolineOnionPacket *NONNULL_PTR a, const struct LDKTrampolineOnionPacket *NONNULL_PTR b);
42568 * Serialize the TrampolineOnionPacket object into a byte array which can be read by TrampolineOnionPacket_read
42570 struct LDKCVec_u8Z TrampolineOnionPacket_write(const struct LDKTrampolineOnionPacket *NONNULL_PTR obj);
42573 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
42575 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
42578 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
42580 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
42583 * Serialize the AcceptChannelV2 object into a byte array which can be read by AcceptChannelV2_read
42585 struct LDKCVec_u8Z AcceptChannelV2_write(const struct LDKAcceptChannelV2 *NONNULL_PTR obj);
42588 * Read a AcceptChannelV2 from a byte array, created by AcceptChannelV2_write
42590 struct LDKCResult_AcceptChannelV2DecodeErrorZ AcceptChannelV2_read(struct LDKu8slice ser);
42593 * Serialize the Stfu object into a byte array which can be read by Stfu_read
42595 struct LDKCVec_u8Z Stfu_write(const struct LDKStfu *NONNULL_PTR obj);
42598 * Read a Stfu from a byte array, created by Stfu_write
42600 struct LDKCResult_StfuDecodeErrorZ Stfu_read(struct LDKu8slice ser);
42603 * Serialize the Splice object into a byte array which can be read by Splice_read
42605 struct LDKCVec_u8Z Splice_write(const struct LDKSplice *NONNULL_PTR obj);
42608 * Read a Splice from a byte array, created by Splice_write
42610 struct LDKCResult_SpliceDecodeErrorZ Splice_read(struct LDKu8slice ser);
42613 * Serialize the SpliceAck object into a byte array which can be read by SpliceAck_read
42615 struct LDKCVec_u8Z SpliceAck_write(const struct LDKSpliceAck *NONNULL_PTR obj);
42618 * Read a SpliceAck from a byte array, created by SpliceAck_write
42620 struct LDKCResult_SpliceAckDecodeErrorZ SpliceAck_read(struct LDKu8slice ser);
42623 * Serialize the SpliceLocked object into a byte array which can be read by SpliceLocked_read
42625 struct LDKCVec_u8Z SpliceLocked_write(const struct LDKSpliceLocked *NONNULL_PTR obj);
42628 * Read a SpliceLocked from a byte array, created by SpliceLocked_write
42630 struct LDKCResult_SpliceLockedDecodeErrorZ SpliceLocked_read(struct LDKu8slice ser);
42633 * Serialize the TxAddInput object into a byte array which can be read by TxAddInput_read
42635 struct LDKCVec_u8Z TxAddInput_write(const struct LDKTxAddInput *NONNULL_PTR obj);
42638 * Read a TxAddInput from a byte array, created by TxAddInput_write
42640 struct LDKCResult_TxAddInputDecodeErrorZ TxAddInput_read(struct LDKu8slice ser);
42643 * Serialize the TxAddOutput object into a byte array which can be read by TxAddOutput_read
42645 struct LDKCVec_u8Z TxAddOutput_write(const struct LDKTxAddOutput *NONNULL_PTR obj);
42648 * Read a TxAddOutput from a byte array, created by TxAddOutput_write
42650 struct LDKCResult_TxAddOutputDecodeErrorZ TxAddOutput_read(struct LDKu8slice ser);
42653 * Serialize the TxRemoveInput object into a byte array which can be read by TxRemoveInput_read
42655 struct LDKCVec_u8Z TxRemoveInput_write(const struct LDKTxRemoveInput *NONNULL_PTR obj);
42658 * Read a TxRemoveInput from a byte array, created by TxRemoveInput_write
42660 struct LDKCResult_TxRemoveInputDecodeErrorZ TxRemoveInput_read(struct LDKu8slice ser);
42663 * Serialize the TxRemoveOutput object into a byte array which can be read by TxRemoveOutput_read
42665 struct LDKCVec_u8Z TxRemoveOutput_write(const struct LDKTxRemoveOutput *NONNULL_PTR obj);
42668 * Read a TxRemoveOutput from a byte array, created by TxRemoveOutput_write
42670 struct LDKCResult_TxRemoveOutputDecodeErrorZ TxRemoveOutput_read(struct LDKu8slice ser);
42673 * Serialize the TxComplete object into a byte array which can be read by TxComplete_read
42675 struct LDKCVec_u8Z TxComplete_write(const struct LDKTxComplete *NONNULL_PTR obj);
42678 * Read a TxComplete from a byte array, created by TxComplete_write
42680 struct LDKCResult_TxCompleteDecodeErrorZ TxComplete_read(struct LDKu8slice ser);
42683 * Serialize the TxSignatures object into a byte array which can be read by TxSignatures_read
42685 struct LDKCVec_u8Z TxSignatures_write(const struct LDKTxSignatures *NONNULL_PTR obj);
42688 * Read a TxSignatures from a byte array, created by TxSignatures_write
42690 struct LDKCResult_TxSignaturesDecodeErrorZ TxSignatures_read(struct LDKu8slice ser);
42693 * Serialize the TxInitRbf object into a byte array which can be read by TxInitRbf_read
42695 struct LDKCVec_u8Z TxInitRbf_write(const struct LDKTxInitRbf *NONNULL_PTR obj);
42698 * Read a TxInitRbf from a byte array, created by TxInitRbf_write
42700 struct LDKCResult_TxInitRbfDecodeErrorZ TxInitRbf_read(struct LDKu8slice ser);
42703 * Serialize the TxAckRbf object into a byte array which can be read by TxAckRbf_read
42705 struct LDKCVec_u8Z TxAckRbf_write(const struct LDKTxAckRbf *NONNULL_PTR obj);
42708 * Read a TxAckRbf from a byte array, created by TxAckRbf_write
42710 struct LDKCResult_TxAckRbfDecodeErrorZ TxAckRbf_read(struct LDKu8slice ser);
42713 * Serialize the TxAbort object into a byte array which can be read by TxAbort_read
42715 struct LDKCVec_u8Z TxAbort_write(const struct LDKTxAbort *NONNULL_PTR obj);
42718 * Read a TxAbort from a byte array, created by TxAbort_write
42720 struct LDKCResult_TxAbortDecodeErrorZ TxAbort_read(struct LDKu8slice ser);
42723 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
42725 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
42728 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
42730 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
42733 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
42735 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
42738 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
42740 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
42743 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
42745 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
42748 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
42750 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
42753 * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
42755 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
42758 * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
42760 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
42763 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
42765 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
42768 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
42770 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
42773 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
42775 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
42778 * Read a FundingCreated from a byte array, created by FundingCreated_write
42780 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
42783 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
42785 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
42788 * Read a FundingSigned from a byte array, created by FundingSigned_write
42790 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
42793 * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
42795 struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj);
42798 * Read a ChannelReady from a byte array, created by ChannelReady_write
42800 struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser);
42803 * Serialize the Init object into a byte array which can be read by Init_read
42805 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
42808 * Read a Init from a byte array, created by Init_write
42810 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
42813 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
42815 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
42818 * Read a OpenChannel from a byte array, created by OpenChannel_write
42820 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
42823 * Serialize the OpenChannelV2 object into a byte array which can be read by OpenChannelV2_read
42825 struct LDKCVec_u8Z OpenChannelV2_write(const struct LDKOpenChannelV2 *NONNULL_PTR obj);
42828 * Read a OpenChannelV2 from a byte array, created by OpenChannelV2_write
42830 struct LDKCResult_OpenChannelV2DecodeErrorZ OpenChannelV2_read(struct LDKu8slice ser);
42833 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
42835 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
42838 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
42840 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
42843 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
42845 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
42848 * Read a Shutdown from a byte array, created by Shutdown_write
42850 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
42853 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
42855 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
42858 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
42860 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
42863 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
42865 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
42868 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
42870 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
42873 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
42875 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
42878 * Read a UpdateFee from a byte array, created by UpdateFee_write
42880 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
42883 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
42885 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
42888 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
42890 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
42893 * Serialize the OnionPacket object into a byte array which can be read by OnionPacket_read
42895 struct LDKCVec_u8Z OnionPacket_write(const struct LDKOnionPacket *NONNULL_PTR obj);
42898 * Read a OnionPacket from a byte array, created by OnionPacket_write
42900 struct LDKCResult_OnionPacketDecodeErrorZ OnionPacket_read(struct LDKu8slice ser);
42903 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
42905 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
42908 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
42910 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
42913 * Read a OnionMessage from a byte array, created by OnionMessage_write
42915 struct LDKCResult_OnionMessageDecodeErrorZ OnionMessage_read(struct LDKu8slice ser);
42918 * Serialize the OnionMessage object into a byte array which can be read by OnionMessage_read
42920 struct LDKCVec_u8Z OnionMessage_write(const struct LDKOnionMessage *NONNULL_PTR obj);
42923 * Serialize the FinalOnionHopData object into a byte array which can be read by FinalOnionHopData_read
42925 struct LDKCVec_u8Z FinalOnionHopData_write(const struct LDKFinalOnionHopData *NONNULL_PTR obj);
42928 * Read a FinalOnionHopData from a byte array, created by FinalOnionHopData_write
42930 struct LDKCResult_FinalOnionHopDataDecodeErrorZ FinalOnionHopData_read(struct LDKu8slice ser);
42933 * Serialize the Ping object into a byte array which can be read by Ping_read
42935 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
42938 * Read a Ping from a byte array, created by Ping_write
42940 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
42943 * Serialize the Pong object into a byte array which can be read by Pong_read
42945 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
42948 * Read a Pong from a byte array, created by Pong_write
42950 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
42953 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
42955 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
42958 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
42960 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
42963 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
42965 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
42968 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
42970 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
42973 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
42975 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
42978 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
42980 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
42983 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
42985 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
42988 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
42990 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
42993 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
42995 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
42998 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
43000 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
43003 * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
43005 struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
43008 * Read a WarningMessage from a byte array, created by WarningMessage_write
43010 struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
43013 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
43015 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
43018 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
43020 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
43023 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
43025 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
43028 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
43030 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
43033 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
43035 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
43038 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
43040 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
43043 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
43045 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
43048 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
43050 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
43053 * Calculates the overflow safe ending block height for the query.
43055 * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`.
43057 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
43060 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
43062 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
43065 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
43067 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
43070 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
43072 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
43075 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
43077 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
43080 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
43082 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
43085 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
43087 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
43090 * Calls the free function if one is set
43092 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
43095 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
43097 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
43100 * Constructs a new IgnoringMessageHandler given each field
43102 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
43105 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
43106 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
43108 struct LDKEventsProvider IgnoringMessageHandler_as_EventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
43111 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
43112 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
43114 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
43117 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
43118 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
43120 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
43123 * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
43124 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
43126 struct LDKOnionMessageHandler IgnoringMessageHandler_as_OnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
43129 * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
43130 * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
43132 struct LDKOffersMessageHandler IgnoringMessageHandler_as_OffersMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
43135 * Constructs a new CustomOnionMessageHandler which calls the relevant methods on this_arg.
43136 * This copies the `inner` pointer in this_arg and thus the returned CustomOnionMessageHandler must be freed before this_arg is
43138 struct LDKCustomOnionMessageHandler IgnoringMessageHandler_as_CustomOnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
43141 * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
43142 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
43144 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
43147 * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
43148 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
43150 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
43153 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
43155 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
43158 * Constructs a new ErroringMessageHandler
43160 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
43163 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
43164 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
43166 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
43169 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
43170 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
43172 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
43175 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
43177 void MessageHandler_free(struct LDKMessageHandler this_obj);
43180 * A message handler which handles messages specific to channels. Usually this is just a
43181 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
43183 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
43185 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
43188 * A message handler which handles messages specific to channels. Usually this is just a
43189 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
43191 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
43193 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
43196 * A message handler which handles messages updating our knowledge of the network channel
43197 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
43199 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
43201 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
43204 * A message handler which handles messages updating our knowledge of the network channel
43205 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
43207 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
43209 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
43212 * A message handler which handles onion messages. This should generally be an
43213 * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
43215 * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
43217 const struct LDKOnionMessageHandler *MessageHandler_get_onion_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
43220 * A message handler which handles onion messages. This should generally be an
43221 * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
43223 * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
43225 void MessageHandler_set_onion_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKOnionMessageHandler val);
43228 * A message handler which handles custom messages. The only LDK-provided implementation is
43229 * [`IgnoringMessageHandler`].
43231 const struct LDKCustomMessageHandler *MessageHandler_get_custom_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
43234 * A message handler which handles custom messages. The only LDK-provided implementation is
43235 * [`IgnoringMessageHandler`].
43237 void MessageHandler_set_custom_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKCustomMessageHandler val);
43240 * Constructs a new MessageHandler given each field
43242 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);
43245 * Creates a copy of a SocketDescriptor
43247 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
43250 * Calls the free function if one is set
43252 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
43255 * Frees any resources used by the PeerDetails, if is_owned is set and inner is non-NULL.
43257 void PeerDetails_free(struct LDKPeerDetails this_obj);
43260 * The node id of the peer.
43262 * For outbound connections, this [`PublicKey`] will be the same as the `their_node_id` parameter
43263 * passed in to [`PeerManager::new_outbound_connection`].
43265 struct LDKPublicKey PeerDetails_get_counterparty_node_id(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
43268 * The node id of the peer.
43270 * For outbound connections, this [`PublicKey`] will be the same as the `their_node_id` parameter
43271 * passed in to [`PeerManager::new_outbound_connection`].
43273 void PeerDetails_set_counterparty_node_id(struct LDKPeerDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val);
43276 * The socket address the peer provided in the initial handshake.
43278 * Will only be `Some` if an address had been previously provided to
43279 * [`PeerManager::new_outbound_connection`] or [`PeerManager::new_inbound_connection`].
43281 * Returns a copy of the field.
43283 struct LDKCOption_SocketAddressZ PeerDetails_get_socket_address(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
43286 * The socket address the peer provided in the initial handshake.
43288 * Will only be `Some` if an address had been previously provided to
43289 * [`PeerManager::new_outbound_connection`] or [`PeerManager::new_inbound_connection`].
43291 void PeerDetails_set_socket_address(struct LDKPeerDetails *NONNULL_PTR this_ptr, struct LDKCOption_SocketAddressZ val);
43294 * The features the peer provided in the initial handshake.
43296 struct LDKInitFeatures PeerDetails_get_init_features(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
43299 * The features the peer provided in the initial handshake.
43301 void PeerDetails_set_init_features(struct LDKPeerDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
43304 * Indicates the direction of the peer connection.
43306 * Will be `true` for inbound connections, and `false` for outbound connections.
43308 bool PeerDetails_get_is_inbound_connection(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
43311 * Indicates the direction of the peer connection.
43313 * Will be `true` for inbound connections, and `false` for outbound connections.
43315 void PeerDetails_set_is_inbound_connection(struct LDKPeerDetails *NONNULL_PTR this_ptr, bool val);
43318 * Constructs a new PeerDetails given each field
43320 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);
43323 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
43325 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
43328 * Constructs a new PeerHandleError given each field
43330 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(void);
43333 * Creates a copy of the PeerHandleError
43335 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
43338 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
43340 void PeerManager_free(struct LDKPeerManager this_obj);
43343 * Constructs a new `PeerManager` with the given message handlers.
43345 * `ephemeral_random_data` is used to derive per-connection ephemeral keys and must be
43346 * cryptographically secure random bytes.
43348 * `current_time` is used as an always-increasing counter that survives across restarts and is
43349 * incremented irregularly internally. In general it is best to simply use the current UNIX
43350 * timestamp, however if it is not available a persistent counter that increases once per
43351 * minute should suffice.
43353 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);
43356 * Returns a list of [`PeerDetails`] for connected peers that have completed the initial
43359 MUST_USE_RES struct LDKCVec_PeerDetailsZ PeerManager_list_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
43362 * Returns the [`PeerDetails`] of a connected peer that has completed the initial handshake.
43364 * Will return `None` if the peer is unknown or it hasn't completed the initial handshake.
43366 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43368 MUST_USE_RES struct LDKPeerDetails PeerManager_peer_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id);
43371 * Indicates a new outbound connection has been established to a node with the given `node_id`
43372 * and an optional remote network address.
43374 * The remote network address adds the option to report a remote IP address back to a connecting
43375 * peer using the init message.
43376 * The user should pass the remote network address of the host they are connected to.
43378 * If an `Err` is returned here you must disconnect the connection immediately.
43380 * Returns a small number of bytes to send to the remote node (currently always 50).
43382 * Panics if descriptor is duplicative with some other descriptor which has not yet been
43383 * [`socket_disconnected`].
43385 * [`socket_disconnected`]: PeerManager::socket_disconnected
43387 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);
43390 * Indicates a new inbound connection has been established to a node with an optional remote
43393 * The remote network address adds the option to report a remote IP address back to a connecting
43394 * peer using the init message.
43395 * The user should pass the remote network address of the host they are connected to.
43397 * May refuse the connection by returning an Err, but will never write bytes to the remote end
43398 * (outbound connector always speaks first). If an `Err` is returned here you must disconnect
43399 * the connection immediately.
43401 * Panics if descriptor is duplicative with some other descriptor which has not yet been
43402 * [`socket_disconnected`].
43404 * [`socket_disconnected`]: PeerManager::socket_disconnected
43406 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);
43409 * Indicates that there is room to write data to the given socket descriptor.
43411 * May return an Err to indicate that the connection should be closed.
43413 * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
43414 * returning. Thus, be very careful with reentrancy issues! The invariants around calling
43415 * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
43416 * ready to call [`write_buffer_space_avail`] again if a write call generated here isn't
43419 * [`send_data`]: SocketDescriptor::send_data
43420 * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
43422 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
43425 * Indicates that data was read from the given socket descriptor.
43427 * May return an Err to indicate that the connection should be closed.
43429 * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
43430 * Thus, however, you should call [`process_events`] after any `read_event` to generate
43431 * [`send_data`] calls to handle responses.
43433 * If `Ok(true)` is returned, further read_events should not be triggered until a
43434 * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
43437 * In order to avoid processing too many messages at once per peer, `data` should be on the
43440 * [`send_data`]: SocketDescriptor::send_data
43441 * [`process_events`]: PeerManager::process_events
43443 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);
43446 * Checks for any events generated by our handlers and processes them. Includes sending most
43447 * response messages as well as messages generated by calls to handler functions directly (eg
43448 * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
43450 * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
43453 * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
43454 * or one of the other clients provided in our language bindings.
43456 * Note that if there are any other calls to this function waiting on lock(s) this may return
43457 * without doing any work. All available events that need handling will be handled before the
43458 * other calls return.
43460 * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
43461 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
43462 * [`send_data`]: SocketDescriptor::send_data
43464 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
43467 * Indicates that the given socket descriptor's connection is now closed.
43469 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
43472 * Disconnect a peer given its node id.
43474 * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
43475 * peer. Thus, be very careful about reentrancy issues.
43477 * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
43479 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
43482 * Disconnects all currently-connected peers. This is useful on platforms where there may be
43483 * an indication that TCP sockets have stalled even if we weren't around to time them out
43484 * using regular ping/pongs.
43486 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
43489 * Send pings to each peer and disconnect those which did not respond to the last round of
43492 * This may be called on any timescale you want, however, roughly once every ten seconds is
43493 * preferred. The call rate determines both how often we send a ping to our peers and how much
43494 * time they have to respond before we disconnect them.
43496 * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
43499 * [`send_data`]: SocketDescriptor::send_data
43501 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
43504 * Generates a signed node_announcement from the given arguments, sending it to all connected
43505 * peers. Note that peers will likely ignore this message unless we have at least one public
43506 * channel which has at least six confirmations on-chain.
43508 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
43509 * node to humans. They carry no in-protocol meaning.
43511 * `addresses` represent the set (possibly empty) of socket addresses on which this node
43512 * accepts incoming connections. These will be included in the node_announcement, publicly
43513 * tying these addresses together and to this node. If you wish to preserve user privacy,
43514 * addresses should likely contain only Tor Onion addresses.
43516 * Panics if `addresses` is absurdly large (more than 100).
43518 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
43520 void PeerManager_broadcast_node_announcement(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_SocketAddressZ addresses);
43523 * Gets the weight for an HTLC-Success transaction.
43525 uint64_t htlc_success_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
43528 * Gets the weight for an HTLC-Timeout transaction.
43530 uint64_t htlc_timeout_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
43533 * Creates a copy of the HTLCClaim
43535 enum LDKHTLCClaim HTLCClaim_clone(const enum LDKHTLCClaim *NONNULL_PTR orig);
43538 * Utility method to constructs a new OfferedTimeout-variant HTLCClaim
43540 enum LDKHTLCClaim HTLCClaim_offered_timeout(void);
43543 * Utility method to constructs a new OfferedPreimage-variant HTLCClaim
43545 enum LDKHTLCClaim HTLCClaim_offered_preimage(void);
43548 * Utility method to constructs a new AcceptedTimeout-variant HTLCClaim
43550 enum LDKHTLCClaim HTLCClaim_accepted_timeout(void);
43553 * Utility method to constructs a new AcceptedPreimage-variant HTLCClaim
43555 enum LDKHTLCClaim HTLCClaim_accepted_preimage(void);
43558 * Utility method to constructs a new Revocation-variant HTLCClaim
43560 enum LDKHTLCClaim HTLCClaim_revocation(void);
43563 * Checks if two HTLCClaims contain equal inner contents.
43564 * This ignores pointers and is_owned flags and looks at the values in fields.
43566 bool HTLCClaim_eq(const enum LDKHTLCClaim *NONNULL_PTR a, const enum LDKHTLCClaim *NONNULL_PTR b);
43569 * Check if a given input witness attempts to claim a HTLC.
43571 MUST_USE_RES struct LDKCOption_HTLCClaimZ HTLCClaim_from_witness(struct LDKWitness witness);
43574 * Build the commitment secret from the seed and the commitment number
43576 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
43579 * Build a closing transaction
43581 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);
43584 * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
43586 void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
43589 * Creates a copy of the CounterpartyCommitmentSecrets
43591 struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
43594 * Creates a new empty `CounterpartyCommitmentSecrets` structure.
43596 MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
43599 * Returns the minimum index of all stored secrets. Note that indexes start
43600 * at 1 << 48 and get decremented by one for each new secret.
43602 MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
43605 * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
43606 * was generated in accordance with BOLT 3 and is consistent with previous secrets.
43608 MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
43611 * Returns the secret at `idx`.
43612 * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
43614 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43616 MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
43619 * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
43621 struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
43624 * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
43626 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
43629 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
43630 * from the base secret and the per_commitment_point.
43632 struct LDKSecretKey derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
43635 * Derives a per-commitment-transaction revocation key from its constituent parts.
43637 * Only the cheating participant owns a valid witness to propagate a revoked
43638 * commitment transaction, thus per_commitment_secret always come from cheater
43639 * and revocation_base_secret always come from punisher, which is the broadcaster
43640 * of the transaction spending with this key knowledge.
43642 struct LDKSecretKey derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
43645 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
43647 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
43650 * The broadcaster's per-commitment public key which was used to derive the other keys.
43652 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
43655 * The broadcaster's per-commitment public key which was used to derive the other keys.
43657 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
43660 * The revocation key which is used to allow the broadcaster of the commitment
43661 * transaction to provide their counterparty the ability to punish them if they broadcast
43664 struct LDKRevocationKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
43667 * The revocation key which is used to allow the broadcaster of the commitment
43668 * transaction to provide their counterparty the ability to punish them if they broadcast
43671 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKRevocationKey val);
43674 * Broadcaster's HTLC Key
43676 struct LDKHtlcKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
43679 * Broadcaster's HTLC Key
43681 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKHtlcKey val);
43684 * Countersignatory's HTLC Key
43686 struct LDKHtlcKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
43689 * Countersignatory's HTLC Key
43691 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKHtlcKey val);
43694 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
43696 struct LDKDelayedPaymentKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
43699 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
43701 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKDelayedPaymentKey val);
43704 * Constructs a new TxCreationKeys given each field
43706 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);
43709 * Checks if two TxCreationKeyss contain equal inner contents.
43710 * This ignores pointers and is_owned flags and looks at the values in fields.
43711 * Two objects with NULL inner values will be considered "equal" here.
43713 bool TxCreationKeys_eq(const struct LDKTxCreationKeys *NONNULL_PTR a, const struct LDKTxCreationKeys *NONNULL_PTR b);
43716 * Creates a copy of the TxCreationKeys
43718 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
43721 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
43723 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
43726 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
43728 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
43731 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
43733 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
43736 * The public key which is used to sign all commitment transactions, as it appears in the
43737 * on-chain channel lock-in 2-of-2 multisig output.
43739 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
43742 * The public key which is used to sign all commitment transactions, as it appears in the
43743 * on-chain channel lock-in 2-of-2 multisig output.
43745 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
43748 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
43749 * revocation keys. This is combined with the per-commitment-secret generated by the
43750 * counterparty to create a secret which the counterparty can reveal to revoke previous
43753 struct LDKRevocationBasepoint ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
43756 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
43757 * revocation keys. This is combined with the per-commitment-secret generated by the
43758 * counterparty to create a secret which the counterparty can reveal to revoke previous
43761 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKRevocationBasepoint val);
43764 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
43765 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
43766 * static across every commitment transaction.
43768 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
43771 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
43772 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
43773 * static across every commitment transaction.
43775 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
43778 * The base point which is used (with derive_public_key) to derive a per-commitment payment
43779 * public key which receives non-HTLC-encumbered funds which are only available for spending
43780 * after some delay (or can be claimed via the revocation path).
43782 struct LDKDelayedPaymentBasepoint ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
43785 * The base point which is used (with derive_public_key) to derive a per-commitment payment
43786 * public key which receives non-HTLC-encumbered funds which are only available for spending
43787 * after some delay (or can be claimed via the revocation path).
43789 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKDelayedPaymentBasepoint val);
43792 * The base point which is used (with derive_public_key) to derive a per-commitment public key
43793 * which is used to encumber HTLC-in-flight outputs.
43795 struct LDKHtlcBasepoint ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
43798 * The base point which is used (with derive_public_key) to derive a per-commitment public key
43799 * which is used to encumber HTLC-in-flight outputs.
43801 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKHtlcBasepoint val);
43804 * Constructs a new ChannelPublicKeys given each field
43806 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);
43809 * Creates a copy of the ChannelPublicKeys
43811 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
43814 * Generates a non-cryptographic 64-bit hash of the ChannelPublicKeys.
43816 uint64_t ChannelPublicKeys_hash(const struct LDKChannelPublicKeys *NONNULL_PTR o);
43819 * Checks if two ChannelPublicKeyss contain equal inner contents.
43820 * This ignores pointers and is_owned flags and looks at the values in fields.
43821 * Two objects with NULL inner values will be considered "equal" here.
43823 bool ChannelPublicKeys_eq(const struct LDKChannelPublicKeys *NONNULL_PTR a, const struct LDKChannelPublicKeys *NONNULL_PTR b);
43826 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
43828 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
43831 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
43833 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
43836 * Create per-state keys from channel base points and the per-commitment point.
43837 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
43839 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);
43842 * Generate per-state keys from channel static keys.
43843 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
43845 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);
43848 * A script either spendable by the revocation
43849 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
43850 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
43852 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);
43855 * Returns the script for the counterparty's output on a holder's commitment transaction based on
43856 * the channel type.
43858 struct LDKCVec_u8Z get_counterparty_payment_script(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, struct LDKPublicKey payment_key);
43861 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
43863 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
43866 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
43867 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
43868 * need to compare this value to whether the commitment transaction in question is that of
43869 * the counterparty or our own.
43871 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
43874 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
43875 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
43876 * need to compare this value to whether the commitment transaction in question is that of
43877 * the counterparty or our own.
43879 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
43882 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
43883 * this divided by 1000.
43885 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
43888 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
43889 * this divided by 1000.
43891 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
43894 * The CLTV lock-time at which this HTLC expires.
43896 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
43899 * The CLTV lock-time at which this HTLC expires.
43901 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
43904 * The hash of the preimage which unlocks this HTLC.
43906 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
43909 * The hash of the preimage which unlocks this HTLC.
43911 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43914 * The position within the commitment transactions' outputs. This may be None if the value is
43915 * below the dust limit (in which case no output appears in the commitment transaction and the
43916 * value is spent to additional transaction fees).
43918 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
43921 * The position within the commitment transactions' outputs. This may be None if the value is
43922 * below the dust limit (in which case no output appears in the commitment transaction and the
43923 * value is spent to additional transaction fees).
43925 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
43928 * Constructs a new HTLCOutputInCommitment given each field
43930 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);
43933 * Creates a copy of the HTLCOutputInCommitment
43935 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
43938 * Checks if two HTLCOutputInCommitments contain equal inner contents.
43939 * This ignores pointers and is_owned flags and looks at the values in fields.
43940 * Two objects with NULL inner values will be considered "equal" here.
43942 bool HTLCOutputInCommitment_eq(const struct LDKHTLCOutputInCommitment *NONNULL_PTR a, const struct LDKHTLCOutputInCommitment *NONNULL_PTR b);
43945 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
43947 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
43950 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
43952 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
43955 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
43956 * does not need to have its previous_output_index filled.
43958 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);
43961 * Gets the redeemscript for a funding output from the two funding public keys.
43962 * Note that the order of funding public keys does not matter.
43964 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
43967 * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
43968 * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
43969 * transaction which needs signing, and can be used to construct an HTLC transaction which is
43970 * broadcastable given a counterparty HTLC signature.
43972 * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
43973 * commitment transaction).
43975 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);
43978 * Returns the witness required to satisfy and spend a HTLC input.
43980 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);
43983 * Gets the witnessScript for the to_remote output when anchors are enabled.
43985 struct LDKCVec_u8Z get_to_countersignatory_with_anchors_redeemscript(struct LDKPublicKey payment_point);
43988 * Gets the witnessScript for an anchor output from the funding public key.
43989 * The witness in the spending input must be:
43990 * <BIP 143 funding_signature>
43991 * After 16 blocks of confirmation, an alternative satisfying witness could be:
43993 * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
43995 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
43998 * Returns the witness required to satisfy and spend an anchor input.
44000 struct LDKWitness build_anchor_input_witness(struct LDKPublicKey funding_key, struct LDKECDSASignature funding_sig);
44003 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
44005 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
44008 * Holder public keys
44010 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
44013 * Holder public keys
44015 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
44018 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
44020 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
44023 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
44025 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
44028 * Whether the holder is the initiator of this channel.
44029 * This is an input to the commitment number obscure factor computation.
44031 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
44034 * Whether the holder is the initiator of this channel.
44035 * This is an input to the commitment number obscure factor computation.
44037 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
44040 * The late-bound counterparty channel transaction parameters.
44041 * These parameters are populated at the point in the protocol where the counterparty provides them.
44043 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44045 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
44048 * The late-bound counterparty channel transaction parameters.
44049 * These parameters are populated at the point in the protocol where the counterparty provides them.
44051 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
44053 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
44056 * The late-bound funding outpoint
44058 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44060 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
44063 * The late-bound funding outpoint
44065 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
44067 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
44070 * This channel's type, as negotiated during channel open. For old objects where this field
44071 * wasn't serialized, it will default to static_remote_key at deserialization.
44073 struct LDKChannelTypeFeatures ChannelTransactionParameters_get_channel_type_features(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
44076 * This channel's type, as negotiated during channel open. For old objects where this field
44077 * wasn't serialized, it will default to static_remote_key at deserialization.
44079 void ChannelTransactionParameters_set_channel_type_features(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
44082 * Constructs a new ChannelTransactionParameters given each field
44084 * Note that counterparty_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
44085 * Note that funding_outpoint_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
44087 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);
44090 * Creates a copy of the ChannelTransactionParameters
44092 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
44095 * Generates a non-cryptographic 64-bit hash of the ChannelTransactionParameters.
44097 uint64_t ChannelTransactionParameters_hash(const struct LDKChannelTransactionParameters *NONNULL_PTR o);
44100 * Checks if two ChannelTransactionParameterss contain equal inner contents.
44101 * This ignores pointers and is_owned flags and looks at the values in fields.
44102 * Two objects with NULL inner values will be considered "equal" here.
44104 bool ChannelTransactionParameters_eq(const struct LDKChannelTransactionParameters *NONNULL_PTR a, const struct LDKChannelTransactionParameters *NONNULL_PTR b);
44107 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
44109 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
44112 * Counter-party public keys
44114 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
44117 * Counter-party public keys
44119 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
44122 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
44124 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
44127 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
44129 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
44132 * Constructs a new CounterpartyChannelTransactionParameters given each field
44134 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
44137 * Creates a copy of the CounterpartyChannelTransactionParameters
44139 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
44142 * Generates a non-cryptographic 64-bit hash of the CounterpartyChannelTransactionParameters.
44144 uint64_t CounterpartyChannelTransactionParameters_hash(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR o);
44147 * Checks if two CounterpartyChannelTransactionParameterss contain equal inner contents.
44148 * This ignores pointers and is_owned flags and looks at the values in fields.
44149 * Two objects with NULL inner values will be considered "equal" here.
44151 bool CounterpartyChannelTransactionParameters_eq(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR a, const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR b);
44154 * Whether the late bound parameters are populated.
44156 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
44159 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
44160 * given that the holder is the broadcaster.
44162 * self.is_populated() must be true before calling this function.
44164 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
44167 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
44168 * given that the counterparty is the broadcaster.
44170 * self.is_populated() must be true before calling this function.
44172 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
44175 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
44177 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
44180 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
44182 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
44185 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
44187 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
44190 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
44192 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
44195 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
44197 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
44200 * Get the channel pubkeys for the broadcaster
44202 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
44205 * Get the channel pubkeys for the countersignatory
44207 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
44210 * Get the contest delay applicable to the transactions.
44211 * Note that the contest delay was selected by the countersignatory.
44213 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
44216 * Whether the channel is outbound from the broadcaster.
44218 * The boolean representing the side that initiated the channel is
44219 * an input to the commitment number obscure factor computation.
44221 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
44224 * The funding outpoint
44226 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
44229 * Whether to use anchors for this channel
44231 MUST_USE_RES struct LDKChannelTypeFeatures DirectedChannelTransactionParameters_channel_type_features(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
44234 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
44236 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
44239 * Our counterparty's signature for the transaction
44241 struct LDKECDSASignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
44244 * Our counterparty's signature for the transaction
44246 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
44249 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
44251 * Returns a copy of the field.
44253 struct LDKCVec_ECDSASignatureZ HolderCommitmentTransaction_get_counterparty_htlc_sigs(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
44256 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
44258 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
44261 * Creates a copy of the HolderCommitmentTransaction
44263 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
44266 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
44268 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
44271 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
44273 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
44276 * Create a new holder transaction with the given counterparty signatures.
44277 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
44279 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);
44282 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
44284 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
44287 * The commitment transaction
44289 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
44292 * The commitment transaction
44294 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
44297 * The txid for the commitment transaction.
44299 * This is provided as a performance optimization, instead of calling transaction.txid()
44302 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
44305 * The txid for the commitment transaction.
44307 * This is provided as a performance optimization, instead of calling transaction.txid()
44310 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
44313 * Constructs a new BuiltCommitmentTransaction given each field
44315 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
44318 * Creates a copy of the BuiltCommitmentTransaction
44320 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
44323 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
44325 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
44328 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
44330 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
44333 * Get the SIGHASH_ALL sighash value of the transaction.
44335 * This can be used to verify a signature.
44337 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);
44340 * Signs the counterparty's commitment transaction.
44342 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);
44345 * Signs the holder commitment transaction because we are about to broadcast it.
44347 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);
44350 * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
44352 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
44355 * Creates a copy of the ClosingTransaction
44357 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
44360 * Generates a non-cryptographic 64-bit hash of the ClosingTransaction.
44362 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
44365 * Checks if two ClosingTransactions contain equal inner contents.
44366 * This ignores pointers and is_owned flags and looks at the values in fields.
44367 * Two objects with NULL inner values will be considered "equal" here.
44369 bool ClosingTransaction_eq(const struct LDKClosingTransaction *NONNULL_PTR a, const struct LDKClosingTransaction *NONNULL_PTR b);
44372 * Construct an object of the class
44374 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);
44377 * Trust our pre-built transaction.
44379 * Applies a wrapper which allows access to the transaction.
44381 * This should only be used if you fully trust the builder of this object. It should not
44382 * be used by an external signer - instead use the verify function.
44384 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
44387 * Verify our pre-built transaction.
44389 * Applies a wrapper which allows access to the transaction.
44391 * An external validating signer must call this method before signing
44392 * or using the built transaction.
44394 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
44397 * The value to be sent to the holder, or zero if the output will be omitted
44399 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
44402 * The value to be sent to the counterparty, or zero if the output will be omitted
44404 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
44407 * The destination of the holder's output
44409 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
44412 * The destination of the counterparty's output
44414 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
44417 * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
44419 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
44422 * The pre-built Bitcoin commitment transaction
44424 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
44427 * Get the SIGHASH_ALL sighash value of the transaction.
44429 * This can be used to verify a signature.
44431 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);
44434 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
44435 * because we are about to broadcast a holder transaction.
44437 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);
44440 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
44442 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
44445 * Creates a copy of the CommitmentTransaction
44447 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
44450 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
44452 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
44455 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
44457 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
44460 * The backwards-counting commitment number
44462 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
44465 * The per commitment point used by the broadcaster.
44467 MUST_USE_RES struct LDKPublicKey CommitmentTransaction_per_commitment_point(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
44470 * The value to be sent to the broadcaster
44472 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
44475 * The value to be sent to the counterparty
44477 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
44480 * The feerate paid per 1000-weight-unit in this commitment transaction.
44482 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
44485 * Trust our pre-built transaction and derived transaction creation public keys.
44487 * Applies a wrapper which allows access to these fields.
44489 * This should only be used if you fully trust the builder of this object. It should not
44490 * be used by an external signer - instead use the verify function.
44492 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
44495 * Verify our pre-built transaction and derived transaction creation public keys.
44497 * Applies a wrapper which allows access to these fields.
44499 * An external validating signer must call this method before signing
44500 * or using the built transaction.
44502 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);
44505 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
44507 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
44510 * The transaction ID of the built Bitcoin transaction
44512 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
44515 * The pre-built Bitcoin commitment transaction
44517 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
44520 * The pre-calculated transaction creation public keys.
44522 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
44525 * Should anchors be used.
44527 MUST_USE_RES struct LDKChannelTypeFeatures TrustedCommitmentTransaction_channel_type_features(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
44530 * Get a signature for each HTLC which was included in the commitment transaction (ie for
44531 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
44533 * The returned Vec has one entry for each HTLC, and in the same order.
44535 * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
44537 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);
44540 * Returns the index of the revokeable output, i.e. the `to_local` output sending funds to
44541 * the broadcaster, in the built transaction, if any exists.
44543 * There are two cases where this may return `None`:
44544 * - The balance of the revokeable output is below the dust limit (only found on commitments
44545 * early in the channel's lifetime, i.e. before the channel reserve is met).
44546 * - This commitment was created before LDK 0.0.117. In this case, the
44547 * commitment transaction previously didn't contain enough information to locate the
44548 * revokeable output.
44550 MUST_USE_RES struct LDKCOption_usizeZ TrustedCommitmentTransaction_revokeable_output_index(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
44553 * Helper method to build an unsigned justice transaction spending the revokeable
44554 * `to_local` output to a destination script. Fee estimation accounts for the expected
44555 * revocation witness data that will be added when signed.
44557 * This method will error if the given fee rate results in a fee greater than the value
44558 * of the output being spent, or if there exists no revokeable `to_local` output on this
44559 * commitment transaction. See [`Self::revokeable_output_index`] for more details.
44561 * The built transaction will allow fee bumping with RBF, and this method takes
44562 * `feerate_per_kw` as an input such that multiple copies of a justice transaction at different
44563 * fee rates may be built.
44565 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);
44568 * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
44569 * shared secret first. This prevents on-chain observers from discovering how many commitment
44570 * transactions occurred in a channel before it was closed.
44572 * This function gets the shared secret from relevant channel public keys and can be used to
44573 * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
44575 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
44578 * Checks if two InitFeaturess contain equal inner contents.
44579 * This ignores pointers and is_owned flags and looks at the values in fields.
44580 * Two objects with NULL inner values will be considered "equal" here.
44582 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
44585 * Checks if two NodeFeaturess contain equal inner contents.
44586 * This ignores pointers and is_owned flags and looks at the values in fields.
44587 * Two objects with NULL inner values will be considered "equal" here.
44589 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
44592 * Checks if two ChannelFeaturess contain equal inner contents.
44593 * This ignores pointers and is_owned flags and looks at the values in fields.
44594 * Two objects with NULL inner values will be considered "equal" here.
44596 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
44599 * Checks if two Bolt11InvoiceFeaturess contain equal inner contents.
44600 * This ignores pointers and is_owned flags and looks at the values in fields.
44601 * Two objects with NULL inner values will be considered "equal" here.
44603 bool Bolt11InvoiceFeatures_eq(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR b);
44606 * Checks if two OfferFeaturess contain equal inner contents.
44607 * This ignores pointers and is_owned flags and looks at the values in fields.
44608 * Two objects with NULL inner values will be considered "equal" here.
44610 bool OfferFeatures_eq(const struct LDKOfferFeatures *NONNULL_PTR a, const struct LDKOfferFeatures *NONNULL_PTR b);
44613 * Checks if two InvoiceRequestFeaturess contain equal inner contents.
44614 * This ignores pointers and is_owned flags and looks at the values in fields.
44615 * Two objects with NULL inner values will be considered "equal" here.
44617 bool InvoiceRequestFeatures_eq(const struct LDKInvoiceRequestFeatures *NONNULL_PTR a, const struct LDKInvoiceRequestFeatures *NONNULL_PTR b);
44620 * Checks if two Bolt12InvoiceFeaturess contain equal inner contents.
44621 * This ignores pointers and is_owned flags and looks at the values in fields.
44622 * Two objects with NULL inner values will be considered "equal" here.
44624 bool Bolt12InvoiceFeatures_eq(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR b);
44627 * Checks if two BlindedHopFeaturess contain equal inner contents.
44628 * This ignores pointers and is_owned flags and looks at the values in fields.
44629 * Two objects with NULL inner values will be considered "equal" here.
44631 bool BlindedHopFeatures_eq(const struct LDKBlindedHopFeatures *NONNULL_PTR a, const struct LDKBlindedHopFeatures *NONNULL_PTR b);
44634 * Checks if two ChannelTypeFeaturess contain equal inner contents.
44635 * This ignores pointers and is_owned flags and looks at the values in fields.
44636 * Two objects with NULL inner values will be considered "equal" here.
44638 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
44641 * Creates a copy of the InitFeatures
44643 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
44646 * Creates a copy of the NodeFeatures
44648 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
44651 * Creates a copy of the ChannelFeatures
44653 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
44656 * Creates a copy of the Bolt11InvoiceFeatures
44658 struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_clone(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR orig);
44661 * Creates a copy of the OfferFeatures
44663 struct LDKOfferFeatures OfferFeatures_clone(const struct LDKOfferFeatures *NONNULL_PTR orig);
44666 * Creates a copy of the InvoiceRequestFeatures
44668 struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_clone(const struct LDKInvoiceRequestFeatures *NONNULL_PTR orig);
44671 * Creates a copy of the Bolt12InvoiceFeatures
44673 struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_clone(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR orig);
44676 * Creates a copy of the BlindedHopFeatures
44678 struct LDKBlindedHopFeatures BlindedHopFeatures_clone(const struct LDKBlindedHopFeatures *NONNULL_PTR orig);
44681 * Creates a copy of the ChannelTypeFeatures
44683 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
44686 * Generates a non-cryptographic 64-bit hash of the InitFeatures.
44688 uint64_t InitFeatures_hash(const struct LDKInitFeatures *NONNULL_PTR o);
44691 * Generates a non-cryptographic 64-bit hash of the NodeFeatures.
44693 uint64_t NodeFeatures_hash(const struct LDKNodeFeatures *NONNULL_PTR o);
44696 * Generates a non-cryptographic 64-bit hash of the ChannelFeatures.
44698 uint64_t ChannelFeatures_hash(const struct LDKChannelFeatures *NONNULL_PTR o);
44701 * Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceFeatures.
44703 uint64_t Bolt11InvoiceFeatures_hash(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR o);
44706 * Generates a non-cryptographic 64-bit hash of the OfferFeatures.
44708 uint64_t OfferFeatures_hash(const struct LDKOfferFeatures *NONNULL_PTR o);
44711 * Generates a non-cryptographic 64-bit hash of the InvoiceRequestFeatures.
44713 uint64_t InvoiceRequestFeatures_hash(const struct LDKInvoiceRequestFeatures *NONNULL_PTR o);
44716 * Generates a non-cryptographic 64-bit hash of the Bolt12InvoiceFeatures.
44718 uint64_t Bolt12InvoiceFeatures_hash(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR o);
44721 * Generates a non-cryptographic 64-bit hash of the BlindedHopFeatures.
44723 uint64_t BlindedHopFeatures_hash(const struct LDKBlindedHopFeatures *NONNULL_PTR o);
44726 * Generates a non-cryptographic 64-bit hash of the ChannelTypeFeatures.
44728 uint64_t ChannelTypeFeatures_hash(const struct LDKChannelTypeFeatures *NONNULL_PTR o);
44731 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
44733 void InitFeatures_free(struct LDKInitFeatures this_obj);
44736 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
44738 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
44741 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
44743 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
44746 * Frees any resources used by the Bolt11InvoiceFeatures, if is_owned is set and inner is non-NULL.
44748 void Bolt11InvoiceFeatures_free(struct LDKBolt11InvoiceFeatures this_obj);
44751 * Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
44753 void OfferFeatures_free(struct LDKOfferFeatures this_obj);
44756 * Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
44758 void InvoiceRequestFeatures_free(struct LDKInvoiceRequestFeatures this_obj);
44761 * Frees any resources used by the Bolt12InvoiceFeatures, if is_owned is set and inner is non-NULL.
44763 void Bolt12InvoiceFeatures_free(struct LDKBolt12InvoiceFeatures this_obj);
44766 * Frees any resources used by the BlindedHopFeatures, if is_owned is set and inner is non-NULL.
44768 void BlindedHopFeatures_free(struct LDKBlindedHopFeatures this_obj);
44771 * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
44773 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
44776 * Create a blank Features with no features set
44778 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
44781 * Returns true if this `Features` object contains required features unknown by `other`.
44783 MUST_USE_RES bool InitFeatures_requires_unknown_bits_from(const struct LDKInitFeatures *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR other);
44786 * Returns true if this `Features` object contains unknown feature flags which are set as
44789 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
44792 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
44795 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
44796 * be set instead (i.e., `bit - 1`).
44798 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
44800 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44803 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
44806 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
44807 * set instead (i.e., `bit + 1`).
44809 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
44811 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44814 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
44815 * by [bLIP 2] or if it is a known `T` feature.
44817 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
44818 * be set instead (i.e., `bit - 1`).
44820 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
44822 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44825 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
44826 * by [bLIP 2] or if it is a known `T` feature.
44828 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
44829 * set instead (i.e., `bit + 1`).
44831 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
44833 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44836 * Create a blank Features with no features set
44838 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
44841 * Returns true if this `Features` object contains required features unknown by `other`.
44843 MUST_USE_RES bool NodeFeatures_requires_unknown_bits_from(const struct LDKNodeFeatures *NONNULL_PTR this_arg, const struct LDKNodeFeatures *NONNULL_PTR other);
44846 * Returns true if this `Features` object contains unknown feature flags which are set as
44849 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
44852 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
44855 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
44856 * be set instead (i.e., `bit - 1`).
44858 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
44860 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44863 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
44866 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
44867 * set instead (i.e., `bit + 1`).
44869 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
44871 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44874 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
44875 * by [bLIP 2] or if it is a known `T` feature.
44877 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
44878 * be set instead (i.e., `bit - 1`).
44880 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
44882 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44885 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
44886 * by [bLIP 2] or if it is a known `T` feature.
44888 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
44889 * set instead (i.e., `bit + 1`).
44891 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
44893 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44896 * Create a blank Features with no features set
44898 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
44901 * Returns true if this `Features` object contains required features unknown by `other`.
44903 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits_from(const struct LDKChannelFeatures *NONNULL_PTR this_arg, const struct LDKChannelFeatures *NONNULL_PTR other);
44906 * Returns true if this `Features` object contains unknown feature flags which are set as
44909 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
44912 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
44915 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
44916 * be set instead (i.e., `bit - 1`).
44918 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
44920 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44923 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
44926 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
44927 * set instead (i.e., `bit + 1`).
44929 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
44931 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44934 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
44935 * by [bLIP 2] or if it is a known `T` feature.
44937 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
44938 * be set instead (i.e., `bit - 1`).
44940 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
44942 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44945 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
44946 * by [bLIP 2] or if it is a known `T` feature.
44948 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
44949 * set instead (i.e., `bit + 1`).
44951 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
44953 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44956 * Create a blank Features with no features set
44958 MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_empty(void);
44961 * Returns true if this `Features` object contains required features unknown by `other`.
44963 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR other);
44966 * Returns true if this `Features` object contains unknown feature flags which are set as
44969 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
44972 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
44975 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
44976 * be set instead (i.e., `bit - 1`).
44978 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
44980 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44983 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
44986 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
44987 * set instead (i.e., `bit + 1`).
44989 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
44991 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44994 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
44995 * by [bLIP 2] or if it is a known `T` feature.
44997 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
44998 * be set instead (i.e., `bit - 1`).
45000 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45002 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45005 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
45006 * by [bLIP 2] or if it is a known `T` feature.
45008 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45009 * set instead (i.e., `bit + 1`).
45011 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45013 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45016 * Create a blank Features with no features set
45018 MUST_USE_RES struct LDKOfferFeatures OfferFeatures_empty(void);
45021 * Returns true if this `Features` object contains required features unknown by `other`.
45023 MUST_USE_RES bool OfferFeatures_requires_unknown_bits_from(const struct LDKOfferFeatures *NONNULL_PTR this_arg, const struct LDKOfferFeatures *NONNULL_PTR other);
45026 * Returns true if this `Features` object contains unknown feature flags which are set as
45029 MUST_USE_RES bool OfferFeatures_requires_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg);
45032 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
45035 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45036 * be set instead (i.e., `bit - 1`).
45038 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45040 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45043 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
45046 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45047 * set instead (i.e., `bit + 1`).
45049 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45051 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45054 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
45055 * by [bLIP 2] or if it is a known `T` feature.
45057 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45058 * be set instead (i.e., `bit - 1`).
45060 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45062 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45065 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
45066 * by [bLIP 2] or if it is a known `T` feature.
45068 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45069 * set instead (i.e., `bit + 1`).
45071 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45073 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45076 * Create a blank Features with no features set
45078 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_empty(void);
45081 * Returns true if this `Features` object contains required features unknown by `other`.
45083 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits_from(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, const struct LDKInvoiceRequestFeatures *NONNULL_PTR other);
45086 * Returns true if this `Features` object contains unknown feature flags which are set as
45089 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg);
45092 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
45095 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45096 * be set instead (i.e., `bit - 1`).
45098 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45100 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45103 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
45106 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45107 * set instead (i.e., `bit + 1`).
45109 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45111 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45114 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
45115 * by [bLIP 2] or if it is a known `T` feature.
45117 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45118 * be set instead (i.e., `bit - 1`).
45120 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45122 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45125 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
45126 * by [bLIP 2] or if it is a known `T` feature.
45128 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45129 * set instead (i.e., `bit + 1`).
45131 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45133 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45136 * Create a blank Features with no features set
45138 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_empty(void);
45141 * Returns true if this `Features` object contains required features unknown by `other`.
45143 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR other);
45146 * Returns true if this `Features` object contains unknown feature flags which are set as
45149 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
45152 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
45155 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45156 * be set instead (i.e., `bit - 1`).
45158 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45160 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45163 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
45166 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45167 * set instead (i.e., `bit + 1`).
45169 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45171 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45174 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
45175 * by [bLIP 2] or if it is a known `T` feature.
45177 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45178 * be set instead (i.e., `bit - 1`).
45180 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45182 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45185 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
45186 * by [bLIP 2] or if it is a known `T` feature.
45188 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45189 * set instead (i.e., `bit + 1`).
45191 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45193 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45196 * Create a blank Features with no features set
45198 MUST_USE_RES struct LDKBlindedHopFeatures BlindedHopFeatures_empty(void);
45201 * Returns true if this `Features` object contains required features unknown by `other`.
45203 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits_from(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, const struct LDKBlindedHopFeatures *NONNULL_PTR other);
45206 * Returns true if this `Features` object contains unknown feature flags which are set as
45209 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg);
45212 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
45215 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45216 * be set instead (i.e., `bit - 1`).
45218 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45220 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45223 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
45226 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45227 * set instead (i.e., `bit + 1`).
45229 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45231 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45234 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
45235 * by [bLIP 2] or if it is a known `T` feature.
45237 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45238 * be set instead (i.e., `bit - 1`).
45240 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45242 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45245 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
45246 * by [bLIP 2] or if it is a known `T` feature.
45248 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45249 * set instead (i.e., `bit + 1`).
45251 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45253 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45256 * Create a blank Features with no features set
45258 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
45261 * Returns true if this `Features` object contains required features unknown by `other`.
45263 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits_from(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, const struct LDKChannelTypeFeatures *NONNULL_PTR other);
45266 * Returns true if this `Features` object contains unknown feature flags which are set as
45269 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45272 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
45275 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45276 * be set instead (i.e., `bit - 1`).
45278 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45280 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45283 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
45286 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45287 * set instead (i.e., `bit + 1`).
45289 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45291 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45294 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
45295 * by [bLIP 2] or if it is a known `T` feature.
45297 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45298 * be set instead (i.e., `bit - 1`).
45300 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45302 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45305 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
45306 * by [bLIP 2] or if it is a known `T` feature.
45308 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45309 * set instead (i.e., `bit + 1`).
45311 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45313 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45316 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
45318 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
45321 * Read a InitFeatures from a byte array, created by InitFeatures_write
45323 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
45326 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
45328 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
45331 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
45333 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
45336 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
45338 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
45341 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
45343 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
45346 * Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read
45348 struct LDKCVec_u8Z Bolt11InvoiceFeatures_write(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR obj);
45351 * Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write
45353 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ Bolt11InvoiceFeatures_read(struct LDKu8slice ser);
45356 * Serialize the Bolt12InvoiceFeatures object into a byte array which can be read by Bolt12InvoiceFeatures_read
45358 struct LDKCVec_u8Z Bolt12InvoiceFeatures_write(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR obj);
45361 * Read a Bolt12InvoiceFeatures from a byte array, created by Bolt12InvoiceFeatures_write
45363 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ Bolt12InvoiceFeatures_read(struct LDKu8slice ser);
45366 * Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read
45368 struct LDKCVec_u8Z BlindedHopFeatures_write(const struct LDKBlindedHopFeatures *NONNULL_PTR obj);
45371 * Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write
45373 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ BlindedHopFeatures_read(struct LDKu8slice ser);
45376 * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
45378 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
45381 * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
45383 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
45386 * Set this feature as optional.
45388 void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45391 * Set this feature as required.
45393 void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45396 * Checks if this feature is supported.
45398 MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45401 * Set this feature as optional.
45403 void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45406 * Set this feature as required.
45408 void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45411 * Checks if this feature is supported.
45413 MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45416 * Checks if this feature is required.
45418 MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45421 * Checks if this feature is required.
45423 MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45426 * Set this feature as optional.
45428 void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45431 * Set this feature as required.
45433 void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45436 * Checks if this feature is supported.
45438 MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45441 * Set this feature as optional.
45443 void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45446 * Set this feature as required.
45448 void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45451 * Checks if this feature is supported.
45453 MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45456 * Set this feature as optional.
45458 void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45461 * Set this feature as required.
45463 void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45466 * Checks if this feature is supported.
45468 MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45471 * Checks if this feature is required.
45473 MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45476 * Checks if this feature is required.
45478 MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45481 * Set this feature as optional.
45483 void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45486 * Set this feature as required.
45488 void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45491 * Checks if this feature is supported.
45493 MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45496 * Set this feature as optional.
45498 void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45501 * Set this feature as required.
45503 void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45506 * Checks if this feature is supported.
45508 MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45511 * Checks if this feature is required.
45513 MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45516 * Checks if this feature is required.
45518 MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45521 * Set this feature as optional.
45523 void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45526 * Set this feature as required.
45528 void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45531 * Checks if this feature is supported.
45533 MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45536 * Set this feature as optional.
45538 void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45541 * Set this feature as required.
45543 void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45546 * Checks if this feature is supported.
45548 MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45551 * Set this feature as optional.
45553 void Bolt11InvoiceFeatures_set_variable_length_onion_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45556 * Set this feature as required.
45558 void Bolt11InvoiceFeatures_set_variable_length_onion_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45561 * Checks if this feature is supported.
45563 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45566 * Checks if this feature is required.
45568 MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45571 * Checks if this feature is required.
45573 MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45576 * Checks if this feature is required.
45578 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45581 * Set this feature as optional.
45583 void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45586 * Set this feature as required.
45588 void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45591 * Checks if this feature is supported.
45593 MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45596 * Set this feature as optional.
45598 void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45601 * Set this feature as required.
45603 void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45606 * Checks if this feature is supported.
45608 MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45611 * Set this feature as optional.
45613 void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45616 * Set this feature as required.
45618 void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45621 * Checks if this feature is supported.
45623 MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45626 * Checks if this feature is required.
45628 MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45631 * Checks if this feature is required.
45633 MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45636 * Checks if this feature is required.
45638 MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45641 * Set this feature as optional.
45643 void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45646 * Set this feature as required.
45648 void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45651 * Checks if this feature is supported.
45653 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45656 * Set this feature as optional.
45658 void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45661 * Set this feature as required.
45663 void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45666 * Checks if this feature is supported.
45668 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45671 * Set this feature as optional.
45673 void Bolt11InvoiceFeatures_set_payment_secret_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45676 * Set this feature as required.
45678 void Bolt11InvoiceFeatures_set_payment_secret_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45681 * Checks if this feature is supported.
45683 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45686 * Checks if this feature is required.
45688 MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45691 * Checks if this feature is required.
45693 MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45696 * Checks if this feature is required.
45698 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45701 * Set this feature as optional.
45703 void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45706 * Set this feature as required.
45708 void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45711 * Checks if this feature is supported.
45713 MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45716 * Set this feature as optional.
45718 void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45721 * Set this feature as required.
45723 void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45726 * Checks if this feature is supported.
45728 MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45731 * Set this feature as optional.
45733 void Bolt11InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45736 * Set this feature as required.
45738 void Bolt11InvoiceFeatures_set_basic_mpp_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45741 * Checks if this feature is supported.
45743 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45746 * Set this feature as optional.
45748 void Bolt12InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
45751 * Set this feature as required.
45753 void Bolt12InvoiceFeatures_set_basic_mpp_required(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
45756 * Checks if this feature is supported.
45758 MUST_USE_RES bool Bolt12InvoiceFeatures_supports_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
45761 * Checks if this feature is required.
45763 MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45766 * Checks if this feature is required.
45768 MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45771 * Checks if this feature is required.
45773 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45776 * Checks if this feature is required.
45778 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
45781 * Set this feature as optional.
45783 void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45786 * Set this feature as required.
45788 void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45791 * Checks if this feature is supported.
45793 MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45796 * Set this feature as optional.
45798 void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45801 * Set this feature as required.
45803 void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45806 * Checks if this feature is supported.
45808 MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45811 * Checks if this feature is required.
45813 MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45816 * Checks if this feature is required.
45818 MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45821 * Set this feature as optional.
45823 void InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45826 * Set this feature as required.
45828 void InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45831 * Checks if this feature is supported.
45833 MUST_USE_RES bool InitFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45836 * Set this feature as optional.
45838 void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45841 * Set this feature as required.
45843 void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45846 * Checks if this feature is supported.
45848 MUST_USE_RES bool NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45851 * Set this feature as optional.
45853 void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45856 * Set this feature as required.
45858 void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45861 * Checks if this feature is supported.
45863 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45866 * Checks if this feature is required.
45868 MUST_USE_RES bool InitFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45871 * Checks if this feature is required.
45873 MUST_USE_RES bool NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45876 * Checks if this feature is required.
45878 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45881 * Set this feature as optional.
45883 void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45886 * Set this feature as required.
45888 void InitFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45891 * Checks if this feature is supported.
45893 MUST_USE_RES bool InitFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45896 * Set this feature as optional.
45898 void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45901 * Set this feature as required.
45903 void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45906 * Checks if this feature is supported.
45908 MUST_USE_RES bool NodeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45911 * Set this feature as optional.
45913 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45916 * Set this feature as required.
45918 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45921 * Checks if this feature is supported.
45923 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45926 * Checks if this feature is required.
45928 MUST_USE_RES bool InitFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45931 * Checks if this feature is required.
45933 MUST_USE_RES bool NodeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45936 * Checks if this feature is required.
45938 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45941 * Set this feature as optional.
45943 void InitFeatures_set_route_blinding_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45946 * Set this feature as required.
45948 void InitFeatures_set_route_blinding_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45951 * Checks if this feature is supported.
45953 MUST_USE_RES bool InitFeatures_supports_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45956 * Set this feature as optional.
45958 void NodeFeatures_set_route_blinding_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45961 * Set this feature as required.
45963 void NodeFeatures_set_route_blinding_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45966 * Checks if this feature is supported.
45968 MUST_USE_RES bool NodeFeatures_supports_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45971 * Checks if this feature is required.
45973 MUST_USE_RES bool InitFeatures_requires_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45976 * Checks if this feature is required.
45978 MUST_USE_RES bool NodeFeatures_requires_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45981 * Set this feature as optional.
45983 void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45986 * Set this feature as required.
45988 void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45991 * Checks if this feature is supported.
45993 MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45996 * Set this feature as optional.
45998 void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46001 * Set this feature as required.
46003 void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46006 * Checks if this feature is supported.
46008 MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46011 * Checks if this feature is required.
46013 MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46016 * Checks if this feature is required.
46018 MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46021 * Set this feature as optional.
46023 void InitFeatures_set_taproot_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46026 * Set this feature as required.
46028 void InitFeatures_set_taproot_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46031 * Checks if this feature is supported.
46033 MUST_USE_RES bool InitFeatures_supports_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46036 * Set this feature as optional.
46038 void NodeFeatures_set_taproot_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46041 * Set this feature as required.
46043 void NodeFeatures_set_taproot_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46046 * Checks if this feature is supported.
46048 MUST_USE_RES bool NodeFeatures_supports_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46051 * Set this feature as optional.
46053 void ChannelTypeFeatures_set_taproot_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46056 * Set this feature as required.
46058 void ChannelTypeFeatures_set_taproot_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46061 * Checks if this feature is supported.
46063 MUST_USE_RES bool ChannelTypeFeatures_supports_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46066 * Checks if this feature is required.
46068 MUST_USE_RES bool InitFeatures_requires_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46071 * Checks if this feature is required.
46073 MUST_USE_RES bool NodeFeatures_requires_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46076 * Checks if this feature is required.
46078 MUST_USE_RES bool ChannelTypeFeatures_requires_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46081 * Set this feature as optional.
46083 void InitFeatures_set_onion_messages_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46086 * Set this feature as required.
46088 void InitFeatures_set_onion_messages_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46091 * Checks if this feature is supported.
46093 MUST_USE_RES bool InitFeatures_supports_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46096 * Set this feature as optional.
46098 void NodeFeatures_set_onion_messages_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46101 * Set this feature as required.
46103 void NodeFeatures_set_onion_messages_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46106 * Checks if this feature is supported.
46108 MUST_USE_RES bool NodeFeatures_supports_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46111 * Checks if this feature is required.
46113 MUST_USE_RES bool InitFeatures_requires_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46116 * Checks if this feature is required.
46118 MUST_USE_RES bool NodeFeatures_requires_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46121 * Set this feature as optional.
46123 void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46126 * Set this feature as required.
46128 void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46131 * Checks if this feature is supported.
46133 MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46136 * Set this feature as optional.
46138 void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46141 * Set this feature as required.
46143 void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46146 * Checks if this feature is supported.
46148 MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46151 * Checks if this feature is required.
46153 MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46156 * Checks if this feature is required.
46158 MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46161 * Set this feature as optional.
46163 void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46166 * Set this feature as required.
46168 void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46171 * Checks if this feature is supported.
46173 MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46176 * Set this feature as optional.
46178 void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46181 * Set this feature as required.
46183 void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46186 * Checks if this feature is supported.
46188 MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46191 * Set this feature as optional.
46193 void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46196 * Set this feature as required.
46198 void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46201 * Checks if this feature is supported.
46203 MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46206 * Checks if this feature is required.
46208 MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46211 * Checks if this feature is required.
46213 MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46216 * Checks if this feature is required.
46218 MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46221 * Set this feature as optional.
46223 void Bolt11InvoiceFeatures_set_payment_metadata_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46226 * Set this feature as required.
46228 void Bolt11InvoiceFeatures_set_payment_metadata_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46231 * Checks if this feature is supported.
46233 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46236 * Checks if this feature is required.
46238 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46241 * Set this feature as optional.
46243 void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46246 * Set this feature as required.
46248 void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46251 * Checks if this feature is supported.
46253 MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46256 * Set this feature as optional.
46258 void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46261 * Set this feature as required.
46263 void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46266 * Checks if this feature is supported.
46268 MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46271 * Set this feature as optional.
46273 void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46276 * Set this feature as required.
46278 void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46281 * Checks if this feature is supported.
46283 MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46286 * Checks if this feature is required.
46288 MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46291 * Checks if this feature is required.
46293 MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46296 * Checks if this feature is required.
46298 MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46301 * Set this feature as optional.
46303 void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46306 * Set this feature as required.
46308 void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46311 * Checks if this feature is supported.
46313 MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46316 * Checks if this feature is required.
46318 MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46321 * Set this feature as optional.
46323 void InitFeatures_set_trampoline_routing_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46326 * Set this feature as required.
46328 void InitFeatures_set_trampoline_routing_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46331 * Checks if this feature is supported.
46333 MUST_USE_RES bool InitFeatures_supports_trampoline_routing(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46336 * Set this feature as optional.
46338 void NodeFeatures_set_trampoline_routing_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46341 * Set this feature as required.
46343 void NodeFeatures_set_trampoline_routing_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46346 * Checks if this feature is supported.
46348 MUST_USE_RES bool NodeFeatures_supports_trampoline_routing(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46351 * Set this feature as optional.
46353 void Bolt11InvoiceFeatures_set_trampoline_routing_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46356 * Set this feature as required.
46358 void Bolt11InvoiceFeatures_set_trampoline_routing_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46361 * Checks if this feature is supported.
46363 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_trampoline_routing(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46366 * Checks if this feature is required.
46368 MUST_USE_RES bool InitFeatures_requires_trampoline_routing(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46371 * Checks if this feature is required.
46373 MUST_USE_RES bool NodeFeatures_requires_trampoline_routing(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46376 * Checks if this feature is required.
46378 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_trampoline_routing(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46381 * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
46383 void ShutdownScript_free(struct LDKShutdownScript this_obj);
46386 * Creates a copy of the ShutdownScript
46388 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
46391 * Checks if two ShutdownScripts contain equal inner contents.
46392 * This ignores pointers and is_owned flags and looks at the values in fields.
46393 * Two objects with NULL inner values will be considered "equal" here.
46395 bool ShutdownScript_eq(const struct LDKShutdownScript *NONNULL_PTR a, const struct LDKShutdownScript *NONNULL_PTR b);
46398 * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
46400 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
46403 * The script that did not meet the requirements from [BOLT #2].
46405 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
46407 struct LDKCVec_u8Z InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
46410 * The script that did not meet the requirements from [BOLT #2].
46412 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
46414 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
46417 * Constructs a new InvalidShutdownScript given each field
46419 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
46422 * Creates a copy of the InvalidShutdownScript
46424 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
46427 * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
46429 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
46432 * Read a ShutdownScript from a byte array, created by ShutdownScript_write
46434 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
46437 * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
46439 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
46442 * Generates a P2WSH script pubkey from the given [`WScriptHash`].
46444 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
46447 * Generates a witness script pubkey from the given segwit version and program.
46449 * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
46450 * [`ShutdownScript::new_p2wsh`] instead.
46454 * This function may return an error if `program` is invalid for the segwit `version`.
46456 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessProgram witness_program);
46459 * Converts the shutdown script into the underlying [`ScriptBuf`].
46461 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
46464 * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
46466 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46468 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
46471 * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
46473 * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
46475 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
46478 * Frees any resources used by the ChannelId, if is_owned is set and inner is non-NULL.
46480 void ChannelId_free(struct LDKChannelId this_obj);
46482 const uint8_t (*ChannelId_get_a(const struct LDKChannelId *NONNULL_PTR this_ptr))[32];
46484 void ChannelId_set_a(struct LDKChannelId *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
46487 * Constructs a new ChannelId given each field
46489 MUST_USE_RES struct LDKChannelId ChannelId_new(struct LDKThirtyTwoBytes a_arg);
46492 * Creates a copy of the ChannelId
46494 struct LDKChannelId ChannelId_clone(const struct LDKChannelId *NONNULL_PTR orig);
46497 * Checks if two ChannelIds contain equal inner contents.
46498 * This ignores pointers and is_owned flags and looks at the values in fields.
46499 * Two objects with NULL inner values will be considered "equal" here.
46501 bool ChannelId_eq(const struct LDKChannelId *NONNULL_PTR a, const struct LDKChannelId *NONNULL_PTR b);
46504 * Generates a non-cryptographic 64-bit hash of the ChannelId.
46506 uint64_t ChannelId_hash(const struct LDKChannelId *NONNULL_PTR o);
46509 * Create _v1_ channel ID based on a funding TX ID and output index
46511 MUST_USE_RES struct LDKChannelId ChannelId_v1_from_funding_txid(const uint8_t (*txid)[32], uint16_t output_index);
46514 * Create _v1_ channel ID from a funding tx outpoint
46516 MUST_USE_RES struct LDKChannelId ChannelId_v1_from_funding_outpoint(struct LDKOutPoint outpoint);
46519 * Create a _temporary_ channel ID randomly, based on an entropy source.
46521 MUST_USE_RES struct LDKChannelId ChannelId_temporary_from_entropy_source(const struct LDKEntropySource *NONNULL_PTR entropy_source);
46524 * Generic constructor; create a new channel ID from the provided data.
46525 * Use a more specific `*_from_*` constructor when possible.
46527 MUST_USE_RES struct LDKChannelId ChannelId_from_bytes(struct LDKThirtyTwoBytes data);
46530 * Create a channel ID consisting of all-zeros data (e.g. when uninitialized or a placeholder).
46532 MUST_USE_RES struct LDKChannelId ChannelId_new_zero(void);
46535 * Check whether ID is consisting of all zeros (uninitialized)
46537 MUST_USE_RES bool ChannelId_is_zero(const struct LDKChannelId *NONNULL_PTR this_arg);
46540 * Create _v2_ channel ID by concatenating the holder revocation basepoint with the counterparty
46541 * revocation basepoint and hashing the result. The basepoints will be concatenated in increasing
46544 MUST_USE_RES struct LDKChannelId ChannelId_v2_from_revocation_basepoints(const struct LDKRevocationBasepoint *NONNULL_PTR ours, const struct LDKRevocationBasepoint *NONNULL_PTR theirs);
46547 * Create temporary _v2_ channel ID by concatenating a zeroed out basepoint with the holder
46548 * revocation basepoint and hashing the result.
46550 MUST_USE_RES struct LDKChannelId ChannelId_temporary_v2_from_revocation_basepoint(const struct LDKRevocationBasepoint *NONNULL_PTR our_revocation_basepoint);
46553 * Serialize the ChannelId object into a byte array which can be read by ChannelId_read
46555 struct LDKCVec_u8Z ChannelId_write(const struct LDKChannelId *NONNULL_PTR obj);
46558 * Read a ChannelId from a byte array, created by ChannelId_write
46560 struct LDKCResult_ChannelIdDecodeErrorZ ChannelId_read(struct LDKu8slice ser);
46563 * Frees any resources used by the Retry
46565 void Retry_free(struct LDKRetry this_ptr);
46568 * Creates a copy of the Retry
46570 struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig);
46573 * Utility method to constructs a new Attempts-variant Retry
46575 struct LDKRetry Retry_attempts(uint32_t a);
46578 * Utility method to constructs a new Timeout-variant Retry
46580 struct LDKRetry Retry_timeout(uint64_t a);
46583 * Checks if two Retrys contain equal inner contents.
46584 * This ignores pointers and is_owned flags and looks at the values in fields.
46586 bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b);
46589 * Generates a non-cryptographic 64-bit hash of the Retry.
46591 uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o);
46594 * Serialize the Retry object into a byte array which can be read by Retry_read
46596 struct LDKCVec_u8Z Retry_write(const struct LDKRetry *NONNULL_PTR obj);
46599 * Read a Retry from a byte array, created by Retry_write
46601 struct LDKCResult_RetryDecodeErrorZ Retry_read(struct LDKu8slice ser);
46604 * Creates a copy of the RetryableSendFailure
46606 enum LDKRetryableSendFailure RetryableSendFailure_clone(const enum LDKRetryableSendFailure *NONNULL_PTR orig);
46609 * Utility method to constructs a new PaymentExpired-variant RetryableSendFailure
46611 enum LDKRetryableSendFailure RetryableSendFailure_payment_expired(void);
46614 * Utility method to constructs a new RouteNotFound-variant RetryableSendFailure
46616 enum LDKRetryableSendFailure RetryableSendFailure_route_not_found(void);
46619 * Utility method to constructs a new DuplicatePayment-variant RetryableSendFailure
46621 enum LDKRetryableSendFailure RetryableSendFailure_duplicate_payment(void);
46624 * Checks if two RetryableSendFailures contain equal inner contents.
46625 * This ignores pointers and is_owned flags and looks at the values in fields.
46627 bool RetryableSendFailure_eq(const enum LDKRetryableSendFailure *NONNULL_PTR a, const enum LDKRetryableSendFailure *NONNULL_PTR b);
46630 * Frees any resources used by the PaymentSendFailure
46632 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
46635 * Creates a copy of the PaymentSendFailure
46637 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
46640 * Utility method to constructs a new ParameterError-variant PaymentSendFailure
46642 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
46645 * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
46647 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
46650 * Utility method to constructs a new AllFailedResendSafe-variant PaymentSendFailure
46652 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_resend_safe(struct LDKCVec_APIErrorZ a);
46655 * Utility method to constructs a new DuplicatePayment-variant PaymentSendFailure
46657 struct LDKPaymentSendFailure PaymentSendFailure_duplicate_payment(void);
46660 * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
46662 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
46665 * Checks if two PaymentSendFailures contain equal inner contents.
46666 * This ignores pointers and is_owned flags and looks at the values in fields.
46668 bool PaymentSendFailure_eq(const struct LDKPaymentSendFailure *NONNULL_PTR a, const struct LDKPaymentSendFailure *NONNULL_PTR b);
46671 * Frees any resources used by the ProbeSendFailure
46673 void ProbeSendFailure_free(struct LDKProbeSendFailure this_ptr);
46676 * Creates a copy of the ProbeSendFailure
46678 struct LDKProbeSendFailure ProbeSendFailure_clone(const struct LDKProbeSendFailure *NONNULL_PTR orig);
46681 * Utility method to constructs a new RouteNotFound-variant ProbeSendFailure
46683 struct LDKProbeSendFailure ProbeSendFailure_route_not_found(void);
46686 * Utility method to constructs a new SendingFailed-variant ProbeSendFailure
46688 struct LDKProbeSendFailure ProbeSendFailure_sending_failed(struct LDKPaymentSendFailure a);
46691 * Checks if two ProbeSendFailures contain equal inner contents.
46692 * This ignores pointers and is_owned flags and looks at the values in fields.
46694 bool ProbeSendFailure_eq(const struct LDKProbeSendFailure *NONNULL_PTR a, const struct LDKProbeSendFailure *NONNULL_PTR b);
46697 * Frees any resources used by the RecipientOnionFields, if is_owned is set and inner is non-NULL.
46699 void RecipientOnionFields_free(struct LDKRecipientOnionFields this_obj);
46702 * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
46703 * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
46704 * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
46707 * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
46708 * multi-path payments require a recipient-provided secret.
46710 * Some implementations may reject spontaneous payments with payment secrets, so you may only
46711 * want to provide a secret for a spontaneous payment if MPP is needed and you know your
46712 * recipient will not reject it.
46714 struct LDKCOption_ThirtyTwoBytesZ RecipientOnionFields_get_payment_secret(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
46717 * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
46718 * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
46719 * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
46722 * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
46723 * multi-path payments require a recipient-provided secret.
46725 * Some implementations may reject spontaneous payments with payment secrets, so you may only
46726 * want to provide a secret for a spontaneous payment if MPP is needed and you know your
46727 * recipient will not reject it.
46729 void RecipientOnionFields_set_payment_secret(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
46732 * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
46733 * arbitrary length. This gives recipients substantially more flexibility to receive
46736 * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
46737 * scheme to authenticate received payments against expected payments and invoices, this field
46738 * is not used in LDK for received payments, and can be used to store arbitrary data in
46739 * invoices which will be received with the payment.
46741 * Note that this field was added to the lightning specification more recently than
46742 * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
46743 * may not be supported as universally.
46745 * Returns a copy of the field.
46747 struct LDKCOption_CVec_u8ZZ RecipientOnionFields_get_payment_metadata(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
46750 * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
46751 * arbitrary length. This gives recipients substantially more flexibility to receive
46754 * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
46755 * scheme to authenticate received payments against expected payments and invoices, this field
46756 * is not used in LDK for received payments, and can be used to store arbitrary data in
46757 * invoices which will be received with the payment.
46759 * Note that this field was added to the lightning specification more recently than
46760 * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
46761 * may not be supported as universally.
46763 void RecipientOnionFields_set_payment_metadata(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
46766 * Creates a copy of the RecipientOnionFields
46768 struct LDKRecipientOnionFields RecipientOnionFields_clone(const struct LDKRecipientOnionFields *NONNULL_PTR orig);
46771 * Checks if two RecipientOnionFieldss contain equal inner contents.
46772 * This ignores pointers and is_owned flags and looks at the values in fields.
46773 * Two objects with NULL inner values will be considered "equal" here.
46775 bool RecipientOnionFields_eq(const struct LDKRecipientOnionFields *NONNULL_PTR a, const struct LDKRecipientOnionFields *NONNULL_PTR b);
46778 * Serialize the RecipientOnionFields object into a byte array which can be read by RecipientOnionFields_read
46780 struct LDKCVec_u8Z RecipientOnionFields_write(const struct LDKRecipientOnionFields *NONNULL_PTR obj);
46783 * Read a RecipientOnionFields from a byte array, created by RecipientOnionFields_write
46785 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ RecipientOnionFields_read(struct LDKu8slice ser);
46788 * Creates a [`RecipientOnionFields`] from only a [`PaymentSecret`]. This is the most common
46789 * set of onion fields for today's BOLT11 invoices - most nodes require a [`PaymentSecret`]
46790 * but do not require or provide any further data.
46792 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_secret_only(struct LDKThirtyTwoBytes payment_secret);
46795 * Creates a new [`RecipientOnionFields`] with no fields. This generally does not create
46796 * payable HTLCs except for single-path spontaneous payments, i.e. this should generally
46797 * only be used for calls to [`ChannelManager::send_spontaneous_payment`]. If you are sending
46798 * a spontaneous MPP this will not work as all MPP require payment secrets; you may
46799 * instead want to use [`RecipientOnionFields::secret_only`].
46801 * [`ChannelManager::send_spontaneous_payment`]: super::channelmanager::ChannelManager::send_spontaneous_payment
46802 * [`RecipientOnionFields::secret_only`]: RecipientOnionFields::secret_only
46804 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_spontaneous_empty(void);
46807 * Creates a new [`RecipientOnionFields`] from an existing one, adding custom TLVs. Each
46808 * TLV is provided as a `(u64, Vec<u8>)` for the type number and serialized value
46809 * respectively. TLV type numbers must be unique and within the range
46810 * reserved for custom types, i.e. >= 2^16, otherwise this method will return `Err(())`.
46812 * This method will also error for types in the experimental range which have been
46813 * standardized within the protocol, which only includes 5482373484 (keysend) for now.
46815 * See [`Self::custom_tlvs`] for more info.
46817 MUST_USE_RES struct LDKCResult_RecipientOnionFieldsNoneZ RecipientOnionFields_with_custom_tlvs(struct LDKRecipientOnionFields this_arg, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs);
46820 * Gets the custom TLVs that will be sent or have been received.
46822 * Custom TLVs allow sending extra application-specific data with a payment. They provide
46823 * additional flexibility on top of payment metadata, as while other implementations may
46824 * require `payment_metadata` to reflect metadata provided in an invoice, custom TLVs
46825 * do not have this restriction.
46827 * Note that if this field is non-empty, it will contain strictly increasing TLVs, each
46828 * represented by a `(u64, Vec<u8>)` for its type number and serialized value respectively.
46829 * This is validated when setting this field using [`Self::with_custom_tlvs`].
46831 MUST_USE_RES struct LDKCVec_C2Tuple_u64CVec_u8ZZZ RecipientOnionFields_custom_tlvs(const struct LDKRecipientOnionFields *NONNULL_PTR this_arg);
46834 * Calls the free function if one is set
46836 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
46839 * Creates a copy of a Type
46841 struct LDKType Type_clone(const struct LDKType *NONNULL_PTR orig);
46844 * Calls the free function if one is set
46846 void Type_free(struct LDKType this_ptr);
46849 * Frees any resources used by the OfferId, if is_owned is set and inner is non-NULL.
46851 void OfferId_free(struct LDKOfferId this_obj);
46853 const uint8_t (*OfferId_get_a(const struct LDKOfferId *NONNULL_PTR this_ptr))[32];
46855 void OfferId_set_a(struct LDKOfferId *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
46858 * Constructs a new OfferId given each field
46860 MUST_USE_RES struct LDKOfferId OfferId_new(struct LDKThirtyTwoBytes a_arg);
46863 * Creates a copy of the OfferId
46865 struct LDKOfferId OfferId_clone(const struct LDKOfferId *NONNULL_PTR orig);
46868 * Checks if two OfferIds contain equal inner contents.
46869 * This ignores pointers and is_owned flags and looks at the values in fields.
46870 * Two objects with NULL inner values will be considered "equal" here.
46872 bool OfferId_eq(const struct LDKOfferId *NONNULL_PTR a, const struct LDKOfferId *NONNULL_PTR b);
46875 * Serialize the OfferId object into a byte array which can be read by OfferId_read
46877 struct LDKCVec_u8Z OfferId_write(const struct LDKOfferId *NONNULL_PTR obj);
46880 * Read a OfferId from a byte array, created by OfferId_write
46882 struct LDKCResult_OfferIdDecodeErrorZ OfferId_read(struct LDKu8slice ser);
46885 * Frees any resources used by the Offer, if is_owned is set and inner is non-NULL.
46887 void Offer_free(struct LDKOffer this_obj);
46890 * Creates a copy of the Offer
46892 struct LDKOffer Offer_clone(const struct LDKOffer *NONNULL_PTR orig);
46895 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
46896 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
46897 * for the selected chain.
46899 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ Offer_chains(const struct LDKOffer *NONNULL_PTR this_arg);
46902 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
46903 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
46905 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Offer_metadata(const struct LDKOffer *NONNULL_PTR this_arg);
46908 * The minimum amount required for a successful payment of a single item.
46910 MUST_USE_RES struct LDKCOption_AmountZ Offer_amount(const struct LDKOffer *NONNULL_PTR this_arg);
46913 * A complete description of the purpose of the payment. Intended to be displayed to the user
46914 * but with the caveat that it has not been verified in any way.
46916 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46918 MUST_USE_RES struct LDKPrintableString Offer_description(const struct LDKOffer *NONNULL_PTR this_arg);
46921 * Features pertaining to the offer.
46923 MUST_USE_RES struct LDKOfferFeatures Offer_offer_features(const struct LDKOffer *NONNULL_PTR this_arg);
46926 * Duration since the Unix epoch when an invoice should no longer be requested.
46928 * If `None`, the offer does not expire.
46930 MUST_USE_RES struct LDKCOption_u64Z Offer_absolute_expiry(const struct LDKOffer *NONNULL_PTR this_arg);
46933 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
46934 * displayed to the user but with the caveat that it has not been verified in any way.
46936 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46938 MUST_USE_RES struct LDKPrintableString Offer_issuer(const struct LDKOffer *NONNULL_PTR this_arg);
46941 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
46942 * recipient privacy by obfuscating its node id.
46944 MUST_USE_RES struct LDKCVec_BlindedPathZ Offer_paths(const struct LDKOffer *NONNULL_PTR this_arg);
46947 * The quantity of items supported.
46949 MUST_USE_RES struct LDKQuantity Offer_supported_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
46952 * The public key used by the recipient to sign invoices.
46954 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46956 MUST_USE_RES struct LDKPublicKey Offer_signing_pubkey(const struct LDKOffer *NONNULL_PTR this_arg);
46959 * Returns the id of the offer.
46961 MUST_USE_RES struct LDKOfferId Offer_id(const struct LDKOffer *NONNULL_PTR this_arg);
46964 * Returns whether the given chain is supported by the offer.
46966 MUST_USE_RES bool Offer_supports_chain(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes chain);
46969 * Whether the offer has expired.
46971 MUST_USE_RES bool Offer_is_expired(const struct LDKOffer *NONNULL_PTR this_arg);
46974 * Whether the offer has expired given the duration since the Unix epoch.
46976 MUST_USE_RES bool Offer_is_expired_no_std(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t duration_since_epoch);
46979 * Returns whether the given quantity is valid for the offer.
46981 MUST_USE_RES bool Offer_is_valid_quantity(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t quantity);
46984 * Returns whether a quantity is expected in an [`InvoiceRequest`] for the offer.
46986 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
46988 MUST_USE_RES bool Offer_expects_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
46991 * Similar to [`Offer::request_invoice`] except it:
46992 * - derives the [`InvoiceRequest::payer_id`] such that a different key can be used for each
46994 * - sets [`InvoiceRequest::payer_metadata`] when [`InvoiceRequestBuilder::build`] is called
46995 * such that it can be used by [`Bolt12Invoice::verify`] to determine if the invoice was
46996 * requested using a base [`ExpandedKey`] from which the payer id was derived, and
46997 * - includes the [`PaymentId`] encrypted in [`InvoiceRequest::payer_metadata`] so that it can
46998 * be used when sending the payment for the requested invoice.
47000 * Useful to protect the sender's privacy.
47002 * [`InvoiceRequest::payer_id`]: crate::offers::invoice_request::InvoiceRequest::payer_id
47003 * [`InvoiceRequest::payer_metadata`]: crate::offers::invoice_request::InvoiceRequest::payer_metadata
47004 * [`Bolt12Invoice::verify`]: crate::offers::invoice::Bolt12Invoice::verify
47005 * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey
47007 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);
47010 * Similar to [`Offer::request_invoice_deriving_payer_id`] except uses `payer_id` for the
47011 * [`InvoiceRequest::payer_id`] instead of deriving a different key for each request.
47013 * Useful for recurring payments using the same `payer_id` with different invoices.
47015 * [`InvoiceRequest::payer_id`]: crate::offers::invoice_request::InvoiceRequest::payer_id
47017 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);
47020 * Creates an [`InvoiceRequestBuilder`] for the offer with the given `metadata` and `payer_id`,
47021 * which will be reflected in the `Bolt12Invoice` response.
47023 * The `metadata` is useful for including information about the derivation of `payer_id` such
47024 * that invoice response handling can be stateless. Also serves as payer-provided entropy while
47025 * hashing in the signature calculation.
47027 * This should not leak any information such as by using a simple BIP-32 derivation path.
47028 * Otherwise, payments may be correlated.
47030 * Errors if the offer contains unknown required features.
47032 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
47034 MUST_USE_RES struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ Offer_request_invoice(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKCVec_u8Z metadata, struct LDKPublicKey payer_id);
47037 * Generates a non-cryptographic 64-bit hash of the Offer.
47039 uint64_t Offer_hash(const struct LDKOffer *NONNULL_PTR o);
47042 * Serialize the Offer object into a byte array which can be read by Offer_read
47044 struct LDKCVec_u8Z Offer_write(const struct LDKOffer *NONNULL_PTR obj);
47047 * Frees any resources used by the Amount
47049 void Amount_free(struct LDKAmount this_ptr);
47052 * Creates a copy of the Amount
47054 struct LDKAmount Amount_clone(const struct LDKAmount *NONNULL_PTR orig);
47057 * Utility method to constructs a new Bitcoin-variant Amount
47059 struct LDKAmount Amount_bitcoin(uint64_t amount_msats);
47062 * Utility method to constructs a new Currency-variant Amount
47064 struct LDKAmount Amount_currency(struct LDKThreeBytes iso4217_code, uint64_t amount);
47067 * Frees any resources used by the Quantity
47069 void Quantity_free(struct LDKQuantity this_ptr);
47072 * Creates a copy of the Quantity
47074 struct LDKQuantity Quantity_clone(const struct LDKQuantity *NONNULL_PTR orig);
47077 * Utility method to constructs a new Bounded-variant Quantity
47079 struct LDKQuantity Quantity_bounded(uint64_t a);
47082 * Utility method to constructs a new Unbounded-variant Quantity
47084 struct LDKQuantity Quantity_unbounded(void);
47087 * Utility method to constructs a new One-variant Quantity
47089 struct LDKQuantity Quantity_one(void);
47092 * Read a Offer object from a string
47094 struct LDKCResult_OfferBolt12ParseErrorZ Offer_from_str(struct LDKStr s);
47097 * Frees any resources used by the InvoiceWithExplicitSigningPubkeyBuilder, if is_owned is set and inner is non-NULL.
47099 void InvoiceWithExplicitSigningPubkeyBuilder_free(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_obj);
47102 * Frees any resources used by the InvoiceWithDerivedSigningPubkeyBuilder, if is_owned is set and inner is non-NULL.
47104 void InvoiceWithDerivedSigningPubkeyBuilder_free(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_obj);
47107 * Builds an unsigned [`Bolt12Invoice`] after checking for valid semantics. It can be signed by
47108 * [`UnsignedBolt12Invoice::sign`].
47110 MUST_USE_RES struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ InvoiceWithExplicitSigningPubkeyBuilder_build(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg);
47113 * Sets the [`Bolt12Invoice::relative_expiry`] as seconds since [`Bolt12Invoice::created_at`].
47114 * Any expiry that has already passed is valid and can be checked for using
47115 * [`Bolt12Invoice::is_expired`].
47117 * Successive calls to this method will override the previous setting.
47119 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, uint32_t relative_expiry_secs);
47122 * Adds a P2WSH address to [`Bolt12Invoice::fallbacks`].
47124 * Successive calls to this method will add another address. Caller is responsible for not
47125 * adding duplicate addresses and only calling if capable of receiving to P2WSH addresses.
47127 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, const uint8_t (*script_hash)[32]);
47130 * Adds a P2WPKH address to [`Bolt12Invoice::fallbacks`].
47132 * Successive calls to this method will add another address. Caller is responsible for not
47133 * adding duplicate addresses and only calling if capable of receiving to P2WPKH addresses.
47135 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wpkh(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, const uint8_t (*pubkey_hash)[20]);
47138 * Adds a P2TR address to [`Bolt12Invoice::fallbacks`].
47140 * Successive calls to this method will add another address. Caller is responsible for not
47141 * adding duplicate addresses and only calling if capable of receiving to P2TR addresses.
47143 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, struct LDKTweakedPublicKey output_key);
47146 * Sets [`Bolt12Invoice::invoice_features`] to indicate MPP may be used. Otherwise, MPP is
47149 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg);
47152 * Builds a signed [`Bolt12Invoice`] after checking for valid semantics.
47154 MUST_USE_RES struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg);
47157 * Sets the [`Bolt12Invoice::relative_expiry`] as seconds since [`Bolt12Invoice::created_at`].
47158 * Any expiry that has already passed is valid and can be checked for using
47159 * [`Bolt12Invoice::is_expired`].
47161 * Successive calls to this method will override the previous setting.
47163 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, uint32_t relative_expiry_secs);
47166 * Adds a P2WSH address to [`Bolt12Invoice::fallbacks`].
47168 * Successive calls to this method will add another address. Caller is responsible for not
47169 * adding duplicate addresses and only calling if capable of receiving to P2WSH addresses.
47171 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wsh(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, const uint8_t (*script_hash)[32]);
47174 * Adds a P2WPKH address to [`Bolt12Invoice::fallbacks`].
47176 * Successive calls to this method will add another address. Caller is responsible for not
47177 * adding duplicate addresses and only calling if capable of receiving to P2WPKH addresses.
47179 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wpkh(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, const uint8_t (*pubkey_hash)[20]);
47182 * Adds a P2TR address to [`Bolt12Invoice::fallbacks`].
47184 * Successive calls to this method will add another address. Caller is responsible for not
47185 * adding duplicate addresses and only calling if capable of receiving to P2TR addresses.
47187 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, struct LDKTweakedPublicKey output_key);
47190 * Sets [`Bolt12Invoice::invoice_features`] to indicate MPP may be used. Otherwise, MPP is
47193 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg);
47196 * Frees any resources used by the UnsignedBolt12Invoice, if is_owned is set and inner is non-NULL.
47198 void UnsignedBolt12Invoice_free(struct LDKUnsignedBolt12Invoice this_obj);
47201 * Calls the free function if one is set
47203 void SignBolt12InvoiceFn_free(struct LDKSignBolt12InvoiceFn this_ptr);
47206 * Returns the [`TaggedHash`] of the invoice to sign.
47208 MUST_USE_RES struct LDKTaggedHash UnsignedBolt12Invoice_tagged_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47211 * Frees any resources used by the Bolt12Invoice, if is_owned is set and inner is non-NULL.
47213 void Bolt12Invoice_free(struct LDKBolt12Invoice this_obj);
47216 * Creates a copy of the Bolt12Invoice
47218 struct LDKBolt12Invoice Bolt12Invoice_clone(const struct LDKBolt12Invoice *NONNULL_PTR orig);
47221 * The chains that may be used when paying a requested invoice.
47223 * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
47225 * [`Offer::chains`]: crate::offers::offer::Offer::chains
47227 MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ UnsignedBolt12Invoice_offer_chains(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47230 * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
47231 * invoice originated from an offer.
47233 * From [`InvoiceRequest::chain`] or [`Refund::chain`].
47235 * [`offer_chains`]: Self::offer_chains
47236 * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
47238 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_chain(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47241 * Opaque bytes set by the originating [`Offer`].
47243 * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
47244 * if the [`Offer`] did not set it.
47246 * [`Offer`]: crate::offers::offer::Offer
47247 * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
47249 MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedBolt12Invoice_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47252 * The minimum amount required for a successful payment of a single item.
47254 * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
47255 * the [`Offer`] did not set it.
47257 * [`Offer`]: crate::offers::offer::Offer
47258 * [`Offer::amount`]: crate::offers::offer::Offer::amount
47260 MUST_USE_RES struct LDKCOption_AmountZ UnsignedBolt12Invoice_amount(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47263 * Features pertaining to the originating [`Offer`].
47265 * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
47268 * [`Offer`]: crate::offers::offer::Offer
47269 * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
47271 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47273 MUST_USE_RES struct LDKOfferFeatures UnsignedBolt12Invoice_offer_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47276 * A complete description of the purpose of the originating offer or refund.
47278 * From [`Offer::description`] or [`Refund::description`].
47280 * [`Offer::description`]: crate::offers::offer::Offer::description
47282 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47284 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_description(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47287 * Duration since the Unix epoch when an invoice should no longer be requested.
47289 * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
47291 * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
47293 MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_absolute_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47296 * The issuer of the offer or refund.
47298 * From [`Offer::issuer`] or [`Refund::issuer`].
47300 * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
47302 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47304 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_issuer(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47307 * Paths to the recipient originating from publicly reachable nodes.
47309 * From [`Offer::paths`] or [`Refund::paths`].
47311 * [`Offer::paths`]: crate::offers::offer::Offer::paths
47313 MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedBolt12Invoice_message_paths(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47316 * The quantity of items supported.
47318 * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
47321 * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
47323 MUST_USE_RES struct LDKCOption_QuantityZ UnsignedBolt12Invoice_supported_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47326 * An unpredictable series of bytes from the payer.
47328 * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
47330 MUST_USE_RES struct LDKu8slice UnsignedBolt12Invoice_payer_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47333 * Features pertaining to requesting an invoice.
47335 * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
47337 MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedBolt12Invoice_invoice_request_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47340 * The quantity of items requested or refunded for.
47342 * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
47344 MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47347 * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
47348 * refund in case there are no [`message_paths`].
47350 * [`message_paths`]: Self::message_paths
47352 MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_payer_id(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47355 * A payer-provided note reflected back in the invoice.
47357 * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
47359 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47361 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_payer_note(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47364 * Duration since the Unix epoch when the invoice was created.
47366 MUST_USE_RES uint64_t UnsignedBolt12Invoice_created_at(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47369 * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
47370 * should no longer be paid.
47372 MUST_USE_RES uint64_t UnsignedBolt12Invoice_relative_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47375 * Whether the invoice has expired.
47377 MUST_USE_RES bool UnsignedBolt12Invoice_is_expired(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47380 * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
47382 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_payment_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47385 * The minimum amount required for a successful payment of the invoice.
47387 MUST_USE_RES uint64_t UnsignedBolt12Invoice_amount_msats(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47390 * Features pertaining to paying an invoice.
47392 MUST_USE_RES struct LDKBolt12InvoiceFeatures UnsignedBolt12Invoice_invoice_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47395 * The public key corresponding to the key used to sign the invoice.
47397 MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_signing_pubkey(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47400 * The chains that may be used when paying a requested invoice.
47402 * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
47404 * [`Offer::chains`]: crate::offers::offer::Offer::chains
47406 MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ Bolt12Invoice_offer_chains(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47409 * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
47410 * invoice originated from an offer.
47412 * From [`InvoiceRequest::chain`] or [`Refund::chain`].
47414 * [`offer_chains`]: Self::offer_chains
47415 * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
47417 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_chain(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47420 * Opaque bytes set by the originating [`Offer`].
47422 * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
47423 * if the [`Offer`] did not set it.
47425 * [`Offer`]: crate::offers::offer::Offer
47426 * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
47428 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt12Invoice_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47431 * The minimum amount required for a successful payment of a single item.
47433 * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
47434 * the [`Offer`] did not set it.
47436 * [`Offer`]: crate::offers::offer::Offer
47437 * [`Offer::amount`]: crate::offers::offer::Offer::amount
47439 MUST_USE_RES struct LDKCOption_AmountZ Bolt12Invoice_amount(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47442 * Features pertaining to the originating [`Offer`].
47444 * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
47447 * [`Offer`]: crate::offers::offer::Offer
47448 * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
47450 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47452 MUST_USE_RES struct LDKOfferFeatures Bolt12Invoice_offer_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47455 * A complete description of the purpose of the originating offer or refund.
47457 * From [`Offer::description`] or [`Refund::description`].
47459 * [`Offer::description`]: crate::offers::offer::Offer::description
47461 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47463 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_description(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47466 * Duration since the Unix epoch when an invoice should no longer be requested.
47468 * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
47470 * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
47472 MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_absolute_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47475 * The issuer of the offer or refund.
47477 * From [`Offer::issuer`] or [`Refund::issuer`].
47479 * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
47481 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47483 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_issuer(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47486 * Paths to the recipient originating from publicly reachable nodes.
47488 * From [`Offer::paths`] or [`Refund::paths`].
47490 * [`Offer::paths`]: crate::offers::offer::Offer::paths
47492 MUST_USE_RES struct LDKCVec_BlindedPathZ Bolt12Invoice_message_paths(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47495 * The quantity of items supported.
47497 * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
47500 * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
47502 MUST_USE_RES struct LDKCOption_QuantityZ Bolt12Invoice_supported_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47505 * An unpredictable series of bytes from the payer.
47507 * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
47509 MUST_USE_RES struct LDKu8slice Bolt12Invoice_payer_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47512 * Features pertaining to requesting an invoice.
47514 * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
47516 MUST_USE_RES struct LDKInvoiceRequestFeatures Bolt12Invoice_invoice_request_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47519 * The quantity of items requested or refunded for.
47521 * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
47523 MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47526 * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
47527 * refund in case there are no [`message_paths`].
47529 * [`message_paths`]: Self::message_paths
47531 MUST_USE_RES struct LDKPublicKey Bolt12Invoice_payer_id(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47534 * A payer-provided note reflected back in the invoice.
47536 * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
47538 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47540 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_payer_note(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47543 * Duration since the Unix epoch when the invoice was created.
47545 MUST_USE_RES uint64_t Bolt12Invoice_created_at(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47548 * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
47549 * should no longer be paid.
47551 MUST_USE_RES uint64_t Bolt12Invoice_relative_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47554 * Whether the invoice has expired.
47556 MUST_USE_RES bool Bolt12Invoice_is_expired(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47559 * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
47561 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_payment_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47564 * The minimum amount required for a successful payment of the invoice.
47566 MUST_USE_RES uint64_t Bolt12Invoice_amount_msats(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47569 * Features pertaining to paying an invoice.
47571 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12Invoice_invoice_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47574 * The public key corresponding to the key used to sign the invoice.
47576 MUST_USE_RES struct LDKPublicKey Bolt12Invoice_signing_pubkey(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47579 * Signature of the invoice verified using [`Bolt12Invoice::signing_pubkey`].
47581 MUST_USE_RES struct LDKSchnorrSignature Bolt12Invoice_signature(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47584 * Hash that was used for signing the invoice.
47586 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_signable_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47589 * Verifies that the invoice was for a request or refund created using the given key. Returns
47590 * the associated [`PaymentId`] to use when sending the payment.
47592 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ Bolt12Invoice_verify(const struct LDKBolt12Invoice *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
47595 * Generates a non-cryptographic 64-bit hash of the Bolt12Invoice.
47597 uint64_t Bolt12Invoice_hash(const struct LDKBolt12Invoice *NONNULL_PTR o);
47600 * Serialize the UnsignedBolt12Invoice object into a byte array which can be read by UnsignedBolt12Invoice_read
47602 struct LDKCVec_u8Z UnsignedBolt12Invoice_write(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR obj);
47605 * Serialize the Bolt12Invoice object into a byte array which can be read by Bolt12Invoice_read
47607 struct LDKCVec_u8Z Bolt12Invoice_write(const struct LDKBolt12Invoice *NONNULL_PTR obj);
47610 * Frees any resources used by the BlindedPayInfo, if is_owned is set and inner is non-NULL.
47612 void BlindedPayInfo_free(struct LDKBlindedPayInfo this_obj);
47615 * Base fee charged (in millisatoshi) for the entire blinded path.
47617 uint32_t BlindedPayInfo_get_fee_base_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
47620 * Base fee charged (in millisatoshi) for the entire blinded path.
47622 void BlindedPayInfo_set_fee_base_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
47625 * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
47626 * (i.e., 10,000 is 1%).
47628 uint32_t BlindedPayInfo_get_fee_proportional_millionths(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
47631 * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
47632 * (i.e., 10,000 is 1%).
47634 void BlindedPayInfo_set_fee_proportional_millionths(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
47637 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
47640 uint16_t BlindedPayInfo_get_cltv_expiry_delta(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
47643 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
47646 void BlindedPayInfo_set_cltv_expiry_delta(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint16_t val);
47649 * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
47650 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
47651 * seen by the recipient.
47653 uint64_t BlindedPayInfo_get_htlc_minimum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
47656 * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
47657 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
47658 * seen by the recipient.
47660 void BlindedPayInfo_set_htlc_minimum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
47663 * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
47664 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
47665 * seen by the recipient.
47667 uint64_t BlindedPayInfo_get_htlc_maximum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
47670 * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
47671 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
47672 * seen by the recipient.
47674 void BlindedPayInfo_set_htlc_maximum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
47677 * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
47680 struct LDKBlindedHopFeatures BlindedPayInfo_get_features(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
47683 * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
47686 void BlindedPayInfo_set_features(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
47689 * Constructs a new BlindedPayInfo given each field
47691 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);
47694 * Creates a copy of the BlindedPayInfo
47696 struct LDKBlindedPayInfo BlindedPayInfo_clone(const struct LDKBlindedPayInfo *NONNULL_PTR orig);
47699 * Generates a non-cryptographic 64-bit hash of the BlindedPayInfo.
47701 uint64_t BlindedPayInfo_hash(const struct LDKBlindedPayInfo *NONNULL_PTR o);
47704 * Checks if two BlindedPayInfos contain equal inner contents.
47705 * This ignores pointers and is_owned flags and looks at the values in fields.
47706 * Two objects with NULL inner values will be considered "equal" here.
47708 bool BlindedPayInfo_eq(const struct LDKBlindedPayInfo *NONNULL_PTR a, const struct LDKBlindedPayInfo *NONNULL_PTR b);
47711 * Serialize the BlindedPayInfo object into a byte array which can be read by BlindedPayInfo_read
47713 struct LDKCVec_u8Z BlindedPayInfo_write(const struct LDKBlindedPayInfo *NONNULL_PTR obj);
47716 * Read a BlindedPayInfo from a byte array, created by BlindedPayInfo_write
47718 struct LDKCResult_BlindedPayInfoDecodeErrorZ BlindedPayInfo_read(struct LDKu8slice ser);
47721 * Frees any resources used by the InvoiceError, if is_owned is set and inner is non-NULL.
47723 void InvoiceError_free(struct LDKInvoiceError this_obj);
47726 * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
47728 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
47729 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
47731 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47733 struct LDKErroneousField InvoiceError_get_erroneous_field(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
47736 * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
47738 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
47739 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
47741 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
47743 void InvoiceError_set_erroneous_field(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKErroneousField val);
47746 * An explanation of the error.
47748 struct LDKUntrustedString InvoiceError_get_message(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
47751 * An explanation of the error.
47753 void InvoiceError_set_message(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKUntrustedString val);
47756 * Constructs a new InvoiceError given each field
47758 * Note that erroneous_field_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
47760 MUST_USE_RES struct LDKInvoiceError InvoiceError_new(struct LDKErroneousField erroneous_field_arg, struct LDKUntrustedString message_arg);
47763 * Creates a copy of the InvoiceError
47765 struct LDKInvoiceError InvoiceError_clone(const struct LDKInvoiceError *NONNULL_PTR orig);
47768 * Frees any resources used by the ErroneousField, if is_owned is set and inner is non-NULL.
47770 void ErroneousField_free(struct LDKErroneousField this_obj);
47773 * The type number of the TLV field containing the error.
47775 uint64_t ErroneousField_get_tlv_fieldnum(const struct LDKErroneousField *NONNULL_PTR this_ptr);
47778 * The type number of the TLV field containing the error.
47780 void ErroneousField_set_tlv_fieldnum(struct LDKErroneousField *NONNULL_PTR this_ptr, uint64_t val);
47783 * A value to use for the TLV field to avoid the error.
47785 * Returns a copy of the field.
47787 struct LDKCOption_CVec_u8ZZ ErroneousField_get_suggested_value(const struct LDKErroneousField *NONNULL_PTR this_ptr);
47790 * A value to use for the TLV field to avoid the error.
47792 void ErroneousField_set_suggested_value(struct LDKErroneousField *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
47795 * Constructs a new ErroneousField given each field
47797 MUST_USE_RES struct LDKErroneousField ErroneousField_new(uint64_t tlv_fieldnum_arg, struct LDKCOption_CVec_u8ZZ suggested_value_arg);
47800 * Creates a copy of the ErroneousField
47802 struct LDKErroneousField ErroneousField_clone(const struct LDKErroneousField *NONNULL_PTR orig);
47805 * Creates an [`InvoiceError`] with the given message.
47807 MUST_USE_RES struct LDKInvoiceError InvoiceError_from_string(struct LDKStr s);
47810 * Serialize the InvoiceError object into a byte array which can be read by InvoiceError_read
47812 struct LDKCVec_u8Z InvoiceError_write(const struct LDKInvoiceError *NONNULL_PTR obj);
47815 * Read a InvoiceError from a byte array, created by InvoiceError_write
47817 struct LDKCResult_InvoiceErrorDecodeErrorZ InvoiceError_read(struct LDKu8slice ser);
47820 * Frees any resources used by the InvoiceRequestWithExplicitPayerIdBuilder, if is_owned is set and inner is non-NULL.
47822 void InvoiceRequestWithExplicitPayerIdBuilder_free(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_obj);
47825 * Frees any resources used by the InvoiceRequestWithDerivedPayerIdBuilder, if is_owned is set and inner is non-NULL.
47827 void InvoiceRequestWithDerivedPayerIdBuilder_free(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_obj);
47830 * Builds an unsigned [`InvoiceRequest`] after checking for valid semantics. It can be signed
47831 * by [`UnsignedInvoiceRequest::sign`].
47833 MUST_USE_RES struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_build(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg);
47836 * Sets the [`InvoiceRequest::chain`] of the given [`Network`] for paying an invoice. If not
47837 * called, [`Network::Bitcoin`] is assumed. Errors if the chain for `network` is not supported
47840 * Successive calls to this method will override the previous setting.
47842 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_chain(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, enum LDKNetwork network);
47845 * Sets the [`InvoiceRequest::amount_msats`] for paying an invoice. Errors if `amount_msats` is
47846 * not at least the expected invoice amount (i.e., [`Offer::amount`] times [`quantity`]).
47848 * Successive calls to this method will override the previous setting.
47850 * [`quantity`]: Self::quantity
47852 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, uint64_t amount_msats);
47855 * Sets [`InvoiceRequest::quantity`] of items. If not set, `1` is assumed. Errors if `quantity`
47856 * does not conform to [`Offer::is_valid_quantity`].
47858 * Successive calls to this method will override the previous setting.
47860 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_quantity(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, uint64_t quantity);
47863 * Sets the [`InvoiceRequest::payer_note`].
47865 * Successive calls to this method will override the previous setting.
47867 MUST_USE_RES void InvoiceRequestWithExplicitPayerIdBuilder_payer_note(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, struct LDKStr payer_note);
47870 * Builds a signed [`InvoiceRequest`] after checking for valid semantics.
47872 MUST_USE_RES struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg);
47875 * Sets the [`InvoiceRequest::chain`] of the given [`Network`] for paying an invoice. If not
47876 * called, [`Network::Bitcoin`] is assumed. Errors if the chain for `network` is not supported
47879 * Successive calls to this method will override the previous setting.
47881 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_chain(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, enum LDKNetwork network);
47884 * Sets the [`InvoiceRequest::amount_msats`] for paying an invoice. Errors if `amount_msats` is
47885 * not at least the expected invoice amount (i.e., [`Offer::amount`] times [`quantity`]).
47887 * Successive calls to this method will override the previous setting.
47889 * [`quantity`]: Self::quantity
47891 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_amount_msats(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, uint64_t amount_msats);
47894 * Sets [`InvoiceRequest::quantity`] of items. If not set, `1` is assumed. Errors if `quantity`
47895 * does not conform to [`Offer::is_valid_quantity`].
47897 * Successive calls to this method will override the previous setting.
47899 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_quantity(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, uint64_t quantity);
47902 * Sets the [`InvoiceRequest::payer_note`].
47904 * Successive calls to this method will override the previous setting.
47906 MUST_USE_RES void InvoiceRequestWithDerivedPayerIdBuilder_payer_note(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, struct LDKStr payer_note);
47909 * Frees any resources used by the UnsignedInvoiceRequest, if is_owned is set and inner is non-NULL.
47911 void UnsignedInvoiceRequest_free(struct LDKUnsignedInvoiceRequest this_obj);
47914 * Calls the free function if one is set
47916 void SignInvoiceRequestFn_free(struct LDKSignInvoiceRequestFn this_ptr);
47919 * Returns the [`TaggedHash`] of the invoice to sign.
47921 MUST_USE_RES struct LDKTaggedHash UnsignedInvoiceRequest_tagged_hash(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
47924 * Frees any resources used by the InvoiceRequest, if is_owned is set and inner is non-NULL.
47926 void InvoiceRequest_free(struct LDKInvoiceRequest this_obj);
47929 * Creates a copy of the InvoiceRequest
47931 struct LDKInvoiceRequest InvoiceRequest_clone(const struct LDKInvoiceRequest *NONNULL_PTR orig);
47934 * Frees any resources used by the VerifiedInvoiceRequest, if is_owned is set and inner is non-NULL.
47936 void VerifiedInvoiceRequest_free(struct LDKVerifiedInvoiceRequest this_obj);
47939 * The identifier of the [`Offer`] for which the [`InvoiceRequest`] was made.
47941 struct LDKOfferId VerifiedInvoiceRequest_get_offer_id(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr);
47944 * The identifier of the [`Offer`] for which the [`InvoiceRequest`] was made.
47946 void VerifiedInvoiceRequest_set_offer_id(struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr, struct LDKOfferId val);
47949 * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
47951 * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
47952 * [`respond_with`].
47954 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
47955 * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
47956 * [`respond_with`]: Self::respond_with
47958 struct LDKCOption_SecretKeyZ VerifiedInvoiceRequest_get_keys(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr);
47961 * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
47963 * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
47964 * [`respond_with`].
47966 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
47967 * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
47968 * [`respond_with`]: Self::respond_with
47970 void VerifiedInvoiceRequest_set_keys(struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr, struct LDKCOption_SecretKeyZ val);
47973 * Creates a copy of the VerifiedInvoiceRequest
47975 struct LDKVerifiedInvoiceRequest VerifiedInvoiceRequest_clone(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR orig);
47978 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
47979 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
47980 * for the selected chain.
47982 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ UnsignedInvoiceRequest_chains(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
47985 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
47986 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
47988 MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedInvoiceRequest_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
47991 * The minimum amount required for a successful payment of a single item.
47993 MUST_USE_RES struct LDKCOption_AmountZ UnsignedInvoiceRequest_amount(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
47996 * A complete description of the purpose of the payment. Intended to be displayed to the user
47997 * but with the caveat that it has not been verified in any way.
47999 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48001 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_description(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48004 * Features pertaining to the offer.
48006 MUST_USE_RES struct LDKOfferFeatures UnsignedInvoiceRequest_offer_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48009 * Duration since the Unix epoch when an invoice should no longer be requested.
48011 * If `None`, the offer does not expire.
48013 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_absolute_expiry(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48016 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
48017 * displayed to the user but with the caveat that it has not been verified in any way.
48019 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48021 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_issuer(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48024 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
48025 * recipient privacy by obfuscating its node id.
48027 MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedInvoiceRequest_paths(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48030 * The quantity of items supported.
48032 MUST_USE_RES struct LDKQuantity UnsignedInvoiceRequest_supported_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48035 * The public key used by the recipient to sign invoices.
48037 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48039 MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_signing_pubkey(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48042 * An unpredictable series of bytes, typically containing information about the derivation of
48045 * [`payer_id`]: Self::payer_id
48047 MUST_USE_RES struct LDKu8slice UnsignedInvoiceRequest_payer_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48050 * A chain from [`Offer::chains`] that the offer is valid for.
48052 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedInvoiceRequest_chain(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48055 * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
48056 * must be greater than or equal to [`Offer::amount`], converted if necessary.
48058 * [`chain`]: Self::chain
48060 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_amount_msats(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48063 * Features pertaining to requesting an invoice.
48065 MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedInvoiceRequest_invoice_request_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48068 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
48070 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48073 * A possibly transient pubkey used to sign the invoice request.
48075 MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_payer_id(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48078 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
48081 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48083 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_payer_note(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48086 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
48087 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
48088 * for the selected chain.
48090 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ InvoiceRequest_chains(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48093 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
48094 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
48096 MUST_USE_RES struct LDKCOption_CVec_u8ZZ InvoiceRequest_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48099 * The minimum amount required for a successful payment of a single item.
48101 MUST_USE_RES struct LDKCOption_AmountZ InvoiceRequest_amount(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48104 * A complete description of the purpose of the payment. Intended to be displayed to the user
48105 * but with the caveat that it has not been verified in any way.
48107 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48109 MUST_USE_RES struct LDKPrintableString InvoiceRequest_description(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48112 * Features pertaining to the offer.
48114 MUST_USE_RES struct LDKOfferFeatures InvoiceRequest_offer_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48117 * Duration since the Unix epoch when an invoice should no longer be requested.
48119 * If `None`, the offer does not expire.
48121 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_absolute_expiry(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48124 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
48125 * displayed to the user but with the caveat that it has not been verified in any way.
48127 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48129 MUST_USE_RES struct LDKPrintableString InvoiceRequest_issuer(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48132 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
48133 * recipient privacy by obfuscating its node id.
48135 MUST_USE_RES struct LDKCVec_BlindedPathZ InvoiceRequest_paths(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48138 * The quantity of items supported.
48140 MUST_USE_RES struct LDKQuantity InvoiceRequest_supported_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48143 * The public key used by the recipient to sign invoices.
48145 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48147 MUST_USE_RES struct LDKPublicKey InvoiceRequest_signing_pubkey(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48150 * An unpredictable series of bytes, typically containing information about the derivation of
48153 * [`payer_id`]: Self::payer_id
48155 MUST_USE_RES struct LDKu8slice InvoiceRequest_payer_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48158 * A chain from [`Offer::chains`] that the offer is valid for.
48160 MUST_USE_RES struct LDKThirtyTwoBytes InvoiceRequest_chain(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48163 * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
48164 * must be greater than or equal to [`Offer::amount`], converted if necessary.
48166 * [`chain`]: Self::chain
48168 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_amount_msats(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48171 * Features pertaining to requesting an invoice.
48173 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequest_invoice_request_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48176 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
48178 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48181 * A possibly transient pubkey used to sign the invoice request.
48183 MUST_USE_RES struct LDKPublicKey InvoiceRequest_payer_id(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48186 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
48189 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48191 MUST_USE_RES struct LDKPrintableString InvoiceRequest_payer_note(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48194 * Creates an [`InvoiceBuilder`] for the request with the given required fields and using the
48195 * [`Duration`] since [`std::time::SystemTime::UNIX_EPOCH`] as the creation time.
48197 * See [`InvoiceRequest::respond_with_no_std`] for further details where the aforementioned
48198 * creation time is used for the `created_at` parameter.
48200 * [`Duration`]: core::time::Duration
48202 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);
48205 * Creates an [`InvoiceBuilder`] for the request with the given required fields.
48207 * Unless [`InvoiceBuilder::relative_expiry`] is set, the invoice will expire two hours after
48208 * `created_at`, which is used to set [`Bolt12Invoice::created_at`]. Useful for `no-std` builds
48209 * where [`std::time::SystemTime`] is not available.
48211 * The caller is expected to remember the preimage of `payment_hash` in order to claim a payment
48214 * The `payment_paths` parameter is useful for maintaining the payment recipient's privacy. It
48215 * must contain one or more elements ordered from most-preferred to least-preferred, if there's
48216 * a preference. Note, however, that any privacy is lost if a public node id was used for
48217 * [`Offer::signing_pubkey`].
48219 * Errors if the request contains unknown required features.
48223 * If the originating [`Offer`] was created using [`OfferBuilder::deriving_signing_pubkey`],
48224 * then use [`InvoiceRequest::verify`] and [`VerifiedInvoiceRequest`] methods instead.
48226 * [`Bolt12Invoice::created_at`]: crate::offers::invoice::Bolt12Invoice::created_at
48227 * [`OfferBuilder::deriving_signing_pubkey`]: crate::offers::offer::OfferBuilder::deriving_signing_pubkey
48229 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);
48232 * Verifies that the request was for an offer created using the given key. Returns the verified
48233 * request which contains the derived keys needed to sign a [`Bolt12Invoice`] for the request
48234 * if they could be extracted from the metadata.
48236 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
48238 MUST_USE_RES struct LDKCResult_VerifiedInvoiceRequestNoneZ InvoiceRequest_verify(struct LDKInvoiceRequest this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
48241 * Signature of the invoice request using [`payer_id`].
48243 * [`payer_id`]: Self::payer_id
48245 MUST_USE_RES struct LDKSchnorrSignature InvoiceRequest_signature(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48248 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
48249 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
48250 * for the selected chain.
48252 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ VerifiedInvoiceRequest_chains(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48255 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
48256 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
48258 MUST_USE_RES struct LDKCOption_CVec_u8ZZ VerifiedInvoiceRequest_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48261 * The minimum amount required for a successful payment of a single item.
48263 MUST_USE_RES struct LDKCOption_AmountZ VerifiedInvoiceRequest_amount(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48266 * A complete description of the purpose of the payment. Intended to be displayed to the user
48267 * but with the caveat that it has not been verified in any way.
48269 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48271 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_description(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48274 * Features pertaining to the offer.
48276 MUST_USE_RES struct LDKOfferFeatures VerifiedInvoiceRequest_offer_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48279 * Duration since the Unix epoch when an invoice should no longer be requested.
48281 * If `None`, the offer does not expire.
48283 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_absolute_expiry(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48286 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
48287 * displayed to the user but with the caveat that it has not been verified in any way.
48289 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48291 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_issuer(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48294 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
48295 * recipient privacy by obfuscating its node id.
48297 MUST_USE_RES struct LDKCVec_BlindedPathZ VerifiedInvoiceRequest_paths(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48300 * The quantity of items supported.
48302 MUST_USE_RES struct LDKQuantity VerifiedInvoiceRequest_supported_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48305 * The public key used by the recipient to sign invoices.
48307 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48309 MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_signing_pubkey(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48312 * An unpredictable series of bytes, typically containing information about the derivation of
48315 * [`payer_id`]: Self::payer_id
48317 MUST_USE_RES struct LDKu8slice VerifiedInvoiceRequest_payer_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48320 * A chain from [`Offer::chains`] that the offer is valid for.
48322 MUST_USE_RES struct LDKThirtyTwoBytes VerifiedInvoiceRequest_chain(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48325 * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
48326 * must be greater than or equal to [`Offer::amount`], converted if necessary.
48328 * [`chain`]: Self::chain
48330 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_amount_msats(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48333 * Features pertaining to requesting an invoice.
48335 MUST_USE_RES struct LDKInvoiceRequestFeatures VerifiedInvoiceRequest_invoice_request_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48338 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
48340 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48343 * A possibly transient pubkey used to sign the invoice request.
48345 MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_payer_id(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48348 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
48351 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48353 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_payer_note(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48356 * Creates an [`InvoiceBuilder`] for the request with the given required fields and using the
48357 * [`Duration`] since [`std::time::SystemTime::UNIX_EPOCH`] as the creation time.
48359 * See [`InvoiceRequest::respond_with_no_std`] for further details where the aforementioned
48360 * creation time is used for the `created_at` parameter.
48362 * [`Duration`]: core::time::Duration
48364 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);
48367 * Creates an [`InvoiceBuilder`] for the request with the given required fields.
48369 * Unless [`InvoiceBuilder::relative_expiry`] is set, the invoice will expire two hours after
48370 * `created_at`, which is used to set [`Bolt12Invoice::created_at`]. Useful for `no-std` builds
48371 * where [`std::time::SystemTime`] is not available.
48373 * The caller is expected to remember the preimage of `payment_hash` in order to claim a payment
48376 * The `payment_paths` parameter is useful for maintaining the payment recipient's privacy. It
48377 * must contain one or more elements ordered from most-preferred to least-preferred, if there's
48378 * a preference. Note, however, that any privacy is lost if a public node id was used for
48379 * [`Offer::signing_pubkey`].
48381 * Errors if the request contains unknown required features.
48385 * If the originating [`Offer`] was created using [`OfferBuilder::deriving_signing_pubkey`],
48386 * then use [`InvoiceRequest::verify`] and [`VerifiedInvoiceRequest`] methods instead.
48388 * [`Bolt12Invoice::created_at`]: crate::offers::invoice::Bolt12Invoice::created_at
48389 * [`OfferBuilder::deriving_signing_pubkey`]: crate::offers::offer::OfferBuilder::deriving_signing_pubkey
48391 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);
48394 * Creates an [`InvoiceBuilder`] for the request using the given required fields and that uses
48395 * derived signing keys from the originating [`Offer`] to sign the [`Bolt12Invoice`]. Must use
48396 * the same [`ExpandedKey`] as the one used to create the offer.
48398 * See [`InvoiceRequest::respond_with`] for further details.
48400 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
48402 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);
48405 * Creates an [`InvoiceBuilder`] for the request using the given required fields and that uses
48406 * derived signing keys from the originating [`Offer`] to sign the [`Bolt12Invoice`]. Must use
48407 * the same [`ExpandedKey`] as the one used to create the offer.
48409 * See [`InvoiceRequest::respond_with_no_std`] for further details.
48411 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
48413 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);
48416 * Serialize the UnsignedInvoiceRequest object into a byte array which can be read by UnsignedInvoiceRequest_read
48418 struct LDKCVec_u8Z UnsignedInvoiceRequest_write(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR obj);
48421 * Serialize the InvoiceRequest object into a byte array which can be read by InvoiceRequest_read
48423 struct LDKCVec_u8Z InvoiceRequest_write(const struct LDKInvoiceRequest *NONNULL_PTR obj);
48426 * Frees any resources used by the InvoiceRequestFields, if is_owned is set and inner is non-NULL.
48428 void InvoiceRequestFields_free(struct LDKInvoiceRequestFields this_obj);
48431 * A possibly transient pubkey used to sign the invoice request.
48433 struct LDKPublicKey InvoiceRequestFields_get_payer_id(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr);
48436 * A possibly transient pubkey used to sign the invoice request.
48438 void InvoiceRequestFields_set_payer_id(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
48441 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
48443 struct LDKCOption_u64Z InvoiceRequestFields_get_quantity(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr);
48446 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
48448 void InvoiceRequestFields_set_quantity(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
48451 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
48452 * response. Truncated to [`PAYER_NOTE_LIMIT`] characters.
48454 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48456 struct LDKUntrustedString InvoiceRequestFields_get_payer_note_truncated(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr);
48459 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
48460 * response. Truncated to [`PAYER_NOTE_LIMIT`] characters.
48462 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
48464 void InvoiceRequestFields_set_payer_note_truncated(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKUntrustedString val);
48467 * Constructs a new InvoiceRequestFields given each field
48469 * Note that payer_note_truncated_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
48471 MUST_USE_RES struct LDKInvoiceRequestFields InvoiceRequestFields_new(struct LDKPublicKey payer_id_arg, struct LDKCOption_u64Z quantity_arg, struct LDKUntrustedString payer_note_truncated_arg);
48474 * Creates a copy of the InvoiceRequestFields
48476 struct LDKInvoiceRequestFields InvoiceRequestFields_clone(const struct LDKInvoiceRequestFields *NONNULL_PTR orig);
48479 * Checks if two InvoiceRequestFieldss contain equal inner contents.
48480 * This ignores pointers and is_owned flags and looks at the values in fields.
48481 * Two objects with NULL inner values will be considered "equal" here.
48483 bool InvoiceRequestFields_eq(const struct LDKInvoiceRequestFields *NONNULL_PTR a, const struct LDKInvoiceRequestFields *NONNULL_PTR b);
48486 * Serialize the InvoiceRequestFields object into a byte array which can be read by InvoiceRequestFields_read
48488 struct LDKCVec_u8Z InvoiceRequestFields_write(const struct LDKInvoiceRequestFields *NONNULL_PTR obj);
48491 * Read a InvoiceRequestFields from a byte array, created by InvoiceRequestFields_write
48493 struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ InvoiceRequestFields_read(struct LDKu8slice ser);
48496 * Frees any resources used by the TaggedHash, if is_owned is set and inner is non-NULL.
48498 void TaggedHash_free(struct LDKTaggedHash this_obj);
48501 * Creates a copy of the TaggedHash
48503 struct LDKTaggedHash TaggedHash_clone(const struct LDKTaggedHash *NONNULL_PTR orig);
48506 * Returns the digest to sign.
48508 MUST_USE_RES const uint8_t (*TaggedHash_as_digest(const struct LDKTaggedHash *NONNULL_PTR this_arg))[32];
48511 * Returns the tag used in the tagged hash.
48513 MUST_USE_RES struct LDKStr TaggedHash_tag(const struct LDKTaggedHash *NONNULL_PTR this_arg);
48516 * Returns the merkle root used in the tagged hash.
48518 MUST_USE_RES struct LDKThirtyTwoBytes TaggedHash_merkle_root(const struct LDKTaggedHash *NONNULL_PTR this_arg);
48521 * Frees any resources used by the SignError
48523 void SignError_free(struct LDKSignError this_ptr);
48526 * Creates a copy of the SignError
48528 struct LDKSignError SignError_clone(const struct LDKSignError *NONNULL_PTR orig);
48531 * Utility method to constructs a new Signing-variant SignError
48533 struct LDKSignError SignError_signing(void);
48536 * Utility method to constructs a new Verification-variant SignError
48538 struct LDKSignError SignError_verification(enum LDKSecp256k1Error a);
48541 * Frees any resources used by the Bolt12ParseError, if is_owned is set and inner is non-NULL.
48543 void Bolt12ParseError_free(struct LDKBolt12ParseError this_obj);
48546 * Creates a copy of the Bolt12ParseError
48548 struct LDKBolt12ParseError Bolt12ParseError_clone(const struct LDKBolt12ParseError *NONNULL_PTR orig);
48551 * Creates a copy of the Bolt12SemanticError
48553 enum LDKBolt12SemanticError Bolt12SemanticError_clone(const enum LDKBolt12SemanticError *NONNULL_PTR orig);
48556 * Utility method to constructs a new AlreadyExpired-variant Bolt12SemanticError
48558 enum LDKBolt12SemanticError Bolt12SemanticError_already_expired(void);
48561 * Utility method to constructs a new UnsupportedChain-variant Bolt12SemanticError
48563 enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_chain(void);
48566 * Utility method to constructs a new UnexpectedChain-variant Bolt12SemanticError
48568 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_chain(void);
48571 * Utility method to constructs a new MissingAmount-variant Bolt12SemanticError
48573 enum LDKBolt12SemanticError Bolt12SemanticError_missing_amount(void);
48576 * Utility method to constructs a new InvalidAmount-variant Bolt12SemanticError
48578 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_amount(void);
48581 * Utility method to constructs a new InsufficientAmount-variant Bolt12SemanticError
48583 enum LDKBolt12SemanticError Bolt12SemanticError_insufficient_amount(void);
48586 * Utility method to constructs a new UnexpectedAmount-variant Bolt12SemanticError
48588 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_amount(void);
48591 * Utility method to constructs a new UnsupportedCurrency-variant Bolt12SemanticError
48593 enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_currency(void);
48596 * Utility method to constructs a new UnknownRequiredFeatures-variant Bolt12SemanticError
48598 enum LDKBolt12SemanticError Bolt12SemanticError_unknown_required_features(void);
48601 * Utility method to constructs a new UnexpectedFeatures-variant Bolt12SemanticError
48603 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_features(void);
48606 * Utility method to constructs a new MissingDescription-variant Bolt12SemanticError
48608 enum LDKBolt12SemanticError Bolt12SemanticError_missing_description(void);
48611 * Utility method to constructs a new MissingSigningPubkey-variant Bolt12SemanticError
48613 enum LDKBolt12SemanticError Bolt12SemanticError_missing_signing_pubkey(void);
48616 * Utility method to constructs a new InvalidSigningPubkey-variant Bolt12SemanticError
48618 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_signing_pubkey(void);
48621 * Utility method to constructs a new UnexpectedSigningPubkey-variant Bolt12SemanticError
48623 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_signing_pubkey(void);
48626 * Utility method to constructs a new MissingQuantity-variant Bolt12SemanticError
48628 enum LDKBolt12SemanticError Bolt12SemanticError_missing_quantity(void);
48631 * Utility method to constructs a new InvalidQuantity-variant Bolt12SemanticError
48633 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_quantity(void);
48636 * Utility method to constructs a new UnexpectedQuantity-variant Bolt12SemanticError
48638 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_quantity(void);
48641 * Utility method to constructs a new InvalidMetadata-variant Bolt12SemanticError
48643 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_metadata(void);
48646 * Utility method to constructs a new UnexpectedMetadata-variant Bolt12SemanticError
48648 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_metadata(void);
48651 * Utility method to constructs a new MissingPayerMetadata-variant Bolt12SemanticError
48653 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_metadata(void);
48656 * Utility method to constructs a new MissingPayerId-variant Bolt12SemanticError
48658 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_id(void);
48661 * Utility method to constructs a new DuplicatePaymentId-variant Bolt12SemanticError
48663 enum LDKBolt12SemanticError Bolt12SemanticError_duplicate_payment_id(void);
48666 * Utility method to constructs a new MissingPaths-variant Bolt12SemanticError
48668 enum LDKBolt12SemanticError Bolt12SemanticError_missing_paths(void);
48671 * Utility method to constructs a new UnexpectedPaths-variant Bolt12SemanticError
48673 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_paths(void);
48676 * Utility method to constructs a new InvalidPayInfo-variant Bolt12SemanticError
48678 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_pay_info(void);
48681 * Utility method to constructs a new MissingCreationTime-variant Bolt12SemanticError
48683 enum LDKBolt12SemanticError Bolt12SemanticError_missing_creation_time(void);
48686 * Utility method to constructs a new MissingPaymentHash-variant Bolt12SemanticError
48688 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payment_hash(void);
48691 * Utility method to constructs a new MissingSignature-variant Bolt12SemanticError
48693 enum LDKBolt12SemanticError Bolt12SemanticError_missing_signature(void);
48696 * Frees any resources used by the RefundMaybeWithDerivedMetadataBuilder, if is_owned is set and inner is non-NULL.
48698 void RefundMaybeWithDerivedMetadataBuilder_free(struct LDKRefundMaybeWithDerivedMetadataBuilder this_obj);
48701 * Creates a new builder for a refund using the [`Refund::payer_id`] for the public node id to
48702 * send to if no [`Refund::paths`] are set. Otherwise, it may be a transient pubkey.
48704 * Additionally, sets the required (empty) [`Refund::description`], [`Refund::payer_metadata`],
48705 * and [`Refund::amount_msats`].
48709 * If constructing a [`Refund`] for use with a [`ChannelManager`], use
48710 * [`ChannelManager::create_refund_builder`] instead of [`RefundBuilder::new`].
48712 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
48713 * [`ChannelManager::create_refund_builder`]: crate::ln::channelmanager::ChannelManager::create_refund_builder
48715 MUST_USE_RES struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_new(struct LDKCVec_u8Z metadata, struct LDKPublicKey payer_id, uint64_t amount_msats);
48718 * Similar to [`RefundBuilder::new`] except, if [`RefundBuilder::path`] is called, the payer id
48719 * is derived from the given [`ExpandedKey`] and nonce. This provides sender privacy by using a
48720 * different payer id for each refund, assuming a different nonce is used. Otherwise, the
48721 * provided `node_id` is used for the payer id.
48723 * Also, sets the metadata when [`RefundBuilder::build`] is called such that it can be used to
48724 * verify that an [`InvoiceRequest`] was produced for the refund given an [`ExpandedKey`].
48726 * The `payment_id` is encrypted in the metadata and should be unique. This ensures that only
48727 * one invoice will be paid for the refund and that payments can be uniquely identified.
48729 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
48730 * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey
48732 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);
48735 * Sets the [`Refund::description`].
48737 * Successive calls to this method will override the previous setting.
48739 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_description(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr description);
48742 * Sets the [`Refund::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has
48743 * already passed is valid and can be checked for using [`Refund::is_expired`].
48745 * Successive calls to this method will override the previous setting.
48747 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, uint64_t absolute_expiry);
48750 * Sets the [`Refund::issuer`].
48752 * Successive calls to this method will override the previous setting.
48754 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_issuer(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr issuer);
48757 * Adds a blinded path to [`Refund::paths`]. Must include at least one path if only connected
48758 * by private channels or if [`Refund::payer_id`] is not a public node id.
48760 * Successive calls to this method will add another blinded path. Caller is responsible for not
48761 * adding duplicate paths.
48763 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_path(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKBlindedPath path);
48766 * Sets the [`Refund::chain`] of the given [`Network`] for paying an invoice. If not
48767 * called, [`Network::Bitcoin`] is assumed.
48769 * Successive calls to this method will override the previous setting.
48771 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_chain(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, enum LDKNetwork network);
48774 * Sets [`Refund::quantity`] of items. This is purely for informational purposes. It is useful
48775 * when the refund pertains to a [`Bolt12Invoice`] that paid for more than one item from an
48776 * [`Offer`] as specified by [`InvoiceRequest::quantity`].
48778 * Successive calls to this method will override the previous setting.
48780 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
48781 * [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
48782 * [`Offer`]: crate::offers::offer::Offer
48784 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_quantity(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, uint64_t quantity);
48787 * Sets the [`Refund::payer_note`].
48789 * Successive calls to this method will override the previous setting.
48791 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_payer_note(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr payer_note);
48794 * Builds a [`Refund`] after checking for valid semantics.
48796 MUST_USE_RES struct LDKCResult_RefundBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_build(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg);
48799 * Frees any resources used by the Refund, if is_owned is set and inner is non-NULL.
48801 void Refund_free(struct LDKRefund this_obj);
48804 * Creates a copy of the Refund
48806 struct LDKRefund Refund_clone(const struct LDKRefund *NONNULL_PTR orig);
48809 * A complete description of the purpose of the refund. Intended to be displayed to the user
48810 * but with the caveat that it has not been verified in any way.
48812 MUST_USE_RES struct LDKPrintableString Refund_description(const struct LDKRefund *NONNULL_PTR this_arg);
48815 * Duration since the Unix epoch when an invoice should no longer be sent.
48817 * If `None`, the refund does not expire.
48819 MUST_USE_RES struct LDKCOption_u64Z Refund_absolute_expiry(const struct LDKRefund *NONNULL_PTR this_arg);
48822 * Whether the refund has expired.
48824 MUST_USE_RES bool Refund_is_expired(const struct LDKRefund *NONNULL_PTR this_arg);
48827 * Whether the refund has expired given the duration since the Unix epoch.
48829 MUST_USE_RES bool Refund_is_expired_no_std(const struct LDKRefund *NONNULL_PTR this_arg, uint64_t duration_since_epoch);
48832 * The issuer of the refund, possibly beginning with `user@domain` or `domain`. Intended to be
48833 * displayed to the user but with the caveat that it has not been verified in any way.
48835 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48837 MUST_USE_RES struct LDKPrintableString Refund_issuer(const struct LDKRefund *NONNULL_PTR this_arg);
48840 * Paths to the sender originating from publicly reachable nodes. Blinded paths provide sender
48841 * privacy by obfuscating its node id.
48843 MUST_USE_RES struct LDKCVec_BlindedPathZ Refund_paths(const struct LDKRefund *NONNULL_PTR this_arg);
48846 * An unpredictable series of bytes, typically containing information about the derivation of
48849 * [`payer_id`]: Self::payer_id
48851 MUST_USE_RES struct LDKu8slice Refund_payer_metadata(const struct LDKRefund *NONNULL_PTR this_arg);
48854 * A chain that the refund is valid for.
48856 MUST_USE_RES struct LDKThirtyTwoBytes Refund_chain(const struct LDKRefund *NONNULL_PTR this_arg);
48859 * The amount to refund in msats (i.e., the minimum lightning-payable unit for [`chain`]).
48861 * [`chain`]: Self::chain
48863 MUST_USE_RES uint64_t Refund_amount_msats(const struct LDKRefund *NONNULL_PTR this_arg);
48866 * Features pertaining to requesting an invoice.
48868 MUST_USE_RES struct LDKInvoiceRequestFeatures Refund_features(const struct LDKRefund *NONNULL_PTR this_arg);
48871 * The quantity of an item that refund is for.
48873 MUST_USE_RES struct LDKCOption_u64Z Refund_quantity(const struct LDKRefund *NONNULL_PTR this_arg);
48876 * A public node id to send to in the case where there are no [`paths`]. Otherwise, a possibly
48877 * transient pubkey.
48879 * [`paths`]: Self::paths
48881 MUST_USE_RES struct LDKPublicKey Refund_payer_id(const struct LDKRefund *NONNULL_PTR this_arg);
48884 * Payer provided note to include in the invoice.
48886 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48888 MUST_USE_RES struct LDKPrintableString Refund_payer_note(const struct LDKRefund *NONNULL_PTR this_arg);
48891 * Generates a non-cryptographic 64-bit hash of the Refund.
48893 uint64_t Refund_hash(const struct LDKRefund *NONNULL_PTR o);
48896 * Serialize the Refund object into a byte array which can be read by Refund_read
48898 struct LDKCVec_u8Z Refund_write(const struct LDKRefund *NONNULL_PTR obj);
48901 * Read a Refund object from a string
48903 struct LDKCResult_RefundBolt12ParseErrorZ Refund_from_str(struct LDKStr s);
48906 * Creates a copy of the UtxoLookupError
48908 enum LDKUtxoLookupError UtxoLookupError_clone(const enum LDKUtxoLookupError *NONNULL_PTR orig);
48911 * Utility method to constructs a new UnknownChain-variant UtxoLookupError
48913 enum LDKUtxoLookupError UtxoLookupError_unknown_chain(void);
48916 * Utility method to constructs a new UnknownTx-variant UtxoLookupError
48918 enum LDKUtxoLookupError UtxoLookupError_unknown_tx(void);
48921 * Frees any resources used by the UtxoResult
48923 void UtxoResult_free(struct LDKUtxoResult this_ptr);
48926 * Creates a copy of the UtxoResult
48928 struct LDKUtxoResult UtxoResult_clone(const struct LDKUtxoResult *NONNULL_PTR orig);
48931 * Utility method to constructs a new Sync-variant UtxoResult
48933 struct LDKUtxoResult UtxoResult_sync(struct LDKCResult_TxOutUtxoLookupErrorZ a);
48936 * Utility method to constructs a new Async-variant UtxoResult
48938 struct LDKUtxoResult UtxoResult_async(struct LDKUtxoFuture a);
48941 * Calls the free function if one is set
48943 void UtxoLookup_free(struct LDKUtxoLookup this_ptr);
48946 * Frees any resources used by the UtxoFuture, if is_owned is set and inner is non-NULL.
48948 void UtxoFuture_free(struct LDKUtxoFuture this_obj);
48951 * Creates a copy of the UtxoFuture
48953 struct LDKUtxoFuture UtxoFuture_clone(const struct LDKUtxoFuture *NONNULL_PTR orig);
48956 * Builds a new future for later resolution.
48958 MUST_USE_RES struct LDKUtxoFuture UtxoFuture_new(void);
48961 * Resolves this future against the given `graph` and with the given `result`.
48963 * This is identical to calling [`UtxoFuture::resolve`] with a dummy `gossip`, disabling
48964 * forwarding the validated gossip message onwards to peers.
48966 * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
48967 * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
48970 * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
48971 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
48973 void UtxoFuture_resolve_without_forwarding(const struct LDKUtxoFuture *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR graph, struct LDKCResult_TxOutUtxoLookupErrorZ result);
48976 * Resolves this future against the given `graph` and with the given `result`.
48978 * The given `gossip` is used to broadcast any validated messages onwards to all peers which
48979 * have available buffer space.
48981 * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
48982 * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
48985 * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
48986 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
48988 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);
48991 * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
48993 void NodeId_free(struct LDKNodeId this_obj);
48996 * Creates a copy of the NodeId
48998 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
49001 * Create a new NodeId from a public key
49003 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
49006 * Create a new NodeId from a slice of bytes
49008 MUST_USE_RES struct LDKCResult_NodeIdDecodeErrorZ NodeId_from_slice(struct LDKu8slice bytes);
49011 * Get the public key slice from this NodeId
49013 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
49016 * Get the public key as an array from this NodeId
49018 MUST_USE_RES const uint8_t (*NodeId_as_array(const struct LDKNodeId *NONNULL_PTR this_arg))[33];
49021 * Get the public key from this NodeId
49023 MUST_USE_RES struct LDKCResult_PublicKeySecp256k1ErrorZ NodeId_as_pubkey(const struct LDKNodeId *NONNULL_PTR this_arg);
49026 * Generates a non-cryptographic 64-bit hash of the NodeId.
49028 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
49031 * Serialize the NodeId object into a byte array which can be read by NodeId_read
49033 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
49036 * Read a NodeId from a byte array, created by NodeId_write
49038 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
49041 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
49043 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
49046 * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
49048 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
49051 * Frees any resources used by the NetworkUpdate
49053 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
49056 * Creates a copy of the NetworkUpdate
49058 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
49061 * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
49063 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
49066 * Utility method to constructs a new ChannelFailure-variant NetworkUpdate
49068 struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent);
49071 * Utility method to constructs a new NodeFailure-variant NetworkUpdate
49073 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
49076 * Checks if two NetworkUpdates contain equal inner contents.
49077 * This ignores pointers and is_owned flags and looks at the values in fields.
49079 bool NetworkUpdate_eq(const struct LDKNetworkUpdate *NONNULL_PTR a, const struct LDKNetworkUpdate *NONNULL_PTR b);
49082 * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
49084 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
49087 * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
49089 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
49092 * Frees any resources used by the P2PGossipSync, if is_owned is set and inner is non-NULL.
49094 void P2PGossipSync_free(struct LDKP2PGossipSync this_obj);
49097 * Creates a new tracker of the actual state of the network of channels and nodes,
49098 * assuming an existing [`NetworkGraph`].
49099 * UTXO lookup is used to make sure announced channels exist on-chain, channel data is
49100 * correct, and the announcement is signed with channel owners' keys.
49102 MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_UtxoLookupZ utxo_lookup, struct LDKLogger logger);
49105 * Adds a provider used to check new announcements. Does not affect
49106 * existing announcements unless they are updated.
49107 * Add, update or remove the provider would replace the current one.
49109 void P2PGossipSync_add_utxo_lookup(const struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_UtxoLookupZ utxo_lookup);
49112 * Handles any network updates originating from [`Event`]s.
49113 * Note that this will skip applying any [`NetworkUpdate::ChannelUpdateMessage`] to avoid
49114 * leaking possibly identifying information of the sender to the public network.
49116 * [`Event`]: crate::events::Event
49118 void NetworkGraph_handle_network_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNetworkUpdate *NONNULL_PTR network_update);
49121 * Gets the chain hash for this network graph.
49123 MUST_USE_RES struct LDKThirtyTwoBytes NetworkGraph_get_chain_hash(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
49126 * Verifies the signature of a [`NodeAnnouncement`].
49128 * Returns an error if it is invalid.
49130 struct LDKCResult_NoneLightningErrorZ verify_node_announcement(const struct LDKNodeAnnouncement *NONNULL_PTR msg);
49133 * Verifies all signatures included in a [`ChannelAnnouncement`].
49135 * Returns an error if one of the signatures is invalid.
49137 struct LDKCResult_NoneLightningErrorZ verify_channel_announcement(const struct LDKChannelAnnouncement *NONNULL_PTR msg);
49140 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
49141 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
49143 struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
49146 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
49147 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
49149 struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
49152 * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
49154 void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
49157 * When the last update to the channel direction was issued.
49158 * Value is opaque, as set in the announcement.
49160 uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
49163 * When the last update to the channel direction was issued.
49164 * Value is opaque, as set in the announcement.
49166 void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
49169 * Whether the channel can be currently used for payments (in this one direction).
49171 bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
49174 * Whether the channel can be currently used for payments (in this one direction).
49176 void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
49179 * The difference in CLTV values that you must have when routing through this channel.
49181 uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
49184 * The difference in CLTV values that you must have when routing through this channel.
49186 void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
49189 * The minimum value, which must be relayed to the next hop via the channel
49191 uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
49194 * The minimum value, which must be relayed to the next hop via the channel
49196 void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
49199 * The maximum value which may be relayed to the next hop via the channel.
49201 uint64_t ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
49204 * The maximum value which may be relayed to the next hop via the channel.
49206 void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
49209 * Fees charged when the channel is used for routing
49211 struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
49214 * Fees charged when the channel is used for routing
49216 void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
49219 * Most recent update for the channel received from the network
49220 * Mostly redundant with the data we store in fields explicitly.
49221 * Everything else is useful only for sending out for initial routing sync.
49222 * Not stored if contains excess data to prevent DoS.
49224 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49226 struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
49229 * Most recent update for the channel received from the network
49230 * Mostly redundant with the data we store in fields explicitly.
49231 * Everything else is useful only for sending out for initial routing sync.
49232 * Not stored if contains excess data to prevent DoS.
49234 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
49236 void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
49239 * Constructs a new ChannelUpdateInfo given each field
49241 * Note that last_update_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
49243 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);
49246 * Creates a copy of the ChannelUpdateInfo
49248 struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
49251 * Checks if two ChannelUpdateInfos contain equal inner contents.
49252 * This ignores pointers and is_owned flags and looks at the values in fields.
49253 * Two objects with NULL inner values will be considered "equal" here.
49255 bool ChannelUpdateInfo_eq(const struct LDKChannelUpdateInfo *NONNULL_PTR a, const struct LDKChannelUpdateInfo *NONNULL_PTR b);
49258 * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
49260 struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
49263 * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
49265 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
49268 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
49270 void ChannelInfo_free(struct LDKChannelInfo this_obj);
49273 * Protocol features of a channel communicated during its announcement
49275 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
49278 * Protocol features of a channel communicated during its announcement
49280 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
49283 * Source node of the first direction of a channel
49285 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
49288 * Source node of the first direction of a channel
49290 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
49293 * Details about the first direction of a channel
49295 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49297 struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
49300 * Details about the first direction of a channel
49302 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
49304 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
49307 * Source node of the second direction of a channel
49309 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
49312 * Source node of the second direction of a channel
49314 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
49317 * Details about the second direction of a channel
49319 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49321 struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
49324 * Details about the second direction of a channel
49326 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
49328 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
49331 * The channel capacity as seen on-chain, if chain lookup is available.
49333 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
49336 * The channel capacity as seen on-chain, if chain lookup is available.
49338 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
49341 * An initial announcement of the channel
49342 * Mostly redundant with the data we store in fields explicitly.
49343 * Everything else is useful only for sending out for initial routing sync.
49344 * Not stored if contains excess data to prevent DoS.
49346 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49348 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
49351 * An initial announcement of the channel
49352 * Mostly redundant with the data we store in fields explicitly.
49353 * Everything else is useful only for sending out for initial routing sync.
49354 * Not stored if contains excess data to prevent DoS.
49356 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
49358 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
49361 * Creates a copy of the ChannelInfo
49363 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
49366 * Checks if two ChannelInfos contain equal inner contents.
49367 * This ignores pointers and is_owned flags and looks at the values in fields.
49368 * Two objects with NULL inner values will be considered "equal" here.
49370 bool ChannelInfo_eq(const struct LDKChannelInfo *NONNULL_PTR a, const struct LDKChannelInfo *NONNULL_PTR b);
49373 * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
49375 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49377 MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
49380 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
49382 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
49385 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
49387 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
49390 * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
49392 void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
49395 * Creates a copy of the DirectedChannelInfo
49397 struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
49400 * Returns information for the channel.
49402 MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
49405 * Returns the [`EffectiveCapacity`] of the channel in the direction.
49407 * This is either the total capacity from the funding transaction, if known, or the
49408 * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
49411 MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
49414 * Returns the `node_id` of the source hop.
49416 * Refers to the `node_id` forwarding the payment to the next hop.
49418 MUST_USE_RES struct LDKNodeId DirectedChannelInfo_source(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
49421 * Returns the `node_id` of the target hop.
49423 * Refers to the `node_id` receiving the payment from the previous hop.
49425 MUST_USE_RES struct LDKNodeId DirectedChannelInfo_target(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
49428 * Frees any resources used by the EffectiveCapacity
49430 void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
49433 * Creates a copy of the EffectiveCapacity
49435 struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
49438 * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
49440 struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
49443 * Utility method to constructs a new AdvertisedMaxHTLC-variant EffectiveCapacity
49445 struct LDKEffectiveCapacity EffectiveCapacity_advertised_max_htlc(uint64_t amount_msat);
49448 * Utility method to constructs a new Total-variant EffectiveCapacity
49450 struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, uint64_t htlc_maximum_msat);
49453 * Utility method to constructs a new Infinite-variant EffectiveCapacity
49455 struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
49458 * Utility method to constructs a new HintMaxHTLC-variant EffectiveCapacity
49460 struct LDKEffectiveCapacity EffectiveCapacity_hint_max_htlc(uint64_t amount_msat);
49463 * Utility method to constructs a new Unknown-variant EffectiveCapacity
49465 struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
49468 * Returns the effective capacity denominated in millisatoshi.
49470 MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
49473 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
49475 void RoutingFees_free(struct LDKRoutingFees this_obj);
49478 * Flat routing fee in millisatoshis.
49480 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
49483 * Flat routing fee in millisatoshis.
49485 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
49488 * Liquidity-based routing fee in millionths of a routed amount.
49489 * In other words, 10000 is 1%.
49491 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
49494 * Liquidity-based routing fee in millionths of a routed amount.
49495 * In other words, 10000 is 1%.
49497 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
49500 * Constructs a new RoutingFees given each field
49502 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
49505 * Checks if two RoutingFeess contain equal inner contents.
49506 * This ignores pointers and is_owned flags and looks at the values in fields.
49507 * Two objects with NULL inner values will be considered "equal" here.
49509 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
49512 * Creates a copy of the RoutingFees
49514 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
49517 * Generates a non-cryptographic 64-bit hash of the RoutingFees.
49519 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
49522 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
49524 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
49527 * Read a RoutingFees from a byte array, created by RoutingFees_write
49529 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
49532 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
49534 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
49537 * Protocol features the node announced support for
49539 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
49542 * Protocol features the node announced support for
49544 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
49547 * When the last known update to the node state was issued.
49548 * Value is opaque, as set in the announcement.
49550 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
49553 * When the last known update to the node state was issued.
49554 * Value is opaque, as set in the announcement.
49556 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
49559 * Color assigned to the node
49561 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
49564 * Color assigned to the node
49566 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
49569 * Moniker assigned to the node.
49570 * May be invalid or malicious (eg control chars),
49571 * should not be exposed to the user.
49573 struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
49576 * Moniker assigned to the node.
49577 * May be invalid or malicious (eg control chars),
49578 * should not be exposed to the user.
49580 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
49583 * An initial announcement of the node
49584 * Mostly redundant with the data we store in fields explicitly.
49585 * Everything else is useful only for sending out for initial routing sync.
49586 * Not stored if contains excess data to prevent DoS.
49588 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49590 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
49593 * An initial announcement of the node
49594 * Mostly redundant with the data we store in fields explicitly.
49595 * Everything else is useful only for sending out for initial routing sync.
49596 * Not stored if contains excess data to prevent DoS.
49598 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
49600 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
49603 * Constructs a new NodeAnnouncementInfo given each field
49605 * Note that announcement_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
49607 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);
49610 * Creates a copy of the NodeAnnouncementInfo
49612 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
49615 * Checks if two NodeAnnouncementInfos contain equal inner contents.
49616 * This ignores pointers and is_owned flags and looks at the values in fields.
49617 * Two objects with NULL inner values will be considered "equal" here.
49619 bool NodeAnnouncementInfo_eq(const struct LDKNodeAnnouncementInfo *NONNULL_PTR a, const struct LDKNodeAnnouncementInfo *NONNULL_PTR b);
49622 * Internet-level addresses via which one can connect to the node
49624 MUST_USE_RES struct LDKCVec_SocketAddressZ NodeAnnouncementInfo_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg);
49627 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
49629 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
49632 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
49634 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
49637 * Frees any resources used by the NodeAlias, if is_owned is set and inner is non-NULL.
49639 void NodeAlias_free(struct LDKNodeAlias this_obj);
49641 const uint8_t (*NodeAlias_get_a(const struct LDKNodeAlias *NONNULL_PTR this_ptr))[32];
49643 void NodeAlias_set_a(struct LDKNodeAlias *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
49646 * Constructs a new NodeAlias given each field
49648 MUST_USE_RES struct LDKNodeAlias NodeAlias_new(struct LDKThirtyTwoBytes a_arg);
49651 * Creates a copy of the NodeAlias
49653 struct LDKNodeAlias NodeAlias_clone(const struct LDKNodeAlias *NONNULL_PTR orig);
49656 * Generates a non-cryptographic 64-bit hash of the NodeAlias.
49658 uint64_t NodeAlias_hash(const struct LDKNodeAlias *NONNULL_PTR o);
49661 * Checks if two NodeAliass contain equal inner contents.
49662 * This ignores pointers and is_owned flags and looks at the values in fields.
49663 * Two objects with NULL inner values will be considered "equal" here.
49665 bool NodeAlias_eq(const struct LDKNodeAlias *NONNULL_PTR a, const struct LDKNodeAlias *NONNULL_PTR b);
49668 * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
49670 struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj);
49673 * Read a NodeAlias from a byte array, created by NodeAlias_write
49675 struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser);
49678 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
49680 void NodeInfo_free(struct LDKNodeInfo this_obj);
49683 * All valid channels a node has announced
49685 * Returns a copy of the field.
49687 struct LDKCVec_u64Z NodeInfo_get_channels(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
49690 * All valid channels a node has announced
49692 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
49695 * More information about a node from node_announcement.
49696 * Optional because we store a Node entry after learning about it from
49697 * a channel announcement, but before receiving a node announcement.
49699 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49701 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
49704 * More information about a node from node_announcement.
49705 * Optional because we store a Node entry after learning about it from
49706 * a channel announcement, but before receiving a node announcement.
49708 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
49710 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
49713 * Constructs a new NodeInfo given each field
49715 * Note that announcement_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
49717 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
49720 * Creates a copy of the NodeInfo
49722 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
49725 * Checks if two NodeInfos contain equal inner contents.
49726 * This ignores pointers and is_owned flags and looks at the values in fields.
49727 * Two objects with NULL inner values will be considered "equal" here.
49729 bool NodeInfo_eq(const struct LDKNodeInfo *NONNULL_PTR a, const struct LDKNodeInfo *NONNULL_PTR b);
49732 * Returns whether the node has only announced Tor addresses.
49734 MUST_USE_RES bool NodeInfo_is_tor_only(const struct LDKNodeInfo *NONNULL_PTR this_arg);
49737 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
49739 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
49742 * Read a NodeInfo from a byte array, created by NodeInfo_write
49744 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
49747 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
49749 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
49752 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
49754 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg);
49757 * Creates a new, empty, network graph.
49759 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(enum LDKNetwork network, struct LDKLogger logger);
49762 * Returns a read-only view of the network graph.
49764 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
49767 * The unix timestamp provided by the most recent rapid gossip sync.
49768 * It will be set by the rapid sync process after every sync completion.
49770 MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
49773 * Update the unix timestamp provided by the most recent rapid gossip sync.
49774 * This should be done automatically by the rapid sync process after every sync completion.
49776 void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp);
49779 * For an already known node (from channel announcements), update its stored properties from a
49780 * given node announcement.
49782 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
49783 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
49784 * routing messages from a source using a protocol other than the lightning P2P protocol.
49786 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
49789 * For an already known node (from channel announcements), update its stored properties from a
49790 * given node announcement without verifying the associated signatures. Because we aren't
49791 * given the associated signatures here we cannot relay the node announcement to any of our
49794 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);
49797 * Store or update channel info from a channel announcement.
49799 * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
49800 * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
49801 * routing messages from a source using a protocol other than the lightning P2P protocol.
49803 * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
49804 * the corresponding UTXO exists on chain and is correctly-formatted.
49806 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);
49809 * Store or update channel info from a channel announcement.
49811 * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
49812 * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
49813 * routing messages from a source using a protocol other than the lightning P2P protocol.
49815 * This will skip verification of if the channel is actually on-chain.
49817 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);
49820 * Store or update channel info from a channel announcement without verifying the associated
49821 * signatures. Because we aren't given the associated signatures here we cannot relay the
49822 * channel announcement to any of our peers.
49824 * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
49825 * the corresponding UTXO exists on chain and is correctly-formatted.
49827 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);
49830 * Update channel from partial announcement data received via rapid gossip sync
49832 * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the
49833 * rapid gossip sync server)
49835 * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields.
49837 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);
49840 * Marks a channel in the graph as failed permanently.
49842 * The channel and any node for which this was their last channel are removed from the graph.
49844 void NetworkGraph_channel_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
49847 * Marks a node in the graph as permanently failed, effectively removing it and its channels
49848 * from local storage.
49850 void NetworkGraph_node_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
49853 * Removes information about channels that we haven't heard any updates about in some time.
49854 * This can be used regularly to prune the network graph of channels that likely no longer
49857 * While there is no formal requirement that nodes regularly re-broadcast their channel
49858 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
49859 * pruning occur for updates which are at least two weeks old, which we implement here.
49861 * Note that for users of the `lightning-background-processor` crate this method may be
49862 * automatically called regularly for you.
49864 * This method will also cause us to stop tracking removed nodes and channels if they have been
49865 * in the map for a while so that these can be resynced from gossip in the future.
49867 * This method is only available with the `std` feature. See
49868 * [`NetworkGraph::remove_stale_channels_and_tracking_with_time`] for `no-std` use.
49870 void NetworkGraph_remove_stale_channels_and_tracking(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
49873 * Removes information about channels that we haven't heard any updates about in some time.
49874 * This can be used regularly to prune the network graph of channels that likely no longer
49877 * While there is no formal requirement that nodes regularly re-broadcast their channel
49878 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
49879 * pruning occur for updates which are at least two weeks old, which we implement here.
49881 * This method will also cause us to stop tracking removed nodes and channels if they have been
49882 * in the map for a while so that these can be resynced from gossip in the future.
49884 * This function takes the current unix time as an argument. For users with the `std` feature
49885 * enabled, [`NetworkGraph::remove_stale_channels_and_tracking`] may be preferable.
49887 void NetworkGraph_remove_stale_channels_and_tracking_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
49890 * For an already known (from announcement) channel, update info about one of the directions
49893 * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
49894 * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
49895 * routing messages from a source using a protocol other than the lightning P2P protocol.
49897 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
49898 * materially in the future will be rejected.
49900 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
49903 * For an already known (from announcement) channel, update info about one of the directions
49904 * of the channel without verifying the associated signatures. Because we aren't given the
49905 * associated signatures here we cannot relay the channel update to any of our peers.
49907 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
49908 * materially in the future will be rejected.
49910 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
49913 * For an already known (from announcement) channel, verify the given [`ChannelUpdate`].
49915 * This checks whether the update currently is applicable by [`Self::update_channel`].
49917 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
49918 * materially in the future will be rejected.
49920 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_verify_channel_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
49923 * Returns information on a channel with the given id.
49925 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49927 MUST_USE_RES struct LDKChannelInfo ReadOnlyNetworkGraph_channel(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
49930 * Returns the list of channels in the graph
49932 MUST_USE_RES struct LDKCVec_u64Z ReadOnlyNetworkGraph_list_channels(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
49935 * Returns information on a node with the given id.
49937 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49939 MUST_USE_RES struct LDKNodeInfo ReadOnlyNetworkGraph_node(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
49942 * Returns the list of nodes in the graph
49944 MUST_USE_RES struct LDKCVec_NodeIdZ ReadOnlyNetworkGraph_list_nodes(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
49947 * Get network addresses by node id.
49948 * Returns None if the requested node is completely unknown,
49949 * or if node announcement for the node was never received.
49951 MUST_USE_RES struct LDKCOption_CVec_SocketAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
49954 * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
49956 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
49959 * Creates a new router.
49961 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);
49964 * Constructs a new Router which calls the relevant methods on this_arg.
49965 * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
49967 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
49970 * Constructs a new MessageRouter which calls the relevant methods on this_arg.
49971 * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is
49973 struct LDKMessageRouter DefaultRouter_as_MessageRouter(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
49976 * Calls the free function if one is set
49978 void Router_free(struct LDKRouter this_ptr);
49981 * Frees any resources used by the ScorerAccountingForInFlightHtlcs, if is_owned is set and inner is non-NULL.
49983 void ScorerAccountingForInFlightHtlcs_free(struct LDKScorerAccountingForInFlightHtlcs this_obj);
49986 * Initialize a new `ScorerAccountingForInFlightHtlcs`.
49988 MUST_USE_RES struct LDKScorerAccountingForInFlightHtlcs ScorerAccountingForInFlightHtlcs_new(struct LDKScoreLookUp scorer, const struct LDKInFlightHtlcs *NONNULL_PTR inflight_htlcs);
49991 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
49992 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
49994 struct LDKScoreLookUp ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(const struct LDKScorerAccountingForInFlightHtlcs *NONNULL_PTR this_arg);
49997 * Frees any resources used by the InFlightHtlcs, if is_owned is set and inner is non-NULL.
49999 void InFlightHtlcs_free(struct LDKInFlightHtlcs this_obj);
50002 * Creates a copy of the InFlightHtlcs
50004 struct LDKInFlightHtlcs InFlightHtlcs_clone(const struct LDKInFlightHtlcs *NONNULL_PTR orig);
50007 * Constructs an empty `InFlightHtlcs`.
50009 MUST_USE_RES struct LDKInFlightHtlcs InFlightHtlcs_new(void);
50012 * Takes in a path with payer's node id and adds the path's details to `InFlightHtlcs`.
50014 void InFlightHtlcs_process_path(struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKPath *NONNULL_PTR path, struct LDKPublicKey payer_node_id);
50017 * Adds a known HTLC given the public key of the HTLC source, target, and short channel
50020 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);
50023 * Returns liquidity in msat given the public key of the HTLC source, target, and short channel
50026 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);
50029 * Serialize the InFlightHtlcs object into a byte array which can be read by InFlightHtlcs_read
50031 struct LDKCVec_u8Z InFlightHtlcs_write(const struct LDKInFlightHtlcs *NONNULL_PTR obj);
50034 * Read a InFlightHtlcs from a byte array, created by InFlightHtlcs_write
50036 struct LDKCResult_InFlightHtlcsDecodeErrorZ InFlightHtlcs_read(struct LDKu8slice ser);
50039 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
50041 void RouteHop_free(struct LDKRouteHop this_obj);
50044 * The node_id of the node at this hop.
50046 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
50049 * The node_id of the node at this hop.
50051 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
50054 * The node_announcement features of the node at this hop. For the last hop, these may be
50055 * amended to match the features present in the invoice this node generated.
50057 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
50060 * The node_announcement features of the node at this hop. For the last hop, these may be
50061 * amended to match the features present in the invoice this node generated.
50063 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
50066 * The channel that should be used from the previous hop to reach this node.
50068 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
50071 * The channel that should be used from the previous hop to reach this node.
50073 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
50076 * The channel_announcement features of the channel that should be used from the previous hop
50077 * to reach this node.
50079 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
50082 * The channel_announcement features of the channel that should be used from the previous hop
50083 * to reach this node.
50085 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
50088 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
50089 * If this is the last hop in [`Path::hops`]:
50090 * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
50091 * * otherwise, this is the full value of this [`Path`]'s part of the payment
50093 * [`BlindedPath`]: crate::blinded_path::BlindedPath
50095 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
50098 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
50099 * If this is the last hop in [`Path::hops`]:
50100 * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
50101 * * otherwise, this is the full value of this [`Path`]'s part of the payment
50103 * [`BlindedPath`]: crate::blinded_path::BlindedPath
50105 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
50108 * The CLTV delta added for this hop.
50109 * If this is the last hop in [`Path::hops`]:
50110 * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
50111 * * otherwise, this is the CLTV delta expected at the destination
50113 * [`BlindedPath`]: crate::blinded_path::BlindedPath
50115 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
50118 * The CLTV delta added for this hop.
50119 * If this is the last hop in [`Path::hops`]:
50120 * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
50121 * * otherwise, this is the CLTV delta expected at the destination
50123 * [`BlindedPath`]: crate::blinded_path::BlindedPath
50125 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
50128 * Indicates whether this hop is possibly announced in the public network graph.
50130 * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
50131 * either know for sure it's announced in the public graph, or if any public channels exist
50132 * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
50133 * the channel to be unannounced.
50135 * Will be `true` for objects serialized with LDK version 0.0.116 and before.
50137 bool RouteHop_get_maybe_announced_channel(const struct LDKRouteHop *NONNULL_PTR this_ptr);
50140 * Indicates whether this hop is possibly announced in the public network graph.
50142 * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
50143 * either know for sure it's announced in the public graph, or if any public channels exist
50144 * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
50145 * the channel to be unannounced.
50147 * Will be `true` for objects serialized with LDK version 0.0.116 and before.
50149 void RouteHop_set_maybe_announced_channel(struct LDKRouteHop *NONNULL_PTR this_ptr, bool val);
50152 * Constructs a new RouteHop given each field
50154 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);
50157 * Creates a copy of the RouteHop
50159 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
50162 * Generates a non-cryptographic 64-bit hash of the RouteHop.
50164 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
50167 * Checks if two RouteHops contain equal inner contents.
50168 * This ignores pointers and is_owned flags and looks at the values in fields.
50169 * Two objects with NULL inner values will be considered "equal" here.
50171 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
50174 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
50176 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
50179 * Read a RouteHop from a byte array, created by RouteHop_write
50181 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
50184 * Frees any resources used by the BlindedTail, if is_owned is set and inner is non-NULL.
50186 void BlindedTail_free(struct LDKBlindedTail this_obj);
50189 * The hops of the [`BlindedPath`] provided by the recipient.
50191 * [`BlindedPath`]: crate::blinded_path::BlindedPath
50193 struct LDKCVec_BlindedHopZ BlindedTail_get_hops(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
50196 * The hops of the [`BlindedPath`] provided by the recipient.
50198 * [`BlindedPath`]: crate::blinded_path::BlindedPath
50200 void BlindedTail_set_hops(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
50203 * The blinding point of the [`BlindedPath`] provided by the recipient.
50205 * [`BlindedPath`]: crate::blinded_path::BlindedPath
50207 struct LDKPublicKey BlindedTail_get_blinding_point(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
50210 * The blinding point of the [`BlindedPath`] provided by the recipient.
50212 * [`BlindedPath`]: crate::blinded_path::BlindedPath
50214 void BlindedTail_set_blinding_point(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKPublicKey val);
50217 * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
50218 * inferring the destination. May be 0.
50220 uint32_t BlindedTail_get_excess_final_cltv_expiry_delta(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
50223 * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
50224 * inferring the destination. May be 0.
50226 void BlindedTail_set_excess_final_cltv_expiry_delta(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint32_t val);
50229 * The total amount paid on this [`Path`], excluding the fees.
50231 uint64_t BlindedTail_get_final_value_msat(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
50234 * The total amount paid on this [`Path`], excluding the fees.
50236 void BlindedTail_set_final_value_msat(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint64_t val);
50239 * Constructs a new BlindedTail given each field
50241 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);
50244 * Creates a copy of the BlindedTail
50246 struct LDKBlindedTail BlindedTail_clone(const struct LDKBlindedTail *NONNULL_PTR orig);
50249 * Generates a non-cryptographic 64-bit hash of the BlindedTail.
50251 uint64_t BlindedTail_hash(const struct LDKBlindedTail *NONNULL_PTR o);
50254 * Checks if two BlindedTails contain equal inner contents.
50255 * This ignores pointers and is_owned flags and looks at the values in fields.
50256 * Two objects with NULL inner values will be considered "equal" here.
50258 bool BlindedTail_eq(const struct LDKBlindedTail *NONNULL_PTR a, const struct LDKBlindedTail *NONNULL_PTR b);
50261 * Serialize the BlindedTail object into a byte array which can be read by BlindedTail_read
50263 struct LDKCVec_u8Z BlindedTail_write(const struct LDKBlindedTail *NONNULL_PTR obj);
50266 * Read a BlindedTail from a byte array, created by BlindedTail_write
50268 struct LDKCResult_BlindedTailDecodeErrorZ BlindedTail_read(struct LDKu8slice ser);
50271 * Frees any resources used by the Path, if is_owned is set and inner is non-NULL.
50273 void Path_free(struct LDKPath this_obj);
50276 * The list of unblinded hops in this [`Path`]. Must be at least length one.
50278 struct LDKCVec_RouteHopZ Path_get_hops(const struct LDKPath *NONNULL_PTR this_ptr);
50281 * The list of unblinded hops in this [`Path`]. Must be at least length one.
50283 void Path_set_hops(struct LDKPath *NONNULL_PTR this_ptr, struct LDKCVec_RouteHopZ val);
50286 * The blinded path at which this path terminates, if we're sending to one, and its metadata.
50288 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50290 struct LDKBlindedTail Path_get_blinded_tail(const struct LDKPath *NONNULL_PTR this_ptr);
50293 * The blinded path at which this path terminates, if we're sending to one, and its metadata.
50295 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
50297 void Path_set_blinded_tail(struct LDKPath *NONNULL_PTR this_ptr, struct LDKBlindedTail val);
50300 * Constructs a new Path given each field
50302 * Note that blinded_tail_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
50304 MUST_USE_RES struct LDKPath Path_new(struct LDKCVec_RouteHopZ hops_arg, struct LDKBlindedTail blinded_tail_arg);
50307 * Creates a copy of the Path
50309 struct LDKPath Path_clone(const struct LDKPath *NONNULL_PTR orig);
50312 * Generates a non-cryptographic 64-bit hash of the Path.
50314 uint64_t Path_hash(const struct LDKPath *NONNULL_PTR o);
50317 * Checks if two Paths contain equal inner contents.
50318 * This ignores pointers and is_owned flags and looks at the values in fields.
50319 * Two objects with NULL inner values will be considered "equal" here.
50321 bool Path_eq(const struct LDKPath *NONNULL_PTR a, const struct LDKPath *NONNULL_PTR b);
50324 * Gets the fees for a given path, excluding any excess paid to the recipient.
50326 MUST_USE_RES uint64_t Path_fee_msat(const struct LDKPath *NONNULL_PTR this_arg);
50329 * Gets the total amount paid on this [`Path`], excluding the fees.
50331 MUST_USE_RES uint64_t Path_final_value_msat(const struct LDKPath *NONNULL_PTR this_arg);
50334 * Gets the final hop's CLTV expiry delta.
50336 MUST_USE_RES struct LDKCOption_u32Z Path_final_cltv_expiry_delta(const struct LDKPath *NONNULL_PTR this_arg);
50339 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
50341 void Route_free(struct LDKRoute this_obj);
50344 * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
50345 * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
50348 struct LDKCVec_PathZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
50351 * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
50352 * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
50355 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_PathZ val);
50358 * The `route_params` parameter passed to [`find_route`].
50360 * This is used by `ChannelManager` to track information which may be required for retries.
50362 * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
50364 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50366 struct LDKRouteParameters Route_get_route_params(const struct LDKRoute *NONNULL_PTR this_ptr);
50369 * The `route_params` parameter passed to [`find_route`].
50371 * This is used by `ChannelManager` to track information which may be required for retries.
50373 * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
50375 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
50377 void Route_set_route_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKRouteParameters val);
50380 * Constructs a new Route given each field
50382 * Note that route_params_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
50384 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_PathZ paths_arg, struct LDKRouteParameters route_params_arg);
50387 * Creates a copy of the Route
50389 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
50392 * Generates a non-cryptographic 64-bit hash of the Route.
50394 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
50397 * Checks if two Routes contain equal inner contents.
50398 * This ignores pointers and is_owned flags and looks at the values in fields.
50399 * Two objects with NULL inner values will be considered "equal" here.
50401 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
50404 * Returns the total amount of fees paid on this [`Route`].
50406 * For objects serialized with LDK 0.0.117 and after, this includes any extra payment made to
50407 * the recipient, which can happen in excess of the amount passed to [`find_route`] via
50408 * [`RouteParameters::final_value_msat`], if we had to reach the [`htlc_minimum_msat`] limits.
50410 * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
50412 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
50415 * Returns the total amount paid on this [`Route`], excluding the fees.
50417 * Might be more than requested as part of the given [`RouteParameters::final_value_msat`] if
50418 * we had to reach the [`htlc_minimum_msat`] limits.
50420 * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
50422 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
50425 * Serialize the Route object into a byte array which can be read by Route_read
50427 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
50430 * Read a Route from a byte array, created by Route_write
50432 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
50435 * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
50437 void RouteParameters_free(struct LDKRouteParameters this_obj);
50440 * The parameters of the failed payment path.
50442 struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
50445 * The parameters of the failed payment path.
50447 void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
50450 * The amount in msats sent on the failed payment path.
50452 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
50455 * The amount in msats sent on the failed payment path.
50457 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
50460 * The maximum total fees, in millisatoshi, that may accrue during route finding.
50462 * This limit also applies to the total fees that may arise while retrying failed payment
50465 * Note that values below a few sats may result in some paths being spuriously ignored.
50467 struct LDKCOption_u64Z RouteParameters_get_max_total_routing_fee_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
50470 * The maximum total fees, in millisatoshi, that may accrue during route finding.
50472 * This limit also applies to the total fees that may arise while retrying failed payment
50475 * Note that values below a few sats may result in some paths being spuriously ignored.
50477 void RouteParameters_set_max_total_routing_fee_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
50480 * Constructs a new RouteParameters given each field
50482 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);
50485 * Creates a copy of the RouteParameters
50487 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
50490 * Generates a non-cryptographic 64-bit hash of the RouteParameters.
50492 uint64_t RouteParameters_hash(const struct LDKRouteParameters *NONNULL_PTR o);
50495 * Checks if two RouteParameterss contain equal inner contents.
50496 * This ignores pointers and is_owned flags and looks at the values in fields.
50497 * Two objects with NULL inner values will be considered "equal" here.
50499 bool RouteParameters_eq(const struct LDKRouteParameters *NONNULL_PTR a, const struct LDKRouteParameters *NONNULL_PTR b);
50502 * Constructs [`RouteParameters`] from the given [`PaymentParameters`] and a payment amount.
50504 * [`Self::max_total_routing_fee_msat`] defaults to 1% of the payment amount + 50 sats
50506 MUST_USE_RES struct LDKRouteParameters RouteParameters_from_payment_params_and_value(struct LDKPaymentParameters payment_params, uint64_t final_value_msat);
50509 * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
50511 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
50514 * Read a RouteParameters from a byte array, created by RouteParameters_write
50516 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
50519 * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
50521 void PaymentParameters_free(struct LDKPaymentParameters this_obj);
50524 * Information about the payee, such as their features and route hints for their channels.
50526 struct LDKPayee PaymentParameters_get_payee(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
50529 * Information about the payee, such as their features and route hints for their channels.
50531 void PaymentParameters_set_payee(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPayee val);
50534 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
50536 struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
50539 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
50541 void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
50544 * The maximum total CLTV delta we accept for the route.
50545 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
50547 uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
50550 * The maximum total CLTV delta we accept for the route.
50551 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
50553 void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
50556 * The maximum number of paths that may be used by (MPP) payments.
50557 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
50559 uint8_t PaymentParameters_get_max_path_count(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
50562 * The maximum number of paths that may be used by (MPP) payments.
50563 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
50565 void PaymentParameters_set_max_path_count(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
50568 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
50569 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
50570 * a lower value prefers to send larger MPP parts, potentially saturating channels and
50571 * increasing failure probability for those paths.
50573 * Note that this restriction will be relaxed during pathfinding after paths which meet this
50574 * restriction have been found. While paths which meet this criteria will be searched for, it
50575 * is ultimately up to the scorer to select them over other paths.
50577 * A value of 0 will allow payments up to and including a channel's total announced usable
50578 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
50582 uint8_t PaymentParameters_get_max_channel_saturation_power_of_half(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
50585 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
50586 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
50587 * a lower value prefers to send larger MPP parts, potentially saturating channels and
50588 * increasing failure probability for those paths.
50590 * Note that this restriction will be relaxed during pathfinding after paths which meet this
50591 * restriction have been found. While paths which meet this criteria will be searched for, it
50592 * is ultimately up to the scorer to select them over other paths.
50594 * A value of 0 will allow payments up to and including a channel's total announced usable
50595 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
50599 void PaymentParameters_set_max_channel_saturation_power_of_half(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
50602 * A list of SCIDs which this payment was previously attempted over and which caused the
50603 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
50606 * Returns a copy of the field.
50608 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_channels(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
50611 * A list of SCIDs which this payment was previously attempted over and which caused the
50612 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
50615 void PaymentParameters_set_previously_failed_channels(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
50618 * A list of indices corresponding to blinded paths in [`Payee::Blinded::route_hints`] which this
50619 * payment was previously attempted over and which caused the payment to fail. Future attempts
50620 * for the same payment shouldn't be relayed through any of these blinded paths.
50622 * Returns a copy of the field.
50624 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_blinded_path_idxs(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
50627 * A list of indices corresponding to blinded paths in [`Payee::Blinded::route_hints`] which this
50628 * payment was previously attempted over and which caused the payment to fail. Future attempts
50629 * for the same payment shouldn't be relayed through any of these blinded paths.
50631 void PaymentParameters_set_previously_failed_blinded_path_idxs(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
50634 * Constructs a new PaymentParameters given each field
50636 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);
50639 * Creates a copy of the PaymentParameters
50641 struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
50644 * Generates a non-cryptographic 64-bit hash of the PaymentParameters.
50646 uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
50649 * Checks if two PaymentParameterss contain equal inner contents.
50650 * This ignores pointers and is_owned flags and looks at the values in fields.
50651 * Two objects with NULL inner values will be considered "equal" here.
50653 bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
50656 * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
50658 struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
50661 * Read a PaymentParameters from a byte array, created by PaymentParameters_write
50663 struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser, uint32_t arg);
50666 * Creates a payee with the node id of the given `pubkey`.
50668 * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
50671 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta);
50674 * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
50676 * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
50679 * Note that MPP keysend is not widely supported yet. The `allow_mpp` lets you choose
50680 * whether your router will be allowed to find a multi-part route for this payment. If you
50681 * set `allow_mpp` to true, you should ensure a payment secret is set on send, likely via
50682 * [`RecipientOnionFields::secret_only`].
50684 * [`RecipientOnionFields::secret_only`]: crate::ln::channelmanager::RecipientOnionFields::secret_only
50686 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta, bool allow_mpp);
50689 * Creates parameters for paying to a blinded payee from the provided invoice. Sets
50690 * [`Payee::Blinded::route_hints`], [`Payee::Blinded::features`], and
50691 * [`PaymentParameters::expiry_time`].
50693 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_bolt12_invoice(const struct LDKBolt12Invoice *NONNULL_PTR invoice);
50696 * Creates parameters for paying to a blinded payee from the provided blinded route hints.
50698 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ blinded_route_hints);
50701 * Frees any resources used by the Payee
50703 void Payee_free(struct LDKPayee this_ptr);
50706 * Creates a copy of the Payee
50708 struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig);
50711 * Utility method to constructs a new Blinded-variant Payee
50713 struct LDKPayee Payee_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints, struct LDKBolt12InvoiceFeatures features);
50716 * Utility method to constructs a new Clear-variant Payee
50718 struct LDKPayee Payee_clear(struct LDKPublicKey node_id, struct LDKCVec_RouteHintZ route_hints, struct LDKBolt11InvoiceFeatures features, uint32_t final_cltv_expiry_delta);
50721 * Generates a non-cryptographic 64-bit hash of the Payee.
50723 uint64_t Payee_hash(const struct LDKPayee *NONNULL_PTR o);
50726 * Checks if two Payees contain equal inner contents.
50727 * This ignores pointers and is_owned flags and looks at the values in fields.
50729 bool Payee_eq(const struct LDKPayee *NONNULL_PTR a, const struct LDKPayee *NONNULL_PTR b);
50732 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
50734 void RouteHint_free(struct LDKRouteHint this_obj);
50736 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
50738 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
50741 * Constructs a new RouteHint given each field
50743 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
50746 * Creates a copy of the RouteHint
50748 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
50751 * Generates a non-cryptographic 64-bit hash of the RouteHint.
50753 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
50756 * Checks if two RouteHints contain equal inner contents.
50757 * This ignores pointers and is_owned flags and looks at the values in fields.
50758 * Two objects with NULL inner values will be considered "equal" here.
50760 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
50763 * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
50765 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
50768 * Read a RouteHint from a byte array, created by RouteHint_write
50770 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
50773 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
50775 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
50778 * The node_id of the non-target end of the route
50780 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
50783 * The node_id of the non-target end of the route
50785 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
50788 * The short_channel_id of this channel
50790 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
50793 * The short_channel_id of this channel
50795 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
50798 * The fees which must be paid to use this channel
50800 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
50803 * The fees which must be paid to use this channel
50805 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
50808 * The difference in CLTV values between this node and the next node.
50810 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
50813 * The difference in CLTV values between this node and the next node.
50815 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
50818 * The minimum value, in msat, which must be relayed to the next hop.
50820 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
50823 * The minimum value, in msat, which must be relayed to the next hop.
50825 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
50828 * The maximum value in msat available for routing with a single HTLC.
50830 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
50833 * The maximum value in msat available for routing with a single HTLC.
50835 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
50838 * Constructs a new RouteHintHop given each field
50840 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);
50843 * Creates a copy of the RouteHintHop
50845 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
50848 * Generates a non-cryptographic 64-bit hash of the RouteHintHop.
50850 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
50853 * Checks if two RouteHintHops contain equal inner contents.
50854 * This ignores pointers and is_owned flags and looks at the values in fields.
50855 * Two objects with NULL inner values will be considered "equal" here.
50857 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
50860 * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
50862 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
50865 * Read a RouteHintHop from a byte array, created by RouteHintHop_write
50867 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
50870 * Frees any resources used by the FirstHopCandidate, if is_owned is set and inner is non-NULL.
50872 void FirstHopCandidate_free(struct LDKFirstHopCandidate this_obj);
50875 * Creates a copy of the FirstHopCandidate
50877 struct LDKFirstHopCandidate FirstHopCandidate_clone(const struct LDKFirstHopCandidate *NONNULL_PTR orig);
50880 * Frees any resources used by the PublicHopCandidate, if is_owned is set and inner is non-NULL.
50882 void PublicHopCandidate_free(struct LDKPublicHopCandidate this_obj);
50885 * The short channel ID of the channel, i.e. the identifier by which we refer to this
50888 uint64_t PublicHopCandidate_get_short_channel_id(const struct LDKPublicHopCandidate *NONNULL_PTR this_ptr);
50891 * The short channel ID of the channel, i.e. the identifier by which we refer to this
50894 void PublicHopCandidate_set_short_channel_id(struct LDKPublicHopCandidate *NONNULL_PTR this_ptr, uint64_t val);
50897 * Creates a copy of the PublicHopCandidate
50899 struct LDKPublicHopCandidate PublicHopCandidate_clone(const struct LDKPublicHopCandidate *NONNULL_PTR orig);
50902 * Frees any resources used by the PrivateHopCandidate, if is_owned is set and inner is non-NULL.
50904 void PrivateHopCandidate_free(struct LDKPrivateHopCandidate this_obj);
50907 * Creates a copy of the PrivateHopCandidate
50909 struct LDKPrivateHopCandidate PrivateHopCandidate_clone(const struct LDKPrivateHopCandidate *NONNULL_PTR orig);
50912 * Frees any resources used by the BlindedPathCandidate, if is_owned is set and inner is non-NULL.
50914 void BlindedPathCandidate_free(struct LDKBlindedPathCandidate this_obj);
50917 * Creates a copy of the BlindedPathCandidate
50919 struct LDKBlindedPathCandidate BlindedPathCandidate_clone(const struct LDKBlindedPathCandidate *NONNULL_PTR orig);
50922 * Frees any resources used by the OneHopBlindedPathCandidate, if is_owned is set and inner is non-NULL.
50924 void OneHopBlindedPathCandidate_free(struct LDKOneHopBlindedPathCandidate this_obj);
50927 * Creates a copy of the OneHopBlindedPathCandidate
50929 struct LDKOneHopBlindedPathCandidate OneHopBlindedPathCandidate_clone(const struct LDKOneHopBlindedPathCandidate *NONNULL_PTR orig);
50932 * Frees any resources used by the CandidateRouteHop
50934 void CandidateRouteHop_free(struct LDKCandidateRouteHop this_ptr);
50937 * Creates a copy of the CandidateRouteHop
50939 struct LDKCandidateRouteHop CandidateRouteHop_clone(const struct LDKCandidateRouteHop *NONNULL_PTR orig);
50942 * Utility method to constructs a new FirstHop-variant CandidateRouteHop
50944 struct LDKCandidateRouteHop CandidateRouteHop_first_hop(struct LDKFirstHopCandidate a);
50947 * Utility method to constructs a new PublicHop-variant CandidateRouteHop
50949 struct LDKCandidateRouteHop CandidateRouteHop_public_hop(struct LDKPublicHopCandidate a);
50952 * Utility method to constructs a new PrivateHop-variant CandidateRouteHop
50954 struct LDKCandidateRouteHop CandidateRouteHop_private_hop(struct LDKPrivateHopCandidate a);
50957 * Utility method to constructs a new Blinded-variant CandidateRouteHop
50959 struct LDKCandidateRouteHop CandidateRouteHop_blinded(struct LDKBlindedPathCandidate a);
50962 * Utility method to constructs a new OneHopBlinded-variant CandidateRouteHop
50964 struct LDKCandidateRouteHop CandidateRouteHop_one_hop_blinded(struct LDKOneHopBlindedPathCandidate a);
50967 * Returns the globally unique short channel ID for this hop, if one is known.
50969 * This only returns `Some` if the channel is public (either our own, or one we've learned
50970 * from the public network graph), and thus the short channel ID we have for this channel is
50971 * globally unique and identifies this channel in a global namespace.
50973 MUST_USE_RES struct LDKCOption_u64Z CandidateRouteHop_globally_unique_short_channel_id(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
50976 * Returns the required difference in HTLC CLTV expiry between the [`Self::source`] and the
50977 * next-hop for an HTLC taking this hop.
50979 * This is the time that the node(s) in this hop have to claim the HTLC on-chain if the
50980 * next-hop goes on chain with a payment preimage.
50982 MUST_USE_RES uint32_t CandidateRouteHop_cltv_expiry_delta(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
50985 * Returns the minimum amount that can be sent over this hop, in millisatoshis.
50987 MUST_USE_RES uint64_t CandidateRouteHop_htlc_minimum_msat(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
50990 * Returns the fees that must be paid to route an HTLC over this channel.
50992 MUST_USE_RES struct LDKRoutingFees CandidateRouteHop_fees(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
50995 * Returns the source node id of current hop.
50997 * Source node id refers to the node forwarding the HTLC through this hop.
50999 * For [`Self::FirstHop`] we return payer's node id.
51001 MUST_USE_RES struct LDKNodeId CandidateRouteHop_source(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
51004 * Returns the target node id of this hop, if known.
51006 * Target node id refers to the node receiving the HTLC after this hop.
51008 * For [`Self::Blinded`] we return `None` because the ultimate destination after the blinded
51011 * For [`Self::OneHopBlinded`] we return `None` because the target is the same as the source,
51012 * and such a return value would be somewhat nonsensical.
51014 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
51016 MUST_USE_RES struct LDKNodeId CandidateRouteHop_target(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
51019 * Finds a route from us (payer) to the given target node (payee).
51021 * If the payee provided features in their invoice, they should be provided via the `payee` field
51022 * in the given [`RouteParameters::payment_params`].
51023 * Without this, MPP will only be used if the payee's features are available in the network graph.
51025 * Private routing paths between a public node and the target may be included in the `payee` field
51026 * of [`RouteParameters::payment_params`].
51028 * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
51029 * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels
51030 * from `network_graph` will be ignored, and only those in `first_hops` will be used.
51032 * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
51033 * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
51034 * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
51038 * Panics if first_hops contains channels without `short_channel_id`s;
51039 * [`ChannelManager::list_usable_channels`] will never include such channels.
51041 * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
51042 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
51043 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
51045 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
51047 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]);
51050 * Construct a route from us (payer) to the target node (payee) via the given hops (which should
51051 * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
51053 * Re-uses logic from `find_route`, so the restrictions described there also apply here.
51055 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]);
51058 * Calls the free function if one is set
51060 void ScoreLookUp_free(struct LDKScoreLookUp this_ptr);
51063 * Calls the free function if one is set
51065 void ScoreUpdate_free(struct LDKScoreUpdate this_ptr);
51068 * Calls the free function if one is set
51070 void Score_free(struct LDKScore this_ptr);
51073 * Calls the free function if one is set
51075 void LockableScore_free(struct LDKLockableScore this_ptr);
51078 * Calls the free function if one is set
51080 void WriteableScore_free(struct LDKWriteableScore this_ptr);
51083 * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
51085 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
51088 * Constructs a new LockableScore which calls the relevant methods on this_arg.
51089 * This copies the `inner` pointer in this_arg and thus the returned LockableScore must be freed before this_arg is
51091 struct LDKLockableScore MultiThreadedLockableScore_as_LockableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
51094 * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
51096 struct LDKCVec_u8Z MultiThreadedLockableScore_write(const struct LDKMultiThreadedLockableScore *NONNULL_PTR obj);
51099 * Constructs a new WriteableScore which calls the relevant methods on this_arg.
51100 * This copies the `inner` pointer in this_arg and thus the returned WriteableScore must be freed before this_arg is
51102 struct LDKWriteableScore MultiThreadedLockableScore_as_WriteableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
51105 * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
51107 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
51110 * Frees any resources used by the MultiThreadedScoreLockRead, if is_owned is set and inner is non-NULL.
51112 void MultiThreadedScoreLockRead_free(struct LDKMultiThreadedScoreLockRead this_obj);
51115 * Frees any resources used by the MultiThreadedScoreLockWrite, if is_owned is set and inner is non-NULL.
51117 void MultiThreadedScoreLockWrite_free(struct LDKMultiThreadedScoreLockWrite this_obj);
51120 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
51121 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
51123 struct LDKScoreLookUp MultiThreadedScoreLockRead_as_ScoreLookUp(const struct LDKMultiThreadedScoreLockRead *NONNULL_PTR this_arg);
51126 * Serialize the MultiThreadedScoreLockWrite object into a byte array which can be read by MultiThreadedScoreLockWrite_read
51128 struct LDKCVec_u8Z MultiThreadedScoreLockWrite_write(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR obj);
51131 * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
51132 * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
51134 struct LDKScoreUpdate MultiThreadedScoreLockWrite_as_ScoreUpdate(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR this_arg);
51137 * Frees any resources used by the ChannelUsage, if is_owned is set and inner is non-NULL.
51139 void ChannelUsage_free(struct LDKChannelUsage this_obj);
51142 * The amount to send through the channel, denominated in millisatoshis.
51144 uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
51147 * The amount to send through the channel, denominated in millisatoshis.
51149 void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
51152 * Total amount, denominated in millisatoshis, already allocated to send through the channel
51153 * as part of a multi-path payment.
51155 uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
51158 * Total amount, denominated in millisatoshis, already allocated to send through the channel
51159 * as part of a multi-path payment.
51161 void ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
51164 * The effective capacity of the channel.
51166 struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
51169 * The effective capacity of the channel.
51171 void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val);
51174 * Constructs a new ChannelUsage given each field
51176 MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg);
51179 * Creates a copy of the ChannelUsage
51181 struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig);
51184 * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
51186 void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
51189 * Creates a copy of the FixedPenaltyScorer
51191 struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
51194 * Creates a new scorer using `penalty_msat`.
51196 MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
51199 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
51200 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
51202 struct LDKScoreLookUp FixedPenaltyScorer_as_ScoreLookUp(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
51205 * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
51206 * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
51208 struct LDKScoreUpdate FixedPenaltyScorer_as_ScoreUpdate(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
51211 * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
51213 struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
51216 * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
51218 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
51221 * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
51223 void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
51226 * Frees any resources used by the ProbabilisticScoringFeeParameters, if is_owned is set and inner is non-NULL.
51228 void ProbabilisticScoringFeeParameters_free(struct LDKProbabilisticScoringFeeParameters this_obj);
51231 * A fixed penalty in msats to apply to each channel.
51233 * Default value: 500 msat
51235 uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51238 * A fixed penalty in msats to apply to each channel.
51240 * Default value: 500 msat
51242 void ProbabilisticScoringFeeParameters_set_base_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
51245 * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
51246 * applied to each channel, in excess of the [`base_penalty_msat`].
51248 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
51249 * fees plus penalty) for large payments. The penalty is computed as the product of this
51250 * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
51251 * amount plus the amount of any other HTLCs flowing we sent over the same channel).
51253 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
51255 * Default value: 8,192 msat
51257 * [`base_penalty_msat`]: Self::base_penalty_msat
51259 uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51262 * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
51263 * applied to each channel, in excess of the [`base_penalty_msat`].
51265 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
51266 * fees plus penalty) for large payments. The penalty is computed as the product of this
51267 * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
51268 * amount plus the amount of any other HTLCs flowing we sent over the same channel).
51270 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
51272 * Default value: 8,192 msat
51274 * [`base_penalty_msat`]: Self::base_penalty_msat
51276 void ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
51279 * A multiplier used in conjunction with the negative `log10` of the channel's success
51280 * probability for a payment, as determined by our latest estimates of the channel's
51281 * liquidity, to determine the liquidity penalty.
51283 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
51284 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
51285 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
51286 * lower bounding the success probability to `0.01`) when the amount falls within the
51287 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
51288 * result in a `u64::max_value` penalty, however.
51290 * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
51292 * Default value: 30,000 msat
51294 * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
51296 uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51299 * A multiplier used in conjunction with the negative `log10` of the channel's success
51300 * probability for a payment, as determined by our latest estimates of the channel's
51301 * liquidity, to determine the liquidity penalty.
51303 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
51304 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
51305 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
51306 * lower bounding the success probability to `0.01`) when the amount falls within the
51307 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
51308 * result in a `u64::max_value` penalty, however.
51310 * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
51312 * Default value: 30,000 msat
51314 * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
51316 void ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
51319 * A multiplier used in conjunction with the total amount flowing over a channel and the
51320 * negative `log10` of the channel's success probability for the payment, as determined by our
51321 * latest estimates of the channel's liquidity, to determine the amount penalty.
51323 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
51324 * fees plus penalty) for large payments. The penalty is computed as the product of this
51325 * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
51326 * `log10` of the success probability.
51328 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
51330 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
51331 * the amount will result in a penalty of the multiplier. And, as the success probability
51332 * decreases, the negative `log10` weighting will increase dramatically. For higher success
51333 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
51336 * Default value: 192 msat
51338 uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51341 * A multiplier used in conjunction with the total amount flowing over a channel and the
51342 * negative `log10` of the channel's success probability for the payment, as determined by our
51343 * latest estimates of the channel's liquidity, to determine the amount penalty.
51345 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
51346 * fees plus penalty) for large payments. The penalty is computed as the product of this
51347 * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
51348 * `log10` of the success probability.
51350 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
51352 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
51353 * the amount will result in a penalty of the multiplier. And, as the success probability
51354 * decreases, the negative `log10` weighting will increase dramatically. For higher success
51355 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
51358 * Default value: 192 msat
51360 void ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
51363 * A multiplier used in conjunction with the negative `log10` of the channel's success
51364 * probability for the payment, as determined based on the history of our estimates of the
51365 * channel's available liquidity, to determine a penalty.
51367 * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
51368 * only our latest estimate for the current liquidity available in the channel, it estimates
51369 * success probability based on the estimated liquidity available in the channel through
51370 * history. Specifically, every time we update our liquidity bounds on a given channel, we
51371 * track which of several buckets those bounds fall into, exponentially decaying the
51372 * probability of each bucket as new samples are added.
51374 * Default value: 10,000 msat
51376 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
51378 uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51381 * A multiplier used in conjunction with the negative `log10` of the channel's success
51382 * probability for the payment, as determined based on the history of our estimates of the
51383 * channel's available liquidity, to determine a penalty.
51385 * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
51386 * only our latest estimate for the current liquidity available in the channel, it estimates
51387 * success probability based on the estimated liquidity available in the channel through
51388 * history. Specifically, every time we update our liquidity bounds on a given channel, we
51389 * track which of several buckets those bounds fall into, exponentially decaying the
51390 * probability of each bucket as new samples are added.
51392 * Default value: 10,000 msat
51394 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
51396 void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
51399 * A multiplier used in conjunction with the total amount flowing over a channel and the
51400 * negative `log10` of the channel's success probability for the payment, as determined based
51401 * on the history of our estimates of the channel's available liquidity, to determine a
51404 * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
51405 * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
51406 * of the amount flowing over this channel, weighted by the negative `log10` of the success
51409 * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
51410 * of using only our latest estimate for the current liquidity available in the channel, it
51411 * estimates success probability based on the estimated liquidity available in the channel
51412 * through history. Specifically, every time we update our liquidity bounds on a given
51413 * channel, we track which of several buckets those bounds fall into, exponentially decaying
51414 * the probability of each bucket as new samples are added.
51416 * Default value: 64 msat
51418 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
51420 uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51423 * A multiplier used in conjunction with the total amount flowing over a channel and the
51424 * negative `log10` of the channel's success probability for the payment, as determined based
51425 * on the history of our estimates of the channel's available liquidity, to determine a
51428 * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
51429 * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
51430 * of the amount flowing over this channel, weighted by the negative `log10` of the success
51433 * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
51434 * of using only our latest estimate for the current liquidity available in the channel, it
51435 * estimates success probability based on the estimated liquidity available in the channel
51436 * through history. Specifically, every time we update our liquidity bounds on a given
51437 * channel, we track which of several buckets those bounds fall into, exponentially decaying
51438 * the probability of each bucket as new samples are added.
51440 * Default value: 64 msat
51442 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
51444 void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
51447 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
51448 * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
51449 * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
51450 * as this makes balance discovery attacks harder to execute, thereby creating an incentive
51451 * to restrict `htlc_maximum_msat` and improve privacy.
51453 * Default value: 250 msat
51455 uint64_t ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51458 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
51459 * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
51460 * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
51461 * as this makes balance discovery attacks harder to execute, thereby creating an incentive
51462 * to restrict `htlc_maximum_msat` and improve privacy.
51464 * Default value: 250 msat
51466 void ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
51469 * This penalty is applied when the total amount flowing over a channel exceeds our current
51470 * estimate of the channel's available liquidity. The total amount is the amount of the
51471 * current HTLC plus any HTLCs which we've sent over the same channel.
51473 * Note that in this case all other penalties, including the
51474 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
51475 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
51476 * applicable, are still included in the overall penalty.
51478 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
51479 * `u64::max_value()` will guarantee that.
51481 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
51483 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
51484 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
51485 * [`base_penalty_msat`]: Self::base_penalty_msat
51486 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
51488 uint64_t ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51491 * This penalty is applied when the total amount flowing over a channel exceeds our current
51492 * estimate of the channel's available liquidity. The total amount is the amount of the
51493 * current HTLC plus any HTLCs which we've sent over the same channel.
51495 * Note that in this case all other penalties, including the
51496 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
51497 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
51498 * applicable, are still included in the overall penalty.
51500 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
51501 * `u64::max_value()` will guarantee that.
51503 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
51505 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
51506 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
51507 * [`base_penalty_msat`]: Self::base_penalty_msat
51508 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
51510 void ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
51513 * In order to calculate most of the scores above, we must first convert a lower and upper
51514 * bound on the available liquidity in a channel into the probability that we think a payment
51515 * will succeed. That probability is derived from a Probability Density Function for where we
51516 * think the liquidity in a channel likely lies, given such bounds.
51518 * If this flag is set, that PDF is simply a constant - we assume that the actual available
51519 * liquidity in a channel is just as likely to be at any point between our lower and upper
51522 * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
51523 * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
51524 * matches experimental results - most routing nodes do not aggressively rebalance their
51525 * channels and flows in the network are often unbalanced, leaving liquidity usually
51528 * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
51529 * of floating-point multiplications in the hottest routing code, which may lead to routing
51530 * performance degradation on some machines.
51532 * Default value: false
51534 bool ProbabilisticScoringFeeParameters_get_linear_success_probability(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51537 * In order to calculate most of the scores above, we must first convert a lower and upper
51538 * bound on the available liquidity in a channel into the probability that we think a payment
51539 * will succeed. That probability is derived from a Probability Density Function for where we
51540 * think the liquidity in a channel likely lies, given such bounds.
51542 * If this flag is set, that PDF is simply a constant - we assume that the actual available
51543 * liquidity in a channel is just as likely to be at any point between our lower and upper
51546 * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
51547 * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
51548 * matches experimental results - most routing nodes do not aggressively rebalance their
51549 * channels and flows in the network are often unbalanced, leaving liquidity usually
51552 * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
51553 * of floating-point multiplications in the hottest routing code, which may lead to routing
51554 * performance degradation on some machines.
51556 * Default value: false
51558 void ProbabilisticScoringFeeParameters_set_linear_success_probability(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, bool val);
51561 * Creates a copy of the ProbabilisticScoringFeeParameters
51563 struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_clone(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR orig);
51566 * Creates a "default" ProbabilisticScoringFeeParameters. See struct and individual field documentaiton for details on which values are used.
51568 MUST_USE_RES struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_default(void);
51571 * Marks the node with the given `node_id` as banned,
51572 * i.e it will be avoided during path finding.
51574 void ProbabilisticScoringFeeParameters_add_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
51577 * Marks all nodes in the given list as banned, i.e.,
51578 * they will be avoided during path finding.
51580 void ProbabilisticScoringFeeParameters_add_banned_from_list(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, struct LDKCVec_NodeIdZ node_ids);
51583 * Removes the node with the given `node_id` from the list of nodes to avoid.
51585 void ProbabilisticScoringFeeParameters_remove_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
51588 * Sets a manual penalty for the given node.
51590 void ProbabilisticScoringFeeParameters_set_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id, uint64_t penalty);
51593 * Removes the node with the given `node_id` from the list of manual penalties.
51595 void ProbabilisticScoringFeeParameters_remove_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
51598 * Clears the list of manual penalties that are applied during path finding.
51600 void ProbabilisticScoringFeeParameters_clear_manual_penalties(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg);
51603 * Frees any resources used by the ProbabilisticScoringDecayParameters, if is_owned is set and inner is non-NULL.
51605 void ProbabilisticScoringDecayParameters_free(struct LDKProbabilisticScoringDecayParameters this_obj);
51608 * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
51609 * tracking can simply live on with increasingly stale data. Instead, when a channel has not
51610 * seen a liquidity estimate update for this amount of time, the historical datapoints are
51612 * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
51614 * Note that after 16 or more half lives all historical data will be completely gone.
51616 * Default value: 14 days
51618 * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorer::historical_estimated_channel_liquidity_probabilities
51620 uint64_t ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
51623 * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
51624 * tracking can simply live on with increasingly stale data. Instead, when a channel has not
51625 * seen a liquidity estimate update for this amount of time, the historical datapoints are
51627 * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
51629 * Note that after 16 or more half lives all historical data will be completely gone.
51631 * Default value: 14 days
51633 * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorer::historical_estimated_channel_liquidity_probabilities
51635 void ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
51638 * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
51639 * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
51640 * the available liquidity is halved and the upper-bound moves half-way to the channel's total
51643 * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
51644 * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
51645 * struct documentation for more info on the way the liquidity bounds are used.
51647 * For example, if the channel's capacity is 1 million sats, and the current upper and lower
51648 * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
51649 * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
51651 * Default value: 6 hours
51655 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
51656 * liquidity knowledge will never decay except when the bounds cross.
51658 uint64_t ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
51661 * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
51662 * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
51663 * the available liquidity is halved and the upper-bound moves half-way to the channel's total
51666 * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
51667 * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
51668 * struct documentation for more info on the way the liquidity bounds are used.
51670 * For example, if the channel's capacity is 1 million sats, and the current upper and lower
51671 * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
51672 * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
51674 * Default value: 6 hours
51678 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
51679 * liquidity knowledge will never decay except when the bounds cross.
51681 void ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
51684 * Constructs a new ProbabilisticScoringDecayParameters given each field
51686 MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_new(uint64_t historical_no_updates_half_life_arg, uint64_t liquidity_offset_half_life_arg);
51689 * Creates a copy of the ProbabilisticScoringDecayParameters
51691 struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_clone(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR orig);
51694 * Creates a "default" ProbabilisticScoringDecayParameters. See struct and individual field documentaiton for details on which values are used.
51696 MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_default(void);
51699 * Creates a new scorer using the given scoring parameters for sending payments from a node
51700 * through a network graph.
51702 MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringDecayParameters decay_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
51705 * Dump the contents of this scorer into the configured logger.
51707 * Note that this writes roughly one line per channel for which we have a liquidity estimate,
51708 * which may be a substantial amount of log output.
51710 void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
51713 * Query the estimated minimum and maximum liquidity available for sending a payment over the
51714 * channel with `scid` towards the given `target` node.
51716 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);
51719 * Query the historical estimated minimum and maximum liquidity available for sending a
51720 * payment over the channel with `scid` towards the given `target` node.
51722 * Returns two sets of 32 buckets. The first set describes the lower-bound liquidity history,
51723 * the second set describes the upper-bound liquidity history. Each bucket describes the
51724 * relative frequency at which we've seen a liquidity bound in the bucket's range relative to
51725 * the channel's total capacity, on an arbitrary scale. Because the values are slowly decayed,
51726 * more recent data points are weighted more heavily than older datapoints.
51728 * Note that the range of each bucket varies by its location to provide more granular results
51729 * at the edges of a channel's capacity, where it is more likely to sit.
51731 * When scoring, the estimated probability that an upper-/lower-bound lies in a given bucket
51732 * is calculated by dividing that bucket's value with the total value of all buckets.
51734 * For example, using a lower bucket count for illustrative purposes, a value of
51735 * `[0, 0, 0, ..., 0, 32]` indicates that we believe the probability of a bound being very
51736 * close to the channel's capacity to be 100%, and have never (recently) seen it in any other
51737 * bucket. A value of `[31, 0, 0, ..., 0, 0, 32]` indicates we've seen the bound being both
51738 * in the top and bottom bucket, and roughly with similar (recent) frequency.
51740 * Because the datapoints are decayed slowly over time, values will eventually return to
51741 * `Some(([0; 32], [0; 32]))` or `None` if no data remains for a channel.
51743 * In order to fetch a single success probability from the buckets provided here, as used in
51744 * the scoring model, see [`Self::historical_estimated_payment_success_probability`].
51746 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);
51749 * Query the probability of payment success sending the given `amount_msat` over the channel
51750 * with `scid` towards the given `target` node, based on the historical estimated liquidity
51753 * These are the same bounds as returned by
51754 * [`Self::historical_estimated_channel_liquidity_probabilities`] (but not those returned by
51755 * [`Self::estimated_channel_liquidity_range`]).
51757 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);
51760 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
51761 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
51763 struct LDKScoreLookUp ProbabilisticScorer_as_ScoreLookUp(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
51766 * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
51767 * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
51769 struct LDKScoreUpdate ProbabilisticScorer_as_ScoreUpdate(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
51772 * Constructs a new Score which calls the relevant methods on this_arg.
51773 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
51775 struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
51778 * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
51780 struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
51783 * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
51785 struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringDecayParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
51788 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
51790 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
51793 * The outpoint which is spendable.
51795 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
51798 * The outpoint which is spendable.
51800 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
51803 * Per commitment point to derive the delayed payment key by key holder.
51805 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
51808 * Per commitment point to derive the delayed payment key by key holder.
51810 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
51813 * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
51814 * the witness_script.
51816 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
51819 * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
51820 * the witness_script.
51822 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
51825 * The output which is referenced by the given outpoint.
51827 struct LDKTxOut DelayedPaymentOutputDescriptor_get_output(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
51830 * The output which is referenced by the given outpoint.
51832 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
51835 * The revocation point specific to the commitment transaction which was broadcast. Used to
51836 * derive the witnessScript for this output.
51838 struct LDKRevocationKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
51841 * The revocation point specific to the commitment transaction which was broadcast. Used to
51842 * derive the witnessScript for this output.
51844 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKRevocationKey val);
51847 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
51848 * This may be useful in re-deriving keys used in the channel to spend the output.
51850 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
51853 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
51854 * This may be useful in re-deriving keys used in the channel to spend the output.
51856 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
51859 * The value of the channel which this output originated from, possibly indirectly.
51861 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
51864 * The value of the channel which this output originated from, possibly indirectly.
51866 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
51869 * The channel public keys and other parameters needed to generate a spending transaction or
51870 * to provide to a re-derived signer through [`ChannelSigner::provide_channel_parameters`].
51872 * Added as optional, but always `Some` if the descriptor was produced in v0.0.123 or later.
51874 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
51876 struct LDKChannelTransactionParameters DelayedPaymentOutputDescriptor_get_channel_transaction_parameters(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
51879 * The channel public keys and other parameters needed to generate a spending transaction or
51880 * to provide to a re-derived signer through [`ChannelSigner::provide_channel_parameters`].
51882 * Added as optional, but always `Some` if the descriptor was produced in v0.0.123 or later.
51884 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
51886 void DelayedPaymentOutputDescriptor_set_channel_transaction_parameters(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
51889 * Constructs a new DelayedPaymentOutputDescriptor given each field
51891 * Note that channel_transaction_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
51893 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);
51896 * Creates a copy of the DelayedPaymentOutputDescriptor
51898 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
51901 * Generates a non-cryptographic 64-bit hash of the DelayedPaymentOutputDescriptor.
51903 uint64_t DelayedPaymentOutputDescriptor_hash(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR o);
51906 * Checks if two DelayedPaymentOutputDescriptors contain equal inner contents.
51907 * This ignores pointers and is_owned flags and looks at the values in fields.
51908 * Two objects with NULL inner values will be considered "equal" here.
51910 bool DelayedPaymentOutputDescriptor_eq(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR b);
51913 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
51915 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
51918 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
51920 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
51923 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
51925 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
51928 * The outpoint which is spendable.
51930 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
51933 * The outpoint which is spendable.
51935 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
51938 * The output which is referenced by the given outpoint.
51940 struct LDKTxOut StaticPaymentOutputDescriptor_get_output(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
51943 * The output which is referenced by the given outpoint.
51945 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
51948 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
51949 * This may be useful in re-deriving keys used in the channel to spend the output.
51951 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
51954 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
51955 * This may be useful in re-deriving keys used in the channel to spend the output.
51957 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
51960 * The value of the channel which this transactions spends.
51962 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
51965 * The value of the channel which this transactions spends.
51967 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
51970 * The necessary channel parameters that need to be provided to the re-derived signer through
51971 * [`ChannelSigner::provide_channel_parameters`].
51973 * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
51975 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
51977 struct LDKChannelTransactionParameters StaticPaymentOutputDescriptor_get_channel_transaction_parameters(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
51980 * The necessary channel parameters that need to be provided to the re-derived signer through
51981 * [`ChannelSigner::provide_channel_parameters`].
51983 * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
51985 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
51987 void StaticPaymentOutputDescriptor_set_channel_transaction_parameters(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
51990 * Constructs a new StaticPaymentOutputDescriptor given each field
51992 * Note that channel_transaction_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
51994 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);
51997 * Creates a copy of the StaticPaymentOutputDescriptor
51999 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
52002 * Generates a non-cryptographic 64-bit hash of the StaticPaymentOutputDescriptor.
52004 uint64_t StaticPaymentOutputDescriptor_hash(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR o);
52007 * Checks if two StaticPaymentOutputDescriptors contain equal inner contents.
52008 * This ignores pointers and is_owned flags and looks at the values in fields.
52009 * Two objects with NULL inner values will be considered "equal" here.
52011 bool StaticPaymentOutputDescriptor_eq(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR b);
52014 * Returns the `witness_script` of the spendable output.
52016 * Note that this will only return `Some` for [`StaticPaymentOutputDescriptor`]s that
52017 * originated from an anchor outputs channel, as they take the form of a P2WSH script.
52019 MUST_USE_RES struct LDKCOption_CVec_u8ZZ StaticPaymentOutputDescriptor_witness_script(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
52022 * The maximum length a well-formed witness spending one of these should have.
52023 * Note: If you have the grind_signatures feature enabled, this will be at least 1 byte
52026 MUST_USE_RES uint64_t StaticPaymentOutputDescriptor_max_witness_length(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
52029 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
52031 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
52034 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
52036 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
52039 * Frees any resources used by the SpendableOutputDescriptor
52041 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
52044 * Creates a copy of the SpendableOutputDescriptor
52046 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
52049 * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
52051 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output, struct LDKThirtyTwoBytes channel_keys_id);
52054 * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
52056 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
52059 * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
52061 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
52064 * Generates a non-cryptographic 64-bit hash of the SpendableOutputDescriptor.
52066 uint64_t SpendableOutputDescriptor_hash(const struct LDKSpendableOutputDescriptor *NONNULL_PTR o);
52069 * Checks if two SpendableOutputDescriptors contain equal inner contents.
52070 * This ignores pointers and is_owned flags and looks at the values in fields.
52072 bool SpendableOutputDescriptor_eq(const struct LDKSpendableOutputDescriptor *NONNULL_PTR a, const struct LDKSpendableOutputDescriptor *NONNULL_PTR b);
52075 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
52077 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
52080 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
52082 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
52085 * Creates an unsigned [`PartiallySignedTransaction`] which spends the given descriptors to
52086 * the given outputs, plus an output to the given change destination (if sufficient
52087 * change value remains). The PSBT will have a feerate, at least, of the given value.
52089 * The `locktime` argument is used to set the transaction's locktime. If `None`, the
52090 * transaction will have a locktime of 0. It it recommended to set this to the current block
52091 * height to avoid fee sniping, unless you have some specific reason to use a different
52094 * Returns the PSBT and expected max transaction weight.
52096 * Returns `Err(())` if the output value is greater than the input value minus required fee,
52097 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
52098 * does not match the one we can spend.
52100 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
52102 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);
52105 * Frees any resources used by the ChannelDerivationParameters, if is_owned is set and inner is non-NULL.
52107 void ChannelDerivationParameters_free(struct LDKChannelDerivationParameters this_obj);
52110 * The value in satoshis of the channel we're attempting to spend the anchor output of.
52112 uint64_t ChannelDerivationParameters_get_value_satoshis(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
52115 * The value in satoshis of the channel we're attempting to spend the anchor output of.
52117 void ChannelDerivationParameters_set_value_satoshis(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, uint64_t val);
52120 * The unique identifier to re-derive the signer for the associated channel.
52122 const uint8_t (*ChannelDerivationParameters_get_keys_id(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr))[32];
52125 * The unique identifier to re-derive the signer for the associated channel.
52127 void ChannelDerivationParameters_set_keys_id(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
52130 * The necessary channel parameters that need to be provided to the re-derived signer through
52131 * [`ChannelSigner::provide_channel_parameters`].
52133 struct LDKChannelTransactionParameters ChannelDerivationParameters_get_transaction_parameters(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
52136 * The necessary channel parameters that need to be provided to the re-derived signer through
52137 * [`ChannelSigner::provide_channel_parameters`].
52139 void ChannelDerivationParameters_set_transaction_parameters(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
52142 * Constructs a new ChannelDerivationParameters given each field
52144 MUST_USE_RES struct LDKChannelDerivationParameters ChannelDerivationParameters_new(uint64_t value_satoshis_arg, struct LDKThirtyTwoBytes keys_id_arg, struct LDKChannelTransactionParameters transaction_parameters_arg);
52147 * Creates a copy of the ChannelDerivationParameters
52149 struct LDKChannelDerivationParameters ChannelDerivationParameters_clone(const struct LDKChannelDerivationParameters *NONNULL_PTR orig);
52152 * Checks if two ChannelDerivationParameterss contain equal inner contents.
52153 * This ignores pointers and is_owned flags and looks at the values in fields.
52154 * Two objects with NULL inner values will be considered "equal" here.
52156 bool ChannelDerivationParameters_eq(const struct LDKChannelDerivationParameters *NONNULL_PTR a, const struct LDKChannelDerivationParameters *NONNULL_PTR b);
52159 * Serialize the ChannelDerivationParameters object into a byte array which can be read by ChannelDerivationParameters_read
52161 struct LDKCVec_u8Z ChannelDerivationParameters_write(const struct LDKChannelDerivationParameters *NONNULL_PTR obj);
52164 * Read a ChannelDerivationParameters from a byte array, created by ChannelDerivationParameters_write
52166 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ ChannelDerivationParameters_read(struct LDKu8slice ser);
52169 * Frees any resources used by the HTLCDescriptor, if is_owned is set and inner is non-NULL.
52171 void HTLCDescriptor_free(struct LDKHTLCDescriptor this_obj);
52174 * The parameters required to derive the signer for the HTLC input.
52176 struct LDKChannelDerivationParameters HTLCDescriptor_get_channel_derivation_parameters(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
52179 * The parameters required to derive the signer for the HTLC input.
52181 void HTLCDescriptor_set_channel_derivation_parameters(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
52184 * The txid of the commitment transaction in which the HTLC output lives.
52186 const uint8_t (*HTLCDescriptor_get_commitment_txid(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr))[32];
52189 * The txid of the commitment transaction in which the HTLC output lives.
52191 void HTLCDescriptor_set_commitment_txid(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
52194 * The number of the commitment transaction in which the HTLC output lives.
52196 uint64_t HTLCDescriptor_get_per_commitment_number(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
52199 * The number of the commitment transaction in which the HTLC output lives.
52201 void HTLCDescriptor_set_per_commitment_number(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint64_t val);
52204 * The key tweak corresponding to the number of the commitment transaction in which the HTLC
52205 * output lives. This tweak is applied to all the basepoints for both parties in the channel to
52206 * arrive at unique keys per commitment.
52208 * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
52210 struct LDKPublicKey HTLCDescriptor_get_per_commitment_point(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
52213 * The key tweak corresponding to the number of the commitment transaction in which the HTLC
52214 * output lives. This tweak is applied to all the basepoints for both parties in the channel to
52215 * arrive at unique keys per commitment.
52217 * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
52219 void HTLCDescriptor_set_per_commitment_point(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
52222 * The feerate to use on the HTLC claiming transaction. This is always `0` for HTLCs
52223 * originating from a channel supporting anchor outputs, otherwise it is the channel's
52224 * negotiated feerate at the time the commitment transaction was built.
52226 uint32_t HTLCDescriptor_get_feerate_per_kw(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
52229 * The feerate to use on the HTLC claiming transaction. This is always `0` for HTLCs
52230 * originating from a channel supporting anchor outputs, otherwise it is the channel's
52231 * negotiated feerate at the time the commitment transaction was built.
52233 void HTLCDescriptor_set_feerate_per_kw(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint32_t val);
52236 * The details of the HTLC as it appears in the commitment transaction.
52238 struct LDKHTLCOutputInCommitment HTLCDescriptor_get_htlc(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
52241 * The details of the HTLC as it appears in the commitment transaction.
52243 void HTLCDescriptor_set_htlc(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKHTLCOutputInCommitment val);
52246 * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
52249 struct LDKCOption_ThirtyTwoBytesZ HTLCDescriptor_get_preimage(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
52252 * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
52255 void HTLCDescriptor_set_preimage(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
52258 * The counterparty's signature required to spend the HTLC output.
52260 struct LDKECDSASignature HTLCDescriptor_get_counterparty_sig(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
52263 * The counterparty's signature required to spend the HTLC output.
52265 void HTLCDescriptor_set_counterparty_sig(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
52268 * Constructs a new HTLCDescriptor given each field
52270 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);
52273 * Creates a copy of the HTLCDescriptor
52275 struct LDKHTLCDescriptor HTLCDescriptor_clone(const struct LDKHTLCDescriptor *NONNULL_PTR orig);
52278 * Checks if two HTLCDescriptors contain equal inner contents.
52279 * This ignores pointers and is_owned flags and looks at the values in fields.
52280 * Two objects with NULL inner values will be considered "equal" here.
52282 bool HTLCDescriptor_eq(const struct LDKHTLCDescriptor *NONNULL_PTR a, const struct LDKHTLCDescriptor *NONNULL_PTR b);
52285 * Serialize the HTLCDescriptor object into a byte array which can be read by HTLCDescriptor_read
52287 struct LDKCVec_u8Z HTLCDescriptor_write(const struct LDKHTLCDescriptor *NONNULL_PTR obj);
52290 * Read a HTLCDescriptor from a byte array, created by HTLCDescriptor_write
52292 struct LDKCResult_HTLCDescriptorDecodeErrorZ HTLCDescriptor_read(struct LDKu8slice ser);
52295 * Returns the outpoint of the HTLC output in the commitment transaction. This is the outpoint
52296 * being spent by the HTLC input in the HTLC transaction.
52298 MUST_USE_RES struct LDKOutPoint HTLCDescriptor_outpoint(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
52301 * Returns the UTXO to be spent by the HTLC input, which can be obtained via
52302 * [`Self::unsigned_tx_input`].
52304 MUST_USE_RES struct LDKTxOut HTLCDescriptor_previous_utxo(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
52307 * Returns the unsigned transaction input spending the HTLC output in the commitment
52310 MUST_USE_RES struct LDKTxIn HTLCDescriptor_unsigned_tx_input(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
52313 * Returns the delayed output created as a result of spending the HTLC output in the commitment
52316 MUST_USE_RES struct LDKTxOut HTLCDescriptor_tx_output(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
52319 * Returns the witness script of the HTLC output in the commitment transaction.
52321 MUST_USE_RES struct LDKCVec_u8Z HTLCDescriptor_witness_script(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
52324 * Returns the fully signed witness required to spend the HTLC output in the commitment
52327 MUST_USE_RES struct LDKWitness HTLCDescriptor_tx_input_witness(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature, struct LDKu8slice witness_script);
52330 * Derives the channel signer required to sign the HTLC input.
52332 MUST_USE_RES struct LDKWriteableEcdsaChannelSigner HTLCDescriptor_derive_channel_signer(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
52335 * Calls the free function if one is set
52337 void ChannelSigner_free(struct LDKChannelSigner this_ptr);
52340 * Creates a copy of the Recipient
52342 enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
52345 * Utility method to constructs a new Node-variant Recipient
52347 enum LDKRecipient Recipient_node(void);
52350 * Utility method to constructs a new PhantomNode-variant Recipient
52352 enum LDKRecipient Recipient_phantom_node(void);
52355 * Calls the free function if one is set
52357 void EntropySource_free(struct LDKEntropySource this_ptr);
52360 * Calls the free function if one is set
52362 void NodeSigner_free(struct LDKNodeSigner this_ptr);
52365 * Calls the free function if one is set
52367 void OutputSpender_free(struct LDKOutputSpender this_ptr);
52370 * Calls the free function if one is set
52372 void SignerProvider_free(struct LDKSignerProvider this_ptr);
52375 * Calls the free function if one is set
52377 void ChangeDestinationSource_free(struct LDKChangeDestinationSource this_ptr);
52380 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
52382 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
52385 * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
52386 * holder's anchor output in a commitment transaction, if one is present.
52388 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
52391 * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
52392 * holder's anchor output in a commitment transaction, if one is present.
52394 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
52397 * Holder secret key for blinded revocation pubkey.
52399 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
52402 * Holder secret key for blinded revocation pubkey.
52404 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
52407 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
52409 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
52412 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
52414 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
52417 * Holder secret key used in an HTLC transaction.
52419 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
52422 * Holder secret key used in an HTLC transaction.
52424 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
52427 * Holder HTLC secret key used in commitment transaction HTLC outputs.
52429 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
52432 * Holder HTLC secret key used in commitment transaction HTLC outputs.
52434 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
52439 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
52444 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
52447 * Creates a copy of the InMemorySigner
52449 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
52452 * Creates a new [`InMemorySigner`].
52454 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);
52457 * Returns the counterparty's pubkeys.
52459 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
52460 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
52462 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
52464 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52467 * Returns the `contest_delay` value specified by our counterparty and applied on holder-broadcastable
52468 * transactions, i.e., the amount of time that we have to wait to recover our funds if we
52469 * broadcast a transaction.
52471 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
52472 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
52474 MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52477 * Returns the `contest_delay` value specified by us and applied on transactions broadcastable
52478 * by our counterparty, i.e., the amount of time that they have to wait to recover their funds
52479 * if they broadcast a transaction.
52481 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
52482 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
52484 MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52487 * Returns whether the holder is the initiator.
52489 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
52490 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
52492 MUST_USE_RES struct LDKCOption_boolZ InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52497 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
52498 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
52500 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
52502 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52505 * Returns a [`ChannelTransactionParameters`] for this channel, to be used when verifying or
52506 * building transactions.
52508 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
52509 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
52511 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
52513 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52516 * Returns the channel type features of the channel parameters. Should be helpful for
52517 * determining a channel's category, i. e. legacy/anchors/taproot/etc.
52519 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
52520 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
52522 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
52524 MUST_USE_RES struct LDKChannelTypeFeatures InMemorySigner_channel_type_features(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52527 * Sign the single input of `spend_tx` at index `input_idx`, which spends the output described
52528 * by `descriptor`, returning the witness stack for the input.
52530 * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
52531 * is not spending the outpoint described by [`descriptor.outpoint`],
52532 * or if an output descriptor `script_pubkey` does not match the one we can spend.
52534 * [`descriptor.outpoint`]: StaticPaymentOutputDescriptor::outpoint
52536 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);
52539 * Sign the single input of `spend_tx` at index `input_idx` which spends the output
52540 * described by `descriptor`, returning the witness stack for the input.
52542 * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
52543 * is not spending the outpoint described by [`descriptor.outpoint`], does not have a
52544 * sequence set to [`descriptor.to_self_delay`], or if an output descriptor
52545 * `script_pubkey` does not match the one we can spend.
52547 * [`descriptor.outpoint`]: DelayedPaymentOutputDescriptor::outpoint
52548 * [`descriptor.to_self_delay`]: DelayedPaymentOutputDescriptor::to_self_delay
52550 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);
52553 * Constructs a new EntropySource which calls the relevant methods on this_arg.
52554 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
52556 struct LDKEntropySource InMemorySigner_as_EntropySource(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52559 * Constructs a new ChannelSigner which calls the relevant methods on this_arg.
52560 * This copies the `inner` pointer in this_arg and thus the returned ChannelSigner must be freed before this_arg is
52562 struct LDKChannelSigner InMemorySigner_as_ChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52565 * Constructs a new EcdsaChannelSigner which calls the relevant methods on this_arg.
52566 * This copies the `inner` pointer in this_arg and thus the returned EcdsaChannelSigner must be freed before this_arg is
52568 struct LDKEcdsaChannelSigner InMemorySigner_as_EcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52571 * Constructs a new WriteableEcdsaChannelSigner which calls the relevant methods on this_arg.
52572 * This copies the `inner` pointer in this_arg and thus the returned WriteableEcdsaChannelSigner must be freed before this_arg is
52574 struct LDKWriteableEcdsaChannelSigner InMemorySigner_as_WriteableEcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52577 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
52579 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
52582 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
52584 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKEntropySource arg);
52587 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
52589 void KeysManager_free(struct LDKKeysManager this_obj);
52592 * Constructs a [`KeysManager`] from a 32-byte seed. If the seed is in some way biased (e.g.,
52593 * your CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
52594 * `starting_time` isn't strictly required to actually be a time, but it must absolutely,
52595 * without a doubt, be unique to this instance. ie if you start multiple times with the same
52596 * `seed`, `starting_time` must be unique to each run. Thus, the easiest way to achieve this
52597 * is to simply use the current time (with very high precision).
52599 * The `seed` MUST be backed up safely prior to use so that the keys can be re-created, however,
52600 * obviously, `starting_time` should be unique every time you reload the library - it is only
52601 * used to generate new ephemeral key data (which will be stored by the individual channel if
52604 * Note that the seed is required to recover certain on-chain funds independent of
52605 * [`ChannelMonitor`] data, though a current copy of [`ChannelMonitor`] data is also required
52606 * for any channel, and some on-chain during-closing funds.
52608 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
52610 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
52613 * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
52615 MUST_USE_RES struct LDKSecretKey KeysManager_get_node_secret_key(const struct LDKKeysManager *NONNULL_PTR this_arg);
52618 * Derive an old [`WriteableEcdsaChannelSigner`] containing per-channel secrets based on a key derivation parameters.
52620 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]);
52623 * Signs the given [`PartiallySignedTransaction`] which spends the given [`SpendableOutputDescriptor`]s.
52624 * The resulting inputs will be finalized and the PSBT will be ready for broadcast if there
52625 * are no other inputs that need signing.
52627 * Returns `Err(())` if the PSBT is missing a descriptor or if we fail to sign.
52629 * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used
52630 * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`].
52632 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);
52635 * Constructs a new EntropySource which calls the relevant methods on this_arg.
52636 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
52638 struct LDKEntropySource KeysManager_as_EntropySource(const struct LDKKeysManager *NONNULL_PTR this_arg);
52641 * Constructs a new NodeSigner which calls the relevant methods on this_arg.
52642 * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
52644 struct LDKNodeSigner KeysManager_as_NodeSigner(const struct LDKKeysManager *NONNULL_PTR this_arg);
52647 * Constructs a new OutputSpender which calls the relevant methods on this_arg.
52648 * This copies the `inner` pointer in this_arg and thus the returned OutputSpender must be freed before this_arg is
52650 struct LDKOutputSpender KeysManager_as_OutputSpender(const struct LDKKeysManager *NONNULL_PTR this_arg);
52653 * Constructs a new SignerProvider which calls the relevant methods on this_arg.
52654 * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
52656 struct LDKSignerProvider KeysManager_as_SignerProvider(const struct LDKKeysManager *NONNULL_PTR this_arg);
52659 * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
52661 void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
52664 * Constructs a new EntropySource which calls the relevant methods on this_arg.
52665 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
52667 struct LDKEntropySource PhantomKeysManager_as_EntropySource(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
52670 * Constructs a new NodeSigner which calls the relevant methods on this_arg.
52671 * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
52673 struct LDKNodeSigner PhantomKeysManager_as_NodeSigner(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
52676 * Constructs a new OutputSpender which calls the relevant methods on this_arg.
52677 * This copies the `inner` pointer in this_arg and thus the returned OutputSpender must be freed before this_arg is
52679 struct LDKOutputSpender PhantomKeysManager_as_OutputSpender(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
52682 * Constructs a new SignerProvider which calls the relevant methods on this_arg.
52683 * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
52685 struct LDKSignerProvider PhantomKeysManager_as_SignerProvider(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
52688 * Constructs a [`PhantomKeysManager`] given a 32-byte seed and an additional `cross_node_seed`
52689 * that is shared across all nodes that intend to participate in [phantom node payments]
52692 * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
52693 * `starting_time_nanos`.
52695 * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
52696 * same across restarts, or else inbound payments may fail.
52698 * [phantom node payments]: PhantomKeysManager
52700 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]);
52703 * See [`KeysManager::derive_channel_keys`] for documentation on this method.
52705 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]);
52708 * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
52710 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
52713 * Gets the \"node_id\" secret key of the phantom node used to sign invoices, decode the
52714 * last-hop onion data, etc.
52716 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_phantom_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
52719 * Frees any resources used by the RandomBytes, if is_owned is set and inner is non-NULL.
52721 void RandomBytes_free(struct LDKRandomBytes this_obj);
52724 * Creates a new instance using the given seed.
52726 MUST_USE_RES struct LDKRandomBytes RandomBytes_new(struct LDKThirtyTwoBytes seed);
52729 * Constructs a new EntropySource which calls the relevant methods on this_arg.
52730 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
52732 struct LDKEntropySource RandomBytes_as_EntropySource(const struct LDKRandomBytes *NONNULL_PTR this_arg);
52735 * Calls the free function if one is set
52737 void EcdsaChannelSigner_free(struct LDKEcdsaChannelSigner this_ptr);
52740 * Creates a copy of a WriteableEcdsaChannelSigner
52742 struct LDKWriteableEcdsaChannelSigner WriteableEcdsaChannelSigner_clone(const struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR orig);
52745 * Calls the free function if one is set
52747 void WriteableEcdsaChannelSigner_free(struct LDKWriteableEcdsaChannelSigner this_ptr);
52750 * Frees any resources used by the OnionMessenger, if is_owned is set and inner is non-NULL.
52752 void OnionMessenger_free(struct LDKOnionMessenger this_obj);
52755 * Calls the free function if one is set
52757 void MessageRouter_free(struct LDKMessageRouter this_ptr);
52760 * Frees any resources used by the DefaultMessageRouter, if is_owned is set and inner is non-NULL.
52762 void DefaultMessageRouter_free(struct LDKDefaultMessageRouter this_obj);
52765 * Creates a [`DefaultMessageRouter`] using the given [`NetworkGraph`].
52767 MUST_USE_RES struct LDKDefaultMessageRouter DefaultMessageRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKEntropySource entropy_source);
52770 * Constructs a new MessageRouter which calls the relevant methods on this_arg.
52771 * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is
52773 struct LDKMessageRouter DefaultMessageRouter_as_MessageRouter(const struct LDKDefaultMessageRouter *NONNULL_PTR this_arg);
52776 * Frees any resources used by the OnionMessagePath, if is_owned is set and inner is non-NULL.
52778 void OnionMessagePath_free(struct LDKOnionMessagePath this_obj);
52781 * Nodes on the path between the sender and the destination.
52783 * Returns a copy of the field.
52785 struct LDKCVec_PublicKeyZ OnionMessagePath_get_intermediate_nodes(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
52788 * Nodes on the path between the sender and the destination.
52790 void OnionMessagePath_set_intermediate_nodes(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKCVec_PublicKeyZ val);
52793 * The recipient of the message.
52795 struct LDKDestination OnionMessagePath_get_destination(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
52798 * The recipient of the message.
52800 void OnionMessagePath_set_destination(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKDestination val);
52803 * Addresses that may be used to connect to [`OnionMessagePath::first_node`].
52805 * Only needs to be set if a connection to the node is required. [`OnionMessenger`] may use
52806 * this to initiate such a connection.
52808 * Returns a copy of the field.
52810 struct LDKCOption_CVec_SocketAddressZZ OnionMessagePath_get_first_node_addresses(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
52813 * Addresses that may be used to connect to [`OnionMessagePath::first_node`].
52815 * Only needs to be set if a connection to the node is required. [`OnionMessenger`] may use
52816 * this to initiate such a connection.
52818 void OnionMessagePath_set_first_node_addresses(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKCOption_CVec_SocketAddressZZ val);
52821 * Constructs a new OnionMessagePath given each field
52823 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);
52826 * Creates a copy of the OnionMessagePath
52828 struct LDKOnionMessagePath OnionMessagePath_clone(const struct LDKOnionMessagePath *NONNULL_PTR orig);
52831 * Returns the first node in the path.
52833 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
52835 MUST_USE_RES struct LDKPublicKey OnionMessagePath_first_node(const struct LDKOnionMessagePath *NONNULL_PTR this_arg);
52838 * Frees any resources used by the Destination
52840 void Destination_free(struct LDKDestination this_ptr);
52843 * Creates a copy of the Destination
52845 struct LDKDestination Destination_clone(const struct LDKDestination *NONNULL_PTR orig);
52848 * Utility method to constructs a new Node-variant Destination
52850 struct LDKDestination Destination_node(struct LDKPublicKey a);
52853 * Utility method to constructs a new BlindedPath-variant Destination
52855 struct LDKDestination Destination_blinded_path(struct LDKBlindedPath a);
52858 * Generates a non-cryptographic 64-bit hash of the Destination.
52860 uint64_t Destination_hash(const struct LDKDestination *NONNULL_PTR o);
52863 * Checks if two Destinations contain equal inner contents.
52864 * This ignores pointers and is_owned flags and looks at the values in fields.
52866 bool Destination_eq(const struct LDKDestination *NONNULL_PTR a, const struct LDKDestination *NONNULL_PTR b);
52869 * Attempts to resolve the [`IntroductionNode::DirectedShortChannelId`] of a
52870 * [`Destination::BlindedPath`] to a [`IntroductionNode::NodeId`], if applicable, using the
52871 * provided [`ReadOnlyNetworkGraph`].
52873 void Destination_resolve(struct LDKDestination *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph);
52876 * Frees any resources used by the SendSuccess
52878 void SendSuccess_free(struct LDKSendSuccess this_ptr);
52881 * Creates a copy of the SendSuccess
52883 struct LDKSendSuccess SendSuccess_clone(const struct LDKSendSuccess *NONNULL_PTR orig);
52886 * Utility method to constructs a new Buffered-variant SendSuccess
52888 struct LDKSendSuccess SendSuccess_buffered(void);
52891 * Utility method to constructs a new BufferedAwaitingConnection-variant SendSuccess
52893 struct LDKSendSuccess SendSuccess_buffered_awaiting_connection(struct LDKPublicKey a);
52896 * Generates a non-cryptographic 64-bit hash of the SendSuccess.
52898 uint64_t SendSuccess_hash(const struct LDKSendSuccess *NONNULL_PTR o);
52901 * Checks if two SendSuccesss contain equal inner contents.
52902 * This ignores pointers and is_owned flags and looks at the values in fields.
52904 bool SendSuccess_eq(const struct LDKSendSuccess *NONNULL_PTR a, const struct LDKSendSuccess *NONNULL_PTR b);
52907 * Frees any resources used by the SendError
52909 void SendError_free(struct LDKSendError this_ptr);
52912 * Creates a copy of the SendError
52914 struct LDKSendError SendError_clone(const struct LDKSendError *NONNULL_PTR orig);
52917 * Utility method to constructs a new Secp256k1-variant SendError
52919 struct LDKSendError SendError_secp256k1(enum LDKSecp256k1Error a);
52922 * Utility method to constructs a new TooBigPacket-variant SendError
52924 struct LDKSendError SendError_too_big_packet(void);
52927 * Utility method to constructs a new TooFewBlindedHops-variant SendError
52929 struct LDKSendError SendError_too_few_blinded_hops(void);
52932 * Utility method to constructs a new InvalidFirstHop-variant SendError
52934 struct LDKSendError SendError_invalid_first_hop(struct LDKPublicKey a);
52937 * Utility method to constructs a new PathNotFound-variant SendError
52939 struct LDKSendError SendError_path_not_found(void);
52942 * Utility method to constructs a new InvalidMessage-variant SendError
52944 struct LDKSendError SendError_invalid_message(void);
52947 * Utility method to constructs a new BufferFull-variant SendError
52949 struct LDKSendError SendError_buffer_full(void);
52952 * Utility method to constructs a new GetNodeIdFailed-variant SendError
52954 struct LDKSendError SendError_get_node_id_failed(void);
52957 * Utility method to constructs a new UnresolvedIntroductionNode-variant SendError
52959 struct LDKSendError SendError_unresolved_introduction_node(void);
52962 * Utility method to constructs a new BlindedPathAdvanceFailed-variant SendError
52964 struct LDKSendError SendError_blinded_path_advance_failed(void);
52967 * Generates a non-cryptographic 64-bit hash of the SendError.
52969 uint64_t SendError_hash(const struct LDKSendError *NONNULL_PTR o);
52972 * Checks if two SendErrors contain equal inner contents.
52973 * This ignores pointers and is_owned flags and looks at the values in fields.
52975 bool SendError_eq(const struct LDKSendError *NONNULL_PTR a, const struct LDKSendError *NONNULL_PTR b);
52978 * Calls the free function if one is set
52980 void CustomOnionMessageHandler_free(struct LDKCustomOnionMessageHandler this_ptr);
52983 * Frees any resources used by the PeeledOnion
52985 void PeeledOnion_free(struct LDKPeeledOnion this_ptr);
52988 * Creates a copy of the PeeledOnion
52990 struct LDKPeeledOnion PeeledOnion_clone(const struct LDKPeeledOnion *NONNULL_PTR orig);
52993 * Utility method to constructs a new Forward-variant PeeledOnion
52995 struct LDKPeeledOnion PeeledOnion_forward(struct LDKNextMessageHop a, struct LDKOnionMessage b);
52998 * Utility method to constructs a new Receive-variant PeeledOnion
53000 struct LDKPeeledOnion PeeledOnion_receive(struct LDKParsedOnionMessageContents a, struct LDKThirtyTwoBytes b, struct LDKBlindedPath c);
53003 * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of
53004 * `path`, first calling [`Destination::resolve`] on `path.destination` with the given
53005 * [`ReadOnlyNetworkGraph`].
53007 * Returns the node id of the peer to send the message to, the message itself, and any addresses
53008 * needed to connect to the first node.
53010 * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
53012 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);
53015 * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of
53018 * Returns the node id of the peer to send the message to, the message itself, and any addresses
53019 * needed to connect to the first node.
53021 * Returns [`SendError::UnresolvedIntroductionNode`] if:
53022 * - `destination` contains a blinded path with an [`IntroductionNode::DirectedShortChannelId`],
53023 * - unless it can be resolved by [`NodeIdLookUp::next_node_id`].
53024 * Use [`create_onion_message_resolving_destination`] instead to resolve the introduction node
53025 * first with a [`ReadOnlyNetworkGraph`].
53027 * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
53029 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);
53032 * Decode one layer of an incoming [`OnionMessage`].
53034 * Returns either the next layer of the onion for forwarding or the decrypted content for the
53037 struct LDKCResult_PeeledOnionNoneZ peel_onion_message(const struct LDKOnionMessage *NONNULL_PTR msg, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKCustomOnionMessageHandler custom_handler);
53040 * Constructs a new `OnionMessenger` to send, forward, and delegate received onion messages to
53041 * their respective handlers.
53043 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);
53046 * Sends an [`OnionMessage`] with the given `contents` to `destination`.
53048 * See [`OnionMessenger`] for example usage.
53050 * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
53052 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);
53055 * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
53056 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
53058 struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
53061 * Calls the free function if one is set
53063 void OffersMessageHandler_free(struct LDKOffersMessageHandler this_ptr);
53066 * Frees any resources used by the OffersMessage
53068 void OffersMessage_free(struct LDKOffersMessage this_ptr);
53071 * Creates a copy of the OffersMessage
53073 struct LDKOffersMessage OffersMessage_clone(const struct LDKOffersMessage *NONNULL_PTR orig);
53076 * Utility method to constructs a new InvoiceRequest-variant OffersMessage
53078 struct LDKOffersMessage OffersMessage_invoice_request(struct LDKInvoiceRequest a);
53081 * Utility method to constructs a new Invoice-variant OffersMessage
53083 struct LDKOffersMessage OffersMessage_invoice(struct LDKBolt12Invoice a);
53086 * Utility method to constructs a new InvoiceError-variant OffersMessage
53088 struct LDKOffersMessage OffersMessage_invoice_error(struct LDKInvoiceError a);
53091 * Returns whether `tlv_type` corresponds to a TLV record for Offers.
53093 MUST_USE_RES bool OffersMessage_is_known_type(uint64_t tlv_type);
53096 * Constructs a new OnionMessageContents which calls the relevant methods on this_arg.
53097 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is
53099 struct LDKOnionMessageContents OffersMessage_as_OnionMessageContents(const struct LDKOffersMessage *NONNULL_PTR this_arg);
53102 * Serialize the OffersMessage object into a byte array which can be read by OffersMessage_read
53104 struct LDKCVec_u8Z OffersMessage_write(const struct LDKOffersMessage *NONNULL_PTR obj);
53107 * Read a OffersMessage from a byte array, created by OffersMessage_write
53109 struct LDKCResult_OffersMessageDecodeErrorZ OffersMessage_read(struct LDKu8slice ser, uint64_t arg_a, const struct LDKLogger *NONNULL_PTR arg_b);
53112 * Frees any resources used by the Packet, if is_owned is set and inner is non-NULL.
53114 void Packet_free(struct LDKPacket this_obj);
53117 * Bolt 04 version number
53119 uint8_t Packet_get_version(const struct LDKPacket *NONNULL_PTR this_ptr);
53122 * Bolt 04 version number
53124 void Packet_set_version(struct LDKPacket *NONNULL_PTR this_ptr, uint8_t val);
53127 * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
53129 struct LDKPublicKey Packet_get_public_key(const struct LDKPacket *NONNULL_PTR this_ptr);
53132 * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
53134 void Packet_set_public_key(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKPublicKey val);
53137 * Encrypted payload for the next hop
53139 * Returns a copy of the field.
53141 struct LDKCVec_u8Z Packet_get_hop_data(const struct LDKPacket *NONNULL_PTR this_ptr);
53144 * Encrypted payload for the next hop
53146 void Packet_set_hop_data(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
53149 * HMAC to verify the integrity of hop_data
53151 const uint8_t (*Packet_get_hmac(const struct LDKPacket *NONNULL_PTR this_ptr))[32];
53154 * HMAC to verify the integrity of hop_data
53156 void Packet_set_hmac(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
53159 * Constructs a new Packet given each field
53161 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);
53164 * Creates a copy of the Packet
53166 struct LDKPacket Packet_clone(const struct LDKPacket *NONNULL_PTR orig);
53169 * Generates a non-cryptographic 64-bit hash of the Packet.
53171 uint64_t Packet_hash(const struct LDKPacket *NONNULL_PTR o);
53174 * Checks if two Packets contain equal inner contents.
53175 * This ignores pointers and is_owned flags and looks at the values in fields.
53176 * Two objects with NULL inner values will be considered "equal" here.
53178 bool Packet_eq(const struct LDKPacket *NONNULL_PTR a, const struct LDKPacket *NONNULL_PTR b);
53181 * Serialize the Packet object into a byte array which can be read by Packet_read
53183 struct LDKCVec_u8Z Packet_write(const struct LDKPacket *NONNULL_PTR obj);
53186 * Frees any resources used by the ParsedOnionMessageContents
53188 void ParsedOnionMessageContents_free(struct LDKParsedOnionMessageContents this_ptr);
53191 * Creates a copy of the ParsedOnionMessageContents
53193 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_clone(const struct LDKParsedOnionMessageContents *NONNULL_PTR orig);
53196 * Utility method to constructs a new Offers-variant ParsedOnionMessageContents
53198 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_offers(struct LDKOffersMessage a);
53201 * Utility method to constructs a new Custom-variant ParsedOnionMessageContents
53203 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_custom(struct LDKOnionMessageContents a);
53206 * Constructs a new OnionMessageContents which calls the relevant methods on this_arg.
53207 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is
53209 struct LDKOnionMessageContents ParsedOnionMessageContents_as_OnionMessageContents(const struct LDKParsedOnionMessageContents *NONNULL_PTR this_arg);
53212 * Serialize the ParsedOnionMessageContents object into a byte array which can be read by ParsedOnionMessageContents_read
53214 struct LDKCVec_u8Z ParsedOnionMessageContents_write(const struct LDKParsedOnionMessageContents *NONNULL_PTR obj);
53217 * Creates a copy of a OnionMessageContents
53219 struct LDKOnionMessageContents OnionMessageContents_clone(const struct LDKOnionMessageContents *NONNULL_PTR orig);
53222 * Calls the free function if one is set
53224 void OnionMessageContents_free(struct LDKOnionMessageContents this_ptr);
53227 * Frees any resources used by the NextMessageHop
53229 void NextMessageHop_free(struct LDKNextMessageHop this_ptr);
53232 * Creates a copy of the NextMessageHop
53234 struct LDKNextMessageHop NextMessageHop_clone(const struct LDKNextMessageHop *NONNULL_PTR orig);
53237 * Utility method to constructs a new NodeId-variant NextMessageHop
53239 struct LDKNextMessageHop NextMessageHop_node_id(struct LDKPublicKey a);
53242 * Utility method to constructs a new ShortChannelId-variant NextMessageHop
53244 struct LDKNextMessageHop NextMessageHop_short_channel_id(uint64_t a);
53247 * Generates a non-cryptographic 64-bit hash of the NextMessageHop.
53249 uint64_t NextMessageHop_hash(const struct LDKNextMessageHop *NONNULL_PTR o);
53252 * Checks if two NextMessageHops contain equal inner contents.
53253 * This ignores pointers and is_owned flags and looks at the values in fields.
53255 bool NextMessageHop_eq(const struct LDKNextMessageHop *NONNULL_PTR a, const struct LDKNextMessageHop *NONNULL_PTR b);
53258 * Frees any resources used by the BlindedPath, if is_owned is set and inner is non-NULL.
53260 void BlindedPath_free(struct LDKBlindedPath this_obj);
53263 * To send to a blinded path, the sender first finds a route to the unblinded
53264 * `introduction_node`, which can unblind its [`encrypted_payload`] to find out the onion
53265 * message or payment's next hop and forward it along.
53267 * [`encrypted_payload`]: BlindedHop::encrypted_payload
53269 struct LDKIntroductionNode BlindedPath_get_introduction_node(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
53272 * To send to a blinded path, the sender first finds a route to the unblinded
53273 * `introduction_node`, which can unblind its [`encrypted_payload`] to find out the onion
53274 * message or payment's next hop and forward it along.
53276 * [`encrypted_payload`]: BlindedHop::encrypted_payload
53278 void BlindedPath_set_introduction_node(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKIntroductionNode val);
53281 * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion
53282 * message or payment.
53284 * [`encrypted_payload`]: BlindedHop::encrypted_payload
53286 struct LDKPublicKey BlindedPath_get_blinding_point(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
53289 * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion
53290 * message or payment.
53292 * [`encrypted_payload`]: BlindedHop::encrypted_payload
53294 void BlindedPath_set_blinding_point(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKPublicKey val);
53297 * The hops composing the blinded path.
53299 struct LDKCVec_BlindedHopZ BlindedPath_get_blinded_hops(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
53302 * The hops composing the blinded path.
53304 void BlindedPath_set_blinded_hops(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
53307 * Constructs a new BlindedPath given each field
53309 MUST_USE_RES struct LDKBlindedPath BlindedPath_new(struct LDKIntroductionNode introduction_node_arg, struct LDKPublicKey blinding_point_arg, struct LDKCVec_BlindedHopZ blinded_hops_arg);
53312 * Creates a copy of the BlindedPath
53314 struct LDKBlindedPath BlindedPath_clone(const struct LDKBlindedPath *NONNULL_PTR orig);
53317 * Generates a non-cryptographic 64-bit hash of the BlindedPath.
53319 uint64_t BlindedPath_hash(const struct LDKBlindedPath *NONNULL_PTR o);
53322 * Checks if two BlindedPaths contain equal inner contents.
53323 * This ignores pointers and is_owned flags and looks at the values in fields.
53324 * Two objects with NULL inner values will be considered "equal" here.
53326 bool BlindedPath_eq(const struct LDKBlindedPath *NONNULL_PTR a, const struct LDKBlindedPath *NONNULL_PTR b);
53329 * Frees any resources used by the IntroductionNode
53331 void IntroductionNode_free(struct LDKIntroductionNode this_ptr);
53334 * Creates a copy of the IntroductionNode
53336 struct LDKIntroductionNode IntroductionNode_clone(const struct LDKIntroductionNode *NONNULL_PTR orig);
53339 * Utility method to constructs a new NodeId-variant IntroductionNode
53341 struct LDKIntroductionNode IntroductionNode_node_id(struct LDKPublicKey a);
53344 * Utility method to constructs a new DirectedShortChannelId-variant IntroductionNode
53346 struct LDKIntroductionNode IntroductionNode_directed_short_channel_id(enum LDKDirection a, uint64_t b);
53349 * Generates a non-cryptographic 64-bit hash of the IntroductionNode.
53351 uint64_t IntroductionNode_hash(const struct LDKIntroductionNode *NONNULL_PTR o);
53354 * Checks if two IntroductionNodes contain equal inner contents.
53355 * This ignores pointers and is_owned flags and looks at the values in fields.
53357 bool IntroductionNode_eq(const struct LDKIntroductionNode *NONNULL_PTR a, const struct LDKIntroductionNode *NONNULL_PTR b);
53360 * Creates a copy of the Direction
53362 enum LDKDirection Direction_clone(const enum LDKDirection *NONNULL_PTR orig);
53365 * Utility method to constructs a new NodeOne-variant Direction
53367 enum LDKDirection Direction_node_one(void);
53370 * Utility method to constructs a new NodeTwo-variant Direction
53372 enum LDKDirection Direction_node_two(void);
53375 * Generates a non-cryptographic 64-bit hash of the Direction.
53377 uint64_t Direction_hash(const enum LDKDirection *NONNULL_PTR o);
53380 * Checks if two Directions contain equal inner contents.
53381 * This ignores pointers and is_owned flags and looks at the values in fields.
53383 bool Direction_eq(const enum LDKDirection *NONNULL_PTR a, const enum LDKDirection *NONNULL_PTR b);
53386 * Calls the free function if one is set
53388 void NodeIdLookUp_free(struct LDKNodeIdLookUp this_ptr);
53391 * Frees any resources used by the EmptyNodeIdLookUp, if is_owned is set and inner is non-NULL.
53393 void EmptyNodeIdLookUp_free(struct LDKEmptyNodeIdLookUp this_obj);
53396 * Constructs a new EmptyNodeIdLookUp given each field
53398 MUST_USE_RES struct LDKEmptyNodeIdLookUp EmptyNodeIdLookUp_new(void);
53401 * Constructs a new NodeIdLookUp which calls the relevant methods on this_arg.
53402 * This copies the `inner` pointer in this_arg and thus the returned NodeIdLookUp must be freed before this_arg is
53404 struct LDKNodeIdLookUp EmptyNodeIdLookUp_as_NodeIdLookUp(const struct LDKEmptyNodeIdLookUp *NONNULL_PTR this_arg);
53407 * Frees any resources used by the BlindedHop, if is_owned is set and inner is non-NULL.
53409 void BlindedHop_free(struct LDKBlindedHop this_obj);
53412 * The blinded node id of this hop in a [`BlindedPath`].
53414 struct LDKPublicKey BlindedHop_get_blinded_node_id(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
53417 * The blinded node id of this hop in a [`BlindedPath`].
53419 void BlindedHop_set_blinded_node_id(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
53422 * The encrypted payload intended for this hop in a [`BlindedPath`].
53424 * Returns a copy of the field.
53426 struct LDKCVec_u8Z BlindedHop_get_encrypted_payload(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
53429 * The encrypted payload intended for this hop in a [`BlindedPath`].
53431 void BlindedHop_set_encrypted_payload(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
53434 * Constructs a new BlindedHop given each field
53436 MUST_USE_RES struct LDKBlindedHop BlindedHop_new(struct LDKPublicKey blinded_node_id_arg, struct LDKCVec_u8Z encrypted_payload_arg);
53439 * Creates a copy of the BlindedHop
53441 struct LDKBlindedHop BlindedHop_clone(const struct LDKBlindedHop *NONNULL_PTR orig);
53444 * Generates a non-cryptographic 64-bit hash of the BlindedHop.
53446 uint64_t BlindedHop_hash(const struct LDKBlindedHop *NONNULL_PTR o);
53449 * Checks if two BlindedHops contain equal inner contents.
53450 * This ignores pointers and is_owned flags and looks at the values in fields.
53451 * Two objects with NULL inner values will be considered "equal" here.
53453 bool BlindedHop_eq(const struct LDKBlindedHop *NONNULL_PTR a, const struct LDKBlindedHop *NONNULL_PTR b);
53456 * Create a one-hop blinded path for a message.
53458 MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_one_hop_for_message(struct LDKPublicKey recipient_node_id, const struct LDKEntropySource *NONNULL_PTR entropy_source);
53461 * Create a blinded path for an onion message, to be forwarded along `node_pks`. The last node
53462 * pubkey in `node_pks` will be the destination node.
53464 * Errors if no hops are provided or if `node_pk`(s) are invalid.
53466 MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_new_for_message(struct LDKCVec_PublicKeyZ node_pks, const struct LDKEntropySource *NONNULL_PTR entropy_source);
53469 * Create a one-hop blinded path for a payment.
53471 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, const struct LDKEntropySource *NONNULL_PTR entropy_source);
53474 * Create a blinded path for a payment, to be forwarded along `intermediate_nodes`.
53477 * * a provided node id is invalid
53478 * * [`BlindedPayInfo`] calculation results in an integer overflow
53479 * * any unknown features are required in the provided [`ForwardTlvs`]
53481 * [`ForwardTlvs`]: crate::blinded_path::payment::ForwardTlvs
53483 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, const struct LDKEntropySource *NONNULL_PTR entropy_source);
53486 * Returns the introduction [`NodeId`] of the blinded path, if it is publicly reachable (i.e.,
53487 * it is found in the network graph).
53489 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
53491 MUST_USE_RES struct LDKNodeId BlindedPath_public_introduction_node_id(const struct LDKBlindedPath *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph);
53494 * Serialize the BlindedPath object into a byte array which can be read by BlindedPath_read
53496 struct LDKCVec_u8Z BlindedPath_write(const struct LDKBlindedPath *NONNULL_PTR obj);
53499 * Read a BlindedPath from a byte array, created by BlindedPath_write
53501 struct LDKCResult_BlindedPathDecodeErrorZ BlindedPath_read(struct LDKu8slice ser);
53504 * Serialize the BlindedHop object into a byte array which can be read by BlindedHop_read
53506 struct LDKCVec_u8Z BlindedHop_write(const struct LDKBlindedHop *NONNULL_PTR obj);
53509 * Read a BlindedHop from a byte array, created by BlindedHop_write
53511 struct LDKCResult_BlindedHopDecodeErrorZ BlindedHop_read(struct LDKu8slice ser);
53514 * Frees any resources used by the ForwardNode, if is_owned is set and inner is non-NULL.
53516 void ForwardNode_free(struct LDKForwardNode this_obj);
53519 * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
53520 * used for [`BlindedPayInfo`] construction.
53522 struct LDKForwardTlvs ForwardNode_get_tlvs(const struct LDKForwardNode *NONNULL_PTR this_ptr);
53525 * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
53526 * used for [`BlindedPayInfo`] construction.
53528 void ForwardNode_set_tlvs(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKForwardTlvs val);
53531 * This node's pubkey.
53533 struct LDKPublicKey ForwardNode_get_node_id(const struct LDKForwardNode *NONNULL_PTR this_ptr);
53536 * This node's pubkey.
53538 void ForwardNode_set_node_id(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKPublicKey val);
53541 * The maximum value, in msat, that may be accepted by this node.
53543 uint64_t ForwardNode_get_htlc_maximum_msat(const struct LDKForwardNode *NONNULL_PTR this_ptr);
53546 * The maximum value, in msat, that may be accepted by this node.
53548 void ForwardNode_set_htlc_maximum_msat(struct LDKForwardNode *NONNULL_PTR this_ptr, uint64_t val);
53551 * Constructs a new ForwardNode given each field
53553 MUST_USE_RES struct LDKForwardNode ForwardNode_new(struct LDKForwardTlvs tlvs_arg, struct LDKPublicKey node_id_arg, uint64_t htlc_maximum_msat_arg);
53556 * Creates a copy of the ForwardNode
53558 struct LDKForwardNode ForwardNode_clone(const struct LDKForwardNode *NONNULL_PTR orig);
53561 * Frees any resources used by the ForwardTlvs, if is_owned is set and inner is non-NULL.
53563 void ForwardTlvs_free(struct LDKForwardTlvs this_obj);
53566 * The short channel id this payment should be forwarded out over.
53568 uint64_t ForwardTlvs_get_short_channel_id(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
53571 * The short channel id this payment should be forwarded out over.
53573 void ForwardTlvs_set_short_channel_id(struct LDKForwardTlvs *NONNULL_PTR this_ptr, uint64_t val);
53576 * Payment parameters for relaying over [`Self::short_channel_id`].
53578 struct LDKPaymentRelay ForwardTlvs_get_payment_relay(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
53581 * Payment parameters for relaying over [`Self::short_channel_id`].
53583 void ForwardTlvs_set_payment_relay(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentRelay val);
53586 * Payment constraints for relaying over [`Self::short_channel_id`].
53588 struct LDKPaymentConstraints ForwardTlvs_get_payment_constraints(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
53591 * Payment constraints for relaying over [`Self::short_channel_id`].
53593 void ForwardTlvs_set_payment_constraints(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
53596 * Supported and required features when relaying a payment onion containing this object's
53597 * corresponding [`BlindedHop::encrypted_payload`].
53599 * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
53601 struct LDKBlindedHopFeatures ForwardTlvs_get_features(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
53604 * Supported and required features when relaying a payment onion containing this object's
53605 * corresponding [`BlindedHop::encrypted_payload`].
53607 * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
53609 void ForwardTlvs_set_features(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
53612 * Constructs a new ForwardTlvs given each field
53614 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);
53617 * Creates a copy of the ForwardTlvs
53619 struct LDKForwardTlvs ForwardTlvs_clone(const struct LDKForwardTlvs *NONNULL_PTR orig);
53622 * Frees any resources used by the ReceiveTlvs, if is_owned is set and inner is non-NULL.
53624 void ReceiveTlvs_free(struct LDKReceiveTlvs this_obj);
53627 * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
53629 const uint8_t (*ReceiveTlvs_get_payment_secret(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr))[32];
53632 * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
53634 void ReceiveTlvs_set_payment_secret(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
53637 * Constraints for the receiver of this payment.
53639 struct LDKPaymentConstraints ReceiveTlvs_get_payment_constraints(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr);
53642 * Constraints for the receiver of this payment.
53644 void ReceiveTlvs_set_payment_constraints(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
53647 * Context for the receiver of this payment.
53649 struct LDKPaymentContext ReceiveTlvs_get_payment_context(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr);
53652 * Context for the receiver of this payment.
53654 void ReceiveTlvs_set_payment_context(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentContext val);
53657 * Constructs a new ReceiveTlvs given each field
53659 MUST_USE_RES struct LDKReceiveTlvs ReceiveTlvs_new(struct LDKThirtyTwoBytes payment_secret_arg, struct LDKPaymentConstraints payment_constraints_arg, struct LDKPaymentContext payment_context_arg);
53662 * Creates a copy of the ReceiveTlvs
53664 struct LDKReceiveTlvs ReceiveTlvs_clone(const struct LDKReceiveTlvs *NONNULL_PTR orig);
53667 * Frees any resources used by the PaymentRelay, if is_owned is set and inner is non-NULL.
53669 void PaymentRelay_free(struct LDKPaymentRelay this_obj);
53672 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
53674 uint16_t PaymentRelay_get_cltv_expiry_delta(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
53677 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
53679 void PaymentRelay_set_cltv_expiry_delta(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint16_t val);
53682 * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
53683 * this [`BlindedHop`], (i.e., 10,000 is 1%).
53685 uint32_t PaymentRelay_get_fee_proportional_millionths(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
53688 * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
53689 * this [`BlindedHop`], (i.e., 10,000 is 1%).
53691 void PaymentRelay_set_fee_proportional_millionths(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
53694 * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
53696 uint32_t PaymentRelay_get_fee_base_msat(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
53699 * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
53701 void PaymentRelay_set_fee_base_msat(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
53704 * Constructs a new PaymentRelay given each field
53706 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);
53709 * Creates a copy of the PaymentRelay
53711 struct LDKPaymentRelay PaymentRelay_clone(const struct LDKPaymentRelay *NONNULL_PTR orig);
53714 * Frees any resources used by the PaymentConstraints, if is_owned is set and inner is non-NULL.
53716 void PaymentConstraints_free(struct LDKPaymentConstraints this_obj);
53719 * The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
53721 uint32_t PaymentConstraints_get_max_cltv_expiry(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
53724 * The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
53726 void PaymentConstraints_set_max_cltv_expiry(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint32_t val);
53729 * The minimum value, in msat, that may be accepted by the node corresponding to this
53732 uint64_t PaymentConstraints_get_htlc_minimum_msat(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
53735 * The minimum value, in msat, that may be accepted by the node corresponding to this
53738 void PaymentConstraints_set_htlc_minimum_msat(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint64_t val);
53741 * Constructs a new PaymentConstraints given each field
53743 MUST_USE_RES struct LDKPaymentConstraints PaymentConstraints_new(uint32_t max_cltv_expiry_arg, uint64_t htlc_minimum_msat_arg);
53746 * Creates a copy of the PaymentConstraints
53748 struct LDKPaymentConstraints PaymentConstraints_clone(const struct LDKPaymentConstraints *NONNULL_PTR orig);
53751 * Frees any resources used by the PaymentContext
53753 void PaymentContext_free(struct LDKPaymentContext this_ptr);
53756 * Creates a copy of the PaymentContext
53758 struct LDKPaymentContext PaymentContext_clone(const struct LDKPaymentContext *NONNULL_PTR orig);
53761 * Utility method to constructs a new Unknown-variant PaymentContext
53763 struct LDKPaymentContext PaymentContext_unknown(struct LDKUnknownPaymentContext a);
53766 * Utility method to constructs a new Bolt12Offer-variant PaymentContext
53768 struct LDKPaymentContext PaymentContext_bolt12_offer(struct LDKBolt12OfferContext a);
53771 * Utility method to constructs a new Bolt12Refund-variant PaymentContext
53773 struct LDKPaymentContext PaymentContext_bolt12_refund(struct LDKBolt12RefundContext a);
53776 * Checks if two PaymentContexts contain equal inner contents.
53777 * This ignores pointers and is_owned flags and looks at the values in fields.
53779 bool PaymentContext_eq(const struct LDKPaymentContext *NONNULL_PTR a, const struct LDKPaymentContext *NONNULL_PTR b);
53782 * Frees any resources used by the UnknownPaymentContext, if is_owned is set and inner is non-NULL.
53784 void UnknownPaymentContext_free(struct LDKUnknownPaymentContext this_obj);
53787 * Creates a copy of the UnknownPaymentContext
53789 struct LDKUnknownPaymentContext UnknownPaymentContext_clone(const struct LDKUnknownPaymentContext *NONNULL_PTR orig);
53792 * Checks if two UnknownPaymentContexts contain equal inner contents.
53793 * This ignores pointers and is_owned flags and looks at the values in fields.
53794 * Two objects with NULL inner values will be considered "equal" here.
53796 bool UnknownPaymentContext_eq(const struct LDKUnknownPaymentContext *NONNULL_PTR a, const struct LDKUnknownPaymentContext *NONNULL_PTR b);
53799 * Frees any resources used by the Bolt12OfferContext, if is_owned is set and inner is non-NULL.
53801 void Bolt12OfferContext_free(struct LDKBolt12OfferContext this_obj);
53804 * The identifier of the [`Offer`].
53806 * [`Offer`]: crate::offers::offer::Offer
53808 struct LDKOfferId Bolt12OfferContext_get_offer_id(const struct LDKBolt12OfferContext *NONNULL_PTR this_ptr);
53811 * The identifier of the [`Offer`].
53813 * [`Offer`]: crate::offers::offer::Offer
53815 void Bolt12OfferContext_set_offer_id(struct LDKBolt12OfferContext *NONNULL_PTR this_ptr, struct LDKOfferId val);
53818 * Fields from an [`InvoiceRequest`] sent for a [`Bolt12Invoice`].
53820 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
53821 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
53823 struct LDKInvoiceRequestFields Bolt12OfferContext_get_invoice_request(const struct LDKBolt12OfferContext *NONNULL_PTR this_ptr);
53826 * Fields from an [`InvoiceRequest`] sent for a [`Bolt12Invoice`].
53828 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
53829 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
53831 void Bolt12OfferContext_set_invoice_request(struct LDKBolt12OfferContext *NONNULL_PTR this_ptr, struct LDKInvoiceRequestFields val);
53834 * Constructs a new Bolt12OfferContext given each field
53836 MUST_USE_RES struct LDKBolt12OfferContext Bolt12OfferContext_new(struct LDKOfferId offer_id_arg, struct LDKInvoiceRequestFields invoice_request_arg);
53839 * Creates a copy of the Bolt12OfferContext
53841 struct LDKBolt12OfferContext Bolt12OfferContext_clone(const struct LDKBolt12OfferContext *NONNULL_PTR orig);
53844 * Checks if two Bolt12OfferContexts contain equal inner contents.
53845 * This ignores pointers and is_owned flags and looks at the values in fields.
53846 * Two objects with NULL inner values will be considered "equal" here.
53848 bool Bolt12OfferContext_eq(const struct LDKBolt12OfferContext *NONNULL_PTR a, const struct LDKBolt12OfferContext *NONNULL_PTR b);
53851 * Frees any resources used by the Bolt12RefundContext, if is_owned is set and inner is non-NULL.
53853 void Bolt12RefundContext_free(struct LDKBolt12RefundContext this_obj);
53856 * Constructs a new Bolt12RefundContext given each field
53858 MUST_USE_RES struct LDKBolt12RefundContext Bolt12RefundContext_new(void);
53861 * Creates a copy of the Bolt12RefundContext
53863 struct LDKBolt12RefundContext Bolt12RefundContext_clone(const struct LDKBolt12RefundContext *NONNULL_PTR orig);
53866 * Checks if two Bolt12RefundContexts contain equal inner contents.
53867 * This ignores pointers and is_owned flags and looks at the values in fields.
53868 * Two objects with NULL inner values will be considered "equal" here.
53870 bool Bolt12RefundContext_eq(const struct LDKBolt12RefundContext *NONNULL_PTR a, const struct LDKBolt12RefundContext *NONNULL_PTR b);
53873 * Serialize the ForwardTlvs object into a byte array which can be read by ForwardTlvs_read
53875 struct LDKCVec_u8Z ForwardTlvs_write(const struct LDKForwardTlvs *NONNULL_PTR obj);
53878 * Serialize the ReceiveTlvs object into a byte array which can be read by ReceiveTlvs_read
53880 struct LDKCVec_u8Z ReceiveTlvs_write(const struct LDKReceiveTlvs *NONNULL_PTR obj);
53883 * Serialize the PaymentRelay object into a byte array which can be read by PaymentRelay_read
53885 struct LDKCVec_u8Z PaymentRelay_write(const struct LDKPaymentRelay *NONNULL_PTR obj);
53888 * Read a PaymentRelay from a byte array, created by PaymentRelay_write
53890 struct LDKCResult_PaymentRelayDecodeErrorZ PaymentRelay_read(struct LDKu8slice ser);
53893 * Serialize the PaymentConstraints object into a byte array which can be read by PaymentConstraints_read
53895 struct LDKCVec_u8Z PaymentConstraints_write(const struct LDKPaymentConstraints *NONNULL_PTR obj);
53898 * Read a PaymentConstraints from a byte array, created by PaymentConstraints_write
53900 struct LDKCResult_PaymentConstraintsDecodeErrorZ PaymentConstraints_read(struct LDKu8slice ser);
53903 * Serialize the PaymentContext object into a byte array which can be read by PaymentContext_read
53905 struct LDKCVec_u8Z PaymentContext_write(const struct LDKPaymentContext *NONNULL_PTR obj);
53908 * Read a PaymentContext from a byte array, created by PaymentContext_write
53910 struct LDKCResult_PaymentContextDecodeErrorZ PaymentContext_read(struct LDKu8slice ser);
53913 * Serialize the UnknownPaymentContext object into a byte array which can be read by UnknownPaymentContext_read
53915 struct LDKCVec_u8Z UnknownPaymentContext_write(const struct LDKUnknownPaymentContext *NONNULL_PTR obj);
53918 * Read a UnknownPaymentContext from a byte array, created by UnknownPaymentContext_write
53920 struct LDKCResult_UnknownPaymentContextDecodeErrorZ UnknownPaymentContext_read(struct LDKu8slice ser);
53923 * Serialize the Bolt12OfferContext object into a byte array which can be read by Bolt12OfferContext_read
53925 struct LDKCVec_u8Z Bolt12OfferContext_write(const struct LDKBolt12OfferContext *NONNULL_PTR obj);
53928 * Read a Bolt12OfferContext from a byte array, created by Bolt12OfferContext_write
53930 struct LDKCResult_Bolt12OfferContextDecodeErrorZ Bolt12OfferContext_read(struct LDKu8slice ser);
53933 * Serialize the Bolt12RefundContext object into a byte array which can be read by Bolt12RefundContext_read
53935 struct LDKCVec_u8Z Bolt12RefundContext_write(const struct LDKBolt12RefundContext *NONNULL_PTR obj);
53938 * Read a Bolt12RefundContext from a byte array, created by Bolt12RefundContext_write
53940 struct LDKCResult_Bolt12RefundContextDecodeErrorZ Bolt12RefundContext_read(struct LDKu8slice ser);
53943 * Frees any resources used by the PaymentPurpose
53945 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
53948 * Creates a copy of the PaymentPurpose
53950 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
53953 * Utility method to constructs a new Bolt11InvoicePayment-variant PaymentPurpose
53955 struct LDKPaymentPurpose PaymentPurpose_bolt11_invoice_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret);
53958 * Utility method to constructs a new Bolt12OfferPayment-variant PaymentPurpose
53960 struct LDKPaymentPurpose PaymentPurpose_bolt12_offer_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret, struct LDKBolt12OfferContext payment_context);
53963 * Utility method to constructs a new Bolt12RefundPayment-variant PaymentPurpose
53965 struct LDKPaymentPurpose PaymentPurpose_bolt12_refund_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret, struct LDKBolt12RefundContext payment_context);
53968 * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
53970 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
53973 * Checks if two PaymentPurposes contain equal inner contents.
53974 * This ignores pointers and is_owned flags and looks at the values in fields.
53976 bool PaymentPurpose_eq(const struct LDKPaymentPurpose *NONNULL_PTR a, const struct LDKPaymentPurpose *NONNULL_PTR b);
53979 * Returns the preimage for this payment, if it is known.
53981 MUST_USE_RES struct LDKCOption_ThirtyTwoBytesZ PaymentPurpose_preimage(const struct LDKPaymentPurpose *NONNULL_PTR this_arg);
53984 * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
53986 struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj);
53989 * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
53991 struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser);
53994 * Frees any resources used by the ClaimedHTLC, if is_owned is set and inner is non-NULL.
53996 void ClaimedHTLC_free(struct LDKClaimedHTLC this_obj);
53999 * The `channel_id` of the channel over which the HTLC was received.
54001 struct LDKChannelId ClaimedHTLC_get_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
54004 * The `channel_id` of the channel over which the HTLC was received.
54006 void ClaimedHTLC_set_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
54009 * The `user_channel_id` of the channel over which the HTLC was received. This is the value
54010 * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
54011 * [`ChannelManager::accept_inbound_channel`] for inbound channels if
54012 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
54013 * `user_channel_id` will be randomized for an inbound channel.
54015 * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
54016 * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
54017 * was not actually claimed until after upgrading.)
54019 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
54020 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
54021 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
54023 struct LDKU128 ClaimedHTLC_get_user_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
54026 * The `user_channel_id` of the channel over which the HTLC was received. This is the value
54027 * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
54028 * [`ChannelManager::accept_inbound_channel`] for inbound channels if
54029 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
54030 * `user_channel_id` will be randomized for an inbound channel.
54032 * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
54033 * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
54034 * was not actually claimed until after upgrading.)
54036 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
54037 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
54038 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
54040 void ClaimedHTLC_set_user_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKU128 val);
54043 * The block height at which this HTLC expires.
54045 uint32_t ClaimedHTLC_get_cltv_expiry(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
54048 * The block height at which this HTLC expires.
54050 void ClaimedHTLC_set_cltv_expiry(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint32_t val);
54053 * The amount (in msats) of this part of an MPP.
54055 uint64_t ClaimedHTLC_get_value_msat(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
54058 * The amount (in msats) of this part of an MPP.
54060 void ClaimedHTLC_set_value_msat(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint64_t val);
54063 * The extra fee our counterparty skimmed off the top of this HTLC, if any.
54065 * This value will always be 0 for [`ClaimedHTLC`]s serialized with LDK versions prior to
54068 uint64_t ClaimedHTLC_get_counterparty_skimmed_fee_msat(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
54071 * The extra fee our counterparty skimmed off the top of this HTLC, if any.
54073 * This value will always be 0 for [`ClaimedHTLC`]s serialized with LDK versions prior to
54076 void ClaimedHTLC_set_counterparty_skimmed_fee_msat(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint64_t val);
54079 * Constructs a new ClaimedHTLC given each field
54081 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);
54084 * Creates a copy of the ClaimedHTLC
54086 struct LDKClaimedHTLC ClaimedHTLC_clone(const struct LDKClaimedHTLC *NONNULL_PTR orig);
54089 * Checks if two ClaimedHTLCs contain equal inner contents.
54090 * This ignores pointers and is_owned flags and looks at the values in fields.
54091 * Two objects with NULL inner values will be considered "equal" here.
54093 bool ClaimedHTLC_eq(const struct LDKClaimedHTLC *NONNULL_PTR a, const struct LDKClaimedHTLC *NONNULL_PTR b);
54096 * Serialize the ClaimedHTLC object into a byte array which can be read by ClaimedHTLC_read
54098 struct LDKCVec_u8Z ClaimedHTLC_write(const struct LDKClaimedHTLC *NONNULL_PTR obj);
54101 * Read a ClaimedHTLC from a byte array, created by ClaimedHTLC_write
54103 struct LDKCResult_ClaimedHTLCDecodeErrorZ ClaimedHTLC_read(struct LDKu8slice ser);
54106 * Frees any resources used by the PathFailure
54108 void PathFailure_free(struct LDKPathFailure this_ptr);
54111 * Creates a copy of the PathFailure
54113 struct LDKPathFailure PathFailure_clone(const struct LDKPathFailure *NONNULL_PTR orig);
54116 * Utility method to constructs a new InitialSend-variant PathFailure
54118 struct LDKPathFailure PathFailure_initial_send(struct LDKAPIError err);
54121 * Utility method to constructs a new OnPath-variant PathFailure
54123 struct LDKPathFailure PathFailure_on_path(struct LDKCOption_NetworkUpdateZ network_update);
54126 * Checks if two PathFailures contain equal inner contents.
54127 * This ignores pointers and is_owned flags and looks at the values in fields.
54129 bool PathFailure_eq(const struct LDKPathFailure *NONNULL_PTR a, const struct LDKPathFailure *NONNULL_PTR b);
54132 * Serialize the PathFailure object into a byte array which can be read by PathFailure_read
54134 struct LDKCVec_u8Z PathFailure_write(const struct LDKPathFailure *NONNULL_PTR obj);
54137 * Read a PathFailure from a byte array, created by PathFailure_write
54139 struct LDKCResult_COption_PathFailureZDecodeErrorZ PathFailure_read(struct LDKu8slice ser);
54142 * Frees any resources used by the ClosureReason
54144 void ClosureReason_free(struct LDKClosureReason this_ptr);
54147 * Creates a copy of the ClosureReason
54149 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
54152 * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
54154 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKUntrustedString peer_msg);
54157 * Utility method to constructs a new HolderForceClosed-variant ClosureReason
54159 struct LDKClosureReason ClosureReason_holder_force_closed(void);
54162 * Utility method to constructs a new LegacyCooperativeClosure-variant ClosureReason
54164 struct LDKClosureReason ClosureReason_legacy_cooperative_closure(void);
54167 * Utility method to constructs a new CounterpartyInitiatedCooperativeClosure-variant ClosureReason
54169 struct LDKClosureReason ClosureReason_counterparty_initiated_cooperative_closure(void);
54172 * Utility method to constructs a new LocallyInitiatedCooperativeClosure-variant ClosureReason
54174 struct LDKClosureReason ClosureReason_locally_initiated_cooperative_closure(void);
54177 * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
54179 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
54182 * Utility method to constructs a new FundingTimedOut-variant ClosureReason
54184 struct LDKClosureReason ClosureReason_funding_timed_out(void);
54187 * Utility method to constructs a new ProcessingError-variant ClosureReason
54189 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
54192 * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
54194 struct LDKClosureReason ClosureReason_disconnected_peer(void);
54197 * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
54199 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
54202 * Utility method to constructs a new CounterpartyCoopClosedUnfundedChannel-variant ClosureReason
54204 struct LDKClosureReason ClosureReason_counterparty_coop_closed_unfunded_channel(void);
54207 * Utility method to constructs a new FundingBatchClosure-variant ClosureReason
54209 struct LDKClosureReason ClosureReason_funding_batch_closure(void);
54212 * Utility method to constructs a new HTLCsTimedOut-variant ClosureReason
54214 struct LDKClosureReason ClosureReason_htlcs_timed_out(void);
54217 * Checks if two ClosureReasons contain equal inner contents.
54218 * This ignores pointers and is_owned flags and looks at the values in fields.
54220 bool ClosureReason_eq(const struct LDKClosureReason *NONNULL_PTR a, const struct LDKClosureReason *NONNULL_PTR b);
54223 * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
54225 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
54228 * Read a ClosureReason from a byte array, created by ClosureReason_write
54230 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
54233 * Frees any resources used by the HTLCDestination
54235 void HTLCDestination_free(struct LDKHTLCDestination this_ptr);
54238 * Creates a copy of the HTLCDestination
54240 struct LDKHTLCDestination HTLCDestination_clone(const struct LDKHTLCDestination *NONNULL_PTR orig);
54243 * Utility method to constructs a new NextHopChannel-variant HTLCDestination
54245 struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKChannelId channel_id);
54248 * Utility method to constructs a new UnknownNextHop-variant HTLCDestination
54250 struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid);
54253 * Utility method to constructs a new InvalidForward-variant HTLCDestination
54255 struct LDKHTLCDestination HTLCDestination_invalid_forward(uint64_t requested_forward_scid);
54258 * Utility method to constructs a new InvalidOnion-variant HTLCDestination
54260 struct LDKHTLCDestination HTLCDestination_invalid_onion(void);
54263 * Utility method to constructs a new FailedPayment-variant HTLCDestination
54265 struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash);
54268 * Checks if two HTLCDestinations contain equal inner contents.
54269 * This ignores pointers and is_owned flags and looks at the values in fields.
54271 bool HTLCDestination_eq(const struct LDKHTLCDestination *NONNULL_PTR a, const struct LDKHTLCDestination *NONNULL_PTR b);
54274 * Serialize the HTLCDestination object into a byte array which can be read by HTLCDestination_read
54276 struct LDKCVec_u8Z HTLCDestination_write(const struct LDKHTLCDestination *NONNULL_PTR obj);
54279 * Read a HTLCDestination from a byte array, created by HTLCDestination_write
54281 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(struct LDKu8slice ser);
54284 * Creates a copy of the PaymentFailureReason
54286 enum LDKPaymentFailureReason PaymentFailureReason_clone(const enum LDKPaymentFailureReason *NONNULL_PTR orig);
54289 * Utility method to constructs a new RecipientRejected-variant PaymentFailureReason
54291 enum LDKPaymentFailureReason PaymentFailureReason_recipient_rejected(void);
54294 * Utility method to constructs a new UserAbandoned-variant PaymentFailureReason
54296 enum LDKPaymentFailureReason PaymentFailureReason_user_abandoned(void);
54299 * Utility method to constructs a new RetriesExhausted-variant PaymentFailureReason
54301 enum LDKPaymentFailureReason PaymentFailureReason_retries_exhausted(void);
54304 * Utility method to constructs a new PaymentExpired-variant PaymentFailureReason
54306 enum LDKPaymentFailureReason PaymentFailureReason_payment_expired(void);
54309 * Utility method to constructs a new RouteNotFound-variant PaymentFailureReason
54311 enum LDKPaymentFailureReason PaymentFailureReason_route_not_found(void);
54314 * Utility method to constructs a new UnexpectedError-variant PaymentFailureReason
54316 enum LDKPaymentFailureReason PaymentFailureReason_unexpected_error(void);
54319 * Checks if two PaymentFailureReasons contain equal inner contents.
54320 * This ignores pointers and is_owned flags and looks at the values in fields.
54322 bool PaymentFailureReason_eq(const enum LDKPaymentFailureReason *NONNULL_PTR a, const enum LDKPaymentFailureReason *NONNULL_PTR b);
54325 * Serialize the PaymentFailureReason object into a byte array which can be read by PaymentFailureReason_read
54327 struct LDKCVec_u8Z PaymentFailureReason_write(const enum LDKPaymentFailureReason *NONNULL_PTR obj);
54330 * Read a PaymentFailureReason from a byte array, created by PaymentFailureReason_write
54332 struct LDKCResult_PaymentFailureReasonDecodeErrorZ PaymentFailureReason_read(struct LDKu8slice ser);
54335 * Frees any resources used by the Event
54337 void Event_free(struct LDKEvent this_ptr);
54340 * Creates a copy of the Event
54342 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
54345 * Utility method to constructs a new FundingGenerationReady-variant Event
54347 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);
54350 * Utility method to constructs a new PaymentClaimable-variant Event
54352 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);
54355 * Utility method to constructs a new PaymentClaimed-variant Event
54357 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);
54360 * Utility method to constructs a new ConnectionNeeded-variant Event
54362 struct LDKEvent Event_connection_needed(struct LDKPublicKey node_id, struct LDKCVec_SocketAddressZ addresses);
54365 * Utility method to constructs a new InvoiceRequestFailed-variant Event
54367 struct LDKEvent Event_invoice_request_failed(struct LDKThirtyTwoBytes payment_id);
54370 * Utility method to constructs a new PaymentSent-variant Event
54372 struct LDKEvent Event_payment_sent(struct LDKCOption_ThirtyTwoBytesZ payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
54375 * Utility method to constructs a new PaymentFailed-variant Event
54377 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_PaymentFailureReasonZ reason);
54380 * Utility method to constructs a new PaymentPathSuccessful-variant Event
54382 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash, struct LDKPath path);
54385 * Utility method to constructs a new PaymentPathFailed-variant Event
54387 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);
54390 * Utility method to constructs a new ProbeSuccessful-variant Event
54392 struct LDKEvent Event_probe_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path);
54395 * Utility method to constructs a new ProbeFailed-variant Event
54397 struct LDKEvent Event_probe_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path, struct LDKCOption_u64Z short_channel_id);
54400 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
54402 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
54405 * Utility method to constructs a new HTLCIntercepted-variant Event
54407 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);
54410 * Utility method to constructs a new SpendableOutputs-variant Event
54412 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs, struct LDKChannelId channel_id);
54415 * Utility method to constructs a new PaymentForwarded-variant Event
54417 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);
54420 * Utility method to constructs a new ChannelPending-variant Event
54422 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);
54425 * Utility method to constructs a new ChannelReady-variant Event
54427 struct LDKEvent Event_channel_ready(struct LDKChannelId channel_id, struct LDKU128 user_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKChannelTypeFeatures channel_type);
54430 * Utility method to constructs a new ChannelClosed-variant Event
54432 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);
54435 * Utility method to constructs a new DiscardFunding-variant Event
54437 struct LDKEvent Event_discard_funding(struct LDKChannelId channel_id, struct LDKTransaction transaction);
54440 * Utility method to constructs a new OpenChannelRequest-variant Event
54442 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);
54445 * Utility method to constructs a new HTLCHandlingFailed-variant Event
54447 struct LDKEvent Event_htlchandling_failed(struct LDKChannelId prev_channel_id, struct LDKHTLCDestination failed_next_destination);
54450 * Utility method to constructs a new BumpTransaction-variant Event
54452 struct LDKEvent Event_bump_transaction(struct LDKBumpTransactionEvent a);
54455 * Checks if two Events contain equal inner contents.
54456 * This ignores pointers and is_owned flags and looks at the values in fields.
54458 bool Event_eq(const struct LDKEvent *NONNULL_PTR a, const struct LDKEvent *NONNULL_PTR b);
54461 * Serialize the Event object into a byte array which can be read by Event_read
54463 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
54466 * Read a Event from a byte array, created by Event_write
54468 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
54471 * Frees any resources used by the MessageSendEvent
54473 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
54476 * Creates a copy of the MessageSendEvent
54478 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
54481 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
54483 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
54486 * Utility method to constructs a new SendAcceptChannelV2-variant MessageSendEvent
54488 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel_v2(struct LDKPublicKey node_id, struct LDKAcceptChannelV2 msg);
54491 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
54493 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
54496 * Utility method to constructs a new SendOpenChannelV2-variant MessageSendEvent
54498 struct LDKMessageSendEvent MessageSendEvent_send_open_channel_v2(struct LDKPublicKey node_id, struct LDKOpenChannelV2 msg);
54501 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
54503 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
54506 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
54508 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
54511 * Utility method to constructs a new SendStfu-variant MessageSendEvent
54513 struct LDKMessageSendEvent MessageSendEvent_send_stfu(struct LDKPublicKey node_id, struct LDKStfu msg);
54516 * Utility method to constructs a new SendSplice-variant MessageSendEvent
54518 struct LDKMessageSendEvent MessageSendEvent_send_splice(struct LDKPublicKey node_id, struct LDKSplice msg);
54521 * Utility method to constructs a new SendSpliceAck-variant MessageSendEvent
54523 struct LDKMessageSendEvent MessageSendEvent_send_splice_ack(struct LDKPublicKey node_id, struct LDKSpliceAck msg);
54526 * Utility method to constructs a new SendSpliceLocked-variant MessageSendEvent
54528 struct LDKMessageSendEvent MessageSendEvent_send_splice_locked(struct LDKPublicKey node_id, struct LDKSpliceLocked msg);
54531 * Utility method to constructs a new SendTxAddInput-variant MessageSendEvent
54533 struct LDKMessageSendEvent MessageSendEvent_send_tx_add_input(struct LDKPublicKey node_id, struct LDKTxAddInput msg);
54536 * Utility method to constructs a new SendTxAddOutput-variant MessageSendEvent
54538 struct LDKMessageSendEvent MessageSendEvent_send_tx_add_output(struct LDKPublicKey node_id, struct LDKTxAddOutput msg);
54541 * Utility method to constructs a new SendTxRemoveInput-variant MessageSendEvent
54543 struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_input(struct LDKPublicKey node_id, struct LDKTxRemoveInput msg);
54546 * Utility method to constructs a new SendTxRemoveOutput-variant MessageSendEvent
54548 struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_output(struct LDKPublicKey node_id, struct LDKTxRemoveOutput msg);
54551 * Utility method to constructs a new SendTxComplete-variant MessageSendEvent
54553 struct LDKMessageSendEvent MessageSendEvent_send_tx_complete(struct LDKPublicKey node_id, struct LDKTxComplete msg);
54556 * Utility method to constructs a new SendTxSignatures-variant MessageSendEvent
54558 struct LDKMessageSendEvent MessageSendEvent_send_tx_signatures(struct LDKPublicKey node_id, struct LDKTxSignatures msg);
54561 * Utility method to constructs a new SendTxInitRbf-variant MessageSendEvent
54563 struct LDKMessageSendEvent MessageSendEvent_send_tx_init_rbf(struct LDKPublicKey node_id, struct LDKTxInitRbf msg);
54566 * Utility method to constructs a new SendTxAckRbf-variant MessageSendEvent
54568 struct LDKMessageSendEvent MessageSendEvent_send_tx_ack_rbf(struct LDKPublicKey node_id, struct LDKTxAckRbf msg);
54571 * Utility method to constructs a new SendTxAbort-variant MessageSendEvent
54573 struct LDKMessageSendEvent MessageSendEvent_send_tx_abort(struct LDKPublicKey node_id, struct LDKTxAbort msg);
54576 * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
54578 struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg);
54581 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
54583 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
54586 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
54588 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
54591 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
54593 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
54596 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
54598 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
54601 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
54603 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
54606 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
54608 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
54611 * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
54613 struct LDKMessageSendEvent MessageSendEvent_send_channel_announcement(struct LDKPublicKey node_id, struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
54616 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
54618 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
54621 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
54623 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
54626 * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
54628 struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
54631 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
54633 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
54636 * Utility method to constructs a new HandleError-variant MessageSendEvent
54638 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
54641 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
54643 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
54646 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
54648 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
54651 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
54653 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
54656 * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
54658 struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
54661 * Calls the free function if one is set
54663 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
54666 * Calls the free function if one is set
54668 void EventsProvider_free(struct LDKEventsProvider this_ptr);
54671 * Calls the free function if one is set
54673 void EventHandler_free(struct LDKEventHandler this_ptr);
54676 * Frees any resources used by the AnchorDescriptor, if is_owned is set and inner is non-NULL.
54678 void AnchorDescriptor_free(struct LDKAnchorDescriptor this_obj);
54681 * The parameters required to derive the signer for the anchor input.
54683 struct LDKChannelDerivationParameters AnchorDescriptor_get_channel_derivation_parameters(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
54686 * The parameters required to derive the signer for the anchor input.
54688 void AnchorDescriptor_set_channel_derivation_parameters(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
54691 * The transaction input's outpoint corresponding to the commitment transaction's anchor
54694 struct LDKOutPoint AnchorDescriptor_get_outpoint(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
54697 * The transaction input's outpoint corresponding to the commitment transaction's anchor
54700 void AnchorDescriptor_set_outpoint(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
54703 * Constructs a new AnchorDescriptor given each field
54705 MUST_USE_RES struct LDKAnchorDescriptor AnchorDescriptor_new(struct LDKChannelDerivationParameters channel_derivation_parameters_arg, struct LDKOutPoint outpoint_arg);
54708 * Creates a copy of the AnchorDescriptor
54710 struct LDKAnchorDescriptor AnchorDescriptor_clone(const struct LDKAnchorDescriptor *NONNULL_PTR orig);
54713 * Checks if two AnchorDescriptors contain equal inner contents.
54714 * This ignores pointers and is_owned flags and looks at the values in fields.
54715 * Two objects with NULL inner values will be considered "equal" here.
54717 bool AnchorDescriptor_eq(const struct LDKAnchorDescriptor *NONNULL_PTR a, const struct LDKAnchorDescriptor *NONNULL_PTR b);
54720 * Returns the UTXO to be spent by the anchor input, which can be obtained via
54721 * [`Self::unsigned_tx_input`].
54723 MUST_USE_RES struct LDKTxOut AnchorDescriptor_previous_utxo(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
54726 * Returns the unsigned transaction input spending the anchor output in the commitment
54729 MUST_USE_RES struct LDKTxIn AnchorDescriptor_unsigned_tx_input(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
54732 * Returns the witness script of the anchor output in the commitment transaction.
54734 MUST_USE_RES struct LDKCVec_u8Z AnchorDescriptor_witness_script(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
54737 * Returns the fully signed witness required to spend the anchor output in the commitment
54740 MUST_USE_RES struct LDKWitness AnchorDescriptor_tx_input_witness(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature);
54743 * Derives the channel signer required to sign the anchor input.
54745 MUST_USE_RES struct LDKWriteableEcdsaChannelSigner AnchorDescriptor_derive_channel_signer(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
54748 * Frees any resources used by the BumpTransactionEvent
54750 void BumpTransactionEvent_free(struct LDKBumpTransactionEvent this_ptr);
54753 * Creates a copy of the BumpTransactionEvent
54755 struct LDKBumpTransactionEvent BumpTransactionEvent_clone(const struct LDKBumpTransactionEvent *NONNULL_PTR orig);
54758 * Utility method to constructs a new ChannelClose-variant BumpTransactionEvent
54760 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);
54763 * Utility method to constructs a new HTLCResolution-variant BumpTransactionEvent
54765 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);
54768 * Checks if two BumpTransactionEvents contain equal inner contents.
54769 * This ignores pointers and is_owned flags and looks at the values in fields.
54771 bool BumpTransactionEvent_eq(const struct LDKBumpTransactionEvent *NONNULL_PTR a, const struct LDKBumpTransactionEvent *NONNULL_PTR b);
54774 * Frees any resources used by the Input, if is_owned is set and inner is non-NULL.
54776 void Input_free(struct LDKInput this_obj);
54779 * The unique identifier of the input.
54781 struct LDKOutPoint Input_get_outpoint(const struct LDKInput *NONNULL_PTR this_ptr);
54784 * The unique identifier of the input.
54786 void Input_set_outpoint(struct LDKInput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
54789 * The UTXO being spent by the input.
54791 struct LDKTxOut Input_get_previous_utxo(const struct LDKInput *NONNULL_PTR this_ptr);
54794 * The UTXO being spent by the input.
54796 void Input_set_previous_utxo(struct LDKInput *NONNULL_PTR this_ptr, struct LDKTxOut val);
54799 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
54800 * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
54803 uint64_t Input_get_satisfaction_weight(const struct LDKInput *NONNULL_PTR this_ptr);
54806 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
54807 * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
54810 void Input_set_satisfaction_weight(struct LDKInput *NONNULL_PTR this_ptr, uint64_t val);
54813 * Constructs a new Input given each field
54815 MUST_USE_RES struct LDKInput Input_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut previous_utxo_arg, uint64_t satisfaction_weight_arg);
54818 * Creates a copy of the Input
54820 struct LDKInput Input_clone(const struct LDKInput *NONNULL_PTR orig);
54823 * Generates a non-cryptographic 64-bit hash of the Input.
54825 uint64_t Input_hash(const struct LDKInput *NONNULL_PTR o);
54828 * Checks if two Inputs contain equal inner contents.
54829 * This ignores pointers and is_owned flags and looks at the values in fields.
54830 * Two objects with NULL inner values will be considered "equal" here.
54832 bool Input_eq(const struct LDKInput *NONNULL_PTR a, const struct LDKInput *NONNULL_PTR b);
54835 * Frees any resources used by the Utxo, if is_owned is set and inner is non-NULL.
54837 void Utxo_free(struct LDKUtxo this_obj);
54840 * The unique identifier of the output.
54842 struct LDKOutPoint Utxo_get_outpoint(const struct LDKUtxo *NONNULL_PTR this_ptr);
54845 * The unique identifier of the output.
54847 void Utxo_set_outpoint(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKOutPoint val);
54850 * The output to spend.
54852 struct LDKTxOut Utxo_get_output(const struct LDKUtxo *NONNULL_PTR this_ptr);
54855 * The output to spend.
54857 void Utxo_set_output(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKTxOut val);
54860 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
54861 * with their lengths included, required to satisfy the output's script. The weight consumed by
54862 * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
54864 uint64_t Utxo_get_satisfaction_weight(const struct LDKUtxo *NONNULL_PTR this_ptr);
54867 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
54868 * with their lengths included, required to satisfy the output's script. The weight consumed by
54869 * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
54871 void Utxo_set_satisfaction_weight(struct LDKUtxo *NONNULL_PTR this_ptr, uint64_t val);
54874 * Constructs a new Utxo given each field
54876 MUST_USE_RES struct LDKUtxo Utxo_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, uint64_t satisfaction_weight_arg);
54879 * Creates a copy of the Utxo
54881 struct LDKUtxo Utxo_clone(const struct LDKUtxo *NONNULL_PTR orig);
54884 * Generates a non-cryptographic 64-bit hash of the Utxo.
54886 uint64_t Utxo_hash(const struct LDKUtxo *NONNULL_PTR o);
54889 * Checks if two Utxos contain equal inner contents.
54890 * This ignores pointers and is_owned flags and looks at the values in fields.
54891 * Two objects with NULL inner values will be considered "equal" here.
54893 bool Utxo_eq(const struct LDKUtxo *NONNULL_PTR a, const struct LDKUtxo *NONNULL_PTR b);
54896 * Returns a `Utxo` with the `satisfaction_weight` estimate for a legacy P2PKH output.
54898 MUST_USE_RES struct LDKUtxo Utxo_new_p2pkh(struct LDKOutPoint outpoint, uint64_t value, const uint8_t (*pubkey_hash)[20]);
54901 * Frees any resources used by the CoinSelection, if is_owned is set and inner is non-NULL.
54903 void CoinSelection_free(struct LDKCoinSelection this_obj);
54906 * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
54907 * requiring additional fees.
54909 struct LDKCVec_UtxoZ CoinSelection_get_confirmed_utxos(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
54912 * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
54913 * requiring additional fees.
54915 void CoinSelection_set_confirmed_utxos(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCVec_UtxoZ val);
54918 * An additional output tracking whether any change remained after coin selection. This output
54919 * should always have a value above dust for its given `script_pubkey`. It should not be
54920 * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
54921 * not met. This implies no other party should be able to spend it except us.
54923 struct LDKCOption_TxOutZ CoinSelection_get_change_output(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
54926 * An additional output tracking whether any change remained after coin selection. This output
54927 * should always have a value above dust for its given `script_pubkey`. It should not be
54928 * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
54929 * not met. This implies no other party should be able to spend it except us.
54931 void CoinSelection_set_change_output(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCOption_TxOutZ val);
54934 * Constructs a new CoinSelection given each field
54936 MUST_USE_RES struct LDKCoinSelection CoinSelection_new(struct LDKCVec_UtxoZ confirmed_utxos_arg, struct LDKCOption_TxOutZ change_output_arg);
54939 * Creates a copy of the CoinSelection
54941 struct LDKCoinSelection CoinSelection_clone(const struct LDKCoinSelection *NONNULL_PTR orig);
54944 * Calls the free function if one is set
54946 void CoinSelectionSource_free(struct LDKCoinSelectionSource this_ptr);
54949 * Calls the free function if one is set
54951 void WalletSource_free(struct LDKWalletSource this_ptr);
54954 * Frees any resources used by the Wallet, if is_owned is set and inner is non-NULL.
54956 void Wallet_free(struct LDKWallet this_obj);
54959 * Returns a new instance backed by the given [`WalletSource`] that serves as an implementation
54960 * of [`CoinSelectionSource`].
54962 MUST_USE_RES struct LDKWallet Wallet_new(struct LDKWalletSource source, struct LDKLogger logger);
54965 * Constructs a new CoinSelectionSource which calls the relevant methods on this_arg.
54966 * This copies the `inner` pointer in this_arg and thus the returned CoinSelectionSource must be freed before this_arg is
54968 struct LDKCoinSelectionSource Wallet_as_CoinSelectionSource(const struct LDKWallet *NONNULL_PTR this_arg);
54971 * Frees any resources used by the BumpTransactionEventHandler, if is_owned is set and inner is non-NULL.
54973 void BumpTransactionEventHandler_free(struct LDKBumpTransactionEventHandler this_obj);
54976 * Returns a new instance capable of handling [`Event::BumpTransaction`] events.
54978 * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
54980 MUST_USE_RES struct LDKBumpTransactionEventHandler BumpTransactionEventHandler_new(struct LDKBroadcasterInterface broadcaster, struct LDKCoinSelectionSource utxo_source, struct LDKSignerProvider signer_provider, struct LDKLogger logger);
54983 * Handles all variants of [`BumpTransactionEvent`].
54985 void BumpTransactionEventHandler_handle_event(const struct LDKBumpTransactionEventHandler *NONNULL_PTR this_arg, const struct LDKBumpTransactionEvent *NONNULL_PTR event);
54988 * Frees any resources used by the FilesystemStore, if is_owned is set and inner is non-NULL.
54990 void FilesystemStore_free(struct LDKFilesystemStore this_obj);
54993 * Constructs a new [`FilesystemStore`].
54995 MUST_USE_RES struct LDKFilesystemStore FilesystemStore_new(struct LDKStr data_dir);
54998 * Returns the data directory.
55000 MUST_USE_RES struct LDKStr FilesystemStore_get_data_dir(const struct LDKFilesystemStore *NONNULL_PTR this_arg);
55003 * Constructs a new KVStore which calls the relevant methods on this_arg.
55004 * This copies the `inner` pointer in this_arg and thus the returned KVStore must be freed before this_arg is
55006 struct LDKKVStore FilesystemStore_as_KVStore(const struct LDKFilesystemStore *NONNULL_PTR this_arg);
55009 * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
55011 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
55014 * Frees any resources used by the GossipSync
55016 void GossipSync_free(struct LDKGossipSync this_ptr);
55019 * Utility method to constructs a new P2P-variant GossipSync
55021 struct LDKGossipSync GossipSync_p2_p(const struct LDKP2PGossipSync *NONNULL_PTR a);
55024 * Utility method to constructs a new Rapid-variant GossipSync
55026 struct LDKGossipSync GossipSync_rapid(const struct LDKRapidGossipSync *NONNULL_PTR a);
55029 * Utility method to constructs a new None-variant GossipSync
55031 struct LDKGossipSync GossipSync_none(void);
55034 * Start a background thread that takes care of responsibilities enumerated in the [top-level
55037 * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
55038 * [`Persister::persist_manager`] returns an error. In case of an error, the error is retrieved by calling
55039 * either [`join`] or [`stop`].
55041 * # Data Persistence
55043 * [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
55044 * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
55045 * [`ChannelManager`]. See the `lightning-persister` crate for LDK's
55046 * provided implementation.
55048 * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if
55049 * [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
55050 * See the `lightning-persister` crate for LDK's provided implementation.
55052 * Typically, users should either implement [`Persister::persist_manager`] to never return an
55053 * error or call [`join`] and handle any error that may arise. For the latter case,
55054 * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
55058 * `event_handler` is responsible for handling events that users should be notified of (e.g.,
55059 * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
55060 * functionality implemented by other handlers.
55061 * * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures.
55063 * # Rapid Gossip Sync
55065 * If rapid gossip sync is meant to run at startup, pass [`RapidGossipSync`] via `gossip_sync`
55066 * to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
55067 * until the [`RapidGossipSync`] instance completes its first sync.
55069 * [top-level documentation]: BackgroundProcessor
55070 * [`join`]: Self::join
55071 * [`stop`]: Self::stop
55072 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
55073 * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
55074 * [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager
55075 * [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph
55076 * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
55077 * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
55079 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);
55082 * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
55083 * [`ChannelManager`].
55087 * This function panics if the background thread has panicked such as while persisting or
55090 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
55092 MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
55095 * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
55096 * [`ChannelManager`].
55100 * This function panics if the background thread has panicked such as while persisting or
55103 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
55105 MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
55108 * Frees any resources used by the Bolt11ParseError
55110 void Bolt11ParseError_free(struct LDKBolt11ParseError this_ptr);
55113 * Creates a copy of the Bolt11ParseError
55115 struct LDKBolt11ParseError Bolt11ParseError_clone(const struct LDKBolt11ParseError *NONNULL_PTR orig);
55118 * Utility method to constructs a new Bech32Error-variant Bolt11ParseError
55120 struct LDKBolt11ParseError Bolt11ParseError_bech32_error(struct LDKBech32Error a);
55123 * Utility method to constructs a new ParseAmountError-variant Bolt11ParseError
55125 struct LDKBolt11ParseError Bolt11ParseError_parse_amount_error(struct LDKError a);
55128 * Utility method to constructs a new MalformedSignature-variant Bolt11ParseError
55130 struct LDKBolt11ParseError Bolt11ParseError_malformed_signature(enum LDKSecp256k1Error a);
55133 * Utility method to constructs a new BadPrefix-variant Bolt11ParseError
55135 struct LDKBolt11ParseError Bolt11ParseError_bad_prefix(void);
55138 * Utility method to constructs a new UnknownCurrency-variant Bolt11ParseError
55140 struct LDKBolt11ParseError Bolt11ParseError_unknown_currency(void);
55143 * Utility method to constructs a new UnknownSiPrefix-variant Bolt11ParseError
55145 struct LDKBolt11ParseError Bolt11ParseError_unknown_si_prefix(void);
55148 * Utility method to constructs a new MalformedHRP-variant Bolt11ParseError
55150 struct LDKBolt11ParseError Bolt11ParseError_malformed_hrp(void);
55153 * Utility method to constructs a new TooShortDataPart-variant Bolt11ParseError
55155 struct LDKBolt11ParseError Bolt11ParseError_too_short_data_part(void);
55158 * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant Bolt11ParseError
55160 struct LDKBolt11ParseError Bolt11ParseError_unexpected_end_of_tagged_fields(void);
55163 * Utility method to constructs a new DescriptionDecodeError-variant Bolt11ParseError
55165 struct LDKBolt11ParseError Bolt11ParseError_description_decode_error(struct LDKError a);
55168 * Utility method to constructs a new PaddingError-variant Bolt11ParseError
55170 struct LDKBolt11ParseError Bolt11ParseError_padding_error(void);
55173 * Utility method to constructs a new IntegerOverflowError-variant Bolt11ParseError
55175 struct LDKBolt11ParseError Bolt11ParseError_integer_overflow_error(void);
55178 * Utility method to constructs a new InvalidSegWitProgramLength-variant Bolt11ParseError
55180 struct LDKBolt11ParseError Bolt11ParseError_invalid_seg_wit_program_length(void);
55183 * Utility method to constructs a new InvalidPubKeyHashLength-variant Bolt11ParseError
55185 struct LDKBolt11ParseError Bolt11ParseError_invalid_pub_key_hash_length(void);
55188 * Utility method to constructs a new InvalidScriptHashLength-variant Bolt11ParseError
55190 struct LDKBolt11ParseError Bolt11ParseError_invalid_script_hash_length(void);
55193 * Utility method to constructs a new InvalidRecoveryId-variant Bolt11ParseError
55195 struct LDKBolt11ParseError Bolt11ParseError_invalid_recovery_id(void);
55198 * Utility method to constructs a new InvalidSliceLength-variant Bolt11ParseError
55200 struct LDKBolt11ParseError Bolt11ParseError_invalid_slice_length(struct LDKStr a);
55203 * Utility method to constructs a new Skip-variant Bolt11ParseError
55205 struct LDKBolt11ParseError Bolt11ParseError_skip(void);
55208 * Checks if two Bolt11ParseErrors contain equal inner contents.
55209 * This ignores pointers and is_owned flags and looks at the values in fields.
55211 bool Bolt11ParseError_eq(const struct LDKBolt11ParseError *NONNULL_PTR a, const struct LDKBolt11ParseError *NONNULL_PTR b);
55214 * Frees any resources used by the ParseOrSemanticError
55216 void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr);
55219 * Creates a copy of the ParseOrSemanticError
55221 struct LDKParseOrSemanticError ParseOrSemanticError_clone(const struct LDKParseOrSemanticError *NONNULL_PTR orig);
55224 * Utility method to constructs a new ParseError-variant ParseOrSemanticError
55226 struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKBolt11ParseError a);
55229 * Utility method to constructs a new SemanticError-variant ParseOrSemanticError
55231 struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKBolt11SemanticError a);
55234 * Checks if two ParseOrSemanticErrors contain equal inner contents.
55235 * This ignores pointers and is_owned flags and looks at the values in fields.
55237 bool ParseOrSemanticError_eq(const struct LDKParseOrSemanticError *NONNULL_PTR a, const struct LDKParseOrSemanticError *NONNULL_PTR b);
55240 * Frees any resources used by the Bolt11Invoice, if is_owned is set and inner is non-NULL.
55242 void Bolt11Invoice_free(struct LDKBolt11Invoice this_obj);
55245 * Checks if two Bolt11Invoices contain equal inner contents.
55246 * This ignores pointers and is_owned flags and looks at the values in fields.
55247 * Two objects with NULL inner values will be considered "equal" here.
55249 bool Bolt11Invoice_eq(const struct LDKBolt11Invoice *NONNULL_PTR a, const struct LDKBolt11Invoice *NONNULL_PTR b);
55252 * Creates a copy of the Bolt11Invoice
55254 struct LDKBolt11Invoice Bolt11Invoice_clone(const struct LDKBolt11Invoice *NONNULL_PTR orig);
55257 * Generates a non-cryptographic 64-bit hash of the Bolt11Invoice.
55259 uint64_t Bolt11Invoice_hash(const struct LDKBolt11Invoice *NONNULL_PTR o);
55262 * Frees any resources used by the SignedRawBolt11Invoice, if is_owned is set and inner is non-NULL.
55264 void SignedRawBolt11Invoice_free(struct LDKSignedRawBolt11Invoice this_obj);
55267 * Checks if two SignedRawBolt11Invoices contain equal inner contents.
55268 * This ignores pointers and is_owned flags and looks at the values in fields.
55269 * Two objects with NULL inner values will be considered "equal" here.
55271 bool SignedRawBolt11Invoice_eq(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR a, const struct LDKSignedRawBolt11Invoice *NONNULL_PTR b);
55274 * Creates a copy of the SignedRawBolt11Invoice
55276 struct LDKSignedRawBolt11Invoice SignedRawBolt11Invoice_clone(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR orig);
55279 * Generates a non-cryptographic 64-bit hash of the SignedRawBolt11Invoice.
55281 uint64_t SignedRawBolt11Invoice_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o);
55284 * Frees any resources used by the RawBolt11Invoice, if is_owned is set and inner is non-NULL.
55286 void RawBolt11Invoice_free(struct LDKRawBolt11Invoice this_obj);
55291 struct LDKRawDataPart RawBolt11Invoice_get_data(const struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr);
55296 void RawBolt11Invoice_set_data(struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
55299 * Checks if two RawBolt11Invoices contain equal inner contents.
55300 * This ignores pointers and is_owned flags and looks at the values in fields.
55301 * Two objects with NULL inner values will be considered "equal" here.
55303 bool RawBolt11Invoice_eq(const struct LDKRawBolt11Invoice *NONNULL_PTR a, const struct LDKRawBolt11Invoice *NONNULL_PTR b);
55306 * Creates a copy of the RawBolt11Invoice
55308 struct LDKRawBolt11Invoice RawBolt11Invoice_clone(const struct LDKRawBolt11Invoice *NONNULL_PTR orig);
55311 * Generates a non-cryptographic 64-bit hash of the RawBolt11Invoice.
55313 uint64_t RawBolt11Invoice_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR o);
55316 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
55318 void RawDataPart_free(struct LDKRawDataPart this_obj);
55321 * generation time of the invoice
55323 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
55326 * generation time of the invoice
55328 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
55331 * Checks if two RawDataParts contain equal inner contents.
55332 * This ignores pointers and is_owned flags and looks at the values in fields.
55333 * Two objects with NULL inner values will be considered "equal" here.
55335 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
55338 * Creates a copy of the RawDataPart
55340 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
55343 * Generates a non-cryptographic 64-bit hash of the RawDataPart.
55345 uint64_t RawDataPart_hash(const struct LDKRawDataPart *NONNULL_PTR o);
55348 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
55350 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
55353 * Checks if two PositiveTimestamps contain equal inner contents.
55354 * This ignores pointers and is_owned flags and looks at the values in fields.
55355 * Two objects with NULL inner values will be considered "equal" here.
55357 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
55360 * Creates a copy of the PositiveTimestamp
55362 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
55365 * Generates a non-cryptographic 64-bit hash of the PositiveTimestamp.
55367 uint64_t PositiveTimestamp_hash(const struct LDKPositiveTimestamp *NONNULL_PTR o);
55370 * Creates a copy of the SiPrefix
55372 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
55375 * Utility method to constructs a new Milli-variant SiPrefix
55377 enum LDKSiPrefix SiPrefix_milli(void);
55380 * Utility method to constructs a new Micro-variant SiPrefix
55382 enum LDKSiPrefix SiPrefix_micro(void);
55385 * Utility method to constructs a new Nano-variant SiPrefix
55387 enum LDKSiPrefix SiPrefix_nano(void);
55390 * Utility method to constructs a new Pico-variant SiPrefix
55392 enum LDKSiPrefix SiPrefix_pico(void);
55395 * Checks if two SiPrefixs contain equal inner contents.
55396 * This ignores pointers and is_owned flags and looks at the values in fields.
55398 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
55401 * Generates a non-cryptographic 64-bit hash of the SiPrefix.
55403 uint64_t SiPrefix_hash(const enum LDKSiPrefix *NONNULL_PTR o);
55406 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
55407 * This is effectively 10^12 * the prefix multiplier
55409 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
55412 * Creates a copy of the Currency
55414 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
55417 * Utility method to constructs a new Bitcoin-variant Currency
55419 enum LDKCurrency Currency_bitcoin(void);
55422 * Utility method to constructs a new BitcoinTestnet-variant Currency
55424 enum LDKCurrency Currency_bitcoin_testnet(void);
55427 * Utility method to constructs a new Regtest-variant Currency
55429 enum LDKCurrency Currency_regtest(void);
55432 * Utility method to constructs a new Simnet-variant Currency
55434 enum LDKCurrency Currency_simnet(void);
55437 * Utility method to constructs a new Signet-variant Currency
55439 enum LDKCurrency Currency_signet(void);
55442 * Generates a non-cryptographic 64-bit hash of the Currency.
55444 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
55447 * Checks if two Currencys contain equal inner contents.
55448 * This ignores pointers and is_owned flags and looks at the values in fields.
55450 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
55453 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
55455 void Sha256_free(struct LDKSha256 this_obj);
55458 * Creates a copy of the Sha256
55460 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
55463 * Generates a non-cryptographic 64-bit hash of the Sha256.
55465 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
55468 * Checks if two Sha256s contain equal inner contents.
55469 * This ignores pointers and is_owned flags and looks at the values in fields.
55470 * Two objects with NULL inner values will be considered "equal" here.
55472 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
55475 * Constructs a new [`Sha256`] from the given bytes, which are assumed to be the output of a
55476 * single sha256 hash.
55478 MUST_USE_RES struct LDKSha256 Sha256_from_bytes(const uint8_t (*bytes)[32]);
55481 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
55483 void Description_free(struct LDKDescription this_obj);
55486 * Creates a copy of the Description
55488 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
55491 * Generates a non-cryptographic 64-bit hash of the Description.
55493 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
55496 * Checks if two Descriptions contain equal inner contents.
55497 * This ignores pointers and is_owned flags and looks at the values in fields.
55498 * Two objects with NULL inner values will be considered "equal" here.
55500 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
55503 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
55505 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
55507 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
55509 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
55512 * Constructs a new PayeePubKey given each field
55514 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
55517 * Creates a copy of the PayeePubKey
55519 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
55522 * Generates a non-cryptographic 64-bit hash of the PayeePubKey.
55524 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
55527 * Checks if two PayeePubKeys contain equal inner contents.
55528 * This ignores pointers and is_owned flags and looks at the values in fields.
55529 * Two objects with NULL inner values will be considered "equal" here.
55531 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
55534 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
55536 void ExpiryTime_free(struct LDKExpiryTime this_obj);
55539 * Creates a copy of the ExpiryTime
55541 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
55544 * Generates a non-cryptographic 64-bit hash of the ExpiryTime.
55546 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
55549 * Checks if two ExpiryTimes contain equal inner contents.
55550 * This ignores pointers and is_owned flags and looks at the values in fields.
55551 * Two objects with NULL inner values will be considered "equal" here.
55553 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
55556 * Frees any resources used by the MinFinalCltvExpiryDelta, if is_owned is set and inner is non-NULL.
55558 void MinFinalCltvExpiryDelta_free(struct LDKMinFinalCltvExpiryDelta this_obj);
55560 uint64_t MinFinalCltvExpiryDelta_get_a(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr);
55562 void MinFinalCltvExpiryDelta_set_a(struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr, uint64_t val);
55565 * Constructs a new MinFinalCltvExpiryDelta given each field
55567 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_new(uint64_t a_arg);
55570 * Creates a copy of the MinFinalCltvExpiryDelta
55572 struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_clone(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR orig);
55575 * Generates a non-cryptographic 64-bit hash of the MinFinalCltvExpiryDelta.
55577 uint64_t MinFinalCltvExpiryDelta_hash(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR o);
55580 * Checks if two MinFinalCltvExpiryDeltas contain equal inner contents.
55581 * This ignores pointers and is_owned flags and looks at the values in fields.
55582 * Two objects with NULL inner values will be considered "equal" here.
55584 bool MinFinalCltvExpiryDelta_eq(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR a, const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR b);
55587 * Frees any resources used by the Fallback
55589 void Fallback_free(struct LDKFallback this_ptr);
55592 * Creates a copy of the Fallback
55594 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
55597 * Utility method to constructs a new SegWitProgram-variant Fallback
55599 struct LDKFallback Fallback_seg_wit_program(struct LDKWitnessVersion version, struct LDKCVec_u8Z program);
55602 * Utility method to constructs a new PubKeyHash-variant Fallback
55604 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
55607 * Utility method to constructs a new ScriptHash-variant Fallback
55609 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
55612 * Generates a non-cryptographic 64-bit hash of the Fallback.
55614 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
55617 * Checks if two Fallbacks contain equal inner contents.
55618 * This ignores pointers and is_owned flags and looks at the values in fields.
55620 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
55623 * Frees any resources used by the Bolt11InvoiceSignature, if is_owned is set and inner is non-NULL.
55625 void Bolt11InvoiceSignature_free(struct LDKBolt11InvoiceSignature this_obj);
55628 * Creates a copy of the Bolt11InvoiceSignature
55630 struct LDKBolt11InvoiceSignature Bolt11InvoiceSignature_clone(const struct LDKBolt11InvoiceSignature *NONNULL_PTR orig);
55633 * Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceSignature.
55635 uint64_t Bolt11InvoiceSignature_hash(const struct LDKBolt11InvoiceSignature *NONNULL_PTR o);
55638 * Checks if two Bolt11InvoiceSignatures contain equal inner contents.
55639 * This ignores pointers and is_owned flags and looks at the values in fields.
55640 * Two objects with NULL inner values will be considered "equal" here.
55642 bool Bolt11InvoiceSignature_eq(const struct LDKBolt11InvoiceSignature *NONNULL_PTR a, const struct LDKBolt11InvoiceSignature *NONNULL_PTR b);
55645 * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
55647 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
55650 * Creates a copy of the PrivateRoute
55652 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
55655 * Generates a non-cryptographic 64-bit hash of the PrivateRoute.
55657 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
55660 * Checks if two PrivateRoutes contain equal inner contents.
55661 * This ignores pointers and is_owned flags and looks at the values in fields.
55662 * Two objects with NULL inner values will be considered "equal" here.
55664 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
55667 * Disassembles the `SignedRawBolt11Invoice` into its three parts:
55669 * 2. hash of the raw invoice
55672 MUST_USE_RES struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ SignedRawBolt11Invoice_into_parts(struct LDKSignedRawBolt11Invoice this_arg);
55675 * The [`RawBolt11Invoice`] which was signed.
55677 MUST_USE_RES struct LDKRawBolt11Invoice SignedRawBolt11Invoice_raw_invoice(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
55680 * The hash of the [`RawBolt11Invoice`] that was signed.
55682 MUST_USE_RES const uint8_t (*SignedRawBolt11Invoice_signable_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg))[32];
55685 * Signature for the invoice.
55687 MUST_USE_RES struct LDKBolt11InvoiceSignature SignedRawBolt11Invoice_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
55690 * Recovers the public key used for signing the invoice from the recoverable signature.
55692 MUST_USE_RES struct LDKCResult_PayeePubKeySecp256k1ErrorZ SignedRawBolt11Invoice_recover_payee_pub_key(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
55695 * Checks if the signature is valid for the included payee public key or if none exists if it's
55696 * valid for the recovered signature (which should always be true?).
55698 MUST_USE_RES bool SignedRawBolt11Invoice_check_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
55701 * Calculate the hash of the encoded `RawBolt11Invoice` which should be signed.
55703 MUST_USE_RES struct LDKThirtyTwoBytes RawBolt11Invoice_signable_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55707 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
55709 MUST_USE_RES struct LDKSha256 RawBolt11Invoice_payment_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55713 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
55715 MUST_USE_RES struct LDKDescription RawBolt11Invoice_description(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55719 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
55721 MUST_USE_RES struct LDKPayeePubKey RawBolt11Invoice_payee_pub_key(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55725 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
55727 MUST_USE_RES struct LDKSha256 RawBolt11Invoice_description_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55731 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
55733 MUST_USE_RES struct LDKExpiryTime RawBolt11Invoice_expiry_time(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55737 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
55739 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta RawBolt11Invoice_min_final_cltv_expiry_delta(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55741 MUST_USE_RES struct LDKCOption_ThirtyTwoBytesZ RawBolt11Invoice_payment_secret(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55743 MUST_USE_RES struct LDKCOption_CVec_u8ZZ RawBolt11Invoice_payment_metadata(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55747 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
55749 MUST_USE_RES struct LDKBolt11InvoiceFeatures RawBolt11Invoice_features(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55751 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawBolt11Invoice_private_routes(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55754 * Returns `None` if no amount is set or on overflow.
55756 MUST_USE_RES struct LDKCOption_u64Z RawBolt11Invoice_amount_pico_btc(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55758 MUST_USE_RES enum LDKCurrency RawBolt11Invoice_currency(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55761 * Creates a `PositiveTimestamp` from a Unix timestamp in the range `0..=MAX_TIMESTAMP`.
55763 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
55765 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
55768 * Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
55769 * the range `0..=MAX_TIMESTAMP`.
55771 * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
55773 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
55775 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
55778 * Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
55779 * `0..=MAX_TIMESTAMP`.
55781 * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
55783 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
55785 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_duration_since_epoch(uint64_t duration);
55788 * Returns the Unix timestamp representing the stored time
55790 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
55793 * Returns the duration of the stored time since the Unix epoch
55795 MUST_USE_RES uint64_t PositiveTimestamp_as_duration_since_epoch(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
55798 * Returns the [`SystemTime`] representing the stored time
55800 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
55803 * The hash of the [`RawBolt11Invoice`] that was signed.
55805 MUST_USE_RES struct LDKThirtyTwoBytes Bolt11Invoice_signable_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55808 * Transform the `Bolt11Invoice` into its unchecked version.
55810 MUST_USE_RES struct LDKSignedRawBolt11Invoice Bolt11Invoice_into_signed_raw(struct LDKBolt11Invoice this_arg);
55813 * Check that the invoice is signed correctly and that key recovery works
55815 MUST_USE_RES struct LDKCResult_NoneBolt11SemanticErrorZ Bolt11Invoice_check_signature(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55818 * Constructs a `Bolt11Invoice` from a [`SignedRawBolt11Invoice`] by checking all its invariants.
55820 * use lightning_invoice::*;
55822 * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
55823 * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
55824 * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
55825 * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
55826 * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
55827 * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
55828 * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
55829 * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
55830 * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
55831 * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
55832 * j5r6drg6k6zcqj0fcwg\";
55834 * let signed = invoice.parse::<SignedRawBolt11Invoice>().unwrap();
55836 * assert!(Bolt11Invoice::from_signed(signed).is_ok());
55839 MUST_USE_RES struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ Bolt11Invoice_from_signed(struct LDKSignedRawBolt11Invoice signed_invoice);
55842 * Returns the `Bolt11Invoice`'s timestamp (should equal its creation time)
55844 MUST_USE_RES uint64_t Bolt11Invoice_timestamp(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55847 * Returns the `Bolt11Invoice`'s timestamp as a duration since the Unix epoch
55849 MUST_USE_RES uint64_t Bolt11Invoice_duration_since_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55852 * Returns the hash to which we will receive the preimage on completion of the payment
55854 MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32];
55857 * Get the payee's public key if one was included in the invoice
55859 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
55861 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55864 * Get the payment secret if one was included in the invoice
55866 MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_secret(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32];
55869 * Get the payment metadata blob if one was included in the invoice
55871 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt11Invoice_payment_metadata(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55874 * Get the invoice features if they were included in the invoice
55876 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
55878 MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11Invoice_features(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55881 * Recover the payee's public key (only to be used if none was included in the invoice)
55883 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_recover_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55886 * Recover the payee's public key if one was included in the invoice, otherwise return the
55887 * recovered public key from the signature
55889 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_get_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55892 * Returns the Duration since the Unix epoch at which the invoice expires.
55893 * Returning None if overflow occurred.
55895 MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_expires_at(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55898 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
55900 MUST_USE_RES uint64_t Bolt11Invoice_expiry_time(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55903 * Returns whether the invoice has expired.
55905 MUST_USE_RES bool Bolt11Invoice_is_expired(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55908 * Returns the Duration remaining until the invoice expires.
55910 MUST_USE_RES uint64_t Bolt11Invoice_duration_until_expiry(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55913 * Returns the Duration remaining until the invoice expires given the current time.
55914 * `time` is the timestamp as a duration since the Unix epoch.
55916 MUST_USE_RES uint64_t Bolt11Invoice_expiration_remaining_from_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t time);
55919 * Returns whether the expiry time would pass at the given point in time.
55920 * `at_time` is the timestamp as a duration since the Unix epoch.
55922 MUST_USE_RES bool Bolt11Invoice_would_expire(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t at_time);
55925 * Returns the invoice's `min_final_cltv_expiry_delta` time, if present, otherwise
55926 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA`].
55928 MUST_USE_RES uint64_t Bolt11Invoice_min_final_cltv_expiry_delta(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55931 * Returns a list of all fallback addresses as [`Address`]es
55933 MUST_USE_RES struct LDKCVec_StrZ Bolt11Invoice_fallback_addresses(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55936 * Returns a list of all routes included in the invoice
55938 MUST_USE_RES struct LDKCVec_PrivateRouteZ Bolt11Invoice_private_routes(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55941 * Returns a list of all routes included in the invoice as the underlying hints
55943 MUST_USE_RES struct LDKCVec_RouteHintZ Bolt11Invoice_route_hints(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55946 * Returns the currency for which the invoice was issued
55948 MUST_USE_RES enum LDKCurrency Bolt11Invoice_currency(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55951 * Returns the amount if specified in the invoice as millisatoshis.
55953 MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_amount_milli_satoshis(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55956 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
55957 * returns [`CreationError::DescriptionTooLong`] otherwise
55959 * Please note that single characters may use more than one byte due to UTF8 encoding.
55961 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
55964 * Returns the underlying description [`UntrustedString`]
55966 MUST_USE_RES struct LDKUntrustedString Description_into_inner(struct LDKDescription this_arg);
55969 * Get the string representation of a Description object
55971 struct LDKStr Description_to_str(const struct LDKDescription *NONNULL_PTR o);
55974 * Construct an `ExpiryTime` from seconds.
55976 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds);
55979 * Construct an `ExpiryTime` from a [`Duration`], dropping the sub-second part.
55981 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_duration(uint64_t duration);
55984 * Returns the expiry time in seconds
55986 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
55989 * Returns a reference to the underlying [`Duration`] (=expiry time)
55991 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
55994 * Creates a new (partial) route from a list of hops
55996 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
55999 * Returns the underlying list of hops
56001 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
56004 * Creates a copy of the CreationError
56006 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
56009 * Utility method to constructs a new DescriptionTooLong-variant CreationError
56011 enum LDKCreationError CreationError_description_too_long(void);
56014 * Utility method to constructs a new RouteTooLong-variant CreationError
56016 enum LDKCreationError CreationError_route_too_long(void);
56019 * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
56021 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
56024 * Utility method to constructs a new InvalidAmount-variant CreationError
56026 enum LDKCreationError CreationError_invalid_amount(void);
56029 * Utility method to constructs a new MissingRouteHints-variant CreationError
56031 enum LDKCreationError CreationError_missing_route_hints(void);
56034 * Utility method to constructs a new MinFinalCltvExpiryDeltaTooShort-variant CreationError
56036 enum LDKCreationError CreationError_min_final_cltv_expiry_delta_too_short(void);
56039 * Checks if two CreationErrors contain equal inner contents.
56040 * This ignores pointers and is_owned flags and looks at the values in fields.
56042 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
56045 * Get the string representation of a CreationError object
56047 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
56050 * Creates a copy of the Bolt11SemanticError
56052 enum LDKBolt11SemanticError Bolt11SemanticError_clone(const enum LDKBolt11SemanticError *NONNULL_PTR orig);
56055 * Utility method to constructs a new NoPaymentHash-variant Bolt11SemanticError
56057 enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_hash(void);
56060 * Utility method to constructs a new MultiplePaymentHashes-variant Bolt11SemanticError
56062 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_hashes(void);
56065 * Utility method to constructs a new NoDescription-variant Bolt11SemanticError
56067 enum LDKBolt11SemanticError Bolt11SemanticError_no_description(void);
56070 * Utility method to constructs a new MultipleDescriptions-variant Bolt11SemanticError
56072 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_descriptions(void);
56075 * Utility method to constructs a new NoPaymentSecret-variant Bolt11SemanticError
56077 enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_secret(void);
56080 * Utility method to constructs a new MultiplePaymentSecrets-variant Bolt11SemanticError
56082 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_secrets(void);
56085 * Utility method to constructs a new InvalidFeatures-variant Bolt11SemanticError
56087 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_features(void);
56090 * Utility method to constructs a new InvalidRecoveryId-variant Bolt11SemanticError
56092 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_recovery_id(void);
56095 * Utility method to constructs a new InvalidSignature-variant Bolt11SemanticError
56097 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_signature(void);
56100 * Utility method to constructs a new ImpreciseAmount-variant Bolt11SemanticError
56102 enum LDKBolt11SemanticError Bolt11SemanticError_imprecise_amount(void);
56105 * Checks if two Bolt11SemanticErrors contain equal inner contents.
56106 * This ignores pointers and is_owned flags and looks at the values in fields.
56108 bool Bolt11SemanticError_eq(const enum LDKBolt11SemanticError *NONNULL_PTR a, const enum LDKBolt11SemanticError *NONNULL_PTR b);
56111 * Get the string representation of a Bolt11SemanticError object
56113 struct LDKStr Bolt11SemanticError_to_str(const enum LDKBolt11SemanticError *NONNULL_PTR o);
56116 * Frees any resources used by the SignOrCreationError
56118 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
56121 * Creates a copy of the SignOrCreationError
56123 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
56126 * Utility method to constructs a new SignError-variant SignOrCreationError
56128 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
56131 * Utility method to constructs a new CreationError-variant SignOrCreationError
56133 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
56136 * Checks if two SignOrCreationErrors contain equal inner contents.
56137 * This ignores pointers and is_owned flags and looks at the values in fields.
56139 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
56142 * Get the string representation of a SignOrCreationError object
56144 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
56147 * Builds the necessary parameters to pay or pre-flight probe the given zero-amount
56148 * [`Bolt11Invoice`] using [`ChannelManager::send_payment`] or
56149 * [`ChannelManager::send_preflight_probes`].
56151 * Prior to paying, you must ensure that the [`Bolt11Invoice::payment_hash`] is unique and the
56152 * same [`PaymentHash`] has never been paid before.
56154 * Will always succeed unless the invoice has an amount specified, in which case
56155 * [`payment_parameters_from_invoice`] should be used.
56157 * [`ChannelManager::send_payment`]: lightning::ln::channelmanager::ChannelManager::send_payment
56158 * [`ChannelManager::send_preflight_probes`]: lightning::ln::channelmanager::ChannelManager::send_preflight_probes
56160 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_zero_amount_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msat);
56163 * Builds the necessary parameters to pay or pre-flight probe the given [`Bolt11Invoice`] using
56164 * [`ChannelManager::send_payment`] or [`ChannelManager::send_preflight_probes`].
56166 * Prior to paying, you must ensure that the [`Bolt11Invoice::payment_hash`] is unique and the
56167 * same [`PaymentHash`] has never been paid before.
56169 * Will always succeed unless the invoice has no amount specified, in which case
56170 * [`payment_parameters_from_zero_amount_invoice`] should be used.
56172 * [`ChannelManager::send_payment`]: lightning::ln::channelmanager::ChannelManager::send_payment
56173 * [`ChannelManager::send_preflight_probes`]: lightning::ln::channelmanager::ChannelManager::send_preflight_probes
56175 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice);
56178 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
56179 * See [`PhantomKeysManager`] for more information on phantom node payments.
56181 * `phantom_route_hints` parameter:
56182 * * Contains channel info for all nodes participating in the phantom invoice
56183 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
56184 * participating node
56185 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
56186 * updated when a channel becomes disabled or closes
56187 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
56188 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
56191 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
56192 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
56193 * If `None` is provided for `payment_hash`, then one will be created.
56195 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
56196 * in excess of the current time.
56198 * `duration_since_epoch` is the current time since epoch in seconds.
56200 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
56201 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`] - 3.
56202 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
56203 * confirmations during routing.
56205 * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
56206 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
56209 * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
56210 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
56211 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
56212 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
56213 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
56214 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
56216 * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
56217 * available and the current time is supplied by the caller.
56219 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);
56222 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
56223 * See [`PhantomKeysManager`] for more information on phantom node payments.
56225 * `phantom_route_hints` parameter:
56226 * * Contains channel info for all nodes participating in the phantom invoice
56227 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
56228 * participating node
56229 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
56230 * updated when a channel becomes disabled or closes
56231 * * Note that the route hints generated from `phantom_route_hints` will be limited to a maximum
56232 * of 3 hints to ensure that the invoice can be scanned in a QR code. These hints are selected
56233 * in the order that the nodes in `PhantomRouteHints` are specified, selecting one hint per node
56234 * until the maximum is hit. Callers may provide as many `PhantomRouteHints::channels` as
56235 * desired, but note that some nodes will be trimmed if more than 3 nodes are provided.
56237 * `description_hash` is a SHA-256 hash of the description text
56239 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
56240 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
56241 * If `None` is provided for `payment_hash`, then one will be created.
56243 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
56244 * in excess of the current time.
56246 * `duration_since_epoch` is the current time since epoch in seconds.
56248 * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
56249 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
56252 * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
56253 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
56254 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
56255 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
56256 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
56258 * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
56259 * available and the current time is supplied by the caller.
56261 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);
56264 * Utility to construct an invoice. Generally, unless you want to do something like a custom
56265 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
56266 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
56267 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
56268 * that the payment secret is valid when the invoice is paid.
56270 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
56271 * in excess of the current time.
56273 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
56274 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
56275 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
56276 * confirmations during routing.
56278 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
56280 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);
56283 * Utility to construct an invoice. Generally, unless you want to do something like a custom
56284 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
56285 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
56286 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
56287 * that the payment secret is valid when the invoice is paid.
56288 * Use this variant if you want to pass the `description_hash` to the invoice.
56290 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
56291 * in excess of the current time.
56293 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
56294 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
56295 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
56296 * confirmations during routing.
56298 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
56300 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);
56303 * See [`create_invoice_from_channelmanager_with_description_hash`]
56304 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
56305 * available and the current time is supplied by the caller.
56307 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);
56310 * See [`create_invoice_from_channelmanager`]
56311 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
56312 * available and the current time is supplied by the caller.
56314 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);
56317 * See [`create_invoice_from_channelmanager_and_duration_since_epoch`]
56318 * This version allows for providing a custom [`PaymentHash`] for the invoice.
56319 * This may be useful if you're building an on-chain swap or involving another protocol where
56320 * the payment hash is also involved outside the scope of lightning.
56322 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);
56325 * Read a SiPrefix object from a string
56327 struct LDKCResult_SiPrefixBolt11ParseErrorZ SiPrefix_from_str(struct LDKStr s);
56330 * Read a Bolt11Invoice object from a string
56332 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ Bolt11Invoice_from_str(struct LDKStr s);
56335 * Read a SignedRawBolt11Invoice object from a string
56337 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ SignedRawBolt11Invoice_from_str(struct LDKStr s);
56340 * Get the string representation of a Bolt11ParseError object
56342 struct LDKStr Bolt11ParseError_to_str(const struct LDKBolt11ParseError *NONNULL_PTR o);
56345 * Get the string representation of a ParseOrSemanticError object
56347 struct LDKStr ParseOrSemanticError_to_str(const struct LDKParseOrSemanticError *NONNULL_PTR o);
56350 * Get the string representation of a Bolt11Invoice object
56352 struct LDKStr Bolt11Invoice_to_str(const struct LDKBolt11Invoice *NONNULL_PTR o);
56355 * Get the string representation of a SignedRawBolt11Invoice object
56357 struct LDKStr SignedRawBolt11Invoice_to_str(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o);
56360 * Get the string representation of a Currency object
56362 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
56365 * Get the string representation of a SiPrefix object
56367 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
56370 * Frees any resources used by the GraphSyncError
56372 void GraphSyncError_free(struct LDKGraphSyncError this_ptr);
56375 * Creates a copy of the GraphSyncError
56377 struct LDKGraphSyncError GraphSyncError_clone(const struct LDKGraphSyncError *NONNULL_PTR orig);
56380 * Utility method to constructs a new DecodeError-variant GraphSyncError
56382 struct LDKGraphSyncError GraphSyncError_decode_error(struct LDKDecodeError a);
56385 * Utility method to constructs a new LightningError-variant GraphSyncError
56387 struct LDKGraphSyncError GraphSyncError_lightning_error(struct LDKLightningError a);
56390 * Frees any resources used by the RapidGossipSync, if is_owned is set and inner is non-NULL.
56392 void RapidGossipSync_free(struct LDKRapidGossipSync this_obj);
56395 * Instantiate a new [`RapidGossipSync`] instance.
56397 MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
56400 * Sync gossip data from a file.
56401 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
56403 * `network_graph`: The network graph to apply the updates to
56405 * `sync_path`: Path to the file where the gossip update data is located
56408 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_sync_network_graph_with_file_path(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKStr sync_path);
56411 * Update network graph from binary data.
56412 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
56414 * `update_data`: `&[u8]` binary stream that comprises the update data
56416 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data);
56419 * Update network graph from binary data.
56420 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
56422 * `update_data`: `&[u8]` binary stream that comprises the update data
56423 * `current_time_unix`: `Option<u64>` optional current timestamp to verify data age
56425 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);
56428 * Returns whether a rapid gossip sync has completed at least once.
56430 MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg);
56432 #endif /* LDK_C_BINDINGS_H */
56434 #include "ldk_ver.h"